Description
The MIR primitive binops for shifting are well-defined even when the shift offset is larger than the size of the left operand: the shift offset is truncated to that size before doing the shift. (MIR building relies on this, with overflow checks disabled it is entirely safe to produce MIR shift binops without any guards.)
On the other hand, the SIMD shift intrinsics are currently UB when the shift offset is larger than the size of the left operand. (This is based on the fact that they lower to LLVM operations that yield poison in that case.)
This is inconsistent. IMO it would be a good idea to make these two primitive shift operations in our language consistent. One is exposed as a binop and one as an intrinsic, but that does not fundamentally make one less primitive than the other. If they are consistent, this reduces possible sources of confusion for backend developers. It also makes implementing the SIMD intrinsics for CTFE/Miri a lot easier, since it can just call the MIR binop in a loop.
Also see the prior discussion at rust-lang/miri#1920 (comment).