[PATCH] D130718: [compiler-rt] [builtins] Detect _Float16 support at compile time

Dimitry Andric via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 29 11:57:11 PDT 2022


dim added a comment.

In D130718#3686439 <https://reviews.llvm.org/D130718#3686439>, @pengfei wrote:

> @kparzysz reminded me. This is not the right direction to solve the problem. The ABI of runtime libraries should be constant rather than changing with different features. Imagining a program may be built with or without `SSE2` and linked with the same runtime. Another problem is compatibility with libgcc. Using `uint16_t` is not compatible with libgcc anymore.
>
> Fortunately, LLVM codegen (unfortunately Darwin isn't) was using `__gnu_h2f_ieee/__gnu_f2h_ieee` before the change https://godbolt.org/z/GnrT5vGr1. So an easy way to solve the problem is always assign `-msse2` when build `extendhftf2/trunctfhf2`.
>
> I have a patch D128872 <https://reviews.llvm.org/D128872> for Darwin targets, I hope we can put it into the 15.x release.

If this is the case, then maybe the whole commit that introduced the use of `_Float16` (i.e. rG655ba9c8a1d22075443711cc749f0b032e07adee <https://reviews.llvm.org/rG655ba9c8a1d22075443711cc749f0b032e07adee>) should be reverted *again*?  (It's already titled 'Reland "Reland "Reland "Reland "[X86][RFC] Enable _Float16 type support on X86 following the psABI""""', so relanding it One More Time shouldn't be that difficult ;))

That said, rG655ba9c8a1d22075443711cc749f0b032e07adee <https://reviews.llvm.org/rG655ba9c8a1d22075443711cc749f0b032e07adee>'s description also says "following the psABI" so maybe this is actually going to improve ABI compatibility?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130718/new/

https://reviews.llvm.org/D130718



More information about the llvm-commits mailing list