llvm.org GIT mirror llvm / 7325257
Shortened code in shuffle masks git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149493 91177308-0d34-0410-b5e6-96231b3b80d8 Elena Demikhovsky 7 years ago
1 changed file(s) with 13 addition(s) and 35 deletion(s). Raw diff Collapse all Expand all
1294012940 OpHi = DAG.getNode(ISD::BITCAST, dl, MVT::v4i32, OpHi);
1294112941
1294212942 // PSHUFD
12943 SmallVector ShufMask1;
12944 ShufMask1.push_back(0);
12945 ShufMask1.push_back(2);
12946 ShufMask1.push_back(0);
12947 ShufMask1.push_back(0);
12943 int ShufMask1[] = {0, 2, 0, 0};
1294812944
1294912945 OpLo = DAG.getVectorShuffle(VT, dl, OpLo, DAG.getUNDEF(VT),
12950 ShufMask1.data());
12946 ShufMask1);
1295112947 OpHi = DAG.getVectorShuffle(VT, dl, OpHi, DAG.getUNDEF(VT),
12952 ShufMask1.data());
12948 ShufMask1);
1295312949
1295412950 // MOVLHPS
12955 SmallVector ShufMask2;
12956 ShufMask2.push_back(0);
12957 ShufMask2.push_back(1);
12958 ShufMask2.push_back(4);
12959 ShufMask2.push_back(5);
12960
12961 return DAG.getVectorShuffle(VT, dl, OpLo, OpHi, ShufMask2.data());
12951 int ShufMask2[] = {0, 1, 4, 5};
12952
12953 return DAG.getVectorShuffle(VT, dl, OpLo, OpHi, ShufMask2);
1296212954 }
1296312955 if ((VT == MVT::v8i16) && (OpVT == MVT::v8i32)) {
1296412956
1297212964 OpHi = DAG.getNode(ISD::BITCAST, dl, MVT::v16i8, OpHi);
1297312965
1297412966 // PSHUFB
12975 SmallVector ShufMask1;
12976 ShufMask1.push_back(0x0);
12977 ShufMask1.push_back(0x1);
12978 ShufMask1.push_back(0x4);
12979 ShufMask1.push_back(0x5);
12980 ShufMask1.push_back(0x8);
12981 ShufMask1.push_back(0x9);
12982 ShufMask1.push_back(0xc);
12983 ShufMask1.push_back(0xd);
12984 for (unsigned i=0; i<8; ++i)
12985 ShufMask1.push_back(-1);
12967 int ShufMask1[] = {0, 1, 4, 5, 8, 9, 12, 13,
12968 -1, -1, -1, -1, -1, -1, -1, -1};
1298612969
1298712970 OpLo = DAG.getVectorShuffle(MVT::v16i8, dl, OpLo,
1298812971 DAG.getUNDEF(MVT::v16i8),
12989 ShufMask1.data());
12972 ShufMask1);
1299012973 OpHi = DAG.getVectorShuffle(MVT::v16i8, dl, OpHi,
1299112974 DAG.getUNDEF(MVT::v16i8),
12992 ShufMask1.data());
12975 ShufMask1);
1299312976
1299412977 OpLo = DAG.getNode(ISD::BITCAST, dl, MVT::v4i32, OpLo);
1299512978 OpHi = DAG.getNode(ISD::BITCAST, dl, MVT::v4i32, OpHi);
1299612979
1299712980 // MOVLHPS
12998 SmallVector ShufMask2;
12999 ShufMask2.push_back(0);
13000 ShufMask2.push_back(1);
13001 ShufMask2.push_back(4);
13002 ShufMask2.push_back(5);
13003
13004 SDValue res = DAG.getVectorShuffle(MVT::v4i32, dl, OpLo, OpHi, ShufMask2.data());
12981 int ShufMask2[] = {0, 1, 4, 5};
12982
12983 SDValue res = DAG.getVectorShuffle(MVT::v4i32, dl, OpLo, OpHi, ShufMask2);
1300512984 return DAG.getNode(ISD::BITCAST, dl, MVT::v8i16, res);
13006
1300712985 }
1300812986
1300912987 return SDValue();