Why do floating point operations differ between -m64 -O0/-O1 and -m32 -O0?

Marc Glisse marc.glisse@inria.fr
Wed Nov 24 11:00:00 GMT 2010


On Wed, 24 Nov 2010, Nikos Chantziaras wrote:

> Is the FPU hardware still available in x86-64 CPUs

Yes of course, and long double even uses it in the ABI.

> On a similar note, is doing floating point computations using SSE faster 
> when compared to the 387?

Yes on modern hardware. But note that moving values between x87 and sse 
registers can cause some overhead.

> It's not that I don't want the excess precision (looks like a Good Thing to 
> me; less rounding errors).  It's that I'm not sure if I can count on it being 
> there.  Would the above routine be a good enough check to see whether excess 
> precision is there?

If you want the larger precision, use long double. The extra precision for 
double can randomly disappear anywhere, as soon as the value is moved from 
a register to memory.

-- 
Marc Glisse



More information about the Gcc-help mailing list