This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Cleanup FAST_MATH misc functions from sysdeps/x86/fpu/bits/mathinline.h


On Thu, Apr 26, 2018 at 2:00 PM, Joseph Myers <joseph@codesourcery.com> wrote:
> On Thu, 26 Apr 2018, Uros Bizjak wrote:
>
>> Hello!
>>
>> Attached patch cleans up FAST_MATH misc functions from
>> sysdeps/x86/fpu/bits/mathinline.h. The patch uses x87 __builtin
>
> What we actually want to do is eliminate bits/mathinline.h completely
> (with libc-internal inlines moving to an internal header) (and then
> eliminate the separate inline function ulps and tests).  There may be a
> few remaining cases that would be useful for GCC to optimize with
> -ffast-math but that it doesn't currently have built-in optimizations for,
> however.
>
> The header, while it exists, does need to work with old GCC versions as
> it's an installed header (optimizations might be disabled with old
> versions, however).

Maybe we can protect these functions with __GNUC_PREREQ (4, 4) in the
mean time? gcc-4.4 that introduced __builtin_copysign is now 10 years
old, so perhaps we can declare it "too old" for these fast-math
optimizations.

>> Patch was tested on x86_64-linux-gnu, and the resulting mathinline.h
>> was used to calculate test results of all changed functions.
>
> Note this code isn't used for 64-bit anyway (it's all inside "#if !defined
> __SSE2_MATH__ && !defined __x86_64__").

Yes -  as said, I have included the header in other test files to
exercise the mentioned part of code. The build confirmed that no build
regressions were introduced.

Uros.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]