mirror of https://gitee.com/openkylin/qemu.git
target/openrisc: Optimize l.jal to next
This allows the tcg optimizer to see, and fold, all of the constants involved in a GOT base register load sequence. Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Richard Henderson <rth@twiddle.net>
This commit is contained in:
parent
762e22edcd
commit
a8000cb480
|
@ -198,7 +198,11 @@ static void gen_jump(DisasContext *dc, int32_t n26, uint32_t reg, uint32_t op0)
|
|||
tcg_gen_movi_tl(jmp_pc, tmp_pc);
|
||||
break;
|
||||
case 0x01: /* l.jal */
|
||||
tcg_gen_movi_tl(cpu_R[9], (dc->pc + 8));
|
||||
tcg_gen_movi_tl(cpu_R[9], dc->pc + 8);
|
||||
/* Optimize jal being used to load the PC for PIC. */
|
||||
if (tmp_pc == dc->pc + 8) {
|
||||
return;
|
||||
}
|
||||
tcg_gen_movi_tl(jmp_pc, tmp_pc);
|
||||
break;
|
||||
case 0x03: /* l.bnf */
|
||||
|
|
Loading…
Reference in New Issue