On Sun, Jun 12, 2016 at 11:50:11PM +0200, Uros Bizjak wrote: > Attached (mostly mechanical) patch uses equivalent built-in functions > for fabsq, copysignq and nanq. The patch allows more aggressive > compiler optimizations, where for fabsq and copysignq, the compiler > will emit 128bit SSE bitops, and a 128bit constant load instead of > nanq function call. > > The patch also improves detection of required builtins, so for ia64, > additional patch [1] is needed. > > 2016-06-12 Uros Bizjak <ubiz...@gmail.com> > > * configure.ac (__float128 support): Also test _builtin_fabsq, > __builtin_copysignq, __builtin_infq and __builtin_nanq. > * configure: Regenerate. > * math/*.c: Use __builtin_fabsq instead of fabsq, __builtin_copysignq > instead of copysignq, __builtin_infq instead of __builtin_inf and > __builtin_nanq instead of nanq. > > Patch was bootstrapped and regression tested on x86_64-linux-gnu > {,-m32}. I have also checked, that no fabsq, copysignq or nanq calls > remain in the library.
Couldn't you instead add into a header inline functions or macros that map fabsq to __builtin_fabsq etc.? Then you could keep the *.c files as is. What I don't really like on the patch is that it diverges too much from the original libc sources (other than replacing suffixes of functions and changing types). Jakub