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

Intermediate, fully functional, rework for variadic functions

* check/cva_list.c: New file implementing a test to ensure
	the value returned by jit_va_start is a valid C va_list.

	* check/va_list.ok: New simple helper file, as now the
	va_list.tst test is enabled.

	* check/va_list.tst: Rewritten for an extensive variadic
	jit functions test.

	* check/Makefile.am: Update for the new tests.

	* lib/jit_arm-cpu.c, lib/jit_arm-swf.c, lib/jit_arm-vfp.c,
	lib/jit_arm.c: Correct broken software float in a previous
	commit. Note that the hard float abi implementation is known
	broken at this time, for special cases involving variadic
	functions, and should be corrected next.

	lib/jit_x86-cpu.c, lib/jit_x86-sz.c, lib/jit_x86.c: Correct
	the jit_va_list_t semantics to match C va_list.
This commit is contained in:
pcpa 2015-05-25 15:20:24 -03:00
parent 237c90295a
commit 0b6cc01eea
12 changed files with 2107 additions and 233 deletions

View file

@ -61,13 +61,16 @@
# define REAL_WORDSIZE 8
#endif
/*
* Types
*/
#if __X32 || __CYGWIN__
typedef jit_pointer_t jit_va_list_t;
#else
typedef struct jit_va_list {
#if __X64 && !__CYGWIN__
jit_int32_t gpoff;
jit_int32_t fpoff;
#endif
jit_pointer_t over;
#if __X64 && !__CYGWIN__
jit_pointer_t save;
/* Declared explicitly as int64 for the x32 abi */
jit_int64_t rdi;
@ -92,8 +95,8 @@ typedef struct jit_va_list {
jit_float64_t _up6;
jit_float64_t xmm7;
jit_float64_t _up7;
#endif
} jit_va_list_t;
#endif
/*
* Prototypes
@ -564,12 +567,12 @@ _jit_ellipsis(jit_state_t *_jit)
assert(!(_jitc->function->self.call & jit_call_varargs));
_jitc->function->self.call |= jit_call_varargs;
#if __X64 && !__CYGWIN__
/* Allocate va_list like object in the stack.
* If applicable, with enough space to save all argument
* registers, and use fixed offsets for them. */
_jitc->function->vaoff = jit_allocai(sizeof(jit_va_list_t));
#if __X64 && !__CYGWIN__
/* Initialize gp offset in save area. */
if (jit_arg_reg_p(_jitc->function->self.argi))
_jitc->function->vagp = _jitc->function->self.argi * 8;