From dcec8673f21da86ae3dcf1ca3e9498127715b795 Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Fri, 22 Nov 2013 09:27:15 +0800 Subject: 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. --- c67-gen.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'c67-gen.c') diff --git a/c67-gen.c b/c67-gen.c index 0d5e33f..1189dbb 100644 --- a/c67-gen.c +++ b/c67-gen.c @@ -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 -- cgit v1.3.1