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:16, skrev Martin Husemann:
On Thu, Feb 02, 2023 at 07:59:32PM +0100, Anders Magnusson wrote:
What is the reason for;
1) return floats in eax/edx instead as a struct?
Just guessing: consistency with other 64bit return values.
Maybe, but since it is two values I thought it would be more streamlined to do like a struct of two floats (which was my question :-) )

2) not just returning all complex numbers on the floating point stack?
Again guessing: %st(0) would not be enough and %st(1)..%st(7) are defined
as scratch registers and to not have any role in function calls. But
*why* this was defined, I have no idea.
Since complex was not in the original elf spec, it could as well have gone in st0/st1 since it wouldn't affect anything else.
Hence my question here as well :-)

-- R


Home | Main Index | Thread Index | Old Index