[PATCH 4/5] x86 long double: Consider pseudo numbers as signaling

Siddhesh Poyarekar siddhesh@gotplt.org
Wed Dec 23 01:50:19 GMT 2020


On 12/23/20 1:43 AM, Adhemerval Zanella via Libc-alpha wrote:
> 
> 
> On 15/12/2020 11:13, Siddhesh Poyarekar via Libc-alpha wrote:
>> Implement a separate x86 version of issignalingl that returns true for
>> pseudo-normal numbers.
>>
>> Also drop comment from the generic version of s_issignalingl since it
>> is no longer true or relevant.
>> ---
>>   sysdeps/ieee754/ldbl-96/s_issignalingl.c |  2 --
>>   sysdeps/x86/fpu/s_issignalingl.c         | 39 ++++++++++++++++++++++++
>>   2 files changed, 39 insertions(+), 2 deletions(-)
>>   create mode 100644 sysdeps/x86/fpu/s_issignalingl.c
>>
>> diff --git a/sysdeps/ieee754/ldbl-96/s_issignalingl.c b/sysdeps/ieee754/ldbl-96/s_issignalingl.c
>> index ec542ad468..2aa0ffae0e 100644
>> --- a/sysdeps/ieee754/ldbl-96/s_issignalingl.c
>> +++ b/sysdeps/ieee754/ldbl-96/s_issignalingl.c
>> @@ -34,8 +34,6 @@ __issignalingl (long double x)
>>     hxi ^= 0x40000000;
>>     /* If lxi != 0, then set any suitable bit of the significand in hxi.  */
>>     hxi |= (lxi | -lxi) >> 31;
>> -  /* We do not recognize a pseudo NaN as sNaN; they're invalid on 80387 and
>> -     later.  */
>>     /* We have to compare for greater (instead of greater or equal), because x's
>>        significand being all-zero designates infinity not NaN.  */
>>     return ((exi & 0x7fff) == 0x7fff) && (hxi > 0xc0000000);
>> diff --git a/sysdeps/x86/fpu/s_issignalingl.c b/sysdeps/x86/fpu/s_issignalingl.c
> 
> We have multiple internal defines that try to use the common implementation
> instead of pushing for arch-specific ones (for instance nan-high-order-bit.h,
> fix-int-fp-convert-zero.h, fix-fp-int-convert-overflow.h, etc).  Maybe it
> would be simpler to just add a new header (nan-handle-pseudo-number.h or
> something related) and adapt the generic implementation.

OK I'll try to do that.

Thanks,
Siddhesh


More information about the Libc-alpha mailing list