aboutsummaryrefslogtreecommitdiff
path: root/target-mips/translate.c
diff options
context:
space:
mode:
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-11-11 11:39:33 +0000
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-11-11 11:39:33 +0000
commit2623c1ecfc87a0a86188c75598410e6b3d0f18a3 (patch)
tree84e8343c15a8915ff03dc0bab22f6d9a0a5c2e59 /target-mips/translate.c
parentd144d1d9e54eacf021c2cd82b206554977e34b70 (diff)
target-mips: optimize gen_op_addr_add() (2/2)
Instead of dynamically generating different code depending on the UX flag, add a new flag in ctx->flags to generate different code. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5677 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-mips/translate.c')
-rw-r--r--target-mips/translate.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/target-mips/translate.c b/target-mips/translate.c
index dbc6d84dcd..ab78c146b2 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -902,16 +902,9 @@ static inline void gen_op_addr_add (DisasContext *ctx, TCGv t0, TCGv t1)
/* For compatibility with 32-bit code, data reference in user mode
with Status_UX = 0 should be casted to 32-bit and sign extended.
See the MIPS64 PRA manual, section 4.10. */
- if ((ctx->hflags & MIPS_HFLAG_KSU) == MIPS_HFLAG_UM) {
- int l1 = gen_new_label();
- TCGv r_tmp = tcg_temp_new(TCG_TYPE_I32);
-
- tcg_gen_ld_i32(r_tmp, cpu_env, offsetof(CPUState, CP0_Status));
- tcg_gen_andi_i32(r_tmp, r_tmp, (1 << CP0St_UX));
- tcg_gen_brcondi_i32(TCG_COND_NE, r_tmp, 0, l1);
+ if (((ctx->hflags & MIPS_HFLAG_KSU) == MIPS_HFLAG_UM) &&
+ !(ctx->hflags & MIPS_HFLAG_UX)) {
tcg_gen_ext32s_i64(t0, t0);
- gen_set_label(l1);
- tcg_temp_free(r_tmp);
}
#endif
}