SDValue Src1 = V1, Src2 = V2;
unsigned Offset1 = 0, Offset2 = 0;
- if (V1.getOpcode() == ISD::EXTRACT_SUBVECTOR &&
- isa<ConstantSDNode>(V1.getOperand(1))) {
- Src1 = V1.getOperand(0);
- Offset1 = V1.getConstantOperandVal(1);
- }
- if (V2.getOpcode() == ISD::EXTRACT_SUBVECTOR &&
- isa<ConstantSDNode>(V2.getOperand(1))) {
- Src2 = V2.getOperand(0);
- Offset2 = V2.getConstantOperandVal(1);
+ while (Src1.getOpcode() == ISD::EXTRACT_SUBVECTOR &&
+ isa<ConstantSDNode>(Src1.getOperand(1))) {
+ Offset1 += Src1.getConstantOperandVal(1);
+ Src1 = Src1.getOperand(0);
+ }
+ while (Src2.getOpcode() == ISD::EXTRACT_SUBVECTOR &&
+ isa<ConstantSDNode>(Src2.getOperand(1))) {
+ Offset2 += Src2.getConstantOperandVal(1);
+ Src2 = Src2.getOperand(0);
}
if (Offset1 == 0 && Offset2 == 0)
return false;
;
; AVX512VBMI-LABEL: trunc_shuffle_v64i8_01_05_09_13_17_21_25_29_33_37_41_45_49_53_57_61:
; AVX512VBMI: # %bb.0:
-; AVX512VBMI-NEXT: vextracti128 $1, %ymm0, %xmm1
-; AVX512VBMI-NEXT: vmovdqa {{.*#+}} xmm2 = <1,5,9,13,u,u,u,u,u,u,u,u,u,u,u,u>
-; AVX512VBMI-NEXT: vpshufb %xmm2, %xmm1, %xmm1
-; AVX512VBMI-NEXT: vpshufb %xmm2, %xmm0, %xmm2
-; AVX512VBMI-NEXT: vpunpckldq {{.*#+}} xmm1 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
+; AVX512VBMI-NEXT: vpbroadcastq {{.*#+}} zmm1 = [2096730264494998785,2096730264494998785,2096730264494998785,2096730264494998785,2096730264494998785,2096730264494998785,2096730264494998785,2096730264494998785]
+; AVX512VBMI-NEXT: vpermb %zmm0, %zmm1, %zmm1
; AVX512VBMI-NEXT: vpbroadcastq {{.*#+}} zmm2 = [4411615795313452321,4411615795313452321,4411615795313452321,4411615795313452321,4411615795313452321,4411615795313452321,4411615795313452321,4411615795313452321]
; AVX512VBMI-NEXT: vpermb %zmm0, %zmm2, %zmm0
; AVX512VBMI-NEXT: vpblendd {{.*#+}} xmm0 = xmm1[0,1],xmm0[2,3]
;
; AVX512VBMI-LABEL: trunc_shuffle_v64i8_01_05_09_13_17_21_25_29_33_37_41_45_49_53_57_62:
; AVX512VBMI: # %bb.0:
-; AVX512VBMI-NEXT: vextracti128 $1, %ymm0, %xmm1
-; AVX512VBMI-NEXT: vmovdqa {{.*#+}} xmm2 = <1,5,9,13,u,u,u,u,u,u,u,u,u,u,u,u>
-; AVX512VBMI-NEXT: vpshufb %xmm2, %xmm1, %xmm1
-; AVX512VBMI-NEXT: vpshufb %xmm2, %xmm0, %xmm2
-; AVX512VBMI-NEXT: vpunpckldq {{.*#+}} xmm1 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
+; AVX512VBMI-NEXT: vpbroadcastq {{.*#+}} zmm1 = [2096730264494998785,2096730264494998785,2096730264494998785,2096730264494998785,2096730264494998785,2096730264494998785,2096730264494998785,2096730264494998785]
+; AVX512VBMI-NEXT: vpermb %zmm0, %zmm1, %zmm1
; AVX512VBMI-NEXT: vpbroadcastq {{.*#+}} zmm2 = [4483673389351380257,4483673389351380257,4483673389351380257,4483673389351380257,4483673389351380257,4483673389351380257,4483673389351380257,4483673389351380257]
; AVX512VBMI-NEXT: vpermb %zmm0, %zmm2, %zmm0
; AVX512VBMI-NEXT: vpblendd {{.*#+}} xmm0 = xmm1[0,1],xmm0[2,3]
;
; AVX512VBMI-LABEL: trunc_shuffle_v64i8_01_05_09_13_17_21_25_29_33_37_41_45_49_53_57_61:
; AVX512VBMI: # %bb.0:
-; AVX512VBMI-NEXT: vextracti128 $1, %ymm0, %xmm1
-; AVX512VBMI-NEXT: vmovdqa {{.*#+}} xmm2 = <1,5,9,13,u,u,u,u,u,u,u,u,u,u,u,u>
-; AVX512VBMI-NEXT: vpshufb %xmm2, %xmm1, %xmm1
-; AVX512VBMI-NEXT: vpshufb %xmm2, %xmm0, %xmm2
-; AVX512VBMI-NEXT: vpunpckldq {{.*#+}} xmm1 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
+; AVX512VBMI-NEXT: vpbroadcastq {{.*#+}} zmm1 = [2096730264494998785,2096730264494998785,2096730264494998785,2096730264494998785,2096730264494998785,2096730264494998785,2096730264494998785,2096730264494998785]
+; AVX512VBMI-NEXT: vpermb %zmm0, %zmm1, %zmm1
; AVX512VBMI-NEXT: vpbroadcastq {{.*#+}} zmm2 = [4411615795313452321,4411615795313452321,4411615795313452321,4411615795313452321,4411615795313452321,4411615795313452321,4411615795313452321,4411615795313452321]
; AVX512VBMI-NEXT: vpermb %zmm0, %zmm2, %zmm0
; AVX512VBMI-NEXT: vpblendd {{.*#+}} xmm0 = xmm1[0,1],xmm0[2,3]
;
; AVX512VBMI-LABEL: trunc_shuffle_v64i8_01_05_09_13_17_21_25_29_33_37_41_45_49_53_57_62:
; AVX512VBMI: # %bb.0:
-; AVX512VBMI-NEXT: vextracti128 $1, %ymm0, %xmm1
-; AVX512VBMI-NEXT: vmovdqa {{.*#+}} xmm2 = <1,5,9,13,u,u,u,u,u,u,u,u,u,u,u,u>
-; AVX512VBMI-NEXT: vpshufb %xmm2, %xmm1, %xmm1
-; AVX512VBMI-NEXT: vpshufb %xmm2, %xmm0, %xmm2
-; AVX512VBMI-NEXT: vpunpckldq {{.*#+}} xmm1 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
+; AVX512VBMI-NEXT: vpbroadcastq {{.*#+}} zmm1 = [2096730264494998785,2096730264494998785,2096730264494998785,2096730264494998785,2096730264494998785,2096730264494998785,2096730264494998785,2096730264494998785]
+; AVX512VBMI-NEXT: vpermb %zmm0, %zmm1, %zmm1
; AVX512VBMI-NEXT: vpbroadcastq {{.*#+}} zmm2 = [4483673389351380257,4483673389351380257,4483673389351380257,4483673389351380257,4483673389351380257,4483673389351380257,4483673389351380257,4483673389351380257]
; AVX512VBMI-NEXT: vpermb %zmm0, %zmm2, %zmm0
; AVX512VBMI-NEXT: vpblendd {{.*#+}} xmm0 = xmm1[0,1],xmm0[2,3]