-mfpmath=387 flag does not prevent gcc from using SSE/SSE2 instructions

Andrew Derrick Balsa andrebalsa@mailingaddress.org
Fri May 2 16:28:00 GMT 2003


Hi

On Friday 02 May 2003 18:23, Jan Hubicka wrote:
...
> > I think -mfpmath should be disabled on x86-64.  Honza, what do you
> > think?  You would break the ABI otherwise,
>
> It is same as to 386. -mfpmath=387 breaks rounding mandated by 386 abi,
> -mfpmath=sse breaks rounding mandated by SSE abi.
> Still there is some code that executes fater when compiled for 387, so I
> would keep that option as working...
>
> Honza

>From the x86-64 ABI, I notice that most FP code would be translated to 
SSE/SSE2 instructions using the SSE registers. Only long double data types 
(80 bits) have to use the 387, and SSE/SSE2 is the forced way for all other 
floating point types.
(ref: http://www.x86-64.org/lists/discuss/msg01021.html)
This makes sense.

There may be some efficiency issues in using mixed 387/SSE code, as moving 
data between register sets seems extremely slow. If there is code that 
executes faster when compiled for 387, perhaps this should be restricted to 
32-bit mode software?

So, perhaps -mfpmath=387 should be deprecated for x86_64?

What happens if I specify -mfpmath=sse and try to use long doubles?

Thanks,
-- 
André Derrick Balsa (Andrew)
andrebalsa@mailingaddress.org



More information about the Gcc-bugs mailing list