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

Uros Bizjak ubizjak@gmail.com
Thu Nov 16 09:00:00 GMT 2006


Hello!

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:

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

test:
        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
        ret

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

2006-11-16  Uros Bizjak  <ubizjak@gmail.com>

	* 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.

Uros.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: doc-sseregparm.diff
Type: application/octet-stream
Size: 1264 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20061116/7c9a0ff9/attachment.obj>


More information about the Gcc-patches mailing list