Skip to content

Commit 561f1d0

Browse files
committed
[X86] add test coverage for concatenation to 512-bit VPERMILPD nodes
1 parent 800593a commit 561f1d0

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

llvm/test/CodeGen/X86/vector-shuffle-512-v8.ll

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1673,6 +1673,53 @@ define <8 x double> @shuffle_v8f64_01234589(<8 x double> %a, <8 x double> %b) {
16731673
ret <8 x double> %shuffle
16741674
}
16751675

1676+
define <8 x double> @concat_shuffle_v8f64_v2f64_10325476(<2 x double> %a0, <2 x double> %a1, <2 x double> %a2, <2 x double> %a3) nounwind {
1677+
; AVX512F-LABEL: concat_shuffle_v8f64_v2f64_10325476:
1678+
; AVX512F: # %bb.0:
1679+
; AVX512F-NEXT: # kill: def $xmm2 killed $xmm2 def $ymm2
1680+
; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 def $ymm0
1681+
; AVX512F-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
1682+
; AVX512F-NEXT: vshufpd {{.*#+}} ymm0 = ymm0[1,0,3,2]
1683+
; AVX512F-NEXT: vinsertf128 $1, %xmm3, %ymm2, %ymm1
1684+
; AVX512F-NEXT: vshufpd {{.*#+}} ymm1 = ymm1[1,0,3,2]
1685+
; AVX512F-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1686+
; AVX512F-NEXT: retq
1687+
;
1688+
; AVX512F-32-LABEL: concat_shuffle_v8f64_v2f64_10325476:
1689+
; AVX512F-32: # %bb.0:
1690+
; AVX512F-32-NEXT: subl $12, %esp
1691+
; AVX512F-32-NEXT: # kill: def $xmm2 killed $xmm2 def $ymm2
1692+
; AVX512F-32-NEXT: # kill: def $xmm0 killed $xmm0 def $ymm0
1693+
; AVX512F-32-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
1694+
; AVX512F-32-NEXT: vshufpd {{.*#+}} ymm0 = ymm0[1,0,3,2]
1695+
; AVX512F-32-NEXT: vinsertf128 $1, {{[0-9]+}}(%esp), %ymm2, %ymm1
1696+
; AVX512F-32-NEXT: vshufpd {{.*#+}} ymm1 = ymm1[1,0,3,2]
1697+
; AVX512F-32-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1698+
; AVX512F-32-NEXT: addl $12, %esp
1699+
; AVX512F-32-NEXT: retl
1700+
%s0 = shufflevector <2 x double> %a0, <2 x double> poison, <2 x i32> <i32 1, i32 0>
1701+
%s1 = shufflevector <2 x double> %a1, <2 x double> poison, <2 x i32> <i32 1, i32 0>
1702+
%s2 = shufflevector <2 x double> %a2, <2 x double> poison, <2 x i32> <i32 1, i32 0>
1703+
%s3 = shufflevector <2 x double> %a3, <2 x double> poison, <2 x i32> <i32 1, i32 0>
1704+
%lo = shufflevector <2 x double> %s0, <2 x double> %s1, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
1705+
%hi = shufflevector <2 x double> %s2, <2 x double> %s3, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
1706+
%res = shufflevector <4 x double> %lo, <4 x double> %hi, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
1707+
ret <8 x double> %res
1708+
}
1709+
1710+
define <8 x double> @concat_shuffle_v8f64_v4f64_10325476(<4 x double> %a0, <4 x double> %a1) nounwind {
1711+
; ALL-LABEL: concat_shuffle_v8f64_v4f64_10325476:
1712+
; ALL: # %bb.0:
1713+
; ALL-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
1714+
; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
1715+
; ALL-NEXT: vshufpd {{.*#+}} zmm0 = zmm0[1,0,3,2,5,4,7,6]
1716+
; ALL-NEXT: ret{{[l|q]}}
1717+
%lo = shufflevector <4 x double> %a0, <4 x double> poison, <4 x i32> <i32 1, i32 0, i32 3, i32 2>
1718+
%hi = shufflevector <4 x double> %a1, <4 x double> poison, <4 x i32> <i32 1, i32 0, i32 3, i32 2>
1719+
%res = shufflevector <4 x double> %lo, <4 x double> %hi, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
1720+
ret <8 x double> %res
1721+
}
1722+
16761723
define <8 x i64> @shuffle_v8i64_89234567(<8 x i64> %a, <8 x i64> %b) {
16771724
; ALL-LABEL: shuffle_v8i64_89234567:
16781725
; ALL: # %bb.0:

0 commit comments

Comments
 (0)