[libc-commits] [libc] [libc][math][c23] Fix X86_Binary80 special cases for canonicalize functions. (PR #86924)

Shourya Goel via libc-commits libc-commits at lists.llvm.org
Thu Mar 28 10:51:40 PDT 2024


================
@@ -199,9 +199,11 @@ LIBC_INLINE int canonicalize(T &cx, const T &x) {
     int exponent = sx.get_biased_exponent();
     if (exponent == 0x7FFF) {
       if (!bit63 && !bit62) {
-        if (mantissa == 0)
-          cx = FPBits<T>::inf(sx.sign()).get_val();
-        else {
+        if (mantissa == 0) {
+          cx = FPBits<T>::quiet_nan(sx.sign(), mantissa).get_val();
+          raise_except_if_required(FE_INVALID);
+          return 1;
+        } else {
----------------
Sh0g0-1758 wrote:

done. 

https://github.com/llvm/llvm-project/pull/86924


More information about the libc-commits mailing list