@@ -1265,11 +1265,15 @@ HexagonTargetLowering::extractHvxSubvectorReg(SDValue OrigOp, SDValue VecV, |
|
|
1265 |
1265 |
// the subvector of interest. The subvector will never overlap two single |
1266 |
1266 |
// vectors. |
1267 |
1267 |
if (isHvxPairTy(VecTy)) { |
1268 |
|
-if (Idx * ElemWidth >= 8*HwLen) |
|
1268 |
+unsigned SubIdx = Hexagon::vsub_lo; |
|
1269 |
+if (Idx * ElemWidth >= 8 * HwLen) { |
|
1270 |
+ SubIdx = Hexagon::vsub_hi; |
1269 |
1271 |
Idx -= VecTy.getVectorNumElements() / 2; |
|
1272 |
+ } |
1270 |
1273 |
|
1271 |
|
- VecV = OrigOp; |
1272 |
|
-if (typeSplit(VecTy).first == ResTy) |
|
1274 |
+ VecTy = typeSplit(VecTy).first; |
|
1275 |
+ VecV = DAG.getTargetExtractSubreg(SubIdx, dl, VecTy, VecV); |
|
1276 |
+if (VecTy == ResTy) |
1273 |
1277 |
return VecV; |
1274 |
1278 |
} |
1275 |
1279 |
|