2015-12-27 21:56:16 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
2015-11-22 21:57:38 +08:00
|
|
|
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512bw -mattr=+avx512dq -mattr=+avx512vl| FileCheck %s
|
|
|
|
|
|
|
|
define <8 x i1> @test(<2 x i1> %a) {
|
|
|
|
; CHECK-LABEL: test:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2015-12-27 21:56:16 +08:00
|
|
|
; CHECK-NEXT: vpsllq $63, %xmm0, %xmm0
|
2016-01-28 21:19:25 +08:00
|
|
|
; CHECK-NEXT: vptestmq %xmm0, %xmm0, %k0
|
2015-11-22 21:57:38 +08:00
|
|
|
; CHECK-NEXT: kshiftlb $2, %k0, %k0
|
|
|
|
; CHECK-NEXT: vpmovm2w %k0, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%res = shufflevector <2 x i1> %a, <2 x i1> undef, <8 x i32> <i32 undef, i32 undef, i32 0, i32 1, i32 undef, i32 undef, i32 undef, i32 undef>
|
|
|
|
ret <8 x i1> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <8 x i1> @test1(<2 x i1> %a) {
|
|
|
|
; CHECK-LABEL: test1:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2015-12-27 21:56:16 +08:00
|
|
|
; CHECK-NEXT: vpsllq $63, %xmm0, %xmm0
|
2016-01-28 21:19:25 +08:00
|
|
|
; CHECK-NEXT: vptestmq %xmm0, %xmm0, %k0
|
2015-11-22 21:57:38 +08:00
|
|
|
; CHECK-NEXT: kshiftlb $4, %k0, %k0
|
|
|
|
; CHECK-NEXT: vpmovm2w %k0, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%res = shufflevector <2 x i1> %a, <2 x i1> undef, <8 x i32> <i32 undef, i32 undef, i32 undef, i32 undef, i32 0, i32 1, i32 undef, i32 undef>
|
|
|
|
ret <8 x i1> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <8 x i1> @test2(<2 x i1> %a) {
|
|
|
|
; CHECK-LABEL: test2:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2015-12-27 21:56:16 +08:00
|
|
|
; CHECK-NEXT: vpsllq $63, %xmm0, %xmm0
|
2016-01-28 21:19:25 +08:00
|
|
|
; CHECK-NEXT: vptestmq %xmm0, %xmm0, %k0
|
2017-12-22 02:44:06 +08:00
|
|
|
; CHECK-NEXT: vpmovm2d %k0, %ymm0
|
|
|
|
; CHECK-NEXT: vperm2i128 {{.*#+}} ymm0 = zero,zero,ymm0[0,1]
|
|
|
|
; CHECK-NEXT: vpmovd2m %ymm0, %k0
|
2015-11-22 21:57:38 +08:00
|
|
|
; CHECK-NEXT: vpmovm2w %k0, %xmm0
|
2017-03-03 17:03:24 +08:00
|
|
|
; CHECK-NEXT: vzeroupper
|
2015-11-22 21:57:38 +08:00
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%res = shufflevector <2 x i1> %a, <2 x i1> zeroinitializer, <8 x i32> <i32 3, i32 3, i32 undef, i32 undef, i32 0, i32 1, i32 undef, i32 undef>
|
|
|
|
ret <8 x i1> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <8 x i1> @test3(<4 x i1> %a) {
|
|
|
|
; CHECK-LABEL: test3:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2015-12-27 21:56:16 +08:00
|
|
|
; CHECK-NEXT: vpslld $31, %xmm0, %xmm0
|
2016-01-28 21:19:25 +08:00
|
|
|
; CHECK-NEXT: vptestmd %xmm0, %xmm0, %k0
|
2015-11-22 21:57:38 +08:00
|
|
|
; CHECK-NEXT: vpmovm2w %k0, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
|
|
|
|
%res = shufflevector <4 x i1> %a, <4 x i1> zeroinitializer, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
|
|
|
|
ret <8 x i1> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <8 x i1> @test4(<4 x i1> %a, <4 x i1>%b) {
|
|
|
|
; CHECK-LABEL: test4:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-12-10 06:44:42 +08:00
|
|
|
; CHECK-NEXT: vpslld $31, %xmm1, %xmm1
|
|
|
|
; CHECK-NEXT: vptestmd %xmm1, %xmm1, %k0
|
2015-12-27 21:56:16 +08:00
|
|
|
; CHECK-NEXT: vpslld $31, %xmm0, %xmm0
|
2016-03-06 15:46:03 +08:00
|
|
|
; CHECK-NEXT: vptestmd %xmm0, %xmm0, %k1
|
2015-11-22 21:57:38 +08:00
|
|
|
; CHECK-NEXT: kshiftlb $4, %k0, %k0
|
2017-12-10 06:44:42 +08:00
|
|
|
; CHECK-NEXT: korb %k0, %k1, %k0
|
2015-11-22 21:57:38 +08:00
|
|
|
; CHECK-NEXT: vpmovm2w %k0, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
|
|
|
|
%res = shufflevector <4 x i1> %a, <4 x i1> %b, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
|
|
|
|
ret <8 x i1> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x i1> @test5(<2 x i1> %a, <2 x i1>%b) {
|
|
|
|
; CHECK-LABEL: test5:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-12-10 06:44:42 +08:00
|
|
|
; CHECK-NEXT: vpsllq $63, %xmm1, %xmm1
|
|
|
|
; CHECK-NEXT: vptestmq %xmm1, %xmm1, %k0
|
2015-12-27 21:56:16 +08:00
|
|
|
; CHECK-NEXT: vpsllq $63, %xmm0, %xmm0
|
2016-03-06 15:46:03 +08:00
|
|
|
; CHECK-NEXT: vptestmq %xmm0, %xmm0, %k1
|
2017-12-10 06:44:42 +08:00
|
|
|
; CHECK-NEXT: kshiftlb $2, %k0, %k0
|
|
|
|
; CHECK-NEXT: korb %k0, %k1, %k0
|
2015-11-22 21:57:38 +08:00
|
|
|
; CHECK-NEXT: vpmovm2d %k0, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
|
|
|
|
%res = shufflevector <2 x i1> %a, <2 x i1> %b, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
|
|
|
|
ret <4 x i1> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <16 x i1> @test6(<2 x i1> %a, <2 x i1>%b) {
|
|
|
|
; CHECK-LABEL: test6:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-12-10 06:44:42 +08:00
|
|
|
; CHECK-NEXT: vpsllq $63, %xmm1, %xmm1
|
|
|
|
; CHECK-NEXT: vptestmq %xmm1, %xmm1, %k0
|
2015-12-27 21:56:16 +08:00
|
|
|
; CHECK-NEXT: vpsllq $63, %xmm0, %xmm0
|
2016-03-06 15:46:03 +08:00
|
|
|
; CHECK-NEXT: vptestmq %xmm0, %xmm0, %k1
|
2017-12-10 06:44:42 +08:00
|
|
|
; CHECK-NEXT: kshiftlb $2, %k0, %k0
|
|
|
|
; CHECK-NEXT: korb %k0, %k1, %k0
|
2015-11-22 21:57:38 +08:00
|
|
|
; CHECK-NEXT: vpmovm2b %k0, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
|
|
|
|
%res = shufflevector <2 x i1> %a, <2 x i1> %b, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
|
|
|
ret <16 x i1> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <32 x i1> @test7(<4 x i1> %a, <4 x i1>%b) {
|
|
|
|
; CHECK-LABEL: test7:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-12-10 06:44:42 +08:00
|
|
|
; CHECK-NEXT: vpslld $31, %xmm1, %xmm1
|
|
|
|
; CHECK-NEXT: vptestmd %xmm1, %xmm1, %k0
|
2015-12-27 21:56:16 +08:00
|
|
|
; CHECK-NEXT: vpslld $31, %xmm0, %xmm0
|
2016-03-06 15:46:03 +08:00
|
|
|
; CHECK-NEXT: vptestmd %xmm0, %xmm0, %k1
|
2015-11-22 21:57:38 +08:00
|
|
|
; CHECK-NEXT: kshiftlb $4, %k0, %k0
|
2017-12-10 06:44:42 +08:00
|
|
|
; CHECK-NEXT: korb %k0, %k1, %k0
|
2015-11-22 21:57:38 +08:00
|
|
|
; CHECK-NEXT: vpmovm2b %k0, %ymm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
|
|
|
|
%res = shufflevector <4 x i1> %a, <4 x i1> %b, <32 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
|
|
|
ret <32 x i1> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <64 x i1> @test8(<8 x i1> %a, <8 x i1>%b) {
|
|
|
|
; CHECK-LABEL: test8:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2015-12-27 21:56:16 +08:00
|
|
|
; CHECK-NEXT: vpsllw $15, %xmm1, %xmm1
|
2015-11-22 21:57:38 +08:00
|
|
|
; CHECK-NEXT: vpmovw2m %xmm1, %k0
|
2015-12-27 21:56:16 +08:00
|
|
|
; CHECK-NEXT: vpsllw $15, %xmm0, %xmm0
|
2015-11-22 21:57:38 +08:00
|
|
|
; CHECK-NEXT: vpmovw2m %xmm0, %k1
|
|
|
|
; CHECK-NEXT: kunpckdq %k1, %k0, %k0
|
|
|
|
; CHECK-NEXT: vpmovm2b %k0, %zmm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
|
|
|
|
%res = shufflevector <8 x i1> %a, <8 x i1> %b, <64 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
|
|
|
|
ret <64 x i1> %res
|
|
|
|
}
|
|
|
|
|
2016-03-08 23:21:25 +08:00
|
|
|
define <4 x i1> @test9(<8 x i1> %a, <8 x i1> %b) {
|
|
|
|
; CHECK-LABEL: test9:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2016-03-08 23:21:25 +08:00
|
|
|
; CHECK-NEXT: vpsllw $15, %xmm0, %xmm0
|
|
|
|
; CHECK-NEXT: vpmovw2m %xmm0, %k0
|
2017-12-30 14:45:43 +08:00
|
|
|
; CHECK-NEXT: kshiftrb $4, %k0, %k0
|
2016-03-08 23:21:25 +08:00
|
|
|
; CHECK-NEXT: vpmovm2d %k0, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%res = shufflevector <8 x i1> %a, <8 x i1> %b, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
|
|
|
|
ret <4 x i1> %res
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i1> @test10(<4 x i1> %a, <4 x i1> %b) {
|
|
|
|
; CHECK-LABEL: test10:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2016-03-08 23:21:25 +08:00
|
|
|
; CHECK-NEXT: vpslld $31, %xmm0, %xmm0
|
|
|
|
; CHECK-NEXT: vptestmd %xmm0, %xmm0, %k0
|
2017-12-30 14:45:43 +08:00
|
|
|
; CHECK-NEXT: kshiftrb $2, %k0, %k0
|
2016-03-08 23:21:25 +08:00
|
|
|
; CHECK-NEXT: vpmovm2q %k0, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%res = shufflevector <4 x i1> %a, <4 x i1> %b, <2 x i32> <i32 2, i32 3>
|
|
|
|
ret <2 x i1> %res
|
|
|
|
}
|
2017-01-30 06:53:33 +08:00
|
|
|
|
|
|
|
define <8 x i1> @test11(<4 x i1> %a, <4 x i1>%b) {
|
|
|
|
; CHECK-LABEL: test11:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-01-30 06:53:33 +08:00
|
|
|
; CHECK-NEXT: vpslld $31, %xmm0, %xmm0
|
|
|
|
; CHECK-NEXT: vptestmd %xmm0, %xmm0, %k0
|
|
|
|
; CHECK-NEXT: kshiftlb $4, %k0, %k0
|
|
|
|
; CHECK-NEXT: vpmovm2w %k0, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
%res = shufflevector <4 x i1> %a, <4 x i1> undef, <8 x i32> <i32 undef, i32 undef, i32 undef, i32 undef, i32 0, i32 1, i32 2, i32 3>
|
|
|
|
ret <8 x i1> %res
|
|
|
|
}
|