-
Notifications
You must be signed in to change notification settings - Fork 11.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LLVM f128 -> f16 conversion selection failure on powerpc64le #92866
Comments
@llvm/issue-subscribers-backend-powerpc Author: Trevor Gross (tgross35)
The below fails to select on target `powerpc64le-unknown-linux-gnu`:
define half @<!-- -->demo(fp128 %a) unnamed_addr {
start:
%_0 = fptrunc fp128 %a to half
ret half %_0
}
Link: https://llvm.godbolt.org/z/16W8EKzfa both |
The reverse conversion also crashes: __float128 from(__fp16 *f) { return *f; }
void to(__fp16 *f, __float128 g) { *f = (__fp16)g; } For pre-power9 targets, For power9 and later targets, |
Thanks for confirming.
Any reason it uses |
No idea.. libgcc does not contain |
In the patch https://reviews.llvm.org/D64282, it says |
It looks like extendhf is not included from that file https://github.com/gcc-mirror/gcc/blob/c7cb0dd94589ab501bca27f93641b4074e5a2e99/libgcc/config/rs6000/float128-sed. It seems like it probably should be a Unless a decision was made to stop adding new symbols for double double at some point? In which case tf for any newer symbols might be IEEE-754 f128. (Unfortunately I can't test this right now) |
I'm afraid that powerpc64le libgcc does not contain symbols: |
@ecnelises Does Clang support them? If so, maybe they could be added to compiler-rt. If you just need something to test against, Rust's compiler_builtins has them already https://github.com/rust-lang/compiler-builtins/blob/06db2de1c098f9c3cf69a52e7a273f19f0dce061/src/float/extend.rs#L101-L120, but with the I know that both Clang and GCC talked about defaulting to IEEE binary128 on PPC rather than the IBM 2xdouble. Do you know if this happened yet, or is still happening? Asking because from section 2.2 here https://gcc.gnu.org/wiki/Ieee128PowerPC, the table mentions that "kf" is always IEEE 754, "tf" is whatever |
See #89054, LLVM compiler-rt misses a lot of them. I think Rust depends on LLVM's compiler builtins, not (dynamic) libgcc?
Both clang and GCC has not moved yet.
It looks like, in libgcc, For Rust or FreeBSD, if these symbols are made into in LLVM compiler-rt, we can go and generate references in LLVM backend. (does |
Rust does link with the shared library I have tried to be pretty on top of powerpc names so most all the
Ah that is too bad, thank you for confirming.
Thanks for looking into this.
To clarify - making LLVM lower correctly shouldn't be blocked on having support in |
Ah, I forgot that part of the problem is that on BE it lowers to Edit: did so in #98126 |
The below fails to select on target
powerpc64le-unknown-linux-gnu
:Link: https://llvm.godbolt.org/z/16W8EKzfa
both
powerpc64
andpowerpc
(32-bit) complete selection and emit a call to__trunctfhf2
. I am not sure if this is correct or if it should try to call__trunckfhf2
instead, but all three targets (powerpc64, powerpc64le, powerpc) should all probably act the same.The text was updated successfully, but these errors were encountered: