aboutsummaryrefslogtreecommitdiff
path: root/target-mips
diff options
context:
space:
mode:
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2009-04-08 21:48:27 +0000
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2009-04-08 21:48:27 +0000
commitc9297f4d1d488bedba02242cc2c532582258c74e (patch)
treec9a884184c90a47f4d038c7119d9ca5a9619c82b /target-mips
parentc905fdacb4da8c48d6b62fab8ed4094a033c3b0f (diff)
downloadqemu-c9297f4d1d488bedba02242cc2c532582258c74e.zip
qemu-c9297f4d1d488bedba02242cc2c532582258c74e.tar.gz
qemu-c9297f4d1d488bedba02242cc2c532582258c74e.tar.bz2
target-mips: optimize gen_farith()
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7046 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-mips')
-rw-r--r--target-mips/translate.c103
1 files changed, 47 insertions, 56 deletions
diff --git a/target-mips/translate.c b/target-mips/translate.c
index 8485ad5..0473060 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -6122,32 +6122,32 @@ static void gen_farith (DisasContext *ctx, uint32_t op1,
case FOP(18, 16):
{
int l1 = gen_new_label();
- TCGv t0 = tcg_temp_new();
- TCGv_i32 fp0 = tcg_temp_local_new_i32();
+ TCGv_i32 fp0;
- gen_load_gpr(t0, ft);
- tcg_gen_brcondi_tl(TCG_COND_NE, t0, 0, l1);
+ if (ft != 0) {
+ tcg_gen_brcondi_tl(TCG_COND_NE, cpu_gpr[ft], 0, l1);
+ }
+ fp0 = tcg_temp_new_i32();
gen_load_fpr32(fp0, fs);
gen_store_fpr32(fp0, fd);
tcg_temp_free_i32(fp0);
gen_set_label(l1);
- tcg_temp_free(t0);
}
opn = "movz.s";
break;
case FOP(19, 16):
{
int l1 = gen_new_label();
- TCGv t0 = tcg_temp_new();
- TCGv_i32 fp0 = tcg_temp_local_new_i32();
-
- gen_load_gpr(t0, ft);
- tcg_gen_brcondi_tl(TCG_COND_EQ, t0, 0, l1);
- gen_load_fpr32(fp0, fs);
- gen_store_fpr32(fp0, fd);
- tcg_temp_free_i32(fp0);
- gen_set_label(l1);
- tcg_temp_free(t0);
+ TCGv_i32 fp0;
+
+ if (ft != 0) {
+ tcg_gen_brcondi_tl(TCG_COND_EQ, cpu_gpr[ft], 0, l1);
+ fp0 = tcg_temp_new_i32();
+ gen_load_fpr32(fp0, fs);
+ gen_store_fpr32(fp0, fd);
+ tcg_temp_free_i32(fp0);
+ gen_set_label(l1);
+ }
}
opn = "movn.s";
break;
@@ -6541,32 +6541,32 @@ static void gen_farith (DisasContext *ctx, uint32_t op1,
case FOP(18, 17):
{
int l1 = gen_new_label();
- TCGv t0 = tcg_temp_new();
- TCGv_i64 fp0 = tcg_temp_local_new_i64();
+ TCGv_i64 fp0;
- gen_load_gpr(t0, ft);
- tcg_gen_brcondi_tl(TCG_COND_NE, t0, 0, l1);
+ if (ft != 0) {
+ tcg_gen_brcondi_tl(TCG_COND_NE, cpu_gpr[ft], 0, l1);
+ }
+ fp0 = tcg_temp_new_i64();
gen_load_fpr64(ctx, fp0, fs);
gen_store_fpr64(ctx, fp0, fd);
tcg_temp_free_i64(fp0);
gen_set_label(l1);
- tcg_temp_free(t0);
}
opn = "movz.d";
break;
case FOP(19, 17):
{
int l1 = gen_new_label();
- TCGv t0 = tcg_temp_new();
- TCGv_i64 fp0 = tcg_temp_local_new_i64();
-
- gen_load_gpr(t0, ft);
- tcg_gen_brcondi_tl(TCG_COND_EQ, t0, 0, l1);
- gen_load_fpr64(ctx, fp0, fs);
- gen_store_fpr64(ctx, fp0, fd);
- tcg_temp_free_i64(fp0);
- gen_set_label(l1);
- tcg_temp_free(t0);
+ TCGv_i64 fp0;
+
+ if (ft != 0) {
+ tcg_gen_brcondi_tl(TCG_COND_EQ, cpu_gpr[ft], 0, l1);
+ fp0 = tcg_temp_new_i64();
+ gen_load_fpr64(ctx, fp0, fs);
+ gen_store_fpr64(ctx, fp0, fd);
+ tcg_temp_free_i64(fp0);
+ gen_set_label(l1);
+ }
}
opn = "movn.d";
break;
@@ -6876,20 +6876,15 @@ static void gen_farith (DisasContext *ctx, uint32_t op1,
check_cp1_64bitmode(ctx);
{
int l1 = gen_new_label();
- TCGv t0 = tcg_temp_new();
- TCGv_i32 fp0 = tcg_temp_local_new_i32();
- TCGv_i32 fph0 = tcg_temp_local_new_i32();
+ TCGv_i32 fp0;
- gen_load_gpr(t0, ft);
- tcg_gen_brcondi_tl(TCG_COND_NE, t0, 0, l1);
- gen_load_fpr32(fp0, fs);
- gen_load_fpr32h(fph0, fs);
- gen_store_fpr32(fp0, fd);
- gen_store_fpr32h(fph0, fd);
- tcg_temp_free_i32(fp0);
- tcg_temp_free_i32(fph0);
+ if (ft != 0)
+ tcg_gen_brcondi_tl(TCG_COND_NE, cpu_gpr[ft], 0, l1);
+ fp0 = tcg_temp_new_i64();
+ gen_load_fpr64(ctx, fp0, fs);
+ gen_store_fpr64(ctx, fp0, fd);
+ tcg_temp_free_i64(fp0);
gen_set_label(l1);
- tcg_temp_free(t0);
}
opn = "movz.ps";
break;
@@ -6897,20 +6892,16 @@ static void gen_farith (DisasContext *ctx, uint32_t op1,
check_cp1_64bitmode(ctx);
{
int l1 = gen_new_label();
- TCGv t0 = tcg_temp_new();
- TCGv_i32 fp0 = tcg_temp_local_new_i32();
- TCGv_i32 fph0 = tcg_temp_local_new_i32();
-
- gen_load_gpr(t0, ft);
- tcg_gen_brcondi_tl(TCG_COND_EQ, t0, 0, l1);
- gen_load_fpr32(fp0, fs);
- gen_load_fpr32h(fph0, fs);
- gen_store_fpr32(fp0, fd);
- gen_store_fpr32h(fph0, fd);
- tcg_temp_free_i32(fp0);
- tcg_temp_free_i32(fph0);
- gen_set_label(l1);
- tcg_temp_free(t0);
+ TCGv_i32 fp0;
+
+ if (ft != 0) {
+ tcg_gen_brcondi_tl(TCG_COND_EQ, cpu_gpr[ft], 0, l1);
+ fp0 = tcg_temp_new_i64();
+ gen_load_fpr64(ctx, fp0, fs);
+ gen_store_fpr64(ctx, fp0, fd);
+ tcg_temp_free_i64(fp0);
+ gen_set_label(l1);
+ }
}
opn = "movn.ps";
break;