[PATCH 1/5] x86 long double: Support pseudo numbers in fpclassifyl

Adhemerval Zanella adhemerval.zanella@linaro.org
Tue Dec 22 18:43:14 GMT 2020



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.

> +     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.


More information about the Libc-alpha mailing list