-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[JIT] ARM64 vector right-shift must dead-code eliminate if the constant is zero. #90051
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
Conversation
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsFixes #89868 The vector right-shift instructions do not allow a zero immediate value in the encoding. See the docs.
|
| GetEmitter()->emitIns_R_R_I(ins, emitSize, targetReg, op2Reg, shiftAmount, opt); | ||
| if (shiftAmount == 0) | ||
| { | ||
| GetEmitter()->emitIns_R_R_R(INS_mov, emitTypeSize(node), targetReg, reg, reg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We really want to use emitIns_Mov but there is an issue with the ARM64 impl that will elide the mov even if canSkip is false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checked the X64 impl and it has a similar issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is eliding a mov an issue here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It breaks the jump table logic which expects a fixed number of bytes per switch case (on Arm64 that's 2 instructions per case, so 8-bytes)
|
@dotnet/jit-contrib @BruceForstall this is ready. |
Fixes #89868
The vector right-shift instructions do not allow a zero immediate value in the encoding. See the docs.