fix ELF x86_64 function callsmob_pipcet/mixed-structs
commitfd808b8a4495ca76aae7da2c22a66e137f446a64
authorPhilip <pipcet@gmail.com>
Sun, 26 Apr 2015 18:19:48 +0000 (26 18:19 +0000)
committerPhilip <pipcet@gmail.com>
Wed, 29 Apr 2015 21:56:08 +0000 (29 21:56 +0000)
tree44eb062e24e724aa08775cd6bf6cac69282c875f
parent4126056fbe62dfc7897b0b2c52abf9fdfbfbffda
fix ELF x86_64 function calls

There were a number of bugs relating to structs that should be packed
into registers, including a total lack of support for structs that
should be split into an integer register plus an SSE register.

Each architecture is now required to define a RegArgs type that explains
how each argument is to be distributed onto machine registers; all
architectures except for x86_64/ELF use

    typedef int RegArgs;

and interpret the value as the number of registers used.

gfunc_sret now takes a RegArgs * as its last argument; if non-NULL, the
RegArgs structure/int is initialized to describe if and how the argument
fits into machine registers.

vdup() is exported for use in the architecture-specific code.
arm-gen.c
arm64-gen.c
c67-gen.c
i386-gen.c
tcc.h
tccgen.c
tests/abitest.c
tests/tests2/80_weird_struct.c [new file with mode: 0644]
tests/tests2/80_weird_struct.expect [new file with mode: 0644]
x86_64-gen.c