[clang] [compiler-rt] [llvm] [SystemZ] Add support for half (fp16) (PR #109164)

Jonas Paulsson via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 8 11:59:33 PST 2025


JonPsson1 wrote:

I was hoping these added lines would enable the conversion functions, but it doesn't seem to work:

```
+  if (TT.isSystemZ()) {
+    setLibcallName(RTLIB::FPROUND_F32_F16, "__truncsfhf2");
+    setLibcallName(RTLIB::FPEXT_F16_F32, "__extendhfsf2");
+  }

clang -target s390x-linux-gnu -march=z16 ./test.c -O3 -o ./a.out --rtlib=compiler-rt
/usr/bin/ld: cannot find /home/ijonpan/llvm-project/build/lib/clang/20/lib/s390x-unknown-linux-gnu/libclang_rt.builtins.a: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```
There is something like COMPILER_RT_HAS_${arch}_FLOAT16 in compiler-rt/lib/builtins/CMakeLists.txt, but I can't find anyplace to add s390x to the targets that will build libclang_rt.builtins.a.

I have configured with -DLLVM_ENABLE_PROJECTS="clang;compiler-rt"

Would anyone know off-hand how to make this work? Thanks.
@nikic @phoebewang @kito-cheng @tgross35 

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


More information about the llvm-commits mailing list