Skip to contentSkip to conversation

Fix arm rrx addressing mode

PATCH New Paul Brook 1 participant 1 message Aug 1, 2004

lore
Share & tools
lore

Paul Brook

author
#0 lore raw

PATCH 1/1 Fix arm rrx addressing mode

The attached patch fixes the arm Rotate Right with Extend addressing mode.

Paul

Index: target-arm/op.c
===================================================================
RCS file: /cvsroot/qemu/qemu/target-arm/op.c,v
retrieving revision 1.3

op.c +13 -0
diff -u -p -r1.3 op.c
@@ -485,6 +502,11 @@ void OPPROTO op_rorl_T1_im(void)
     T1 = ((uint32_t)T1 >> shift) | (T1 << (32 - shift));
 }
 
+void OPPROTO op_rrxl_T1(void)
+{
+    T1 = ((uint32_t)T1 >> 1) | ((uint32_t)env->CF << 31);
+}
+
 /* T1 based, set C flag */
 void OPPROTO op_shll_T1_im_cc(void)
 {
@@ -512,6 +534,14 @@ void OPPROTO op_rorl_T1_im_cc(void)
     T1 = ((uint32_t)T1 >> shift) | (T1 << (32 - shift));
 }
 
+void OPPROTO op_rrxl_T1_cc(void)
+{
+    uint32_t c;
+    c = T1 & 1;
+    T1 = ((uint32_t)T1 >> 1) | ((uint32_t)env->CF << 31);
+    env->CF = c;
+}
+
 /* T2 based */
 void OPPROTO op_shll_T2_im(void)
 {

Index: target-arm/translate.c
===================================================================
RCS file: /cvsroot/qemu/qemu/target-arm/translate.c,v retrieving revision 1.10

translate.c +5 -0
diff -u -p -r1.10 translate.c
@@ -365,6 +484,11 @@ static void disas_arm_insn(DisasContext 
                     } else {
                         gen_shift_T1_im[shiftop](shift);
                     }
+                } else if (shiftop == 3) {
+                    if (logic_cc)
+                        gen_op_rrxl_T1_cc();
+                    else
+                        gen_op_rrxl_T1();
                 }
             } else {
                 rs = (insn >> 8) & 0xf;