1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-22 03:30:22 +02:00

Make it simpler to add support for more than 64 registers.

* include/lightning/jit_private.h, lib/jit_arm.c,
	lib/jit_mips-cpu.c, lib/jit_mips.c, lib/jit_ppc-cpu.c,
	lib/jit_ppc.c, lib/jit_print.c, lib/jit_sparc-cpu.c,
	lib/jit_sparc.c, lib/jit_x86-cpu.c, lib/jit_x86.c,
	lib/lightning.c: Change all jit_regset macros to take
	a pointer argument, to avoid structure copies when
	adding a port to an architecture with more than 64
	registers.
This commit is contained in:
pcpa 2013-04-10 15:07:01 -03:00
parent 066db584c9
commit 7bdd22bd99
13 changed files with 310 additions and 309 deletions

View file

@ -294,8 +294,8 @@ _jit_prolog(jit_state_t *_jit)
if (_jitc->function)
jit_epilog();
assert(jit_regset_cmp_ui(_jitc->regarg, 0) == 0);
jit_regset_set_ui(_jitc->regsav, 0);
assert(jit_regset_cmp_ui(&_jitc->regarg, 0) == 0);
jit_regset_set_ui(&_jitc->regsav, 0);
offset = _jitc->functions.offset;
if (offset >= _jitc->functions.length) {
jit_realloc((jit_pointer_t *)&_jitc->functions.ptr,
@ -323,7 +323,7 @@ _jit_prolog(jit_state_t *_jit)
*/
_jitc->function->epilog->w.w = offset;
jit_regset_new(_jitc->function->regset);
jit_regset_new(&_jitc->function->regset);
}
jit_int32_t
@ -784,13 +784,13 @@ _jit_finishi(jit_state_t *_jit, jit_pointer_t i0)
* registers, and not save/restore it, what would be wrong if using the
* the return value, otherwise, just a needless noop */
/* >> prevent %rax from being allocated as the function pointer */
jit_regset_setbit(_jitc->regarg, _RAX);
jit_regset_setbit(&_jitc->regarg, _RAX);
reg = jit_get_reg(jit_class_gpr);
node = jit_movi(reg, (jit_word_t)i0);
jit_finishr(reg);
jit_unget_reg(reg);
/* << prevent %rax from being allocated as the function pointer */
jit_regset_clrbit(_jitc->regarg, _RAX);
jit_regset_clrbit(&_jitc->regarg, _RAX);
#else
node = jit_calli(i0);
node->v.w = _jitc->function->call.argi;