bug-binutils
[Top][All Lists]
Advanced

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

[Bug binutils/21197] Why Function Argument Did Not Pass in SSE Register


From: rudyy.id at gmail dot com
Subject: [Bug binutils/21197] Why Function Argument Did Not Pass in SSE Register With Attributes sseregparm When Param Data Type is Long Double?
Date: Sat, 25 Feb 2017 19:52:33 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=21197

--- Comment #4 from Rudy Y. <rudyy.id at gmail dot com> ---
I think you misunderstood my question.
Let me make simple for you.

1. That assembler code I post came from the log after compiling some C source
NOT after compiling an Assembler source.
2. I use ms_abi style for calling convention.
3. In ms_abi for 64-bit os, every floating point parameter should goes into xmm
(sse) register if sse has been enable in compilation, NOT in common register
(pointer).
4. From number 3, using gcc 6.3+rev. 245043 and binutils 2.27+git 1273da0, only
float and double data type parameter pass in xmm (sse) not long double.

For example (C):

dosomething(long double value) {
   return (value + value); /* ms_abi only see "value" in xmm register */
                           /* not a pointer for "value" */
}

int main() {
   long double a = 2.3;
   a = dosomething(a); /* gas using rcx passing 'a' parameter for 'dosomething'
*/
                       /* that was wrong. */
                       /* in ms_abi "value a" should be in xmm register */
                       /* not "a pointer to value a". */
}

This is a bug indeed.
I'm already check in some microsoft binary.
You can see microsoft statement about x64 in
https://msdn.microsoft.com/en-us/library/ms235286.aspx.

Quote from https://msdn.microsoft.com/en-us/library/ms235286.aspx:
"The x87 register stack is unused. It may be used by the callee, but must be
considered volatile across function calls. All floating point operations are
done using the 16 XMM registers. Integer arguments are passed in registers RCX,
RDX, R8, and R9. Floating point arguments are passed in XMM0L, XMM1L, XMM2L,
and XMM3L."

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]