@@ -32059,21 +32059,19 @@ void X86TargetLowering::ReplaceNodeResults(SDNode *N,
32059
32059
unsigned WidenNumElts = WidenVT.getVectorNumElements();
32060
32060
unsigned InBits = InVT.getSizeInBits();
32061
32061
32062
- if (128 % InBits == 0) {
32063
- // See if there are sufficient leading bits to perform a PACKUS/PACKSS.
32064
- unsigned PackOpcode;
32065
- if (SDValue Src =
32066
- matchTruncateWithPACK(PackOpcode, VT, In, dl, DAG, Subtarget)) {
32067
- SDValue WidenSrc =
32068
- widenSubVector(Src, false, Subtarget, DAG, dl,
32069
- InEltVT.getSizeInBits() * WidenNumElts);
32070
- if (SDValue Res = truncateVectorWithPACK(PackOpcode, WidenVT, WidenSrc,
32071
- dl, DAG, Subtarget)) {
32072
- Results.push_back(Res);
32073
- return;
32074
- }
32062
+ // See if there are sufficient leading bits to perform a PACKUS/PACKSS.
32063
+ unsigned PackOpcode;
32064
+ if (SDValue Src =
32065
+ matchTruncateWithPACK(PackOpcode, VT, In, dl, DAG, Subtarget)) {
32066
+ if (SDValue Res = truncateVectorWithPACK(PackOpcode, VT, Src,
32067
+ dl, DAG, Subtarget)) {
32068
+ Res = widenSubVector(WidenVT, Res, false, Subtarget, DAG, dl);
32069
+ Results.push_back(Res);
32070
+ return;
32075
32071
}
32072
+ }
32076
32073
32074
+ if (128 % InBits == 0) {
32077
32075
// 128 bit and smaller inputs should avoid truncate all together and
32078
32076
// just use a build_vector that will become a shuffle.
32079
32077
// TODO: Widen and use a shuffle directly?
0 commit comments