Skip to contentSkip to conversation

Move MIPS to GOTO_TB

PATCH In review Paul Brook 1 participant 2 messages Sep 11, 2005

lore
Share & tools
lore

Paul Brook

author
#0 lore raw

PATCH 1/1 Move MIPS to GOTO_TB

The attached patch migrates the MIPS target from JUMP_TB to GOTO_TB.

Paul

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

op.c +13 -25
diff -u -p -r1.3 op.c
@@ -487,7 +487,16 @@ OP_COND(ltz, (int32_t)T0 < 0);
 
 /* Branchs */
 //#undef USE_DIRECT_JUMP
-#define EIP env->PC
+
+void OPPROTO op_goto_tb0(void)
+{
+    GOTO_TB(op_goto_tb0, PARAM1, 0);
+}
+
+void OPPROTO op_goto_tb1(void)
+{
+    GOTO_TB(op_goto_tb1, PARAM1, 1);
+}
 
 /* Branch to register */
 void op_save_breg_target (void)
@@ -506,13 +515,6 @@ void op_breg (void)
     RETURN();
 }
 
-/* Unconditional branch */
-void op_branch (void)
-{
-    JUMP_TB(branch, PARAM1, 0, PARAM2);
-    RETURN();
-}
-
 void op_save_btarget (void)
 {
     env->btarget = PARAM1;
@@ -538,24 +540,10 @@ void op_restore_bcond (void)
     RETURN();
 }
 
-void op_bcond (void)
-{
-    if (T2) {
-        JUMP_TB(bcond, PARAM1, 0, PARAM2);
-    } else {
-        JUMP_TB(bcond, PARAM1, 1, PARAM3);
-    }
-    RETURN();
-}
-
-/* Likely branch (used to skip the delay slot) */
-void op_blikely (void)
+void op_jnz_T2 (void)
 {
-    /* If the test is false, skip the delay slot */
-    if (T2 == 0) {
-        env->hflags = PARAM3;
-        JUMP_TB(blikely, PARAM1, 1, PARAM2);
-    }
+    if (T2)
+        GOTO_LABEL_PARAM(1);
     RETURN();
 }
 

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

translate.c +39 -7

96 lines not on this page · raw message

author
#1 lore raw
Quoted 1 line · Paul Brook

The attached patch migrates the MIPS target from JUMP_TB to GOTO_TB.

Grr, missed a change in gen_intermediate_code_internal. This patch should actually work.

Paul

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

op.c +13 -25
diff -u -p -r1.3 op.c
@@ -487,7 +487,16 @@ OP_COND(ltz, (int32_t)T0 < 0);
 
 /* Branchs */
 //#undef USE_DIRECT_JUMP
-#define EIP env->PC
+
+void OPPROTO op_goto_tb0(void)
+{
+    GOTO_TB(op_goto_tb0, PARAM1, 0);
+}
+
+void OPPROTO op_goto_tb1(void)
+{
+    GOTO_TB(op_goto_tb1, PARAM1, 1);
+}
 
 /* Branch to register */
 void op_save_breg_target (void)
@@ -506,13 +515,6 @@ void op_breg (void)
     RETURN();
 }
 
-/* Unconditional branch */
-void op_branch (void)
-{
-    JUMP_TB(branch, PARAM1, 0, PARAM2);
-    RETURN();
-}
-
 void op_save_btarget (void)
 {
     env->btarget = PARAM1;
@@ -538,24 +540,10 @@ void op_restore_bcond (void)
     RETURN();
 }
 
-void op_bcond (void)
-{
-    if (T2) {
-        JUMP_TB(bcond, PARAM1, 0, PARAM2);
-    } else {
-        JUMP_TB(bcond, PARAM1, 1, PARAM3);
-    }
-    RETURN();
-}
-
-/* Likely branch (used to skip the delay slot) */
-void op_blikely (void)
+void op_jnz_T2 (void)
 {
-    /* If the test is false, skip the delay slot */
-    if (T2 == 0) {
-        env->hflags = PARAM3;
-        JUMP_TB(blikely, PARAM1, 1, PARAM2);
-    }
+    if (T2)
+        GOTO_LABEL_PARAM(1);
     RETURN();
 }
 

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

translate.c +40 -7

103 lines not on this page · raw message