-
Notifications
You must be signed in to change notification settings - Fork 1.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
Cranelift: Miscompilation of iselect.i128 with fcmp.f32 condition #3963
Comments
Turns out the i128 version was a miscompilation. Splitting the i128 into two i64 and the individually selecting them makes my code behave as expected. |
Had to apply a workaround for this issue here: bjorn3/rustc_codegen_cranelift@f3d97cc#diff-08d1d6f3581ff3b21f5b1cbb3dd36a818ad7938bc288bf410e8a845e172e5e55R153-R158 |
cc @cfallin |
@abrown would you be able to take a look at this? |
Issue bytecodealliance#3963 identified a miscompilation with select in which the second in the pair of `CMOV`s (one pair per `i128` register) used the wrong flag. This change fixes the error in the x64 ISLE helper function emitting these `CMOV` instructions.
Issue #3963 identified a miscompilation with select in which the second in the pair of `CMOV`s (one pair per `i128` register) used the wrong flag. This change fixes the error in the x64 ISLE helper function emitting these `CMOV` instructions.
This was fixed by #4017 I think. |
.clif
Test CaseSteps to Reproduce
clif-util compile -D repro.clif --target x86_64 --set enable_llvm_abi_extensions=1
Expected Results
No duplicate instructions.
Actual Results
The
mov esi, 0x7fc00000
,cmovne rax, rdi
andcmovne rdx, rsi
instructions are duplicated.Versions and Environment
Cranelift version or commit: 105163c
Operating system: N/A
Architecture: x86_64
Extra Info
Regalloc input:
If I use i64 instead of i128 the second
cmovne
turns intocmovp
:The text was updated successfully, but these errors were encountered: