1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -disable-peephole -mtriple=i386-apple-darwin -mattr=+sse4.1 -show-mc-encoding | FileCheck %s --check-prefixes=SSE,X86-SSE
3 ; RUN: llc < %s -disable-peephole -mtriple=i386-apple-darwin -mattr=+avx -show-mc-encoding | FileCheck %s --check-prefixes=AVX,AVX1,X86-AVX1
4 ; RUN: llc < %s -disable-peephole -mtriple=i386-apple-darwin -mattr=+avx512f,+avx512bw,+avx512dq,+avx512vl -show-mc-encoding | FileCheck %s --check-prefixes=AVX,AVX512,X86-AVX512
5 ; RUN: llc < %s -disable-peephole -mtriple=x86_64-apple-darwin -mattr=+sse4.1 -show-mc-encoding | FileCheck %s --check-prefixes=SSE,X64-SSE
6 ; RUN: llc < %s -disable-peephole -mtriple=x86_64-apple-darwin -mattr=+avx -show-mc-encoding | FileCheck %s --check-prefixes=AVX,AVX1,X64-AVX1
7 ; RUN: llc < %s -disable-peephole -mtriple=x86_64-apple-darwin -mattr=+avx512f,+avx512bw,+avx512dq,+avx512vl -show-mc-encoding | FileCheck %s --check-prefixes=AVX,AVX512,X64-AVX512
9 ; This test works just like the non-upgrade one except that it only checks
10 ; forms which require auto-upgrading.
12 define <2 x double> @test_x86_sse41_blendpd(<2 x double> %a0, <2 x double> %a1) {
13 ; SSE-LABEL: test_x86_sse41_blendpd:
15 ; SSE-NEXT: blendps $12, %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x3a,0x0c,0xc1,0x0c]
16 ; SSE-NEXT: ## xmm0 = xmm0[0,1],xmm1[2,3]
17 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
19 ; AVX-LABEL: test_x86_sse41_blendpd:
21 ; AVX-NEXT: vblendps $3, %xmm0, %xmm1, %xmm0 ## encoding: [0xc4,0xe3,0x71,0x0c,0xc0,0x03]
22 ; AVX-NEXT: ## xmm0 = xmm0[0,1],xmm1[2,3]
23 ; AVX-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
24 %res = call <2 x double> @llvm.x86.sse41.blendpd(<2 x double> %a0, <2 x double> %a1, i32 6) ; <<2 x double>> [#uses=1]
27 declare <2 x double> @llvm.x86.sse41.blendpd(<2 x double>, <2 x double>, i32) nounwind readnone
30 define <4 x float> @test_x86_sse41_blendps(<4 x float> %a0, <4 x float> %a1) {
31 ; SSE-LABEL: test_x86_sse41_blendps:
33 ; SSE-NEXT: blendps $7, %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x3a,0x0c,0xc1,0x07]
34 ; SSE-NEXT: ## xmm0 = xmm1[0,1,2],xmm0[3]
35 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
37 ; AVX-LABEL: test_x86_sse41_blendps:
39 ; AVX-NEXT: vblendps $8, %xmm0, %xmm1, %xmm0 ## encoding: [0xc4,0xe3,0x71,0x0c,0xc0,0x08]
40 ; AVX-NEXT: ## xmm0 = xmm1[0,1,2],xmm0[3]
41 ; AVX-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
42 %res = call <4 x float> @llvm.x86.sse41.blendps(<4 x float> %a0, <4 x float> %a1, i32 7) ; <<4 x float>> [#uses=1]
45 declare <4 x float> @llvm.x86.sse41.blendps(<4 x float>, <4 x float>, i32) nounwind readnone
48 define <2 x double> @test_x86_sse41_dppd(<2 x double> %a0, <2 x double> %a1) {
49 ; SSE-LABEL: test_x86_sse41_dppd:
51 ; SSE-NEXT: dppd $7, %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x3a,0x41,0xc1,0x07]
52 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
54 ; AVX-LABEL: test_x86_sse41_dppd:
56 ; AVX-NEXT: vdppd $7, %xmm1, %xmm0, %xmm0 ## encoding: [0xc4,0xe3,0x79,0x41,0xc1,0x07]
57 ; AVX-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
58 %res = call <2 x double> @llvm.x86.sse41.dppd(<2 x double> %a0, <2 x double> %a1, i32 7) ; <<2 x double>> [#uses=1]
61 declare <2 x double> @llvm.x86.sse41.dppd(<2 x double>, <2 x double>, i32) nounwind readnone
64 define <4 x float> @test_x86_sse41_dpps(<4 x float> %a0, <4 x float> %a1) {
65 ; SSE-LABEL: test_x86_sse41_dpps:
67 ; SSE-NEXT: dpps $7, %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x3a,0x40,0xc1,0x07]
68 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
70 ; AVX-LABEL: test_x86_sse41_dpps:
72 ; AVX-NEXT: vdpps $7, %xmm1, %xmm0, %xmm0 ## encoding: [0xc4,0xe3,0x79,0x40,0xc1,0x07]
73 ; AVX-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
74 %res = call <4 x float> @llvm.x86.sse41.dpps(<4 x float> %a0, <4 x float> %a1, i32 7) ; <<4 x float>> [#uses=1]
77 declare <4 x float> @llvm.x86.sse41.dpps(<4 x float>, <4 x float>, i32) nounwind readnone
80 define <4 x float> @test_x86_sse41_insertps(<4 x float> %a0, <4 x float> %a1) {
81 ; SSE-LABEL: test_x86_sse41_insertps:
83 ; SSE-NEXT: insertps $17, %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x3a,0x21,0xc1,0x11]
84 ; SSE-NEXT: ## xmm0 = zero,xmm1[0],xmm0[2,3]
85 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
87 ; AVX1-LABEL: test_x86_sse41_insertps:
89 ; AVX1-NEXT: vinsertps $17, %xmm1, %xmm0, %xmm0 ## encoding: [0xc4,0xe3,0x79,0x21,0xc1,0x11]
90 ; AVX1-NEXT: ## xmm0 = zero,xmm1[0],xmm0[2,3]
91 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
93 ; AVX512-LABEL: test_x86_sse41_insertps:
95 ; AVX512-NEXT: vinsertps $17, %xmm1, %xmm0, %xmm0 ## EVEX TO VEX Compression encoding: [0xc4,0xe3,0x79,0x21,0xc1,0x11]
96 ; AVX512-NEXT: ## xmm0 = zero,xmm1[0],xmm0[2,3]
97 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
98 %res = call <4 x float> @llvm.x86.sse41.insertps(<4 x float> %a0, <4 x float> %a1, i32 17) ; <<4 x float>> [#uses=1]
101 declare <4 x float> @llvm.x86.sse41.insertps(<4 x float>, <4 x float>, i32) nounwind readnone
104 define <2 x i64> @test_x86_sse41_movntdqa(ptr %a0) {
105 ; X86-SSE-LABEL: test_x86_sse41_movntdqa:
107 ; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %eax ## encoding: [0x8b,0x44,0x24,0x04]
108 ; X86-SSE-NEXT: movntdqa (%eax), %xmm0 ## encoding: [0x66,0x0f,0x38,0x2a,0x00]
109 ; X86-SSE-NEXT: retl ## encoding: [0xc3]
111 ; X86-AVX1-LABEL: test_x86_sse41_movntdqa:
112 ; X86-AVX1: ## %bb.0:
113 ; X86-AVX1-NEXT: movl {{[0-9]+}}(%esp), %eax ## encoding: [0x8b,0x44,0x24,0x04]
114 ; X86-AVX1-NEXT: vmovntdqa (%eax), %xmm0 ## encoding: [0xc4,0xe2,0x79,0x2a,0x00]
115 ; X86-AVX1-NEXT: retl ## encoding: [0xc3]
117 ; X86-AVX512-LABEL: test_x86_sse41_movntdqa:
118 ; X86-AVX512: ## %bb.0:
119 ; X86-AVX512-NEXT: movl {{[0-9]+}}(%esp), %eax ## encoding: [0x8b,0x44,0x24,0x04]
120 ; X86-AVX512-NEXT: vmovntdqa (%eax), %xmm0 ## EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x2a,0x00]
121 ; X86-AVX512-NEXT: retl ## encoding: [0xc3]
123 ; X64-SSE-LABEL: test_x86_sse41_movntdqa:
125 ; X64-SSE-NEXT: movntdqa (%rdi), %xmm0 ## encoding: [0x66,0x0f,0x38,0x2a,0x07]
126 ; X64-SSE-NEXT: retq ## encoding: [0xc3]
128 ; X64-AVX1-LABEL: test_x86_sse41_movntdqa:
129 ; X64-AVX1: ## %bb.0:
130 ; X64-AVX1-NEXT: vmovntdqa (%rdi), %xmm0 ## encoding: [0xc4,0xe2,0x79,0x2a,0x07]
131 ; X64-AVX1-NEXT: retq ## encoding: [0xc3]
133 ; X64-AVX512-LABEL: test_x86_sse41_movntdqa:
134 ; X64-AVX512: ## %bb.0:
135 ; X64-AVX512-NEXT: vmovntdqa (%rdi), %xmm0 ## EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x2a,0x07]
136 ; X64-AVX512-NEXT: retq ## encoding: [0xc3]
137 %res = call <2 x i64> @llvm.x86.sse41.movntdqa(ptr %a0)
140 declare <2 x i64> @llvm.x86.sse41.movntdqa(ptr) nounwind readnone
143 define <8 x i16> @test_x86_sse41_mpsadbw(<16 x i8> %a0, <16 x i8> %a1) {
144 ; SSE-LABEL: test_x86_sse41_mpsadbw:
146 ; SSE-NEXT: mpsadbw $7, %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x3a,0x42,0xc1,0x07]
147 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
149 ; AVX-LABEL: test_x86_sse41_mpsadbw:
151 ; AVX-NEXT: vmpsadbw $7, %xmm1, %xmm0, %xmm0 ## encoding: [0xc4,0xe3,0x79,0x42,0xc1,0x07]
152 ; AVX-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
153 %res = call <8 x i16> @llvm.x86.sse41.mpsadbw(<16 x i8> %a0, <16 x i8> %a1, i32 7) ; <<8 x i16>> [#uses=1]
156 declare <8 x i16> @llvm.x86.sse41.mpsadbw(<16 x i8>, <16 x i8>, i32) nounwind readnone
159 define <8 x i16> @test_x86_sse41_pblendw(<8 x i16> %a0, <8 x i16> %a1) {
160 ; SSE-LABEL: test_x86_sse41_pblendw:
162 ; SSE-NEXT: pblendw $7, %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x3a,0x0e,0xc1,0x07]
163 ; SSE-NEXT: ## xmm0 = xmm1[0,1,2],xmm0[3,4,5,6,7]
164 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
166 ; AVX-LABEL: test_x86_sse41_pblendw:
168 ; AVX-NEXT: vpblendw $7, %xmm1, %xmm0, %xmm0 ## encoding: [0xc4,0xe3,0x79,0x0e,0xc1,0x07]
169 ; AVX-NEXT: ## xmm0 = xmm1[0,1,2],xmm0[3,4,5,6,7]
170 ; AVX-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
171 %res = call <8 x i16> @llvm.x86.sse41.pblendw(<8 x i16> %a0, <8 x i16> %a1, i32 7) ; <<8 x i16>> [#uses=1]
174 declare <8 x i16> @llvm.x86.sse41.pblendw(<8 x i16>, <8 x i16>, i32) nounwind readnone
177 define <4 x i32> @test_x86_sse41_pmovsxbd(<16 x i8> %a0) {
178 ; SSE-LABEL: test_x86_sse41_pmovsxbd:
180 ; SSE-NEXT: pmovsxbd %xmm0, %xmm0 ## encoding: [0x66,0x0f,0x38,0x21,0xc0]
181 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
183 ; AVX1-LABEL: test_x86_sse41_pmovsxbd:
185 ; AVX1-NEXT: vpmovsxbd %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x21,0xc0]
186 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
188 ; AVX512-LABEL: test_x86_sse41_pmovsxbd:
190 ; AVX512-NEXT: vpmovsxbd %xmm0, %xmm0 ## EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x21,0xc0]
191 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
192 %res = call <4 x i32> @llvm.x86.sse41.pmovsxbd(<16 x i8> %a0) ; <<4 x i32>> [#uses=1]
195 declare <4 x i32> @llvm.x86.sse41.pmovsxbd(<16 x i8>) nounwind readnone
198 define <2 x i64> @test_x86_sse41_pmovsxbq(<16 x i8> %a0) {
199 ; SSE-LABEL: test_x86_sse41_pmovsxbq:
201 ; SSE-NEXT: pmovsxbq %xmm0, %xmm0 ## encoding: [0x66,0x0f,0x38,0x22,0xc0]
202 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
204 ; AVX1-LABEL: test_x86_sse41_pmovsxbq:
206 ; AVX1-NEXT: vpmovsxbq %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x22,0xc0]
207 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
209 ; AVX512-LABEL: test_x86_sse41_pmovsxbq:
211 ; AVX512-NEXT: vpmovsxbq %xmm0, %xmm0 ## EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x22,0xc0]
212 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
213 %res = call <2 x i64> @llvm.x86.sse41.pmovsxbq(<16 x i8> %a0) ; <<2 x i64>> [#uses=1]
216 declare <2 x i64> @llvm.x86.sse41.pmovsxbq(<16 x i8>) nounwind readnone
219 define <8 x i16> @test_x86_sse41_pmovsxbw(<16 x i8> %a0) {
220 ; SSE-LABEL: test_x86_sse41_pmovsxbw:
222 ; SSE-NEXT: pmovsxbw %xmm0, %xmm0 ## encoding: [0x66,0x0f,0x38,0x20,0xc0]
223 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
225 ; AVX1-LABEL: test_x86_sse41_pmovsxbw:
227 ; AVX1-NEXT: vpmovsxbw %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x20,0xc0]
228 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
230 ; AVX512-LABEL: test_x86_sse41_pmovsxbw:
232 ; AVX512-NEXT: vpmovsxbw %xmm0, %xmm0 ## EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x20,0xc0]
233 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
234 %res = call <8 x i16> @llvm.x86.sse41.pmovsxbw(<16 x i8> %a0) ; <<8 x i16>> [#uses=1]
237 declare <8 x i16> @llvm.x86.sse41.pmovsxbw(<16 x i8>) nounwind readnone
240 define <2 x i64> @test_x86_sse41_pmovsxdq(<4 x i32> %a0) {
241 ; SSE-LABEL: test_x86_sse41_pmovsxdq:
243 ; SSE-NEXT: pmovsxdq %xmm0, %xmm0 ## encoding: [0x66,0x0f,0x38,0x25,0xc0]
244 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
246 ; AVX1-LABEL: test_x86_sse41_pmovsxdq:
248 ; AVX1-NEXT: vpmovsxdq %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x25,0xc0]
249 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
251 ; AVX512-LABEL: test_x86_sse41_pmovsxdq:
253 ; AVX512-NEXT: vpmovsxdq %xmm0, %xmm0 ## EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x25,0xc0]
254 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
255 %res = call <2 x i64> @llvm.x86.sse41.pmovsxdq(<4 x i32> %a0) ; <<2 x i64>> [#uses=1]
258 declare <2 x i64> @llvm.x86.sse41.pmovsxdq(<4 x i32>) nounwind readnone
261 define <4 x i32> @test_x86_sse41_pmovsxwd(<8 x i16> %a0) {
262 ; SSE-LABEL: test_x86_sse41_pmovsxwd:
264 ; SSE-NEXT: pmovsxwd %xmm0, %xmm0 ## encoding: [0x66,0x0f,0x38,0x23,0xc0]
265 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
267 ; AVX1-LABEL: test_x86_sse41_pmovsxwd:
269 ; AVX1-NEXT: vpmovsxwd %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x23,0xc0]
270 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
272 ; AVX512-LABEL: test_x86_sse41_pmovsxwd:
274 ; AVX512-NEXT: vpmovsxwd %xmm0, %xmm0 ## EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x23,0xc0]
275 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
276 %res = call <4 x i32> @llvm.x86.sse41.pmovsxwd(<8 x i16> %a0) ; <<4 x i32>> [#uses=1]
279 declare <4 x i32> @llvm.x86.sse41.pmovsxwd(<8 x i16>) nounwind readnone
282 define <2 x i64> @test_x86_sse41_pmovsxwq(<8 x i16> %a0) {
283 ; SSE-LABEL: test_x86_sse41_pmovsxwq:
285 ; SSE-NEXT: pmovsxwq %xmm0, %xmm0 ## encoding: [0x66,0x0f,0x38,0x24,0xc0]
286 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
288 ; AVX1-LABEL: test_x86_sse41_pmovsxwq:
290 ; AVX1-NEXT: vpmovsxwq %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x24,0xc0]
291 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
293 ; AVX512-LABEL: test_x86_sse41_pmovsxwq:
295 ; AVX512-NEXT: vpmovsxwq %xmm0, %xmm0 ## EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x24,0xc0]
296 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
297 %res = call <2 x i64> @llvm.x86.sse41.pmovsxwq(<8 x i16> %a0) ; <<2 x i64>> [#uses=1]
300 declare <2 x i64> @llvm.x86.sse41.pmovsxwq(<8 x i16>) nounwind readnone
303 define <4 x i32> @test_x86_sse41_pmovzxbd(<16 x i8> %a0) {
304 ; SSE-LABEL: test_x86_sse41_pmovzxbd:
306 ; SSE-NEXT: pmovzxbd %xmm0, %xmm0 ## encoding: [0x66,0x0f,0x38,0x31,0xc0]
307 ; SSE-NEXT: ## xmm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero,xmm0[2],zero,zero,zero,xmm0[3],zero,zero,zero
308 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
310 ; AVX1-LABEL: test_x86_sse41_pmovzxbd:
312 ; AVX1-NEXT: vpmovzxbd %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x31,0xc0]
313 ; AVX1-NEXT: ## xmm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero,xmm0[2],zero,zero,zero,xmm0[3],zero,zero,zero
314 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
316 ; AVX512-LABEL: test_x86_sse41_pmovzxbd:
318 ; AVX512-NEXT: vpmovzxbd %xmm0, %xmm0 ## EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x31,0xc0]
319 ; AVX512-NEXT: ## xmm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero,xmm0[2],zero,zero,zero,xmm0[3],zero,zero,zero
320 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
321 %res = call <4 x i32> @llvm.x86.sse41.pmovzxbd(<16 x i8> %a0) ; <<4 x i32>> [#uses=1]
324 declare <4 x i32> @llvm.x86.sse41.pmovzxbd(<16 x i8>) nounwind readnone
327 define <2 x i64> @test_x86_sse41_pmovzxbq(<16 x i8> %a0) {
328 ; SSE-LABEL: test_x86_sse41_pmovzxbq:
330 ; SSE-NEXT: pmovzxbq %xmm0, %xmm0 ## encoding: [0x66,0x0f,0x38,0x32,0xc0]
331 ; SSE-NEXT: ## xmm0 = xmm0[0],zero,zero,zero,zero,zero,zero,zero,xmm0[1],zero,zero,zero,zero,zero,zero,zero
332 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
334 ; AVX1-LABEL: test_x86_sse41_pmovzxbq:
336 ; AVX1-NEXT: vpmovzxbq %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x32,0xc0]
337 ; AVX1-NEXT: ## xmm0 = xmm0[0],zero,zero,zero,zero,zero,zero,zero,xmm0[1],zero,zero,zero,zero,zero,zero,zero
338 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
340 ; AVX512-LABEL: test_x86_sse41_pmovzxbq:
342 ; AVX512-NEXT: vpmovzxbq %xmm0, %xmm0 ## EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x32,0xc0]
343 ; AVX512-NEXT: ## xmm0 = xmm0[0],zero,zero,zero,zero,zero,zero,zero,xmm0[1],zero,zero,zero,zero,zero,zero,zero
344 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
345 %res = call <2 x i64> @llvm.x86.sse41.pmovzxbq(<16 x i8> %a0) ; <<2 x i64>> [#uses=1]
348 declare <2 x i64> @llvm.x86.sse41.pmovzxbq(<16 x i8>) nounwind readnone
351 define <8 x i16> @test_x86_sse41_pmovzxbw(<16 x i8> %a0) {
352 ; SSE-LABEL: test_x86_sse41_pmovzxbw:
354 ; SSE-NEXT: pmovzxbw %xmm0, %xmm0 ## encoding: [0x66,0x0f,0x38,0x30,0xc0]
355 ; SSE-NEXT: ## xmm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero,xmm0[4],zero,xmm0[5],zero,xmm0[6],zero,xmm0[7],zero
356 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
358 ; AVX1-LABEL: test_x86_sse41_pmovzxbw:
360 ; AVX1-NEXT: vpmovzxbw %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x30,0xc0]
361 ; AVX1-NEXT: ## xmm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero,xmm0[4],zero,xmm0[5],zero,xmm0[6],zero,xmm0[7],zero
362 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
364 ; AVX512-LABEL: test_x86_sse41_pmovzxbw:
366 ; AVX512-NEXT: vpmovzxbw %xmm0, %xmm0 ## EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x30,0xc0]
367 ; AVX512-NEXT: ## xmm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero,xmm0[4],zero,xmm0[5],zero,xmm0[6],zero,xmm0[7],zero
368 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
369 %res = call <8 x i16> @llvm.x86.sse41.pmovzxbw(<16 x i8> %a0) ; <<8 x i16>> [#uses=1]
372 declare <8 x i16> @llvm.x86.sse41.pmovzxbw(<16 x i8>) nounwind readnone
375 define <2 x i64> @test_x86_sse41_pmovzxdq(<4 x i32> %a0) {
376 ; SSE-LABEL: test_x86_sse41_pmovzxdq:
378 ; SSE-NEXT: pmovzxdq %xmm0, %xmm0 ## encoding: [0x66,0x0f,0x38,0x35,0xc0]
379 ; SSE-NEXT: ## xmm0 = xmm0[0],zero,xmm0[1],zero
380 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
382 ; AVX1-LABEL: test_x86_sse41_pmovzxdq:
384 ; AVX1-NEXT: vpmovzxdq %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x35,0xc0]
385 ; AVX1-NEXT: ## xmm0 = xmm0[0],zero,xmm0[1],zero
386 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
388 ; AVX512-LABEL: test_x86_sse41_pmovzxdq:
390 ; AVX512-NEXT: vpmovzxdq %xmm0, %xmm0 ## EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x35,0xc0]
391 ; AVX512-NEXT: ## xmm0 = xmm0[0],zero,xmm0[1],zero
392 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
393 %res = call <2 x i64> @llvm.x86.sse41.pmovzxdq(<4 x i32> %a0) ; <<2 x i64>> [#uses=1]
396 declare <2 x i64> @llvm.x86.sse41.pmovzxdq(<4 x i32>) nounwind readnone
399 define <4 x i32> @test_x86_sse41_pmovzxwd(<8 x i16> %a0) {
400 ; SSE-LABEL: test_x86_sse41_pmovzxwd:
402 ; SSE-NEXT: pmovzxwd %xmm0, %xmm0 ## encoding: [0x66,0x0f,0x38,0x33,0xc0]
403 ; SSE-NEXT: ## xmm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero
404 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
406 ; AVX1-LABEL: test_x86_sse41_pmovzxwd:
408 ; AVX1-NEXT: vpmovzxwd %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x33,0xc0]
409 ; AVX1-NEXT: ## xmm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero
410 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
412 ; AVX512-LABEL: test_x86_sse41_pmovzxwd:
414 ; AVX512-NEXT: vpmovzxwd %xmm0, %xmm0 ## EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x33,0xc0]
415 ; AVX512-NEXT: ## xmm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero
416 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
417 %res = call <4 x i32> @llvm.x86.sse41.pmovzxwd(<8 x i16> %a0) ; <<4 x i32>> [#uses=1]
420 declare <4 x i32> @llvm.x86.sse41.pmovzxwd(<8 x i16>) nounwind readnone
423 define <2 x i64> @test_x86_sse41_pmovzxwq(<8 x i16> %a0) {
424 ; SSE-LABEL: test_x86_sse41_pmovzxwq:
426 ; SSE-NEXT: pmovzxwq %xmm0, %xmm0 ## encoding: [0x66,0x0f,0x38,0x34,0xc0]
427 ; SSE-NEXT: ## xmm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero
428 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
430 ; AVX1-LABEL: test_x86_sse41_pmovzxwq:
432 ; AVX1-NEXT: vpmovzxwq %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x34,0xc0]
433 ; AVX1-NEXT: ## xmm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero
434 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
436 ; AVX512-LABEL: test_x86_sse41_pmovzxwq:
438 ; AVX512-NEXT: vpmovzxwq %xmm0, %xmm0 ## EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x34,0xc0]
439 ; AVX512-NEXT: ## xmm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero
440 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
441 %res = call <2 x i64> @llvm.x86.sse41.pmovzxwq(<8 x i16> %a0) ; <<2 x i64>> [#uses=1]
444 declare <2 x i64> @llvm.x86.sse41.pmovzxwq(<8 x i16>) nounwind readnone
446 define <16 x i8> @max_epi8(<16 x i8> %a0, <16 x i8> %a1) {
447 ; SSE-LABEL: max_epi8:
449 ; SSE-NEXT: pmaxsb %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x38,0x3c,0xc1]
450 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
452 ; AVX1-LABEL: max_epi8:
454 ; AVX1-NEXT: vpmaxsb %xmm1, %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x3c,0xc1]
455 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
457 ; AVX512-LABEL: max_epi8:
459 ; AVX512-NEXT: vpmaxsb %xmm1, %xmm0, %xmm0 ## EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x3c,0xc1]
460 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
461 %res = call <16 x i8> @llvm.x86.sse41.pmaxsb(<16 x i8> %a0, <16 x i8> %a1)
464 declare <16 x i8> @llvm.x86.sse41.pmaxsb(<16 x i8>, <16 x i8>) nounwind readnone
466 define <16 x i8> @min_epi8(<16 x i8> %a0, <16 x i8> %a1) {
467 ; SSE-LABEL: min_epi8:
469 ; SSE-NEXT: pminsb %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x38,0x38,0xc1]
470 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
472 ; AVX1-LABEL: min_epi8:
474 ; AVX1-NEXT: vpminsb %xmm1, %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x38,0xc1]
475 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
477 ; AVX512-LABEL: min_epi8:
479 ; AVX512-NEXT: vpminsb %xmm1, %xmm0, %xmm0 ## EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x38,0xc1]
480 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
481 %res = call <16 x i8> @llvm.x86.sse41.pminsb(<16 x i8> %a0, <16 x i8> %a1)
484 declare <16 x i8> @llvm.x86.sse41.pminsb(<16 x i8>, <16 x i8>) nounwind readnone
486 define <8 x i16> @max_epu16(<8 x i16> %a0, <8 x i16> %a1) {
487 ; SSE-LABEL: max_epu16:
489 ; SSE-NEXT: pmaxuw %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x38,0x3e,0xc1]
490 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
492 ; AVX1-LABEL: max_epu16:
494 ; AVX1-NEXT: vpmaxuw %xmm1, %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x3e,0xc1]
495 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
497 ; AVX512-LABEL: max_epu16:
499 ; AVX512-NEXT: vpmaxuw %xmm1, %xmm0, %xmm0 ## EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x3e,0xc1]
500 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
501 %res = call <8 x i16> @llvm.x86.sse41.pmaxuw(<8 x i16> %a0, <8 x i16> %a1)
504 declare <8 x i16> @llvm.x86.sse41.pmaxuw(<8 x i16>, <8 x i16>) nounwind readnone
506 define <8 x i16> @min_epu16(<8 x i16> %a0, <8 x i16> %a1) {
507 ; SSE-LABEL: min_epu16:
509 ; SSE-NEXT: pminuw %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x38,0x3a,0xc1]
510 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
512 ; AVX1-LABEL: min_epu16:
514 ; AVX1-NEXT: vpminuw %xmm1, %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x3a,0xc1]
515 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
517 ; AVX512-LABEL: min_epu16:
519 ; AVX512-NEXT: vpminuw %xmm1, %xmm0, %xmm0 ## EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x3a,0xc1]
520 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
521 %res = call <8 x i16> @llvm.x86.sse41.pminuw(<8 x i16> %a0, <8 x i16> %a1)
524 declare <8 x i16> @llvm.x86.sse41.pminuw(<8 x i16>, <8 x i16>) nounwind readnone
526 define <4 x i32> @max_epi32(<4 x i32> %a0, <4 x i32> %a1) {
527 ; SSE-LABEL: max_epi32:
529 ; SSE-NEXT: pmaxsd %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x38,0x3d,0xc1]
530 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
532 ; AVX1-LABEL: max_epi32:
534 ; AVX1-NEXT: vpmaxsd %xmm1, %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x3d,0xc1]
535 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
537 ; AVX512-LABEL: max_epi32:
539 ; AVX512-NEXT: vpmaxsd %xmm1, %xmm0, %xmm0 ## EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x3d,0xc1]
540 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
541 %res = call <4 x i32> @llvm.x86.sse41.pmaxsd(<4 x i32> %a0, <4 x i32> %a1)
544 declare <4 x i32> @llvm.x86.sse41.pmaxsd(<4 x i32>, <4 x i32>) nounwind readnone
546 define <4 x i32> @min_epi32(<4 x i32> %a0, <4 x i32> %a1) {
547 ; SSE-LABEL: min_epi32:
549 ; SSE-NEXT: pminsd %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x38,0x39,0xc1]
550 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
552 ; AVX1-LABEL: min_epi32:
554 ; AVX1-NEXT: vpminsd %xmm1, %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x39,0xc1]
555 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
557 ; AVX512-LABEL: min_epi32:
559 ; AVX512-NEXT: vpminsd %xmm1, %xmm0, %xmm0 ## EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x39,0xc1]
560 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
561 %res = call <4 x i32> @llvm.x86.sse41.pminsd(<4 x i32> %a0, <4 x i32> %a1)
564 declare <4 x i32> @llvm.x86.sse41.pminsd(<4 x i32>, <4 x i32>) nounwind readnone
566 define <4 x i32> @max_epu32(<4 x i32> %a0, <4 x i32> %a1) {
567 ; SSE-LABEL: max_epu32:
569 ; SSE-NEXT: pmaxud %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x38,0x3f,0xc1]
570 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
572 ; AVX1-LABEL: max_epu32:
574 ; AVX1-NEXT: vpmaxud %xmm1, %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x3f,0xc1]
575 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
577 ; AVX512-LABEL: max_epu32:
579 ; AVX512-NEXT: vpmaxud %xmm1, %xmm0, %xmm0 ## EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x3f,0xc1]
580 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
581 %res = call <4 x i32> @llvm.x86.sse41.pmaxud(<4 x i32> %a0, <4 x i32> %a1)
584 declare <4 x i32> @llvm.x86.sse41.pmaxud(<4 x i32>, <4 x i32>) nounwind readnone
586 define <4 x i32> @min_epu32(<4 x i32> %a0, <4 x i32> %a1) {
587 ; SSE-LABEL: min_epu32:
589 ; SSE-NEXT: pminud %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x38,0x3b,0xc1]
590 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
592 ; AVX1-LABEL: min_epu32:
594 ; AVX1-NEXT: vpminud %xmm1, %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x3b,0xc1]
595 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
597 ; AVX512-LABEL: min_epu32:
599 ; AVX512-NEXT: vpminud %xmm1, %xmm0, %xmm0 ## EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x3b,0xc1]
600 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
601 %res = call <4 x i32> @llvm.x86.sse41.pminud(<4 x i32> %a0, <4 x i32> %a1)
604 declare <4 x i32> @llvm.x86.sse41.pminud(<4 x i32>, <4 x i32>) nounwind readnone
607 define <2 x i64> @test_x86_sse41_pmuldq(<4 x i32> %a0, <4 x i32> %a1) {
608 ; SSE-LABEL: test_x86_sse41_pmuldq:
610 ; SSE-NEXT: pmuldq %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x38,0x28,0xc1]
611 ; SSE-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
613 ; AVX1-LABEL: test_x86_sse41_pmuldq:
615 ; AVX1-NEXT: vpmuldq %xmm1, %xmm0, %xmm0 ## encoding: [0xc4,0xe2,0x79,0x28,0xc1]
616 ; AVX1-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
618 ; AVX512-LABEL: test_x86_sse41_pmuldq:
620 ; AVX512-NEXT: vpmuldq %xmm1, %xmm0, %xmm0 ## EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x28,0xc1]
621 ; AVX512-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
622 %res = call <2 x i64> @llvm.x86.sse41.pmuldq(<4 x i32> %a0, <4 x i32> %a1) ; <<2 x i64>> [#uses=1]
625 declare <2 x i64> @llvm.x86.sse41.pmuldq(<4 x i32>, <4 x i32>) nounwind readnone