mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-22 11:34:09 +02:00
Add initial support to implement vararg jit functions
* include/lightning.h, include/lightning/jit_private.h, lib/jit_names.c, lib/lightning.c: Add initial support for the new jit_va_start, jit_va_arg, jit_va_arg_d, and jit_va_end interfaces. The jit_va_start call is supposed to return a va_list compatible pointer, but not yet decided if it will be "declared" stdarg compatible, as for now only x86 support has been added (and should be compatible), but issues may arise on other backends. * check/lightning.c: Add wrappers to call the new jit_va_* interfaces. * lib/jit_x86-cpu.c, lib/jit_x86.c: Implement the new jit_va_* for x86. * lib/jit_x86-sz.c: Add fields, but not yet fully updated, as this is an intermediate commit. * lib/jit_aarch64-sz.c, lib/jit_aarch64.c, lib/jit_alpha-sz.c, lib/jit_alpha.c, lib/jit_arm-sz.c, lib/jit_arm.c, lib/jit_hppa-sz.c, lib/jit_hppa.c, lib/jit_ia64-sz.c, lib/jit_ia64.c, lib/jit_mips-sz.c, lib/jit_mips.c, lib/jit_ppc-sz.c, lib/jit_ppc.c, lib/jit_s390-sz.c, lib/jit_s390.c, lib/jit_sparc-sz.c, lib/jit_sparc.c: Prepare for the new jit_va_* interfaces. Not yet implemented, and will cause an assertion if used. * check/va_list.tst: Simple early test case, that works on x86_64, x32, ix86, cygwin, and cygwin64.
This commit is contained in:
parent
a15f261afc
commit
d639674549
28 changed files with 639 additions and 29 deletions
|
@ -497,6 +497,9 @@ static void bunordr_d(void); static void bunordi_d(void);
|
|||
static void pushargr_d(void); static void pushargi_d(void);
|
||||
static void retr_d(void); static void reti_d(void);
|
||||
static void retval_d(void);
|
||||
static void vastart(void);
|
||||
static void vaarg(void); static void vaarg_d(void);
|
||||
static void vaend(void);
|
||||
|
||||
static void error(const char *format, ...) noreturn printf_format(1, 2);
|
||||
static void warn(const char *format, ...) printf_format(1, 2) maybe_unused;
|
||||
|
@ -576,6 +579,7 @@ static char *data;
|
|||
static size_t data_offset, data_length;
|
||||
static instr_t instr_vector[] = {
|
||||
#define entry(value) { NULL, #value, value }
|
||||
#define entry2(name, function) { NULL, name, function }
|
||||
entry(align), entry(name),
|
||||
entry(prolog),
|
||||
entry(frame), entry(tramp),
|
||||
|
@ -806,7 +810,10 @@ static instr_t instr_vector[] = {
|
|||
entry(pushargr_d), entry(pushargi_d),
|
||||
entry(retr_d), entry(reti_d),
|
||||
entry(retval_d),
|
||||
|
||||
entry2("va_start", vastart),
|
||||
entry2("va_arg", vaarg),
|
||||
entry2("va_arg_d", vaarg_d),
|
||||
entry2("va_end", vaend),
|
||||
#undef entry
|
||||
};
|
||||
|
||||
|
@ -1644,6 +1651,31 @@ entry_lb_fr_fr(bunordr_d) entry_lb_fr_dm(bunordi_d)
|
|||
entry_fr(pushargr_d) entry_dm(pushargi_d)
|
||||
entry_fr(retr_d) entry_dm(reti_d)
|
||||
entry_fr(retval_d)
|
||||
static void
|
||||
vastart(void)
|
||||
{
|
||||
jit_gpr_t r0 = get_ireg();
|
||||
jit_va_start(r0);
|
||||
}
|
||||
static void
|
||||
vaarg(void)
|
||||
{
|
||||
jit_gpr_t r0 = get_ireg(), r1 = get_ireg();
|
||||
jit_va_arg(r0, r1);
|
||||
}
|
||||
static void
|
||||
vaarg_d(void)
|
||||
{
|
||||
jit_fpr_t r0 = get_freg();
|
||||
jit_gpr_t r1 = get_ireg();
|
||||
jit_va_arg_d(r0, r1);
|
||||
}
|
||||
static void
|
||||
vaend(void)
|
||||
{
|
||||
jit_gpr_t r0 = get_ireg();
|
||||
jit_va_end(r0);
|
||||
}
|
||||
#undef entry_fn
|
||||
#undef entry_fm
|
||||
#undef entry_dm
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue