[PATCH 2/8] x86: Do not use __builtin_fpclassify for _Float64x/long double
Adhemerval Zanella Netto
adhemerval.zanella@linaro.org
Fri Dec 19 12:00:40 GMT 2025
On 18/12/25 20:36, H.J. Lu wrote:
> On Thu, Dec 18, 2025 at 8:39 PM Adhemerval Zanella Netto
> <adhemerval.zanella@linaro.org> wrote:
>>
>>
>>
>> On 17/12/25 20:54, H.J. Lu wrote:
>>> On Thu, Dec 18, 2025 at 7:22 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>>>>
>>>> On Thu, Dec 18, 2025 at 1:56 AM Adhemerval Zanella
>>>> <adhemerval.zanella@linaro.org> wrote:
>>>>>
>>>>> Neither gcc [1] nor clang [2] handles pseudo-normal numbers correctly
>>>>> with the __builtin_fpclassify, so disable its usage for _Float64x and
>>>>> long double types.
>>>>
>>>> Please add tests to verify this fix.
>>>>
>>>>>
>>>>> This only affects x86, so add a new header, fp-builtin-denormal.h, that
>>>>> defines whether the architecture requires disabling the optimization
>>>>> through a new glibc define (__FP_BUILTIN_FPCLASSIFY_DENORMAL).
>>>>>
>>>>> It fixes the regression on test-ldouble-fpclassify and
>>>>> test-float64x-fpclassify when built with clang:
>>>>
>>>
>>> Why don't they fail with GCC?
>>
>> I forgot to add on the commit message, but gcc builds the fpclassify tests
>> with -fsignaling-nans. With gcc this defines __SUPPORT_SNAN__, which will
>> always calls the glibc symbol. The clang does not support the options,
>> nor define __SUPPORT_SNAN__; and then will always use the builtin.
>
> We should add some tests without -fsignaling-nans.
Ack, I will work on it.
More information about the Libc-alpha
mailing list