public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: optimization/6562: useless subl/addl $12, %esp in small functions involving sse2
@ 2002-05-05 15:02 hubicka
0 siblings, 0 replies; 2+ messages in thread
From: hubicka @ 2002-05-05 15:02 UTC (permalink / raw)
To: Sylvain.Pion, gcc-bugs, gcc-prs, nobody
Synopsis: useless subl/addl $12, %esp in small functions involving sse2
State-Changed-From-To: open->closed
State-Changed-By: hubicka
State-Changed-When: Sun May 5 15:02:02 2002
State-Changed-Why:
The add/sum is mandatory - stack needs to be allocated in order to move value from i387 to SSE register. Sadly i386 ABI requires values to be returned there. With -mfpmath=sse,i387 the move should not happen and the result should be computed in i387 directly.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6562
^ permalink raw reply [flat|nested] 2+ messages in thread
* optimization/6562: useless subl/addl $12, %esp in small functions involving sse2
@ 2002-05-04 21:36 Sylvain.Pion
0 siblings, 0 replies; 2+ messages in thread
From: Sylvain.Pion @ 2002-05-04 21:36 UTC (permalink / raw)
To: gcc-gnats; +Cc: Sylvain.Pion
>Number: 6562
>Category: optimization
>Synopsis: useless subl/addl $12, %esp in small functions involving sse2
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: pessimizes-code
>Submitter-Id: net
>Arrival-Date: Sat May 04 21:36:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Sylvain Pion
>Release: 3.1 and 3.2 20020502
>Organization:
>Environment:
Configured with: /u/zosma/0/prisme/spion/gcc/gcc_trunc/configure --disable-shared --disable-nls --enable-languages=c++ --prefix=/u/zosma/0/prisme/spion/gcc/Linux_trunc --with-gnu-as --with-gnu-ld --with-as=/u/zosma/0/prisme/spion/gcc/Binutils/Linux/bin/as --with-ld=/u/zosma/0/prisme/spion/gcc/Binutils/Linux/bin/ld
Thread model: single
gcc version 3.2 20020502 (experimental)
>Description:
Compiling small functions sometimes adds unnecessary
"subl $12, %esp" and "addl $12, %esp".
For example, the attached function involving SSE2, which
produces the x86 assembly :
add:
subl $12, %esp
movsd 24(%esp), %xmm0
addsd 16(%esp), %xmm0
movsd %xmm0, (%esp)
fldl (%esp)
addl $12, %esp
ret
A similar problem appears with C++ try blocks (see PR 3962), so it's not SSE related.
>How-To-Repeat:
Compile the following function with :
gcc -S -O2 -fomit-frame-pointer -mfpmath=sse -march=pentium4 foo.c
double add(double a, double b) { return a+b; }
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-05-05 22:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-05 15:02 optimization/6562: useless subl/addl $12, %esp in small functions involving sse2 hubicka
-- strict thread matches above, loose matches on Subject: below --
2002-05-04 21:36 Sylvain.Pion
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).