X86: silence sign comparison warning

GCC 4.8 detected a signed compare [-Wsign-compare].  Add a cast for the
destination index.  Add an assert to catch a potential overflow however unlikely
it may be.

llvm-svn: 213878
This commit is contained in:
Saleem Abdulrasool 2014-07-24 17:12:06 +00:00
parent 83e60581c3
commit 34610e33ae
1 changed files with 3 additions and 1 deletions

View File

@ -9069,7 +9069,9 @@ static SDValue getINSERTPS(ShuffleVectorSDNode *SVOp, SDLoc &dl,
// should assume we're changing V2's element's place and behave
// accordingly.
int FromV2 = std::count_if(Mask.begin(), Mask.end(), FromV2Predicate);
if (FromV1 == FromV2 && DestIndex == Mask[DestIndex] % 4) {
assert(DestIndex <= INT32_MAX && "truncated destination index");
if (FromV1 == FromV2 &&
static_cast<int>(DestIndex) == Mask[DestIndex] % 4) {
From = V2;
To = V1;
DestIndex =