GCC viciously beaten by ICC in (poorly designed) trig test!

Nathanael Nerode neroden@twcny.rr.com
Mon Mar 15 18:12:00 GMT 2004


Scott Robert Ladd wrote:
>Using both GCC 3.3.3 and Intel C++ 8.0, I compiled the above with these command lines:
> 
> 
>   gcc -o sincosg -lm -std=gnu99 -O3 -march=pentium4 \
>           -mfpmath=387 -ffast-math -fomit-frame-pointer sincos.c
            ^^^^^^^^^^^^

> icc -o sincosi -lm -O3 -xN -tpp7 -ipo sincos.c
<snip>
 
>Examining the generated assembler source shows that Intel eliminates the
>function call to "doit()" entirely, replacing it with inline code that 
>calls internal functions such as vmldSin2 and vmldCos2, 
Did you try marking doit inline?

>while it's actual 
>compilation of doit() uses the SSE2 sincos instruction, whereas GCC 
>generates calls to the 387 instructions fsin and fcos.
Well, duh, given the command line options.

>    -mfpmath=sse
Did this change the generated assembler to use the sse instructions?
It probably should have, and if it didn't, that's probably a bug.

-- 
Make sure your vote will count.
http://www.verifiedvoting.org/



More information about the Gcc mailing list