tccgen: factor out gfunc_return
Also: - on windows i386 and x86-64, structures of size <= 8 are NOT returned in registers if size is not one of 1,2,4,8. - cleanup: put all tv-push/pop/swap/rot into one place
This commit is contained in:
20
x86_64-gen.c
20
x86_64-gen.c
@ -752,25 +752,21 @@ void gen_offs_sp(int b, int r, int d)
|
||||
ST_FUNC int gfunc_sret(CType *vt, int variadic, CType *ret, int *ret_align, int *regsize)
|
||||
{
|
||||
int size, align;
|
||||
*regsize = 8;
|
||||
*ret_align = 1; // Never have to re-align return values for x86-64
|
||||
*regsize = 8;
|
||||
size = type_size(vt, &align);
|
||||
ret->ref = NULL;
|
||||
if (size > 8) {
|
||||
if (size > 8 || (size & (size - 1)))
|
||||
return 0;
|
||||
} else if (size > 4) {
|
||||
if (size == 8)
|
||||
ret->t = VT_LLONG;
|
||||
return 1;
|
||||
} else if (size > 2) {
|
||||
else if (size == 4)
|
||||
ret->t = VT_INT;
|
||||
return 1;
|
||||
} else if (size > 1) {
|
||||
else if (size == 2)
|
||||
ret->t = VT_SHORT;
|
||||
return 1;
|
||||
} else {
|
||||
else
|
||||
ret->t = VT_BYTE;
|
||||
return 1;
|
||||
}
|
||||
ret->ref = NULL;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int is_sse_float(int t) {
|
||||
|
||||
Reference in New Issue
Block a user