[JIT] ARM64 vector right-shift must dead-code eliminate if the constant is zero.#90051
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.
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.
Just checked the X64 impl and it has a similar issue.
There was a problem hiding this comment.
Why is eliding a mov an issue here?
There was a problem hiding this comment.
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.