qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] fix ARMv7 MOV R15, xxx operation
@ 2009-03-13  8:10 Riihimaki Juha
  2009-03-13 11:52 ` Paul Brook
  0 siblings, 1 reply; 8+ messages in thread
From: Riihimaki Juha @ 2009-03-13  8:10 UTC (permalink / raw)
  To: qemu-devel

The behavior of several ARM mode commands where the destination  
register is R15 has changed in ARMv7 to mimic the behavior of the BX  
instruction. While this calls for a little bit wider fix in the code,  
this patch fixes the issue for the special case of MOV instruction.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
---

diff --git a/target-arm/translate.c b/target-arm/translate.c
index 3cef021..7d9a934 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -6201,17 +6212,24 @@ static void disas_arm_insn(CPUState * env,  
DisasContext *s)
                  gen_op_logic_T0_cc();
              break;
          case 0x0d:
-            if (logic_cc && rd == 15) {
-                /* MOVS r15, ... is used for exception return.  */
-                if (IS_USER(s))
-                    goto illegal_op;
-                gen_op_movl_T0_T1();
-                gen_exception_return(s);
-            } else {
-                gen_movl_reg_T1(s, rd);
-                if (logic_cc)
-                    gen_op_logic_T1_cc();
+            if (rd == 15) {
+                if (logic_cc) {
+                    /* MOVS r15, ... is used for exception return.  */
+                    if (IS_USER(s))
+                        goto illegal_op;
+                    gen_op_movl_T0_T1();
+                    gen_exception_return(s);
+                    break;
+                } else if (ENABLE_ARCH_7) {
+                    tmp = new_tmp();
+                    tcg_gen_mov_i32(tmp, cpu_T[1]);
+                    gen_bx(s, tmp);
+                    break;
+                }
              }
+            gen_movl_reg_T1(s, rd);
+            if (logic_cc)
+                gen_op_logic_T1_cc();
              break;
          case 0x0e:
              gen_op_bicl_T0_T1();

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-03-14 13:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-13  8:10 [Qemu-devel] [PATCH] fix ARMv7 MOV R15, xxx operation Riihimaki Juha
2009-03-13 11:52 ` Paul Brook
2009-03-13 14:18   ` Riihimaki Juha
2009-03-13 15:13     ` Laurent Desnogues
2009-03-13 18:26       ` Riihimaki Juha
2009-03-13 18:29         ` Paul Brook
2009-03-13 18:57           ` Riihimaki Juha
2009-03-14 13:22             ` Paul Brook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).