Using attribute cleanup for rounding mode save/restore

Richard Henderson rth@twiddle.net
Tue Mar 6 22:14:00 GMT 2012


I did some testing with s_tan, which has oodles of returns.

The good news is that the patch below results in identical
assembly before and after, testing with Fedora 16 gcc-4.6.2.

The less amusing news is that we get a better register
allocation with the "goto ret" form (as measured by resulting
object size).  Note that this is true with or without using
attribute cleanup.  Given the "return" form, there is a tiny
increase in object size with attribute cleanup, but nothing
nearly as significant as "return" vs "goto ret".  AFAICT,
nothing ever changes between the various forms except the
register allocation.

The use of the function-local inline isn't as conceptually
clean as I'd like, but there's nothing functionally wrong
with it and it neatly avoids having to restructure the
various math_private.h headers.

Comments?  Should I flush this out and submit it properly?


r~
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: z
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20120306/9c5f3867/attachment.ksh>


More information about the Libc-alpha mailing list