[libc-commits] [libc] [libc][math][c23] Fix X86_80 Special Case (PR #86924)

via libc-commits libc-commits at lists.llvm.org
Thu Mar 28 07:09:29 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 {
----------------
lntue wrote:

Remove `else` since you already return in the if statement.

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


More information about the libc-commits mailing list