-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
[PowerPC] SIGILL in PPCTargetLowering
for powerpc-unknown-linux-gnu
with pwr9 target feature
#92233
Comments
@llvm/issue-subscribers-backend-powerpc Author: Trevor Gross (tgross35)
I don't know whether 32-bit ppc with power9 is actually valid, but it shouldn't sigill in any case.
The reproduction comes from Rust: #![feature(f128)]
#[no_mangle]
pub fn entry(a: u128) -> f128 {
f128::from_bits(a)
} Invocation:
IR: ; ModuleID = 'transmute_lib.1e179323af95c5c5-cgu.0'
source_filename = "transmute_lib.1e179323af95c5c5-cgu.0"
target datalayout = "E-m:e-p:32:32-Fn32-i64:64-n32"
target triple = "powerpc-unknown-linux-gnu"
; core::f128::<impl f128>::from_bits
; Function Attrs: inlinehint uwtable
define internal fp128 @"_ZN4core4f12822_$LT$impl$u20$f128$GT$9from_bits17hd411f033365ec7b5E"(i128 %v) unnamed_addr #<!-- -->0 {
start:
%_0 = bitcast i128 %v to fp128
ret fp128 %_0
}
; Function Attrs: uwtable
define fp128 @<!-- -->entry(i128 %a) unnamed_addr #<!-- -->1 {
start:
; call core::f128::<impl f128>::from_bits
%_0 = call fp128 @"_ZN4core4f12822_$LT$impl$u20$f128$GT$9from_bits17hd411f033365ec7b5E"(i128 %a)
ret fp128 %_0
}
attributes #<!-- -->0 = { inlinehint uwtable "probe-stack"="inline-asm" "target-cpu"="pwr9" }
attributes #<!-- -->1 = { uwtable "probe-stack"="inline-asm" "target-cpu"="pwr9" }
!llvm.module.flags = !{!0}
!llvm.ident = !{!1}
!0 = !{i32 8, !"PIC Level", i32 2}
!1 = !{!"rustc version 1.80.0-nightly (9c9b56879 2024-05-05)"} Backtrace from GDB:
|
I've fixed the crash in 3d8c2f0103556674a36b7252dd2f726912768527 Please note that __i128 is not supported in clang frontend for target powerpc-unknown-linux-gnu. See https://godbolt.org/z/M1onxvb5W Maybe rust should also disable the __i128 support for target powerpc-unknown-linux-gnu |
Great, thank you for the quick fix!
Integer types i128 and u128 have been around for years on all platforms without many big issues, so those won't be going anywhere (in fact, Clang could probably enable them on more targets based on this evidence). f128 support is indeed buggy almost everywhere - but it's currently an unstable feature and will be for a while, so we are just trying to identify what bugs exist before deciding what exactly will eventually be stabilized. |
Thank you! If you are going to check the f128 support status in LLVM backend for powerpc-unknown-linux-gnu, I am glad to investigate issues you get. |
Thank you :) If you are familiar with that platform, do you know if QEMU has some limitations with this target? I was hitting a SIGILL at |
Unfortunately I don't have much knowledge about the QEMU. For the SIGILL at stxvd2x, 1: Is the simulated target PWR7 or above? 2: Does the address match stxvd2x alignment requirement according to the PPC user manual? |
This only happens when 128-bit floats are involved. The reproduction comes from Rust:
Invocation:
IR:
Backtrace from GDB:
The text was updated successfully, but these errors were encountered: