x86-64 ABI fixes.
abitest now passes; however test1-3 fail in init_test. All other tests pass. I need to re-test Win32 and Linux-x86. I've added a dummy implementation of gfunc_sret to c67-gen.c so it should now compile, and I think it should behave as before I created gfunc_sret.
This commit is contained in:
14
tccgen.c
14
tccgen.c
@ -2495,21 +2495,29 @@ ST_FUNC void vstore(void)
|
||||
vtop[-1].r = t | VT_LVAL;
|
||||
}
|
||||
store(r, vtop - 1);
|
||||
#ifndef TCC_TARGET_X86_64
|
||||
/* two word case handling : store second register at word + 4 */
|
||||
/* two word case handling : store second register at word + 4 (or +8 for x86-64) */
|
||||
#ifdef TCC_TARGET_X86_64
|
||||
if ((ft & VT_BTYPE) == VT_QLONG) {
|
||||
#else
|
||||
if ((ft & VT_BTYPE) == VT_LLONG) {
|
||||
#endif
|
||||
vswap();
|
||||
/* convert to int to increment easily */
|
||||
#ifdef TCC_TARGET_X86_64
|
||||
vtop->type.t = VT_LLONG;
|
||||
gaddrof();
|
||||
vpushi(8);
|
||||
#else
|
||||
vtop->type.t = VT_INT;
|
||||
gaddrof();
|
||||
vpushi(4);
|
||||
#endif
|
||||
gen_op('+');
|
||||
vtop->r |= VT_LVAL;
|
||||
vswap();
|
||||
/* XXX: it works because r2 is spilled last ! */
|
||||
store(vtop->r2, vtop - 1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
vswap();
|
||||
vtop--; /* NOT vpop() because on x86 it would flush the fp stack */
|
||||
|
||||
Reference in New Issue
Block a user