[cfe-dev] Was the SSE2 _mm_slli_si128 / _mm_srli_si128 behavior change in r272246 intentional?

Brooks Moses via cfe-dev cfe-dev at lists.llvm.org
Fri Jun 24 18:10:10 PDT 2016


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?

- Brooks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160624/ae04cacd/attachment.html>


More information about the cfe-dev mailing list