Search
lxdream.org :: lxdream :: r879:a07af43e03c4
lxdream 0.9.1
released Jun 29
Download Now
changeset879:a07af43e03c4
parent878:c498ba66e851
child880:214979b3bc80
authornkeynes
dateSun Oct 19 05:42:05 2008 +0000 (15 years ago)
Fix corner flag case with conditional delayed branches
src/sh4/sh4x86.in
1.1 --- a/src/sh4/sh4x86.in Sun Oct 19 05:09:31 2008 +0000
1.2 +++ b/src/sh4/sh4x86.in Sun Oct 19 05:42:05 2008 +0000
1.3 @@ -1519,11 +1519,13 @@
1.4 }
1.5 sh4vma_t target = disp + pc + 4;
1.6 OP(0x0F); OP(0x80+sh4_x86.tstate); uint32_t *patch = (uint32_t *)xlat_output; OP32(0); // JT rel32
1.7 + int save_tstate = sh4_x86.tstate;
1.8 sh4_translate_instruction(pc+2);
1.9 exit_block_rel( target, pc+4 );
1.10
1.11 // not taken
1.12 *patch = (xlat_output - ((uint8_t *)patch)) - 4;
1.13 + sh4_x86.tstate = save_tstate;
1.14 sh4_translate_instruction(pc+2);
1.15 return 4;
1.16 }
1.17 @@ -1652,10 +1654,12 @@
1.18 sh4_x86.tstate = TSTATE_E;
1.19 }
1.20 OP(0x0F); OP(0x80+(sh4_x86.tstate^1)); uint32_t *patch = (uint32_t *)xlat_output; OP32(0); // JF rel32
1.21 + int save_tstate = sh4_x86.tstate;
1.22 sh4_translate_instruction(pc+2);
1.23 exit_block_rel( disp + pc + 4, pc+4 );
1.24 // not taken
1.25 *patch = (xlat_output - ((uint8_t *)patch)) - 4;
1.26 + sh4_x86.tstate = save_tstate;
1.27 sh4_translate_instruction(pc+2);
1.28 return 4;
1.29 }
.