This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[DOC PATCH, commited]: Fix the number of register-passing SSE arguments.


The documentation is misleading about number of arguments passed in
SSE registers to local and sseregparm functions. Correct number is 3,
as shown in this testcase:

static double __attribute__((noinline))
foo_d(double a, double b, double c, double d)
 return a + b + c +d;

volatile double a, b, c, d, x;

void test()
 x = foo_d(a, b, c, d);

gcc -O2 -mfpmath=sse -msse2 -fomit-frame-pointer:

       addsd   %xmm1, %xmm0
       addsd   %xmm2, %xmm0
       addsd   4(%esp), %xmm0   <<< 4th argument comes from stack

       subl    $8, %esp
       movsd   d, %xmm3
       movsd   c, %xmm2
       movsd   %xmm3, (%esp)     <<< 4th argument goes to stack
       movsd   b, %xmm1
       movsd   a, %xmm0
       call    foo_d
       movsd   %xmm0, x
       addl    $8, %esp

Attached patch corrects documentation to reflect the reality. Patch
was committed to SVN as obvious.

2006-11-16 Uros Bizjak <>

	* config/i386/i386.c (ix86_function_sseregparm): Fix comment:
	number of arguments passed to local functions in SSE registers is 3.

	* doc/invoke.texi (Function Attributes) [sseregparm]: Correct
	number of arguments passed in SSE registers to 3.


Attachment: doc-sseregparm.diff
Description: Binary data

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]