llvm.org GIT mirror llvm / 7e6bfeb
[X86][AVX512] createVariablePermute - Non-VLX targets can widen v4i64/v8f64 variable permutes to v8i64/v8f64 Permutes in the upper elements will be undefined, but they will be discarded anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327238 91177308-0d34-0410-b5e6-96231b3b80d8 Simon Pilgrim 2 years ago
2 changed file(s) with 40 addition(s) and 74 deletion(s). Raw diff Collapse all Expand all
80478047 break;
80488048 case MVT::v4i64:
80498049 case MVT::v4f64:
8050 if (Subtarget.hasVLX())
8050 if (Subtarget.hasAVX512()) {
8051 if (!Subtarget.hasVLX()) {
8052 MVT WidenSrcVT = MVT::getVectorVT(VT.getScalarType(), 8);
8053 SrcVec = widenSubVector(WidenSrcVT, SrcVec, false, Subtarget, DAG,
8054 SDLoc(SrcVec));
8055 IndicesVec = widenSubVector(MVT::v8i64, IndicesVec, false, Subtarget,
8056 DAG, SDLoc(IndicesVec));
8057 SDValue Res = createVariablePermute(WidenSrcVT, SrcVec, IndicesVec, DL,
8058 DAG, Subtarget);
8059 return extract256BitVector(Res, 0, DAG, DL);
8060 }
80518061 Opcode = X86ISD::VPERMV;
8052 else if (Subtarget.hasXOP()) {
8062 } else if (Subtarget.hasXOP()) {
80538063 SrcVec = DAG.getBitcast(MVT::v4f64, SrcVec);
80548064 SDValue LoLo =
80558065 DAG.getVectorShuffle(MVT::v4f64, DL, SrcVec, SrcVec, {0, 1, 0, 1});
6565 ;
6666 ; AVX512F-LABEL: var_shuffle_v4i64:
6767 ; AVX512F: # %bb.0:
68 ; AVX512F-NEXT: vpbroadcastq {{.*#+}} ymm2 = [2,2,2,2]
69 ; AVX512F-NEXT: vpmuludq %ymm2, %ymm1, %ymm2
70 ; AVX512F-NEXT: vpsrlq $32, %ymm1, %ymm3
71 ; AVX512F-NEXT: vpbroadcastq {{.*#+}} ymm4 = [8589934594,8589934594,8589934594,8589934594]
72 ; AVX512F-NEXT: vpmuludq %ymm4, %ymm3, %ymm3
73 ; AVX512F-NEXT: vpaddq %ymm3, %ymm2, %ymm2
74 ; AVX512F-NEXT: vpsllq $32, %ymm2, %ymm2
75 ; AVX512F-NEXT: vpmuludq %ymm4, %ymm1, %ymm1
76 ; AVX512F-NEXT: vpbroadcastq {{.*#+}} ymm3 = [4294967296,4294967296,4294967296,4294967296]
77 ; AVX512F-NEXT: vpaddq %ymm3, %ymm2, %ymm2
78 ; AVX512F-NEXT: vpaddq %ymm2, %ymm1, %ymm1
79 ; AVX512F-NEXT: vpermd %ymm0, %ymm1, %ymm0
68 ; AVX512F-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
69 ; AVX512F-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
70 ; AVX512F-NEXT: vpermpd %zmm0, %zmm1, %zmm0
71 ; AVX512F-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
8072 ; AVX512F-NEXT: retq
8173 ;
8274 ; AVX512DQ-LABEL: var_shuffle_v4i64:
8375 ; AVX512DQ: # %bb.0:
8476 ; AVX512DQ-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
85 ; AVX512DQ-NEXT: vpbroadcastq {{.*#+}} ymm2 = [8589934594,8589934594,8589934594,8589934594]
86 ; AVX512DQ-NEXT: vpmullq %zmm2, %zmm1, %zmm1
87 ; AVX512DQ-NEXT: vpbroadcastq {{.*#+}} ymm2 = [4294967296,4294967296,4294967296,4294967296]
88 ; AVX512DQ-NEXT: vpaddq %ymm2, %ymm1, %ymm1
89 ; AVX512DQ-NEXT: vpermd %ymm0, %ymm1, %ymm0
77 ; AVX512DQ-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
78 ; AVX512DQ-NEXT: vpermpd %zmm0, %zmm1, %zmm0
79 ; AVX512DQ-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
9080 ; AVX512DQ-NEXT: retq
9181 ;
9282 ; AVX512VL-LABEL: var_shuffle_v4i64:
13761366 ;
13771367 ; AVX512F-LABEL: var_shuffle_v4f64:
13781368 ; AVX512F: # %bb.0:
1379 ; AVX512F-NEXT: vpbroadcastq {{.*#+}} ymm2 = [2,2,2,2]
1380 ; AVX512F-NEXT: vpmuludq %ymm2, %ymm1, %ymm2
1381 ; AVX512F-NEXT: vpsrlq $32, %ymm1, %ymm3
1382 ; AVX512F-NEXT: vpbroadcastq {{.*#+}} ymm4 = [8589934594,8589934594,8589934594,8589934594]
1383 ; AVX512F-NEXT: vpmuludq %ymm4, %ymm3, %ymm3
1384 ; AVX512F-NEXT: vpaddq %ymm3, %ymm2, %ymm2
1385 ; AVX512F-NEXT: vpsllq $32, %ymm2, %ymm2
1386 ; AVX512F-NEXT: vpmuludq %ymm4, %ymm1, %ymm1
1387 ; AVX512F-NEXT: vpbroadcastq {{.*#+}} ymm3 = [4294967296,4294967296,4294967296,4294967296]
1388 ; AVX512F-NEXT: vpaddq %ymm3, %ymm2, %ymm2
1389 ; AVX512F-NEXT: vpaddq %ymm2, %ymm1, %ymm1
1390 ; AVX512F-NEXT: vpermd %ymm0, %ymm1, %ymm0
1369 ; AVX512F-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
1370 ; AVX512F-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
1371 ; AVX512F-NEXT: vpermpd %zmm0, %zmm1, %zmm0
1372 ; AVX512F-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
13911373 ; AVX512F-NEXT: retq
13921374 ;
13931375 ; AVX512DQ-LABEL: var_shuffle_v4f64:
13941376 ; AVX512DQ: # %bb.0:
13951377 ; AVX512DQ-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
1396 ; AVX512DQ-NEXT: vpbroadcastq {{.*#+}} ymm2 = [8589934594,8589934594,8589934594,8589934594]
1397 ; AVX512DQ-NEXT: vpmullq %zmm2, %zmm1, %zmm1
1398 ; AVX512DQ-NEXT: vpbroadcastq {{.*#+}} ymm2 = [4294967296,4294967296,4294967296,4294967296]
1399 ; AVX512DQ-NEXT: vpaddq %ymm2, %ymm1, %ymm1
1400 ; AVX512DQ-NEXT: vpermd %ymm0, %ymm1, %ymm0
1378 ; AVX512DQ-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
1379 ; AVX512DQ-NEXT: vpermpd %zmm0, %zmm1, %zmm0
1380 ; AVX512DQ-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
14011381 ; AVX512DQ-NEXT: retq
14021382 ;
14031383 ; AVX512VL-LABEL: var_shuffle_v4f64:
15571537 ;
15581538 ; AVX512F-LABEL: var_shuffle_v4i64_from_v2i64:
15591539 ; AVX512F: # %bb.0:
1560 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $ymm0
1561 ; AVX512F-NEXT: vpbroadcastq {{.*#+}} ymm2 = [2,2,2,2]
1562 ; AVX512F-NEXT: vpmuludq %ymm2, %ymm1, %ymm2
1563 ; AVX512F-NEXT: vpsrlq $32, %ymm1, %ymm3
1564 ; AVX512F-NEXT: vpbroadcastq {{.*#+}} ymm4 = [8589934594,8589934594,8589934594,8589934594]
1565 ; AVX512F-NEXT: vpmuludq %ymm4, %ymm3, %ymm3
1566 ; AVX512F-NEXT: vpaddq %ymm3, %ymm2, %ymm2
1567 ; AVX512F-NEXT: vpsllq $32, %ymm2, %ymm2
1568 ; AVX512F-NEXT: vpmuludq %ymm4, %ymm1, %ymm1
1569 ; AVX512F-NEXT: vpbroadcastq {{.*#+}} ymm3 = [4294967296,4294967296,4294967296,4294967296]
1570 ; AVX512F-NEXT: vpaddq %ymm3, %ymm2, %ymm2
1571 ; AVX512F-NEXT: vpaddq %ymm2, %ymm1, %ymm1
1572 ; AVX512F-NEXT: vpermd %ymm0, %ymm1, %ymm0
1540 ; AVX512F-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
1541 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1542 ; AVX512F-NEXT: vpermpd %zmm0, %zmm1, %zmm0
1543 ; AVX512F-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
15731544 ; AVX512F-NEXT: retq
15741545 ;
15751546 ; AVX512DQ-LABEL: var_shuffle_v4i64_from_v2i64:
15761547 ; AVX512DQ: # %bb.0:
15771548 ; AVX512DQ-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
1578 ; AVX512DQ-NEXT: # kill: def $xmm0 killed $xmm0 def $ymm0
1579 ; AVX512DQ-NEXT: vpbroadcastq {{.*#+}} ymm2 = [8589934594,8589934594,8589934594,8589934594]
1580 ; AVX512DQ-NEXT: vpmullq %zmm2, %zmm1, %zmm1
1581 ; AVX512DQ-NEXT: vpbroadcastq {{.*#+}} ymm2 = [4294967296,4294967296,4294967296,4294967296]
1582 ; AVX512DQ-NEXT: vpaddq %ymm2, %ymm1, %ymm1
1583 ; AVX512DQ-NEXT: vpermd %ymm0, %ymm1, %ymm0
1549 ; AVX512DQ-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1550 ; AVX512DQ-NEXT: vpermpd %zmm0, %zmm1, %zmm0
1551 ; AVX512DQ-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
15841552 ; AVX512DQ-NEXT: retq
15851553 ;
15861554 ; AVX512VL-LABEL: var_shuffle_v4i64_from_v2i64:
28052773 ;
28062774 ; AVX512F-LABEL: var_shuffle_v4f64_from_v2f64:
28072775 ; AVX512F: # %bb.0:
2808 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $ymm0
2809 ; AVX512F-NEXT: vpbroadcastq {{.*#+}} ymm2 = [2,2,2,2]
2810 ; AVX512F-NEXT: vpmuludq %ymm2, %ymm1, %ymm2
2811 ; AVX512F-NEXT: vpsrlq $32, %ymm1, %ymm3
2812 ; AVX512F-NEXT: vpbroadcastq {{.*#+}} ymm4 = [8589934594,8589934594,8589934594,8589934594]
2813 ; AVX512F-NEXT: vpmuludq %ymm4, %ymm3, %ymm3
2814 ; AVX512F-NEXT: vpaddq %ymm3, %ymm2, %ymm2
2815 ; AVX512F-NEXT: vpsllq $32, %ymm2, %ymm2
2816 ; AVX512F-NEXT: vpmuludq %ymm4, %ymm1, %ymm1
2817 ; AVX512F-NEXT: vpbroadcastq {{.*#+}} ymm3 = [4294967296,4294967296,4294967296,4294967296]
2818 ; AVX512F-NEXT: vpaddq %ymm3, %ymm2, %ymm2
2819 ; AVX512F-NEXT: vpaddq %ymm2, %ymm1, %ymm1
2820 ; AVX512F-NEXT: vpermd %ymm0, %ymm1, %ymm0
2776 ; AVX512F-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2777 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
2778 ; AVX512F-NEXT: vpermpd %zmm0, %zmm1, %zmm0
2779 ; AVX512F-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
28212780 ; AVX512F-NEXT: retq
28222781 ;
28232782 ; AVX512DQ-LABEL: var_shuffle_v4f64_from_v2f64:
28242783 ; AVX512DQ: # %bb.0:
28252784 ; AVX512DQ-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
2826 ; AVX512DQ-NEXT: # kill: def $xmm0 killed $xmm0 def $ymm0
2827 ; AVX512DQ-NEXT: vpbroadcastq {{.*#+}} ymm2 = [8589934594,8589934594,8589934594,8589934594]
2828 ; AVX512DQ-NEXT: vpmullq %zmm2, %zmm1, %zmm1
2829 ; AVX512DQ-NEXT: vpbroadcastq {{.*#+}} ymm2 = [4294967296,4294967296,4294967296,4294967296]
2830 ; AVX512DQ-NEXT: vpaddq %ymm2, %ymm1, %ymm1
2831 ; AVX512DQ-NEXT: vpermd %ymm0, %ymm1, %ymm0
2785 ; AVX512DQ-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
2786 ; AVX512DQ-NEXT: vpermpd %zmm0, %zmm1, %zmm0
2787 ; AVX512DQ-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
28322788 ; AVX512DQ-NEXT: retq
28332789 ;
28342790 ; AVX512VL-LABEL: var_shuffle_v4f64_from_v2f64: