Fix assert when decoding PSHUFB mask
authorRobert Lougher <rob.lougher@gmail.com>
Mon, 22 Sep 2014 11:54:38 +0000 (11:54 +0000)
committerRobert Lougher <rob.lougher@gmail.com>
Mon, 22 Sep 2014 11:54:38 +0000 (11:54 +0000)
commit2ee97f03a44796b5702d57105526a44de47b27d7
tree7825337b6f99150bff23adcadff0640bcfe86793
parent98ef3474ef26f06ca673a292027584567306d430
Fix assert when decoding PSHUFB mask

The PSHUFB mask decode routine used to assert if the mask index was out of
range (<0 or greater than the size of the vector).  The problem is, we can
legitimately have a PSHUFB with a large index using intrinsics.  The
instruction only uses the least significant 4 bits.  This change removes the
assert and masks the index to match the instruction behaviour.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218242 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/Utils/X86ShuffleDecode.cpp
test/CodeGen/X86/pshufb-mask-comments.ll [new file with mode: 0644]