diff options
author | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-03-05 17:59:48 +0000 |
---|---|---|
committer | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-03-05 17:59:48 +0000 |
commit | 375ee38b4ba6c2c640a77253ffadcdcea5d76002 (patch) | |
tree | b6fa66bdd05f905ba1bfc9cc80a18b0c6030b255 /target-sparc/translate.c | |
parent | 21fc3cfc10a016a8cd253898b5c1cb8f331983e5 (diff) |
Convert Sparc64 trap state ops to TCG
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4018 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-sparc/translate.c')
-rw-r--r-- | target-sparc/translate.c | 81 |
1 files changed, 73 insertions, 8 deletions
diff --git a/target-sparc/translate.c b/target-sparc/translate.c index cefb848721..2546195fef 100644 --- a/target-sparc/translate.c +++ b/target-sparc/translate.c @@ -1386,16 +1386,48 @@ static void disas_sparc_insn(DisasContext * dc) rs1 = GET_FIELD(insn, 13, 17); switch (rs1) { case 0: // tpc - gen_op_rdtpc(); + { + TCGv r_tsptr; + + r_tsptr = tcg_temp_new(TCG_TYPE_PTR); + tcg_gen_ld_ptr(r_tsptr, cpu_env, + offsetof(CPUState, tsptr)); + tcg_gen_ld_tl(cpu_T[0], r_tsptr, + offsetof(trap_state, tpc)); + } break; case 1: // tnpc - gen_op_rdtnpc(); + { + TCGv r_tsptr; + + r_tsptr = tcg_temp_new(TCG_TYPE_PTR); + tcg_gen_ld_ptr(r_tsptr, cpu_env, + offsetof(CPUState, tsptr)); + tcg_gen_ld_tl(cpu_T[0], r_tsptr, + offsetof(trap_state, tnpc)); + } break; case 2: // tstate - gen_op_rdtstate(); + { + TCGv r_tsptr; + + r_tsptr = tcg_temp_new(TCG_TYPE_PTR); + tcg_gen_ld_ptr(r_tsptr, cpu_env, + offsetof(CPUState, tsptr)); + tcg_gen_ld_tl(cpu_T[0], r_tsptr, + offsetof(trap_state, tstate)); + } break; case 3: // tt - gen_op_rdtt(); + { + TCGv r_tsptr; + + r_tsptr = tcg_temp_new(TCG_TYPE_PTR); + tcg_gen_ld_ptr(r_tsptr, cpu_env, + offsetof(CPUState, tsptr)); + tcg_gen_ld_i32(cpu_T[0], r_tsptr, + offsetof(trap_state, tt)); + } break; case 4: // tick { @@ -2536,16 +2568,48 @@ static void disas_sparc_insn(DisasContext * dc) #ifdef TARGET_SPARC64 switch (rd) { case 0: // tpc - gen_op_wrtpc(); + { + TCGv r_tsptr; + + r_tsptr = tcg_temp_new(TCG_TYPE_PTR); + tcg_gen_ld_ptr(r_tsptr, cpu_env, + offsetof(CPUState, tsptr)); + tcg_gen_st_tl(cpu_T[0], r_tsptr, + offsetof(trap_state, tpc)); + } break; case 1: // tnpc - gen_op_wrtnpc(); + { + TCGv r_tsptr; + + r_tsptr = tcg_temp_new(TCG_TYPE_PTR); + tcg_gen_ld_ptr(r_tsptr, cpu_env, + offsetof(CPUState, tsptr)); + tcg_gen_st_tl(cpu_T[0], r_tsptr, + offsetof(trap_state, tnpc)); + } break; case 2: // tstate - gen_op_wrtstate(); + { + TCGv r_tsptr; + + r_tsptr = tcg_temp_new(TCG_TYPE_PTR); + tcg_gen_ld_ptr(r_tsptr, cpu_env, + offsetof(CPUState, tsptr)); + tcg_gen_st_tl(cpu_T[0], r_tsptr, + offsetof(trap_state, tstate)); + } break; case 3: // tt - gen_op_wrtt(); + { + TCGv r_tsptr; + + r_tsptr = tcg_temp_new(TCG_TYPE_PTR); + tcg_gen_ld_ptr(r_tsptr, cpu_env, + offsetof(CPUState, tsptr)); + tcg_gen_st_i32(cpu_T[0], r_tsptr, + offsetof(trap_state, tt)); + } break; case 4: // tick { @@ -3921,6 +3985,7 @@ void cpu_reset(CPUSPARCState *env) env->pstate = PS_PRIV; env->hpstate = HS_PRIV; env->pc = 0x1fff0000000ULL; + env->tsptr = &env->ts[env->tl]; #else env->pc = 0; env->mmuregs[0] &= ~(MMU_E | MMU_NF); |