-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
x86 wrong code for floating point comparison #63055
Labels
Comments
Reduced: define i64 @test(double %arg) {
%fcmp = fcmp une double 0x7FF8000000000000, %arg
%ext = zext i1 %fcmp to i64
ret i64 %ext
} After type legalization:
After DAGCombining:
After legalization:
Either the combine or the legalization are wrong, depending on BooleanContents. |
The problem is
|
Candidate patch: https://reviews.llvm.org/D151883 |
nikic
added a commit
to rust-lang/llvm-project
that referenced
this issue
Jun 5, 2023
FoldSetCC() returns UNDEF in a number of cases. However, the SetCC result must follow BooleanContents. Unless the type is a pre-legalization i1 or we have UndefinedBooleanContents, the use of UNDEF will not uphold the requirement that the top bits are either zero or match the low bit. In such cases, return zero instead. Fixes llvm#63055. Differential Revision: https://reviews.llvm.org/D151883 (cherry picked from commit e506bfa)
veselypeta
pushed a commit
to veselypeta/cherillvm
that referenced
this issue
Aug 27, 2024
FoldSetCC() returns UNDEF in a number of cases. However, the SetCC result must follow BooleanContents. Unless the type is a pre-legalization i1 or we have UndefinedBooleanContents, the use of UNDEF will not uphold the requirement that the top bits are either zero or match the low bit. In such cases, return zero instead. Fixes llvm/llvm-project#63055. Differential Revision: https://reviews.llvm.org/D151883
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From rust-lang/rust#112170
%_30
should be 1, asNaN != 0
is true, however on x86print_var
gets called with 255:https://godbolt.org/z/5f447cnfn
opt -O3
is correct:The text was updated successfully, but these errors were encountered: