<div dir="ltr">Craig et al -<div><br></div><div>We recently ran into a code bug that was revealed by the way that r272246 ("[X86] Handle AVX2 pslldqi and psrldqi intrinsics shufflevector creation directly in the header file instead of in CGBuiltin.cpp. Simplify the sse2 equivalents as well.") changed the behavior of the SSE2 _mm_slli_si128 and _mm_srli_si128 intrinsics.</div><div><br></div><div>Previously, these intrinsics worked correctly with all values of shift operands, and would produce a result of zero for any shift value outside of the [0-15] range.</div><div><br></div><div>With this change, any value of the shift operand outside of the range [0-16] -- note, that's 16, not 15 -- will cause a compilation error.</div><div><br></div><div>Now, I can see good arguments for why limiting the range to [0-16] would be a good idea; after all, it did reveal a code bug in our case.  However, this behavior change wasn't mentioned in the change description, and I can also see good arguments for why one wouldn't want this limit -- so I figure it's a good idea to raise the question explicitly: Was this behavior change intentional?  If not, is it nonetheless the desired behavior?</div><div><br></div><div>- Brooks</div><div><br></div></div>