This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/16584] -msse2 also enabling -mfpmath=sse option causing illegal instruction errors
- From: "aron-gcc at sightspeed dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Jul 2004 17:11:40 -0000
- Subject: [Bug c/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 aron-gcc at sightspeed dot com 2004-07-16 17:11 -------
Three responses too this:
1. Just using -msse does not trigger the same behiavor with SSE1 floating point
calls in regular code.
2. Even if (1) was performing this: The man page section under -mfpmath states
that the -mfpmath option must explicitly be passed for normal floating point
code to be repalced with SSE code. Even if you explicity pass -mfpmath=387 -
msse2, it will still generate SSE2 for non-intrinsics code.
3. If you description is correct, How are you supposed to generate binaries
that are processor safe on x86. We ship a Linux program that has sections
optimized (using Intrinsics) that are protected by runtime CPUID detection.
The man pages that I have for GCC state for -msse2
These switches enable or disable the use of built-in
functions that allow direct access to the MMX, SSE,
SSE2, SSE3 and 3Dnow extensions of the instruction
set.
------> To have SSE/SSE2 instructions generated automatically
from floating-point code, see -mfpmath=sse.
<man page section on -mfpmath >
-mfpmath=unit
Generate floating point arithmetics for selected unit
unit. The choices for unit are:
387 Use the standard 387 floating point coprocessor
present majority of chips and emulated otherwise.
Code compiled with this option will run almost
everywhere. The temporary results are computed in
80bit precision instead of precision specified by
the type resulting in slightly different results
compared to most of other chips. See -ffloat-store
for more detailed description.
This is the default choice for i386 compiler.
sse Use scalar floating point instructions present in
the SSE instruction set. This instruction set is
supported by Pentium3 and newer chips, in the AMD
line by Athlon-4, Athlon-xp and Athlon-mp chips.
The earlier version of SSE instruction set sup
ports only single precision arithmetics, thus the
double and extended precision arithmetics is still
done using 387. Later version, present only in
Pentium4 and the future AMD x86-64 chips supports
double precision arithmetics too.
For i387 you need to use -march=cpu-type, -msse or
-msse2 switches to enable SSE extensions and make
this option effective. For x86-64 compiler, these
extensions are enabled by default.
Thank You.
Aron Rosenberg
<a href="http://www.sightspeed.com">http://www.sightspeed.com</a>
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16584