[compiler-rt] [llvm] [compiler-rt] Use integers for __gnu_h2f_ieee and __gnu_f2h_ieee (PR #220167)

Trevor Gross via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 5 19:15:25 PDT 2026


================
@@ -16,14 +16,16 @@ COMPILER_RT_ABI NOINLINE float __extendhfsf2(src_t a) {
   return __extendXfYf2__(a);
 }
 
+// arm32-gnueabi-only routine that always uses the integer ABI. This should be
+// gnueabi-specific, but LLVM currently emits it on more arm platforms.
+COMPILER_RT_ABI uint32_t __gnu_h2f_ieee(uint16_t a) {
+  return dstToRep(__extendXfYf2__(srcFromRep(a)));
----------------
tgross35 wrote:

Prior to this change, compiler-rt has `__gnu_h2f_ieee` available on all platforms - but that doesn't make sense, it's a GCC function with an unusual signature that's only used (by either LLVM or GCC) on arm32-eabi. So this PR makes the signature match libgcc, and the second PR makes it only available on arm32-eabi.

I think it would be ideal if LLVM actually only emitted `__gnu_h2f_ieee` on platforms with a GNU environment so that compiler-rt doesn't need to ship both on eabi platforms but that's nontrivial. I think it's still a win to not ship this on targets like x86 where it should definitely not be needed.

I suppose I could flip flop the PR order if that makes more sense? Restrict the availability first, then make the signature match.

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


More information about the llvm-commits mailing list