Commit 06d92f40a120eca9ba431be5a190186cb8f3fab3
1 parent
0cf5c677
Workaround dyngen problems with m68k conditional branch ops.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2968 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
2 changed files
with
40 additions
and
14 deletions
target-m68k/op-hacks.h
| ... | ... | @@ -103,3 +103,28 @@ static inline void gen_op_goto_tb(int dummy, int n, long tb) |
| 103 | 103 | gen_op_goto_tb1(TBPARAM(tb)); |
| 104 | 104 | } |
| 105 | 105 | } |
| 106 | + | |
| 107 | +static inline void gen_op_jmp_z32(int val, int label) | |
| 108 | +{ | |
| 109 | + gen_op_set_T0_z32(val); | |
| 110 | + gen_op_jmp_T0(label); | |
| 111 | +} | |
| 112 | + | |
| 113 | +static inline void gen_op_jmp_nz32(int val, int label) | |
| 114 | +{ | |
| 115 | + gen_op_set_T0_nz32(val); | |
| 116 | + gen_op_jmp_T0(label); | |
| 117 | +} | |
| 118 | + | |
| 119 | +static inline void gen_op_jmp_s32(int val, int label) | |
| 120 | +{ | |
| 121 | + gen_op_set_T0_s32(val); | |
| 122 | + gen_op_jmp_T0(label); | |
| 123 | +} | |
| 124 | + | |
| 125 | +static inline void gen_op_jmp_ns32(int val, int label) | |
| 126 | +{ | |
| 127 | + gen_op_set_T0_ns32(val); | |
| 128 | + gen_op_jmp_T0(label); | |
| 129 | +} | |
| 130 | + | ... | ... |
target-m68k/op.c
| ... | ... | @@ -487,37 +487,38 @@ OP(jmp) |
| 487 | 487 | GOTO_LABEL_PARAM(1); |
| 488 | 488 | } |
| 489 | 489 | |
| 490 | -/* These ops involve a function call, which probably requires a stack frame | |
| 491 | - and breaks things on some hosts. */ | |
| 492 | -OP(jmp_z32) | |
| 490 | +OP(set_T0_z32) | |
| 493 | 491 | { |
| 494 | 492 | uint32_t arg = get_op(PARAM1); |
| 495 | - if (arg == 0) | |
| 496 | - GOTO_LABEL_PARAM(2); | |
| 493 | + T0 = (arg == 0); | |
| 497 | 494 | FORCE_RET(); |
| 498 | 495 | } |
| 499 | 496 | |
| 500 | -OP(jmp_nz32) | |
| 497 | +OP(set_T0_nz32) | |
| 501 | 498 | { |
| 502 | 499 | uint32_t arg = get_op(PARAM1); |
| 503 | - if (arg != 0) | |
| 504 | - GOTO_LABEL_PARAM(2); | |
| 500 | + T0 = (arg != 0); | |
| 505 | 501 | FORCE_RET(); |
| 506 | 502 | } |
| 507 | 503 | |
| 508 | -OP(jmp_s32) | |
| 504 | +OP(set_T0_s32) | |
| 509 | 505 | { |
| 510 | 506 | int32_t arg = get_op(PARAM1); |
| 511 | - if (arg < 0) | |
| 512 | - GOTO_LABEL_PARAM(2); | |
| 507 | + T0 = (arg > 0); | |
| 513 | 508 | FORCE_RET(); |
| 514 | 509 | } |
| 515 | 510 | |
| 516 | -OP(jmp_ns32) | |
| 511 | +OP(set_T0_ns32) | |
| 517 | 512 | { |
| 518 | 513 | int32_t arg = get_op(PARAM1); |
| 519 | - if (arg >= 0) | |
| 520 | - GOTO_LABEL_PARAM(2); | |
| 514 | + T0 = (arg >= 0); | |
| 515 | + FORCE_RET(); | |
| 516 | +} | |
| 517 | + | |
| 518 | +OP(jmp_T0) | |
| 519 | +{ | |
| 520 | + if (T0) | |
| 521 | + GOTO_LABEL_PARAM(1); | |
| 521 | 522 | FORCE_RET(); |
| 522 | 523 | } |
| 523 | 524 | ... | ... |