diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 4d0662a7fd0..3718f79a49e 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -5294,8 +5294,8 @@ X86TargetLowering::LowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG) const { int MaskVec[] = { Reverse1 ? 1 : 0, Reverse1 ? 0 : 1, - static_cast(Reverse2 ? 1-NumElems : NumElems), - static_cast(Reverse2 ? NumElems : 1+NumElems) + static_cast(Reverse2 ? NumElems+1 : NumElems), + static_cast(Reverse2 ? NumElems : NumElems+1) }; return DAG.getVectorShuffle(VT, dl, V[0], V[1], &MaskVec[0]); }