mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-04 22:40:25 +02:00
Implement the "live" code to explicitly tell a register is live.
*include/lightning.h, lib/lightning.c: Add the new jit_live code to explicitly mark a register as live. It is required to avoid assuming functions always return a value in the gpr and fpr return register, and to avoid the need of some very specialized codes that vary too much from backend to backend, to instruct the optimization code the return register is live. * lib/jit_arm.c, lib/jit_mips.c, lib/jit_ppc.c, lib/jit_print.c, lib/jit_x86.c: Update for the new jit_live code. * check/ret.ok, check/ret.tst: New files implementing a simple test case that would previously fail at least in ix86/x86_64. * check/Makefile.am: Update for new "ret" test case.
This commit is contained in:
parent
7b2c9cfb2a
commit
60c1c545fc
12 changed files with 140 additions and 32 deletions
|
@ -187,14 +187,20 @@ _jit_retr(jit_state_t *_jit, jit_int32_t u)
|
|||
void
|
||||
_jit_reti(jit_state_t *_jit, jit_word_t u)
|
||||
{
|
||||
jit_movi(JIT_RET, u);
|
||||
if (JIT_RET != u)
|
||||
jit_movi(JIT_RET, u);
|
||||
else
|
||||
jit_live(JIT_RET);
|
||||
jit_ret();
|
||||
}
|
||||
|
||||
void
|
||||
_jit_retr_f(jit_state_t *_jit, jit_int32_t u)
|
||||
{
|
||||
jit_movr_f(JIT_FRET, u);
|
||||
if (JIT_FRET != u)
|
||||
jit_movr_f(JIT_FRET, u);
|
||||
else
|
||||
jit_live(JIT_FRET);
|
||||
jit_ret();
|
||||
}
|
||||
|
||||
|
@ -208,7 +214,10 @@ _jit_reti_f(jit_state_t *_jit, jit_float32_t u)
|
|||
void
|
||||
_jit_retr_d(jit_state_t *_jit, jit_int32_t u)
|
||||
{
|
||||
jit_movr_d(JIT_FRET, u);
|
||||
if (JIT_FRET != u)
|
||||
jit_movr_d(JIT_FRET, u);
|
||||
else
|
||||
jit_live(JIT_FRET);
|
||||
jit_ret();
|
||||
}
|
||||
|
||||
|
@ -1209,6 +1218,7 @@ _emit_code(jit_state_t *_jit)
|
|||
movi_d_ww(rn(node->u.w), rn(node->v.w),
|
||||
(jit_float64_t *)node->w.n->u.w);
|
||||
break;
|
||||
case jit_code_live:
|
||||
case jit_code_arg:
|
||||
case jit_code_arg_f: case jit_code_arg_d:
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue