Craig et al -
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.
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.
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.
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?