aboutsummaryrefslogtreecommitdiff
path: root/target-sparc
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-03-14 17:35:02 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-03-14 17:35:02 +0000
commitf5069b26a4c8a8967278856fb62898d7ed8d44c3 (patch)
tree12bb70bae894db9e8ca2edae9f7e15864c38a116 /target-sparc
parent2e0ded9c7c647c9587f0c16a968dc8be0b3840de (diff)
downloadqemu-f5069b26a4c8a8967278856fb62898d7ed8d44c3.zip
qemu-f5069b26a4c8a8967278856fb62898d7ed8d44c3.tar.gz
qemu-f5069b26a4c8a8967278856fb62898d7ed8d44c3.tar.bz2
Use memory globals for G registers
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4062 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-sparc')
-rw-r--r--target-sparc/translate.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/target-sparc/translate.c b/target-sparc/translate.c
index c188bcc..933a2f1 100644
--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -47,6 +47,7 @@
/* global register indexes */
static TCGv cpu_env, cpu_T[3], cpu_regwptr, cpu_cc_src, cpu_cc_dst, cpu_psr;
+static TCGv cpu_gregs[8];
#ifdef TARGET_SPARC64
static TCGv cpu_xcc;
#endif
@@ -222,7 +223,7 @@ static inline void gen_movl_reg_TN(int reg, TCGv tn)
if (reg == 0)
tcg_gen_movi_tl(tn, 0);
else if (reg < 8)
- tcg_gen_ld_tl(tn, cpu_env, offsetof(CPUState, gregs[reg]));
+ tcg_gen_mov_tl(tn, cpu_gregs[reg]);
else {
tcg_gen_ld_tl(tn, cpu_regwptr, (reg - 8) * sizeof(target_ulong));
}
@@ -250,7 +251,7 @@ static inline void gen_movl_TN_reg(int reg, TCGv tn)
if (reg == 0)
return;
else if (reg < 8)
- tcg_gen_st_tl(tn, cpu_env, offsetof(CPUState, gregs[reg]));
+ tcg_gen_mov_tl(cpu_gregs[reg], tn);
else {
tcg_gen_st_tl(tn, cpu_regwptr, (reg - 8) * sizeof(target_ulong));
}
@@ -4673,6 +4674,17 @@ CPUSPARCState *cpu_sparc_init(const char *cpu_model)
CPUSPARCState *env;
const sparc_def_t *def;
static int inited;
+ unsigned int i;
+ static const char * const gregnames[8] = {
+ NULL, // g0 not used
+ "g1",
+ "g2",
+ "g3",
+ "g4",
+ "g5",
+ "g6",
+ "g7",
+ };
def = cpu_sparc_find_by_name(cpu_model);
if (!def)
@@ -4729,6 +4741,10 @@ CPUSPARCState *cpu_sparc_init(const char *cpu_model)
cpu_psr = tcg_global_mem_new(TCG_TYPE_I32,
TCG_AREG0, offsetof(CPUState, psr),
"psr");
+ for (i = 1; i < 8; i++)
+ cpu_gregs[i] = tcg_global_mem_new(TCG_TYPE_TL, TCG_AREG0,
+ offsetof(CPUState, gregs[i]),
+ gregnames[i]);
}
cpu_reset(env);