Skip to contentSkip to conversation

ARM: fix usad8 and usada8 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 usad8 and usada8 instructions

This fixes the destination and accumulator registers for the usad8 and usada8 instructions.

---
 target-arm/translate.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
target-arm/translate.c +3 -3
index 186f1d5..305a438 100644
@@ -6556,12 +6556,12 @@ static void disas_arm_insn(CPUState * env, DisasContext *s)
                         tmp2 = load_reg(s, rs);
                         gen_helper_usad8(tmp, tmp, tmp2);
                         dead_tmp(tmp2);
-                        if (rn != 15) {
-                            tmp2 = load_reg(s, rn);
+                        if (rd != 15) {
+                            tmp2 = load_reg(s, rd);
                             tcg_gen_add_i32(tmp, tmp, tmp2);
                             dead_tmp(tmp2);
                         }
-                        store_reg(s, rd, tmp);
+                        store_reg(s, rn, tmp);
                         break;
                     case 0x20: case 0x24: case 0x28: case 0x2c:
                         /* Bitfield insert/clear.  */
Signature · 1 line
1.6.0.4
#1 lore raw
Quoted 2 lines · Mans Rullgard

This fixes the destination and accumulator registers for the usad8 and usada8 instructions.

This patch is correct.

Is this when I should put a "acked-by"?

Laurent

Quoted 31 lines
---
 target-arm/translate.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
target-arm/translate.c +3 -4
index 186f1d5..305a438 100644
@@ -6556,12 +6556,12 @@ static void disas_arm_insn(CPUState * env, DisasContext *s)
                        tmp2 = load_reg(s, rs);
                        gen_helper_usad8(tmp, tmp, tmp2);
                        dead_tmp(tmp2);
-                        if (rn != 15) {
-                            tmp2 = load_reg(s, rn);
+                        if (rd != 15) {
+                            tmp2 = load_reg(s, rd);
                            tcg_gen_add_i32(tmp, tmp, tmp2);
                            dead_tmp(tmp2);
                        }
-                        store_reg(s, rd, tmp);
+                        store_reg(s, rn, tmp);
                        break;
                    case 0x20: case 0x24: case 0x28: case 0x2c:
                        /* Bitfield insert/clear.  */
--

1.6.0.4