Em sáb., 3 de set. de 2022 às 10:58, Paul Cercueil
<paul@crapouillou.net> escreveu:
Hi Paulo,
Somewhere in my code I do:
jit_patch_abs(jit_jmpi(), code);
On PowerPC at least, this unconditionally resolves to a movi_p() +
jmpr(), which isn't ideal - it could totally be a PC-relative branch
instead.
Is there a valid reason why this isn't converted to a PC-relative
branch, or is it a bug?
A pc relative jump is used only if it is a backward jump to a
node. If it is a raw address it will still do a jmpr.
But indeed, most if no all other ports do a relative jump if
possible, to a raw address if it is in range.
Please share a jit_print() of the generated code so I can
check if it is triggering some bug or if for some reason it is
some expected condition.
Likely it will work if you replace:
(void)jmpi_p(node->u.w);
with:
(void)jmpi(node->u.w);