-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[aarch64] Cannot select: constant:i128<0>
for llvm.maximum.f128
#139380
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
Labels
backend:AArch64
crash
Prefer [crash-on-valid] or [crash-on-invalid]
llvm:SelectionDAG
SelectionDAGISel as well
Comments
@llvm/issue-subscribers-backend-aarch64 Author: None (Urgau)
I'm seeing an error when trying to use `llvm.minimum.f128` and `llvm.maximum.f128` on aarch64.
define fp128 @<!-- -->call_maximum_fp128(fp128 %x, fp128 %y) unnamed_addr #<!-- -->0 {
start:
%0 = tail call fp128 @<!-- -->llvm.maximum.f128(fp128 %x, fp128 %y) #<!-- -->2
ret fp128 %0
}
; Function Attrs: mustprogress nofree nosync nounwind readnone speculatable willreturn
declare fp128 @<!-- -->llvm.maximum.f128(fp128, fp128)
|
This was referenced May 14, 2025
nikic
added a commit
that referenced
this issue
Jun 2, 2025
FMAXIMUM is currently legalized via IS_FPCLASS for the signed zero handling. This is problematic, because it assumes the equivalent integer type is legal. Many targets have legal fp128, but illegal i128, so this results in legalization failures. Fix this by replacing IS_FPCLASS with checking the bitcast to integer instead. In that case it is sufficient to use any legal integer type, as we're just interested in the sign bit. This can be obtained via a stack temporary cast. There is existing FloatSignAsInt functionality used for legalization of FABS and similar we can use for this purpose. Fixes #139380. Fixes #139381. Fixes #140445.
llvm-sync bot
pushed a commit
to arm/arm-toolchain
that referenced
this issue
Jun 2, 2025
FMAXIMUM is currently legalized via IS_FPCLASS for the signed zero handling. This is problematic, because it assumes the equivalent integer type is legal. Many targets have legal fp128, but illegal i128, so this results in legalization failures. Fix this by replacing IS_FPCLASS with checking the bitcast to integer instead. In that case it is sufficient to use any legal integer type, as we're just interested in the sign bit. This can be obtained via a stack temporary cast. There is existing FloatSignAsInt functionality used for legalization of FABS and similar we can use for this purpose. Fixes llvm/llvm-project#139380. Fixes llvm/llvm-project#139381. Fixes llvm/llvm-project#140445.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backend:AArch64
crash
Prefer [crash-on-valid] or [crash-on-invalid]
llvm:SelectionDAG
SelectionDAGISel as well
I'm seeing an error when trying to use
llvm.minimum.f128
andllvm.maximum.f128
on aarch64.https://godbolt.org/z/YWdK1ecM5
The text was updated successfully, but these errors were encountered: