From 732525758f3c486f5e570528e7fd9b35fe121ba0 Mon Sep 17 00:00:00 2001 From: Elena Demikhovsky Date: Wed, 1 Feb 2012 10:33:05 +0000 Subject: [PATCH] Shortened code in shuffle masks git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149493 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86ISelLowering.cpp | 44 ++++++++---------------------- 1 file changed, 11 insertions(+), 33 deletions(-) diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index f84d2864056..a0b4cb54dcf 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -12941,25 +12941,17 @@ SDValue X86TargetLowering::PerformTruncateCombine(SDNode *N, SelectionDAG &DAG, OpHi = DAG.getNode(ISD::BITCAST, dl, MVT::v4i32, OpHi); // PSHUFD - SmallVector ShufMask1; - ShufMask1.push_back(0); - ShufMask1.push_back(2); - ShufMask1.push_back(0); - ShufMask1.push_back(0); + int ShufMask1[] = {0, 2, 0, 0}; OpLo = DAG.getVectorShuffle(VT, dl, OpLo, DAG.getUNDEF(VT), - ShufMask1.data()); + ShufMask1); OpHi = DAG.getVectorShuffle(VT, dl, OpHi, DAG.getUNDEF(VT), - ShufMask1.data()); + ShufMask1); // MOVLHPS - SmallVector ShufMask2; - ShufMask2.push_back(0); - ShufMask2.push_back(1); - ShufMask2.push_back(4); - ShufMask2.push_back(5); + int ShufMask2[] = {0, 1, 4, 5}; - return DAG.getVectorShuffle(VT, dl, OpLo, OpHi, ShufMask2.data()); + return DAG.getVectorShuffle(VT, dl, OpLo, OpHi, ShufMask2); } if ((VT == MVT::v8i16) && (OpVT == MVT::v8i32)) { @@ -12973,38 +12965,24 @@ SDValue X86TargetLowering::PerformTruncateCombine(SDNode *N, SelectionDAG &DAG, OpHi = DAG.getNode(ISD::BITCAST, dl, MVT::v16i8, OpHi); // PSHUFB - SmallVector ShufMask1; - ShufMask1.push_back(0x0); - ShufMask1.push_back(0x1); - ShufMask1.push_back(0x4); - ShufMask1.push_back(0x5); - ShufMask1.push_back(0x8); - ShufMask1.push_back(0x9); - ShufMask1.push_back(0xc); - ShufMask1.push_back(0xd); - for (unsigned i=0; i<8; ++i) - ShufMask1.push_back(-1); + int ShufMask1[] = {0, 1, 4, 5, 8, 9, 12, 13, + -1, -1, -1, -1, -1, -1, -1, -1}; OpLo = DAG.getVectorShuffle(MVT::v16i8, dl, OpLo, DAG.getUNDEF(MVT::v16i8), - ShufMask1.data()); + ShufMask1); OpHi = DAG.getVectorShuffle(MVT::v16i8, dl, OpHi, DAG.getUNDEF(MVT::v16i8), - ShufMask1.data()); + ShufMask1); OpLo = DAG.getNode(ISD::BITCAST, dl, MVT::v4i32, OpLo); OpHi = DAG.getNode(ISD::BITCAST, dl, MVT::v4i32, OpHi); // MOVLHPS - SmallVector ShufMask2; - ShufMask2.push_back(0); - ShufMask2.push_back(1); - ShufMask2.push_back(4); - ShufMask2.push_back(5); + int ShufMask2[] = {0, 1, 4, 5}; - SDValue res = DAG.getVectorShuffle(MVT::v4i32, dl, OpLo, OpHi, ShufMask2.data()); + SDValue res = DAG.getVectorShuffle(MVT::v4i32, dl, OpLo, OpHi, ShufMask2); return DAG.getNode(ISD::BITCAST, dl, MVT::v8i16, res); - } return SDValue();