1727 |
|
|
1728 |
/*** Branch ***/ |
/*** Branch ***/ |
1729 |
|
|
1730 |
static inline void gen_jmp_tb(long tb, int n, uint32_t dest) |
static inline void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest) |
1731 |
{ |
{ |
1732 |
if (n == 0) |
TranslationBlock *tb; |
1733 |
gen_op_goto_tb0(TBPARAM(tb)); |
tb = ctx->tb; |
1734 |
else |
if ((tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK)) { |
1735 |
gen_op_goto_tb1(TBPARAM(tb)); |
if (n == 0) |
1736 |
gen_op_set_T1(dest); |
gen_op_goto_tb0(TBPARAM(tb)); |
1737 |
gen_op_b_T1(); |
else |
1738 |
gen_op_set_T0(tb + n); |
gen_op_goto_tb1(TBPARAM(tb)); |
1739 |
gen_op_exit_tb(); |
gen_op_set_T1(dest); |
1740 |
|
gen_op_b_T1(); |
1741 |
|
gen_op_set_T0((long)tb + n); |
1742 |
|
gen_op_exit_tb(); |
1743 |
|
} else { |
1744 |
|
gen_op_set_T1(dest); |
1745 |
|
gen_op_b_T1(); |
1746 |
|
gen_op_set_T0(0); |
1747 |
|
gen_op_exit_tb(); |
1748 |
|
} |
1749 |
} |
} |
1750 |
|
|
1751 |
/* b ba bl bla */ |
/* b ba bl bla */ |
1763 |
if (LK(ctx->opcode)) { |
if (LK(ctx->opcode)) { |
1764 |
gen_op_setlr(ctx->nip); |
gen_op_setlr(ctx->nip); |
1765 |
} |
} |
1766 |
gen_jmp_tb((long)ctx->tb, 0, target); |
gen_goto_tb(ctx, 0, target); |
1767 |
ctx->exception = EXCP_BRANCH; |
ctx->exception = EXCP_BRANCH; |
1768 |
} |
} |
1769 |
|
|
1814 |
case 4: |
case 4: |
1815 |
case 6: |
case 6: |
1816 |
if (type == BCOND_IM) { |
if (type == BCOND_IM) { |
1817 |
gen_jmp_tb((long)ctx->tb, 0, target); |
gen_goto_tb(ctx, 0, target); |
1818 |
} else { |
} else { |
1819 |
gen_op_b_T1(); |
gen_op_b_T1(); |
1820 |
} |
} |
1856 |
if (type == BCOND_IM) { |
if (type == BCOND_IM) { |
1857 |
int l1 = gen_new_label(); |
int l1 = gen_new_label(); |
1858 |
gen_op_jz_T0(l1); |
gen_op_jz_T0(l1); |
1859 |
gen_jmp_tb((long)ctx->tb, 0, target); |
gen_goto_tb(ctx, 0, target); |
1860 |
gen_set_label(l1); |
gen_set_label(l1); |
1861 |
gen_jmp_tb((long)ctx->tb, 1, ctx->nip); |
gen_goto_tb(ctx, 1, ctx->nip); |
1862 |
} else { |
} else { |
1863 |
gen_op_btest_T1(ctx->nip); |
gen_op_btest_T1(ctx->nip); |
1864 |
} |
} |
2278 |
} |
} |
2279 |
gen_op_load_gpr_T0(rS(ctx->opcode)); |
gen_op_load_gpr_T0(rS(ctx->opcode)); |
2280 |
gen_op_store_sr(SR(ctx->opcode)); |
gen_op_store_sr(SR(ctx->opcode)); |
2281 |
|
RET_MTMSR(ctx); |
2282 |
#endif |
#endif |
2283 |
} |
} |
2284 |
|
|
2295 |
gen_op_load_gpr_T0(rS(ctx->opcode)); |
gen_op_load_gpr_T0(rS(ctx->opcode)); |
2296 |
gen_op_load_gpr_T1(rB(ctx->opcode)); |
gen_op_load_gpr_T1(rB(ctx->opcode)); |
2297 |
gen_op_store_srin(); |
gen_op_store_srin(); |
2298 |
|
RET_MTMSR(ctx); |
2299 |
#endif |
#endif |
2300 |
} |
} |
2301 |
|
|
2609 |
#endif |
#endif |
2610 |
} |
} |
2611 |
if (ctx.exception == EXCP_NONE) { |
if (ctx.exception == EXCP_NONE) { |
2612 |
gen_jmp_tb((long)ctx.tb, 0, ctx.nip); |
gen_goto_tb(&ctx, 0, ctx.nip); |
2613 |
} else if (ctx.exception != EXCP_BRANCH) { |
} else if (ctx.exception != EXCP_BRANCH) { |
2614 |
gen_op_set_T0(0); |
gen_op_set_T0(0); |
2615 |
} |
} |