Skip to contentSkip to conversation

ARM: fix smmul and smmla instructions

PATCH In review Mans Rullgard 2 participants 2 messages Nov 25, 2008 – Nov 26, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: fix smmul and smmla instructions

This fixes the destination and accumulator registers for the smmul and smmla instructions.

---
 target-arm/translate.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
target-arm/translate.c +3 -3
index 305a438..49e48c5 100644
@@ -6507,8 +6507,8 @@ static void disas_arm_insn(CPUState * env, DisasContext *s)
                         tcg_gen_shri_i64(tmp64, tmp64, 32);
                         tmp = new_tmp();
                         tcg_gen_trunc_i64_i32(tmp, tmp64);
-                        if (rn != 15) {
-                            tmp2 = load_reg(s, rn);
+                        if (rd != 15) {
+                            tmp2 = load_reg(s, rd);
                             if (insn & (1 << 6)) {
                                 tcg_gen_sub_i32(tmp, tmp, tmp2);
                             } else {
@@ -6516,7 +6516,7 @@ static void disas_arm_insn(CPUState * env, DisasContext *s)
                             }
                             dead_tmp(tmp2);
                         }
-                        store_reg(s, rd, tmp);
+                        store_reg(s, rn, tmp);
                     } else {
                         if (insn & (1 << 5))
                             gen_swap_half(tmp2);
Signature · 1 line
1.6.0.4
#1 lore raw
Quoted 2 lines · Mans Rullgard

This fixes the destination and accumulator registers for the smmul and smmla instructions.

This patch is correct.

Laurent

Quoted 35 lines
---
 target-arm/translate.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
target-arm/translate.c +3 -4
index 305a438..49e48c5 100644
@@ -6507,8 +6507,8 @@ static void disas_arm_insn(CPUState * env, DisasContext *s)
                        tcg_gen_shri_i64(tmp64, tmp64, 32);
                        tmp = new_tmp();
                        tcg_gen_trunc_i64_i32(tmp, tmp64);
-                        if (rn != 15) {
-                            tmp2 = load_reg(s, rn);
+                        if (rd != 15) {
+                            tmp2 = load_reg(s, rd);
                            if (insn & (1 << 6)) {
                                tcg_gen_sub_i32(tmp, tmp, tmp2);
                            } else {
@@ -6516,7 +6516,7 @@ static void disas_arm_insn(CPUState * env, DisasContext *s)
                            }
                            dead_tmp(tmp2);
                        }
-                        store_reg(s, rd, tmp);
+                        store_reg(s, rn, tmp);
                    } else {
                        if (insn & (1 << 5))
                            gen_swap_half(tmp2);
--

1.6.0.4