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

ppc: Add initial jit_va_ calls to ppc

* lib/jit_ppc-cpu.c, lib/jit_ppc-fpu.c, lib/jit_ppc.c:
	Add base support to jit vararg functions to the PowerPC backend.
This commit is contained in:
pcpa 2015-05-05 20:55:05 -03:00
parent 2c8b5e530c
commit cc217f0608
4 changed files with 108 additions and 0 deletions

View file

@ -33,6 +33,13 @@
# define F_DISP (__WORDSIZE >> 3) - sizeof(jit_float32_t)
#endif
/*
* Types
*/
typedef struct jit_va_list {
jit_pointer_t stack;
} jit_va_list_t;
/*
* Prototypes
*/
@ -306,6 +313,12 @@ _jit_ellipsis(jit_state_t *_jit)
else {
assert(!(_jitc->function->self.call & jit_call_varargs));
_jitc->function->self.call |= jit_call_varargs;
/* Allocate va_list like object in the stack. */
_jitc->function->vaoff = jit_allocai(sizeof(jit_va_list_t));
_jitc->function->vagp = _jitc->function->self.argi;
_jitc->function->vafp = _jitc->function->self.argf;
}
}
@ -1436,9 +1449,19 @@ _emit_code(jit_state_t *_jit)
epilog(node);
_jitc->function = NULL;
break;
case jit_code_va_start:
vastart(rn(node->u.w));
break;
case jit_code_va_arg:
vaarg(rn(node->u.w), rn(node->v.w));
break;
case jit_code_va_arg_d:
vaarg_d(rn(node->u.w), rn(node->v.w));
break;
case jit_code_live:
case jit_code_arg:
case jit_code_arg_f: case jit_code_arg_d:
case jit_code_va_end:
break;
default:
abort();