This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/16584] -msse2 also enabling -mfpmath=sse option causing illegal instruction errors
- From: "uros at kss-loka dot si" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Dec 2004 14:29:29 -0000
- Subject: [Bug target/16584] -msse2 also enabling -mfpmath=sse option causing illegal instruction errors
- References: <20040716024656.16584.aron-gcc@sightspeed.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From uros at kss-loka dot si 2004-12-24 14:29 -------
With current TARGET_SSE_MATH work, mainline gcc produces:
main:
pushl %ebp
movl %esp, %ebp
subl $24, %esp
andl $-16, %esp
movl $0, %eax
addl $15, %eax
addl $15, %eax
shrl $4, %eax
sall $4, %eax
subl %eax, %esp
movl $1, -8(%ebp)
movl -8(%ebp), %eax
imull -8(%ebp), %eax
pushl %eax
fildl (%esp)
leal 4(%esp), %esp
fstps -4(%ebp)
movl $0, %eax
leave
ret
However, -mfpmath just tells which instruction set is preferred. It is -msse,
-mmmx etc. that tells the compiler which instructions it can use, independently
of -mfpmath setting. For example, cvttss2si insn will be generated when -msse is
specified, no matter what -mfpmath setting you use.
-mmmx, -msse and -msse2 are treated the same way as -march=pentium3, etc. You
can not run the code, compiled with -march=pentium4 on i586.
However, this part of documentation should be fixed:
For i387 you need to use `-march=CPU-TYPE', `-msse' or
`-msse2' switches to enable SSE extensions and make this
I belive, it should read:
For i386 compiler, you need to use `-march=CPU-TYPE', `-msse' or
`-msse2' switches to enable SSE extensions and make this
Uros.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16584