diff options
| author | Thomas Preud'homme <robotux@celest.fr> | 2013-11-22 09:27:15 +0800 |
|---|---|---|
| committer | Thomas Preud'homme <robotux@celest.fr> | 2013-11-22 09:27:15 +0800 |
| commit | dcec8673f21da86ae3dcf1ca3e9498127715b795 (patch) | |
| tree | d545ceed139dd57a6d6077368c9bbd248123f964 /c67-gen.c | |
| parent | d9d60a1ebd9ae24aafd2e042d5ad38f515583b7e (diff) | |
| download | tinycc-dcec8673f21da86ae3dcf1ca3e9498127715b795.tar.gz tinycc-dcec8673f21da86ae3dcf1ca3e9498127715b795.tar.bz2 | |
Add support for struct > 4B returned via registers
On ARM with hardfloat calling convention, structure containing 4 fields
or less of the same float type are returned via float registers. This
means that a structure can be returned in up to 4 double registers in a
structure is composed of 4 doubles. This commit adds support for return
of structures in several registers.
Diffstat (limited to 'c67-gen.c')
| -rw-r--r-- | c67-gen.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1879,10 +1879,11 @@ static void gcall_or_jmp(int is_jmp) } } -/* Return 1 if this function returns via an sret pointer, 0 otherwise */ +/* Return the number of registers needed to return the struct, or 0 if + returning via struct pointer. */ ST_FUNC int gfunc_sret(CType *vt, CType *ret, int *ret_align) { *ret_align = 1; // Never have to re-align return values for x86-64 - return 1; + return 0; } /* generate function call with address in (vtop->t, vtop->c) and free function |
