[flang-commits] [libc] [lldb] [clang-tools-extra] [libclc] [llvm] [libunwind] [clang] [lld] [compiler-rt] [libcxx] [libcxxabi] [flang] [builtins] Generate __multc3 for z/OS (PR #77554)

Alexander Richardson via flang-commits flang-commits at lists.llvm.org
Thu Jan 11 10:07:09 PST 2024


================
@@ -189,11 +189,15 @@ typedef long double tf_float;
 #define CRT_LDBL_IEEE_F128
 #endif
 #define TF_C(x) x##L
-#elif __LDBL_MANT_DIG__ == 113
-// Use long double instead of __float128 if it matches the IEEE 128-bit format.
+#elif __LDBL_MANT_DIG__ == 113 ||                                              \
+    (__FLT_RADIX__ == 16 && __LDBL_MANT_DIG__ == 28)
+// Use long double instead of __float128 if it matches the IEEE 128-bit format
+// or the IBM hexadecimal format.
 #define CRT_LDBL_128BIT
+#if __LDBL_MANT_DIG__ == 113
 #define CRT_HAS_F128
 #define CRT_HAS_IEEE_TF
+#endif
 #define CRT_LDBL_IEEE_F128
----------------
arichardson wrote:

```suggestion
#define CRT_LDBL_128BIT
#define CRT_HAS_F128
#if __LDBL_MANT_DIG__ == 113
#define CRT_HAS_IEEE_TF
#define CRT_LDBL_IEEE_F128
#endif
```

I was suggesting to not define the tf_float is IEEE macros, CRT_HAS_F128 should still be set since we do have a 128-bit floating point type.

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


More information about the flang-commits mailing list