• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512cd,+fast-variable-shuffle | FileCheck %s --check-prefixes=ALL,AVX512CD
3; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx512cd,+fast-variable-shuffle | FileCheck %s --check-prefixes=ALL,AVX512CD
4; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512cd,+avx512bw,+fast-variable-shuffle | FileCheck %s --check-prefixes=ALL,AVX512CDBW
5; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx512cd,+avx512bw,+fast-variable-shuffle | FileCheck %s --check-prefixes=ALL,AVX512CDBW
6; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512vl,avx512cd,+avx512bw,+fast-variable-shuffle | FileCheck %s --check-prefixes=ALL,AVX512VLCDBW
7; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx512vl,avx512cd,+avx512bw,+fast-variable-shuffle | FileCheck %s --check-prefixes=ALL,AVX512VLCDBW
8
9define <2 x i64> @test_mm_epi64(<8 x i16> %a, <8 x i16> %b) {
10; AVX512CD-LABEL: test_mm_epi64:
11; AVX512CD:       # %bb.0: # %entry
12; AVX512CD-NEXT:    vpcmpeqw %xmm1, %xmm0, %xmm0
13; AVX512CD-NEXT:    vpmovsxwq %xmm0, %zmm0
14; AVX512CD-NEXT:    vptestmq %zmm0, %zmm0, %k0
15; AVX512CD-NEXT:    vpbroadcastmb2q %k0, %zmm0
16; AVX512CD-NEXT:    # kill: def $xmm0 killed $xmm0 killed $zmm0
17; AVX512CD-NEXT:    vzeroupper
18; AVX512CD-NEXT:    ret{{[l|q]}}
19;
20; AVX512CDBW-LABEL: test_mm_epi64:
21; AVX512CDBW:       # %bb.0: # %entry
22; AVX512CDBW-NEXT:    # kill: def $xmm1 killed $xmm1 def $zmm1
23; AVX512CDBW-NEXT:    # kill: def $xmm0 killed $xmm0 def $zmm0
24; AVX512CDBW-NEXT:    vpcmpeqw %zmm1, %zmm0, %k0
25; AVX512CDBW-NEXT:    vpbroadcastmb2q %k0, %zmm0
26; AVX512CDBW-NEXT:    # kill: def $xmm0 killed $xmm0 killed $zmm0
27; AVX512CDBW-NEXT:    vzeroupper
28; AVX512CDBW-NEXT:    ret{{[l|q]}}
29;
30; AVX512VLCDBW-LABEL: test_mm_epi64:
31; AVX512VLCDBW:       # %bb.0: # %entry
32; AVX512VLCDBW-NEXT:    vpcmpeqw %xmm1, %xmm0, %k0
33; AVX512VLCDBW-NEXT:    vpbroadcastmb2q %k0, %xmm0
34; AVX512VLCDBW-NEXT:    ret{{[l|q]}}
35entry:
36  %0 = icmp eq <8 x i16> %a, %b
37  %1 = bitcast <8 x i1> %0 to i8
38  %conv.i = zext i8 %1 to i64
39  %vecinit.i.i = insertelement <2 x i64> undef, i64 %conv.i, i32 0
40  %vecinit1.i.i = shufflevector <2 x i64> %vecinit.i.i, <2 x i64> undef, <2 x i32> zeroinitializer
41  ret <2 x i64> %vecinit1.i.i
42}
43
44define <4 x i32> @test_mm_epi32(<16 x i8> %a, <16 x i8> %b) {
45; AVX512CD-LABEL: test_mm_epi32:
46; AVX512CD:       # %bb.0: # %entry
47; AVX512CD-NEXT:    vpcmpeqb %xmm1, %xmm0, %xmm0
48; AVX512CD-NEXT:    vpmovmskb %xmm0, %eax
49; AVX512CD-NEXT:    vmovd %eax, %xmm0
50; AVX512CD-NEXT:    vpbroadcastd %xmm0, %xmm0
51; AVX512CD-NEXT:    ret{{[l|q]}}
52;
53; AVX512CDBW-LABEL: test_mm_epi32:
54; AVX512CDBW:       # %bb.0: # %entry
55; AVX512CDBW-NEXT:    # kill: def $xmm1 killed $xmm1 def $zmm1
56; AVX512CDBW-NEXT:    # kill: def $xmm0 killed $xmm0 def $zmm0
57; AVX512CDBW-NEXT:    vpcmpeqb %zmm1, %zmm0, %k0
58; AVX512CDBW-NEXT:    vpbroadcastmw2d %k0, %zmm0
59; AVX512CDBW-NEXT:    # kill: def $xmm0 killed $xmm0 killed $zmm0
60; AVX512CDBW-NEXT:    vzeroupper
61; AVX512CDBW-NEXT:    ret{{[l|q]}}
62;
63; AVX512VLCDBW-LABEL: test_mm_epi32:
64; AVX512VLCDBW:       # %bb.0: # %entry
65; AVX512VLCDBW-NEXT:    vpcmpeqb %xmm1, %xmm0, %k0
66; AVX512VLCDBW-NEXT:    vpbroadcastmw2d %k0, %xmm0
67; AVX512VLCDBW-NEXT:    ret{{[l|q]}}
68entry:
69  %0 = icmp eq <16 x i8> %a, %b
70  %1 = bitcast <16 x i1> %0 to i16
71  %conv.i = zext i16 %1 to i32
72  %vecinit.i.i = insertelement <4 x i32> undef, i32 %conv.i, i32 0
73  %vecinit3.i.i = shufflevector <4 x i32> %vecinit.i.i, <4 x i32> undef, <4 x i32> zeroinitializer
74  ret <4 x i32> %vecinit3.i.i
75}
76
77define <16 x i32> @test_mm512_epi32(<16 x i32> %a, <16 x i32> %b) {
78; ALL-LABEL: test_mm512_epi32:
79; ALL:       # %bb.0: # %entry
80; ALL-NEXT:    vpcmpeqd %zmm1, %zmm0, %k0
81; ALL-NEXT:    vpbroadcastmw2d %k0, %zmm0
82; ALL-NEXT:    ret{{[l|q]}}
83entry:
84  %0 = icmp eq <16 x i32> %a, %b
85  %1 = bitcast <16 x i1> %0 to i16
86  %conv.i = zext i16 %1 to i32
87  %vecinit.i.i = insertelement <16 x i32> undef, i32 %conv.i, i32 0
88  %vecinit15.i.i = shufflevector <16 x i32> %vecinit.i.i, <16 x i32> undef, <16 x i32> zeroinitializer
89  ret <16 x i32> %vecinit15.i.i
90}
91
92define <8 x i64> @test_mm512_epi64(<8 x i32> %a, <8 x i32> %b) {
93; AVX512CD-LABEL: test_mm512_epi64:
94; AVX512CD:       # %bb.0: # %entry
95; AVX512CD-NEXT:    # kill: def $ymm1 killed $ymm1 def $zmm1
96; AVX512CD-NEXT:    # kill: def $ymm0 killed $ymm0 def $zmm0
97; AVX512CD-NEXT:    vpcmpeqd %zmm1, %zmm0, %k0
98; AVX512CD-NEXT:    vpbroadcastmb2q %k0, %zmm0
99; AVX512CD-NEXT:    ret{{[l|q]}}
100;
101; AVX512CDBW-LABEL: test_mm512_epi64:
102; AVX512CDBW:       # %bb.0: # %entry
103; AVX512CDBW-NEXT:    # kill: def $ymm1 killed $ymm1 def $zmm1
104; AVX512CDBW-NEXT:    # kill: def $ymm0 killed $ymm0 def $zmm0
105; AVX512CDBW-NEXT:    vpcmpeqd %zmm1, %zmm0, %k0
106; AVX512CDBW-NEXT:    vpbroadcastmb2q %k0, %zmm0
107; AVX512CDBW-NEXT:    ret{{[l|q]}}
108;
109; AVX512VLCDBW-LABEL: test_mm512_epi64:
110; AVX512VLCDBW:       # %bb.0: # %entry
111; AVX512VLCDBW-NEXT:    vpcmpeqd %ymm1, %ymm0, %k0
112; AVX512VLCDBW-NEXT:    vpbroadcastmb2q %k0, %zmm0
113; AVX512VLCDBW-NEXT:    ret{{[l|q]}}
114entry:
115  %0 = icmp eq <8 x i32> %a, %b
116  %1 = bitcast <8 x i1> %0 to i8
117  %conv.i = zext i8 %1 to i64
118  %vecinit.i.i = insertelement <8 x i64> undef, i64 %conv.i, i32 0
119  %vecinit7.i.i = shufflevector <8 x i64> %vecinit.i.i, <8 x i64> undef, <8 x i32> zeroinitializer
120  ret <8 x i64> %vecinit7.i.i
121}
122
123define <4 x i64> @test_mm256_epi64(<8 x i32> %a, <8 x i32> %b) {
124; AVX512CD-LABEL: test_mm256_epi64:
125; AVX512CD:       # %bb.0: # %entry
126; AVX512CD-NEXT:    # kill: def $ymm1 killed $ymm1 def $zmm1
127; AVX512CD-NEXT:    # kill: def $ymm0 killed $ymm0 def $zmm0
128; AVX512CD-NEXT:    vpcmpeqd %zmm1, %zmm0, %k0
129; AVX512CD-NEXT:    vpbroadcastmb2q %k0, %zmm0
130; AVX512CD-NEXT:    # kill: def $ymm0 killed $ymm0 killed $zmm0
131; AVX512CD-NEXT:    ret{{[l|q]}}
132;
133; AVX512CDBW-LABEL: test_mm256_epi64:
134; AVX512CDBW:       # %bb.0: # %entry
135; AVX512CDBW-NEXT:    # kill: def $ymm1 killed $ymm1 def $zmm1
136; AVX512CDBW-NEXT:    # kill: def $ymm0 killed $ymm0 def $zmm0
137; AVX512CDBW-NEXT:    vpcmpeqd %zmm1, %zmm0, %k0
138; AVX512CDBW-NEXT:    vpbroadcastmb2q %k0, %zmm0
139; AVX512CDBW-NEXT:    # kill: def $ymm0 killed $ymm0 killed $zmm0
140; AVX512CDBW-NEXT:    ret{{[l|q]}}
141;
142; AVX512VLCDBW-LABEL: test_mm256_epi64:
143; AVX512VLCDBW:       # %bb.0: # %entry
144; AVX512VLCDBW-NEXT:    vpcmpeqd %ymm1, %ymm0, %k0
145; AVX512VLCDBW-NEXT:    vpbroadcastmb2q %k0, %ymm0
146; AVX512VLCDBW-NEXT:    ret{{[l|q]}}
147entry:
148  %0 = icmp eq <8 x i32> %a, %b
149  %1 = bitcast <8 x i1> %0 to i8
150  %conv.i = zext i8 %1 to i64
151  %vecinit.i.i = insertelement <4 x i64> undef, i64 %conv.i, i32 0
152  %vecinit3.i.i = shufflevector <4 x i64> %vecinit.i.i, <4 x i64> undef, <4 x i32> zeroinitializer
153  ret <4 x i64> %vecinit3.i.i
154}
155
156define <8 x i32> @test_mm256_epi32(<16 x i16> %a, <16 x i16> %b) {
157; AVX512CD-LABEL: test_mm256_epi32:
158; AVX512CD:       # %bb.0: # %entry
159; AVX512CD-NEXT:    vpcmpeqw %ymm1, %ymm0, %ymm0
160; AVX512CD-NEXT:    vpmovsxwd %ymm0, %zmm0
161; AVX512CD-NEXT:    vptestmd %zmm0, %zmm0, %k0
162; AVX512CD-NEXT:    vpbroadcastmw2d %k0, %zmm0
163; AVX512CD-NEXT:    # kill: def $ymm0 killed $ymm0 killed $zmm0
164; AVX512CD-NEXT:    ret{{[l|q]}}
165;
166; AVX512CDBW-LABEL: test_mm256_epi32:
167; AVX512CDBW:       # %bb.0: # %entry
168; AVX512CDBW-NEXT:    # kill: def $ymm1 killed $ymm1 def $zmm1
169; AVX512CDBW-NEXT:    # kill: def $ymm0 killed $ymm0 def $zmm0
170; AVX512CDBW-NEXT:    vpcmpeqw %zmm1, %zmm0, %k0
171; AVX512CDBW-NEXT:    vpbroadcastmw2d %k0, %zmm0
172; AVX512CDBW-NEXT:    # kill: def $ymm0 killed $ymm0 killed $zmm0
173; AVX512CDBW-NEXT:    ret{{[l|q]}}
174;
175; AVX512VLCDBW-LABEL: test_mm256_epi32:
176; AVX512VLCDBW:       # %bb.0: # %entry
177; AVX512VLCDBW-NEXT:    vpcmpeqw %ymm1, %ymm0, %k0
178; AVX512VLCDBW-NEXT:    vpbroadcastmw2d %k0, %ymm0
179; AVX512VLCDBW-NEXT:    ret{{[l|q]}}
180entry:
181  %0 = icmp eq <16 x i16> %a, %b
182  %1 = bitcast <16 x i1> %0 to i16
183  %conv.i = zext i16 %1 to i32
184  %vecinit.i.i = insertelement <8 x i32> undef, i32 %conv.i, i32 0
185  %vecinit7.i.i = shufflevector <8 x i32> %vecinit.i.i, <8 x i32> undef, <8 x i32> zeroinitializer
186  ret <8 x i32> %vecinit7.i.i
187}
188
189