[PATCH 1/5] x86 long double: Support pseudo numbers in fpclassifyl
Siddhesh Poyarekar
siddhesh@sourceware.org
Wed Dec 23 01:43:11 GMT 2020
On 12/23/20 12:13 AM, Adhemerval Zanella via Libc-alpha wrote:
>
>
> On 15/12/2020 11:13, Siddhesh Poyarekar via Libc-alpha wrote:
>> ---
>> sysdeps/i386/fpu/s_fpclassifyl.c | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/sysdeps/i386/fpu/s_fpclassifyl.c b/sysdeps/i386/fpu/s_fpclassifyl.c
>> index 501312f51e..aeaec7279c 100644
>> --- a/sysdeps/i386/fpu/s_fpclassifyl.c
>> +++ b/sysdeps/i386/fpu/s_fpclassifyl.c
>> @@ -34,6 +34,10 @@ __fpclassifyl (long double x)
>> retval = FP_ZERO;
>> else if (ex == 0 && (hx & 0x80000000) == 0)
>> retval = FP_SUBNORMAL;
>> + /* Pseudo-normals, i.e. pseudo-zero, pseudo-infinity and unnormals. They
>
> Intel manual adds a hyphen for un-normals.
>
Fixed.
>> + behave like NaNs, so categorize them as such. */
>> + else if ((hx & 0x80000000) == 0)
>> + retval = FP_NAN;
>
> Ok.
>
>> else if (ex == 0x7fff)
>> retval = ((hx & 0x7fffffff) | lx) != 0 ? FP_NAN : FP_INFINITE;
>>
>>
>
> Maybe move the implementation to sysdep/x86/fpu since it is used for
> both x86_64 and i386? It avoid the implicit cross abi include the
> and make the implementation selection more clear.
>
OK.
Thanks,
Siddhesh
More information about the Libc-alpha
mailing list