I have a piece of code that runs 70% slower with SSE enabled than with plain
387 on a Dual CPU Xeon system.
I'm not an optimization fanatic, but since -mfpmath=sse is enabled by default
on amd64 this could cause huge performance losses while making amd64 binaries
on this CPU
The runlog is:
[EMAIL PROTECTED] ~]$ uname -a
FreeBSD enc1 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Fri Jan 12 11:05:30 UTC 2007
[EMAIL PROTECTED]:/usr/obj/usr/src/sys/SMP
[EMAIL PROTECTED] ~]$ gcc42 -v
Using built-in specs.
Target: i386-portbld-freebsd6.2
Configured with: ./..//gcc-4.2-20071024/configure --disable-nls
--with-system-zlib --with-libiconv-prefix=/usr/local --with-gmp=/usr/local
--program-suffix=42 --libdir=/usr/local/lib/gcc-4.2.3
--with-gxx-include-dir=/usr/local/lib/gcc-4.2.3/include/c++/ --disable-rpath
--prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/gcc42
i386-portbld-freebsd6.2
Thread model: posix
gcc version 4.2.3 20071024 (prerelease)
[EMAIL PROTECTED] ~]$ gcc42 ssucks.c -O2 -march=prescott -o ssucks-387
[EMAIL PROTECTED] ~]$ gcc42 ssucks.c -O2 -march=prescott -o ssucks-sse
-mfpmath=sse
[EMAIL PROTECTED] ~]$ ssucks-387 ; ssucks-sse
FLOPS C Program (Double Precision), V2.0 18 Dec 1992
Module Error RunTime MFLOPS
(usec)
1 4.0146e-13 0.0147 953.0052
2 -1.4166e-13 0.0061 1149.6845
FLOPS C Program (Double Precision), V2.0 18 Dec 1992
Module Error RunTime MFLOPS
(usec)
1 4.0146e-13 0.0146 960.7945
2 -1.4166e-13 0.0281 249.3171
[EMAIL PROTECTED] ~]$
1149.6845 vs 249.3171: a ~78% slowdown by just enabling sse
I have source, assembled files and runlog online here:
http://teknoraver.campuslife.it/software/gcc-sse/
Cheers,
Matteo Croce
--
Summary: 70% slowdown with SSE enabled
Product: gcc
Version: 4.2.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rootkit85 at yahoo dot it
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34682