[compiler-rt] Found one more delta to unbreak build for z/os (PR #82789)

Alexander Richardson via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 17 11:23:19 PST 2025


================
@@ -368,10 +368,11 @@ static __inline fp_t __compiler_rt_fmax(fp_t x, fp_t y) {
 #endif
 }
 
-#elif defined(QUAD_PRECISION) && defined(CRT_HAS_TF_MODE)
+#elif defined(QUAD_PRECISION)
+#if defined(CRT_HAS_TF_MODE)
+#if defined(CRT_HAS_IEEE_TF)
----------------
arichardson wrote:

CRT_HAS_TF_MODE is defined as follows (f128 and int128):
```
// __(u)int128_t is currently needed to compile the *tf builtins as we would
// otherwise need to manually expand the bit manipulation on two 64-bit value.
#if defined(CRT_HAS_128BIT) && defined(CRT_HAS_F128)
#define CRT_HAS_TF_MODE
#endif
```
CRT_HAS_F128 has two options: CRT_HAS_IEEE_TF or CRT_LDBL_128BIT so I believe these checks are equivalent.

We only need the int128 support for the compiler-rt internal IEEE128 functions, for the non-IEEE we fall back to libc calls.

So in my proposed structure, I believe this would work for 32-bit sparc: it has 128-bit float which is ieee but no int128. But since it also has 128-bit long double it would take the second branch and use the libc functions that don't depend on int128.


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


More information about the llvm-commits mailing list