1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-11 16:20:19 +02:00

Correct issues with 32 bit big endian mips abis

* lib/jit_mips-cpu.c: Correct frame size and varargs
	initialization for the n32 abi.
	* lib/jit_mips.c, lib/jit_mips-fpu.c: Correct 32 bit abis
	in big-endian.
This commit is contained in:
pcpa 2018-01-31 08:52:27 -05:00
parent df57fa95eb
commit 68dc475474
4 changed files with 89 additions and 54 deletions

View file

@ -21,10 +21,6 @@
# include <sys/cachectl.h>
#endif
/* FIXME Need to detect (from /proc on Linux?) if a Loongson or Godson,
* because n32 and n64 mandate that float registers are 64 bit, and
* on the later, registers are 32 bit.
*/
#if NEW_ABI
# define NUM_WORD_ARGS 8
# define STACK_SLOT 8
@ -34,7 +30,7 @@
# define STACK_SLOT 4
# define STACK_SHIFT 2
#endif
#if __BYTE_ORDER == __BIG_ENDIAN && __WORDSIZE == 32
#if NEW_ABI && __BYTE_ORDER == __BIG_ENDIAN && __WORDSIZE == 32
# define WORD_ADJUST 4
#else
# define WORD_ADJUST 0
@ -614,7 +610,7 @@ _jit_putargr(jit_state_t *_jit, jit_int32_t u, jit_node_t *v)
if (jit_arg_reg_p(v->u.w))
jit_movr(_A0 - v->u.w, u);
else
jit_stxi(v->u.w, _FP, u);
jit_stxi(v->u.w + WORD_ADJUST, _FP, u);
jit_dec_synth();
}
@ -629,7 +625,7 @@ _jit_putargi(jit_state_t *_jit, jit_word_t u, jit_node_t *v)
else {
regno = jit_get_reg(jit_class_gpr);
jit_movi(regno, u);
jit_stxi(v->u.w, _FP, regno);
jit_stxi(v->u.w + WORD_ADJUST, _FP, regno);
jit_unget_reg(regno);
}
jit_dec_synth();