tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: x86 abi for complex.



Den 2023-02-02 kl. 20:29, skrev Joseph Koshy:
On Thu, Feb 02, 2023 at 07:59:32PM +0100, Anders Magnusson wrote:

I looked at the "complex" abi code generated on NetBSD/i386
for function calls, and noticed a slight discrepancy.
For functions returning double or long double complex, the complex
numbers are handled as returning of structs with the same content.
But; for functions returning float complex, the return values are
returned in eax/edx and not as the corresponding struct.
I believe that is how the i386 ABI is defined:

   https://www.uclibc.org/docs/psABI-i386.pdf (page 14)
Yep, sounds quite likely.
What is the reason for;
1) return floats in eax/edx instead as a struct?
My guess: passing these values in registers helps
reduce memory traffic.
I don't think so, since the values must be stored into memory anyway to get them into the floating point registers.

-- R


Home | Main Index | Thread Index | Old Index