Do FOLLOW_CONST_JUMPS for bcl 20,BI,TARGET branches too, since that's an

unconditional jump and we don't need the LR in that case.

Also fix this:
SheepShaver: ../kpx_cpu/src/cpu/ppc/ppc-translate.cpp:1499: powerpc_block_info* powerpc_cpu::compile_block(unsigned int): Assertion `dg.jmp_addr[i] != __null' failed.
Aborted

aka. StuffIt Expander + pressing the 'Cancel' button.
This commit is contained in:
gbeauche 2004-05-23 06:41:25 +00:00
parent 05bd5f40b4
commit b0aae35951

View File

@ -449,15 +449,17 @@ powerpc_cpu::compile_block(uint32 entry_point)
}
case PPC_I(BC): // Branch Conditional
{
const int bo = BO_field::extract(opcode);
#if FOLLOW_CONST_JUMPS
if (!LK_field::test(opcode)) {
const int bo = BO_field::extract(opcode);
if (!BO_CONDITIONAL_BRANCH(bo) && !BO_DECREMENT_CTR(bo)) {
if (AA_field::test(opcode))
dpc = 0;
op.jmp.target = ((dpc + operand_BD::get(this, opcode)) & -4);
goto do_const_jump;
if (!BO_CONDITIONAL_BRANCH(bo) && !BO_DECREMENT_CTR(bo)) {
if (LK_field::test(opcode)) {
const uint32 npc = dpc + 4;
dg.gen_store_im_LR(npc);
}
if (AA_field::test(opcode))
dpc = 0;
op.jmp.target = ((dpc + operand_BD::get(this, opcode)) & -4);
goto do_const_jump;
}
#endif
const uint32 tpc = ((AA_field::test(opcode) ? 0 : dpc) + operand_BD::get(this, opcode)) & -4;
@ -467,7 +469,9 @@ powerpc_cpu::compile_block(uint32 entry_point)
if (direct_chaining_possible(bi->pc, tpc)) {
use_direct_block_chaining = true;
bi->jmp_pc[0] = tpc;
bi->jmp_pc[1] = npc;
// Make sure it's a conditional branch
if (BO_CONDITIONAL_BRANCH(bo) || BO_DECREMENT_CTR(bo))
bi->jmp_pc[1] = npc;
}
#endif
dg.gen_mov_32_A0_im(tpc);