diff options
| author | James Lyon <jamesly0n@hotmail.com> | 2013-04-19 00:40:48 +0100 |
|---|---|---|
| committer | James Lyon <jamesly0n@hotmail.com> | 2013-04-19 00:46:49 +0100 |
| commit | 55ea6d3fc175b0e01e2e946ca9b319c1fbe8aa67 (patch) | |
| tree | 7f541d052ececf742853561cd1d8099635ee5ae8 /tccgen.c | |
| parent | 3f1d9000071eeebe315795079c3adbe4022d6d19 (diff) | |
| download | tinycc-55ea6d3fc175b0e01e2e946ca9b319c1fbe8aa67.tar.gz tinycc-55ea6d3fc175b0e01e2e946ca9b319c1fbe8aa67.tar.bz2 | |
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.
Diffstat (limited to 'tccgen.c')
| -rw-r--r-- | tccgen.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -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 */ |
