mirror of
https://github.com/mii443/qemu.git
synced 2025-08-23 15:48:20 +00:00
tcg/arm: Fix goto_tb for large translation blocks
Correct arithmetic for separating high and low on a large negative number. Cc: qemu-stable@nongnu.org Fixes:79ffece444
("tcg/arm: Implement direct branch for goto_tb") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1714 Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Michael Tokarev <mjt@tls.msk.ru> (cherry picked from commite41f1825b4
) Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
committed by
Michael Tokarev
parent
e5f105655c
commit
181e548715
@ -1736,9 +1736,9 @@ static void tcg_out_goto_tb(TCGContext *s, int which)
|
|||||||
* shifted immediate from pc.
|
* shifted immediate from pc.
|
||||||
*/
|
*/
|
||||||
int h = -i_disp;
|
int h = -i_disp;
|
||||||
int l = h & 0xfff;
|
int l = -(h & 0xfff);
|
||||||
|
|
||||||
h = encode_imm_nofail(h - l);
|
h = encode_imm_nofail(h + l);
|
||||||
tcg_out_dat_imm(s, COND_AL, ARITH_SUB, TCG_REG_R0, TCG_REG_PC, h);
|
tcg_out_dat_imm(s, COND_AL, ARITH_SUB, TCG_REG_R0, TCG_REG_PC, h);
|
||||||
tcg_out_ld32_12(s, COND_AL, TCG_REG_PC, TCG_REG_R0, l);
|
tcg_out_ld32_12(s, COND_AL, TCG_REG_PC, TCG_REG_R0, l);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user