LWN.net Logo

Pettenò: Debunking x32 myths

Pettenò: Debunking x32 myths

Posted Jun 28, 2012 0:42 UTC (Thu) by mansr (guest, #85328)
In reply to: Pettenò: Debunking x32 myths by nix
Parent article: Pettenò: Debunking x32 myths

Thanks for the clarification on the flags.

While you are right that -mfpmath=sse still uses the x87 parameter passing, it is my experience that (well-written) software making heavy use of floating-point spends most its time inside functions rather than in calls between them. Moreover, such software mostly passes around pointers to large arrays of data, not individual floating-point values.

Concerning libm, many compilers (gcc included) inline many of its functions, often using only one or a few instructions. For example, on x86 a call to sqrt() is turned into a single sqrtsd instruction.


(Log in to post comments)

Pettenò: Debunking x32 myths

Posted Jun 28, 2012 14:23 UTC (Thu) by nix (subscriber, #2304) [Link]

You are, of course, correct that -mfpmath=sse provides most of the performance benefits of the -msseregparm-equivalent used by x32 -- however, it doesn't provide all of them, and in extreme circumstances can actually be slower than x87 (though it generally requires contrived benchmarks to do that).

Regarding inlined math operations, yes, quite a few can be inlined. A lot of the more complex stuff is just too large to usefully inline, though :( but I suppose the really common things generally are inlined (sqrt() being rather more commonly used than, e.g., y1f()).

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds