mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-24 11:41:07 +00:00
Fix ldbl-128ibm ceill, rintl etc. for sNaN arguments (bug 20156).
The ldbl-128ibm implementations of ceill, floorl, roundl, truncl, rintl and nearbyintl wrongly return an sNaN when given an sNaN argument. This patch fixes them to add such an argument to itself to turn it into a quiet NaN. (The code structure means this "else" case applies to any argument which is zero or not finite; it's OK to do this in all such cases.) Tested for powerpc. [BZ #20156] * sysdeps/ieee754/ldbl-128ibm/s_ceill.c (__ceill): Add high part to itself when zero or not finite. * sysdeps/ieee754/ldbl-128ibm/s_floorl.c (__floorl): Likewise. * sysdeps/ieee754/ldbl-128ibm/s_rintl.c (__rintl): Likewise. * sysdeps/ieee754/ldbl-128ibm/s_roundl.c (__roundl): Likewise. * sysdeps/ieee754/ldbl-128ibm/s_truncl.c (__truncl): Likewise.
This commit is contained in:
parent
98c9c9d9ca
commit
bba1419589
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
||||
2016-05-27 Joseph Myers <joseph@codesourcery.com>
|
||||
|
||||
[BZ #20156]
|
||||
* sysdeps/ieee754/ldbl-128ibm/s_ceill.c (__ceill): Add high part
|
||||
to itself when zero or not finite.
|
||||
* sysdeps/ieee754/ldbl-128ibm/s_floorl.c (__floorl): Likewise.
|
||||
* sysdeps/ieee754/ldbl-128ibm/s_rintl.c (__rintl): Likewise.
|
||||
* sysdeps/ieee754/ldbl-128ibm/s_roundl.c (__roundl): Likewise.
|
||||
* sysdeps/ieee754/ldbl-128ibm/s_truncl.c (__truncl): Likewise.
|
||||
|
||||
2016-05-26 Joseph Myers <joseph@codesourcery.com>
|
||||
|
||||
[BZ #20153]
|
||||
|
@ -52,6 +52,9 @@ __ceill (long double x)
|
||||
ldbl_canonicalize_int (&xh, &xl);
|
||||
}
|
||||
}
|
||||
else
|
||||
/* Quiet signaling NaN arguments. */
|
||||
xh += xh;
|
||||
|
||||
return ldbl_pack (xh, xl);
|
||||
}
|
||||
|
@ -52,6 +52,9 @@ __floorl (long double x)
|
||||
ldbl_canonicalize_int (&xh, &xl);
|
||||
}
|
||||
}
|
||||
else
|
||||
/* Quiet signaling NaN arguments. */
|
||||
xh += xh;
|
||||
|
||||
return ldbl_pack (xh, xl);
|
||||
}
|
||||
|
@ -119,6 +119,9 @@ __rintl (long double x)
|
||||
fesetround (save_round);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
/* Quiet signaling NaN arguments. */
|
||||
xh += xh;
|
||||
|
||||
return ldbl_pack (xh, xl);
|
||||
}
|
||||
|
@ -77,6 +77,9 @@ __roundl (long double x)
|
||||
ldbl_canonicalize_int (&xh, &xl);
|
||||
}
|
||||
}
|
||||
else
|
||||
/* Quiet signaling NaN arguments. */
|
||||
xh += xh;
|
||||
|
||||
return ldbl_pack (xh, xl);
|
||||
}
|
||||
|
@ -52,6 +52,9 @@ __truncl (long double x)
|
||||
ldbl_canonicalize_int (&xh, &xl);
|
||||
}
|
||||
}
|
||||
else
|
||||
/* Quiet signaling NaN arguments. */
|
||||
xh += xh;
|
||||
|
||||
return ldbl_pack (xh, xl);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user