aboutsummaryrefslogtreecommitdiff
path: root/target-sparc/op.c
diff options
context:
space:
mode:
Diffstat (limited to 'target-sparc/op.c')
-rw-r--r--target-sparc/op.c33
1 files changed, 26 insertions, 7 deletions
diff --git a/target-sparc/op.c b/target-sparc/op.c
index e466e09f81..1ce3f95094 100644
--- a/target-sparc/op.c
+++ b/target-sparc/op.c
@@ -643,24 +643,43 @@ void OPPROTO op_next_insn(void)
env->npc = env->npc + 4;
}
-void OPPROTO op_generic_branch(void)
+void OPPROTO op_branch(void)
+{
+ env->npc = PARAM3; /* XXX: optimize */
+ JUMP_TB(op_branch, PARAM1, 0, PARAM2);
+}
+
+void OPPROTO op_branch2(void)
{
if (T2) {
- env->npc = PARAM1;
+ env->npc = PARAM2 + 4;
+ JUMP_TB(op_branch2, PARAM1, 0, PARAM2);
} else {
- env->npc = PARAM2;
+ env->npc = PARAM3 + 4;
+ JUMP_TB(op_branch2, PARAM1, 1, PARAM3);
+ }
+ FORCE_RET();
+}
+
+void OPPROTO op_branch_a(void)
+{
+ if (T2) {
+ env->npc = PARAM2; /* XXX: optimize */
+ JUMP_TB(op_generic_branch_a, PARAM1, 0, PARAM3);
+ } else {
+ env->npc = PARAM3 + 8; /* XXX: optimize */
+ JUMP_TB(op_generic_branch_a, PARAM1, 1, PARAM3 + 4);
}
FORCE_RET();
}
-void OPPROTO op_generic_branch_a(void)
+void OPPROTO op_generic_branch(void)
{
if (T2) {
- env->pc = PARAM2;
env->npc = PARAM1;
} else {
- env->pc = PARAM2 + 4;
- env->npc = PARAM2 + 8;
+ env->npc = PARAM2;
}
FORCE_RET();
}
+