aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@codesourcery.com>2009-07-01 10:52:22 -0700
committerAurelien Jarno <aurelien@aurel32.net>2009-07-03 03:28:20 +0200
commit98070ce00f1561bb244c366b2cb76c4b4f7c2de1 (patch)
treecfd8c1d506792ac385466f82b06f2f4176bd69d2 /target-mips
parentFix hxtool. (diff)
downloadqemu-kvm-98070ce00f1561bb244c366b2cb76c4b4f7c2de1.tar.gz
qemu-kvm-98070ce00f1561bb244c366b2cb76c4b4f7c2de1.tar.bz2
qemu-kvm-98070ce00f1561bb244c366b2cb76c4b4f7c2de1.zip
target-mips: fix MADD and MSUB/MSUBU instructions
MADD was not correctly writing to HI. MSUB/MSUBU are specified as `HI||LO - product', not `product - HI||LO'. Signed-off-by: Nathan Froyd <froydnj@codesourcery.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'target-mips')
-rw-r--r--target-mips/translate.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/target-mips/translate.c b/target-mips/translate.c
index 6f5bea4b0..d316b9d1e 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -2132,7 +2132,7 @@ static void gen_muldiv (DisasContext *ctx, uint32_t opc,
tcg_gen_trunc_i64_tl(t1, t2);
tcg_temp_free_i64(t2);
tcg_gen_ext32s_tl(cpu_LO[0], t0);
- tcg_gen_ext32s_tl(cpu_LO[1], t1);
+ tcg_gen_ext32s_tl(cpu_HI[0], t1);
}
opn = "madd";
break;
@@ -2167,7 +2167,7 @@ static void gen_muldiv (DisasContext *ctx, uint32_t opc,
tcg_gen_ext_tl_i64(t3, t1);
tcg_gen_mul_i64(t2, t2, t3);
tcg_gen_concat_tl_i64(t3, cpu_LO[0], cpu_HI[0]);
- tcg_gen_sub_i64(t2, t2, t3);
+ tcg_gen_sub_i64(t2, t3, t2);
tcg_temp_free_i64(t3);
tcg_gen_trunc_i64_tl(t0, t2);
tcg_gen_shri_i64(t2, t2, 32);
@@ -2189,7 +2189,7 @@ static void gen_muldiv (DisasContext *ctx, uint32_t opc,
tcg_gen_extu_tl_i64(t3, t1);
tcg_gen_mul_i64(t2, t2, t3);
tcg_gen_concat_tl_i64(t3, cpu_LO[0], cpu_HI[0]);
- tcg_gen_sub_i64(t2, t2, t3);
+ tcg_gen_sub_i64(t2, t3, t2);
tcg_temp_free_i64(t3);
tcg_gen_trunc_i64_tl(t0, t2);
tcg_gen_shri_i64(t2, t2, 32);