1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=x86_64-linux-gnu -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
5 define <8 x i16> @test_mul_v8i16(<8 x i16> %arg1, <8 x i16> %arg2) #0 {
6 %ret = mul <8 x i16> %arg1, %arg2
10 define <8 x i16> @test_mul_v8i16_avx(<8 x i16> %arg1, <8 x i16> %arg2) #1 {
11 %ret = mul <8 x i16> %arg1, %arg2
15 define <8 x i16> @test_mul_v8i16_avx512bwvl(<8 x i16> %arg1, <8 x i16> %arg2) #2 {
16 %ret = mul <8 x i16> %arg1, %arg2
20 define <4 x i32> @test_mul_v4i32(<4 x i32> %arg1, <4 x i32> %arg2) #3 {
21 %ret = mul <4 x i32> %arg1, %arg2
25 define <4 x i32> @test_mul_v4i32_avx(<4 x i32> %arg1, <4 x i32> %arg2) #1 {
26 %ret = mul <4 x i32> %arg1, %arg2
30 define <4 x i32> @test_mul_v4i32_avx512vl(<4 x i32> %arg1, <4 x i32> %arg2) #4 {
31 %ret = mul <4 x i32> %arg1, %arg2
35 define <2 x i64> @test_mul_v2i64(<2 x i64> %arg1, <2 x i64> %arg2) #5 {
36 %ret = mul <2 x i64> %arg1, %arg2
40 define <16 x i16> @test_mul_v16i16(<16 x i16> %arg1, <16 x i16> %arg2) #6 {
41 %ret = mul <16 x i16> %arg1, %arg2
45 define <16 x i16> @test_mul_v16i16_avx512bwvl(<16 x i16> %arg1, <16 x i16> %arg2) #2 {
46 %ret = mul <16 x i16> %arg1, %arg2
50 define <8 x i32> @test_mul_v8i32(<8 x i32> %arg1, <8 x i32> %arg2) #6 {
51 %ret = mul <8 x i32> %arg1, %arg2
55 define <8 x i32> @test_mul_v8i32_avx512vl(<8 x i32> %arg1, <8 x i32> %arg2) #4 {
56 %ret = mul <8 x i32> %arg1, %arg2
60 define <4 x i64> @test_mul_v4i64(<4 x i64> %arg1, <4 x i64> %arg2) #5 {
61 %ret = mul <4 x i64> %arg1, %arg2
65 define <32 x i16> @test_mul_v32i16(<32 x i16> %arg1, <32 x i16> %arg2) #7 {
66 %ret = mul <32 x i16> %arg1, %arg2
70 define <16 x i32> @test_mul_v16i32(<16 x i32> %arg1, <16 x i32> %arg2) #8 {
71 %ret = mul <16 x i32> %arg1, %arg2
75 define <8 x i64> @test_mul_v8i64(<8 x i64> %arg1, <8 x i64> %arg2) #9 {
76 %ret = mul <8 x i64> %arg1, %arg2
80 attributes #0 = { "target-features"="+sse2" }
81 attributes #1 = { "target-features"="+avx" }
82 attributes #2 = { "target-features"="+avx512vl,+avx512f,+avx512bw" }
83 attributes #3 = { "target-features"="+sse4.1" }
84 attributes #4 = { "target-features"="+avx512vl,+avx512f" }
85 attributes #5 = { "target-features"="+avx2,+avx512vl,+avx512f,+avx512dq" }
86 attributes #6 = { "target-features"="+avx2" }
87 attributes #7 = { "target-features"="+avx512f,+avx512bw" }
88 attributes #8 = { "target-features"="+avx512f" }
89 attributes #9 = { "target-features"="+avx512f,+avx512dq" }
98 - { id: 0, class: vecr }
99 - { id: 1, class: vecr }
100 - { id: 2, class: vecr }
103 liveins: $xmm0, $xmm1
105 ; CHECK-LABEL: name: test_mul_v8i16
106 ; CHECK: [[COPY:%[0-9]+]]:vr128 = COPY $xmm0
107 ; CHECK: [[COPY1:%[0-9]+]]:vr128 = COPY $xmm1
108 ; CHECK: [[PMULLWrr:%[0-9]+]]:vr128 = PMULLWrr [[COPY]], [[COPY1]]
109 ; CHECK: $xmm0 = COPY [[PMULLWrr]]
110 ; CHECK: RET 0, implicit $xmm0
111 %0(<8 x s16>) = COPY $xmm0
112 %1(<8 x s16>) = COPY $xmm1
113 %2(<8 x s16>) = G_MUL %0, %1
114 $xmm0 = COPY %2(<8 x s16>)
115 RET 0, implicit $xmm0
119 name: test_mul_v8i16_avx
122 regBankSelected: true
124 - { id: 0, class: vecr }
125 - { id: 1, class: vecr }
126 - { id: 2, class: vecr }
129 liveins: $xmm0, $xmm1
131 ; CHECK-LABEL: name: test_mul_v8i16_avx
132 ; CHECK: [[COPY:%[0-9]+]]:vr128 = COPY $xmm0
133 ; CHECK: [[COPY1:%[0-9]+]]:vr128 = COPY $xmm1
134 ; CHECK: [[VPMULLWrr:%[0-9]+]]:vr128 = VPMULLWrr [[COPY]], [[COPY1]]
135 ; CHECK: $xmm0 = COPY [[VPMULLWrr]]
136 ; CHECK: RET 0, implicit $xmm0
137 %0(<8 x s16>) = COPY $xmm0
138 %1(<8 x s16>) = COPY $xmm1
139 %2(<8 x s16>) = G_MUL %0, %1
140 $xmm0 = COPY %2(<8 x s16>)
141 RET 0, implicit $xmm0
145 name: test_mul_v8i16_avx512bwvl
148 regBankSelected: true
150 - { id: 0, class: vecr }
151 - { id: 1, class: vecr }
152 - { id: 2, class: vecr }
155 liveins: $xmm0, $xmm1
157 ; CHECK-LABEL: name: test_mul_v8i16_avx512bwvl
158 ; CHECK: [[COPY:%[0-9]+]]:vr128x = COPY $xmm0
159 ; CHECK: [[COPY1:%[0-9]+]]:vr128x = COPY $xmm1
160 ; CHECK: [[VPMULLWZ128rr:%[0-9]+]]:vr128x = VPMULLWZ128rr [[COPY]], [[COPY1]]
161 ; CHECK: $xmm0 = COPY [[VPMULLWZ128rr]]
162 ; CHECK: RET 0, implicit $xmm0
163 %0(<8 x s16>) = COPY $xmm0
164 %1(<8 x s16>) = COPY $xmm1
165 %2(<8 x s16>) = G_MUL %0, %1
166 $xmm0 = COPY %2(<8 x s16>)
167 RET 0, implicit $xmm0
174 regBankSelected: true
176 - { id: 0, class: vecr }
177 - { id: 1, class: vecr }
178 - { id: 2, class: vecr }
181 liveins: $xmm0, $xmm1
183 ; CHECK-LABEL: name: test_mul_v4i32
184 ; CHECK: [[COPY:%[0-9]+]]:vr128 = COPY $xmm0
185 ; CHECK: [[COPY1:%[0-9]+]]:vr128 = COPY $xmm1
186 ; CHECK: [[PMULLDrr:%[0-9]+]]:vr128 = PMULLDrr [[COPY]], [[COPY1]]
187 ; CHECK: $xmm0 = COPY [[PMULLDrr]]
188 ; CHECK: RET 0, implicit $xmm0
189 %0(<4 x s32>) = COPY $xmm0
190 %1(<4 x s32>) = COPY $xmm1
191 %2(<4 x s32>) = G_MUL %0, %1
192 $xmm0 = COPY %2(<4 x s32>)
193 RET 0, implicit $xmm0
197 name: test_mul_v4i32_avx
200 regBankSelected: true
202 - { id: 0, class: vecr }
203 - { id: 1, class: vecr }
204 - { id: 2, class: vecr }
207 liveins: $xmm0, $xmm1
209 ; CHECK-LABEL: name: test_mul_v4i32_avx
210 ; CHECK: [[COPY:%[0-9]+]]:vr128 = COPY $xmm0
211 ; CHECK: [[COPY1:%[0-9]+]]:vr128 = COPY $xmm1
212 ; CHECK: [[VPMULLDrr:%[0-9]+]]:vr128 = VPMULLDrr [[COPY]], [[COPY1]]
213 ; CHECK: $xmm0 = COPY [[VPMULLDrr]]
214 ; CHECK: RET 0, implicit $xmm0
215 %0(<4 x s32>) = COPY $xmm0
216 %1(<4 x s32>) = COPY $xmm1
217 %2(<4 x s32>) = G_MUL %0, %1
218 $xmm0 = COPY %2(<4 x s32>)
219 RET 0, implicit $xmm0
223 name: test_mul_v4i32_avx512vl
226 regBankSelected: true
228 - { id: 0, class: vecr }
229 - { id: 1, class: vecr }
230 - { id: 2, class: vecr }
233 liveins: $xmm0, $xmm1
235 ; CHECK-LABEL: name: test_mul_v4i32_avx512vl
236 ; CHECK: [[COPY:%[0-9]+]]:vr128x = COPY $xmm0
237 ; CHECK: [[COPY1:%[0-9]+]]:vr128x = COPY $xmm1
238 ; CHECK: [[VPMULLDZ128rr:%[0-9]+]]:vr128x = VPMULLDZ128rr [[COPY]], [[COPY1]]
239 ; CHECK: $xmm0 = COPY [[VPMULLDZ128rr]]
240 ; CHECK: RET 0, implicit $xmm0
241 %0(<4 x s32>) = COPY $xmm0
242 %1(<4 x s32>) = COPY $xmm1
243 %2(<4 x s32>) = G_MUL %0, %1
244 $xmm0 = COPY %2(<4 x s32>)
245 RET 0, implicit $xmm0
252 regBankSelected: true
254 - { id: 0, class: vecr }
255 - { id: 1, class: vecr }
256 - { id: 2, class: vecr }
259 liveins: $xmm0, $xmm1
261 ; CHECK-LABEL: name: test_mul_v2i64
262 ; CHECK: [[COPY:%[0-9]+]]:vr128x = COPY $xmm0
263 ; CHECK: [[COPY1:%[0-9]+]]:vr128x = COPY $xmm1
264 ; CHECK: [[VPMULLQZ128rr:%[0-9]+]]:vr128x = VPMULLQZ128rr [[COPY]], [[COPY1]]
265 ; CHECK: $xmm0 = COPY [[VPMULLQZ128rr]]
266 ; CHECK: RET 0, implicit $xmm0
267 %0(<2 x s64>) = COPY $xmm0
268 %1(<2 x s64>) = COPY $xmm1
269 %2(<2 x s64>) = G_MUL %0, %1
270 $xmm0 = COPY %2(<2 x s64>)
271 RET 0, implicit $xmm0
275 name: test_mul_v16i16
278 regBankSelected: true
280 - { id: 0, class: vecr }
281 - { id: 1, class: vecr }
282 - { id: 2, class: vecr }
285 liveins: $ymm0, $ymm1
287 ; CHECK-LABEL: name: test_mul_v16i16
288 ; CHECK: [[COPY:%[0-9]+]]:vr256 = COPY $ymm0
289 ; CHECK: [[COPY1:%[0-9]+]]:vr256 = COPY $ymm1
290 ; CHECK: [[VPMULLWYrr:%[0-9]+]]:vr256 = VPMULLWYrr [[COPY]], [[COPY1]]
291 ; CHECK: $ymm0 = COPY [[VPMULLWYrr]]
292 ; CHECK: RET 0, implicit $ymm0
293 %0(<16 x s16>) = COPY $ymm0
294 %1(<16 x s16>) = COPY $ymm1
295 %2(<16 x s16>) = G_MUL %0, %1
296 $ymm0 = COPY %2(<16 x s16>)
297 RET 0, implicit $ymm0
301 name: test_mul_v16i16_avx512bwvl
304 regBankSelected: true
306 - { id: 0, class: vecr }
307 - { id: 1, class: vecr }
308 - { id: 2, class: vecr }
311 liveins: $ymm0, $ymm1
313 ; CHECK-LABEL: name: test_mul_v16i16_avx512bwvl
314 ; CHECK: [[COPY:%[0-9]+]]:vr256x = COPY $ymm0
315 ; CHECK: [[COPY1:%[0-9]+]]:vr256x = COPY $ymm1
316 ; CHECK: [[VPMULLWZ256rr:%[0-9]+]]:vr256x = VPMULLWZ256rr [[COPY]], [[COPY1]]
317 ; CHECK: $ymm0 = COPY [[VPMULLWZ256rr]]
318 ; CHECK: RET 0, implicit $ymm0
319 %0(<16 x s16>) = COPY $ymm0
320 %1(<16 x s16>) = COPY $ymm1
321 %2(<16 x s16>) = G_MUL %0, %1
322 $ymm0 = COPY %2(<16 x s16>)
323 RET 0, implicit $ymm0
330 regBankSelected: true
332 - { id: 0, class: vecr }
333 - { id: 1, class: vecr }
334 - { id: 2, class: vecr }
337 liveins: $ymm0, $ymm1
339 ; CHECK-LABEL: name: test_mul_v8i32
340 ; CHECK: [[COPY:%[0-9]+]]:vr256 = COPY $ymm0
341 ; CHECK: [[COPY1:%[0-9]+]]:vr256 = COPY $ymm1
342 ; CHECK: [[VPMULLDYrr:%[0-9]+]]:vr256 = VPMULLDYrr [[COPY]], [[COPY1]]
343 ; CHECK: $ymm0 = COPY [[VPMULLDYrr]]
344 ; CHECK: RET 0, implicit $ymm0
345 %0(<8 x s32>) = COPY $ymm0
346 %1(<8 x s32>) = COPY $ymm1
347 %2(<8 x s32>) = G_MUL %0, %1
348 $ymm0 = COPY %2(<8 x s32>)
349 RET 0, implicit $ymm0
353 name: test_mul_v8i32_avx512vl
356 regBankSelected: true
358 - { id: 0, class: vecr }
359 - { id: 1, class: vecr }
360 - { id: 2, class: vecr }
363 liveins: $ymm0, $ymm1
365 ; CHECK-LABEL: name: test_mul_v8i32_avx512vl
366 ; CHECK: [[COPY:%[0-9]+]]:vr256x = COPY $ymm0
367 ; CHECK: [[COPY1:%[0-9]+]]:vr256x = COPY $ymm1
368 ; CHECK: [[VPMULLDZ256rr:%[0-9]+]]:vr256x = VPMULLDZ256rr [[COPY]], [[COPY1]]
369 ; CHECK: $ymm0 = COPY [[VPMULLDZ256rr]]
370 ; CHECK: RET 0, implicit $ymm0
371 %0(<8 x s32>) = COPY $ymm0
372 %1(<8 x s32>) = COPY $ymm1
373 %2(<8 x s32>) = G_MUL %0, %1
374 $ymm0 = COPY %2(<8 x s32>)
375 RET 0, implicit $ymm0
382 regBankSelected: true
384 - { id: 0, class: vecr }
385 - { id: 1, class: vecr }
386 - { id: 2, class: vecr }
389 liveins: $ymm0, $ymm1
391 ; CHECK-LABEL: name: test_mul_v4i64
392 ; CHECK: [[COPY:%[0-9]+]]:vr256x = COPY $ymm0
393 ; CHECK: [[COPY1:%[0-9]+]]:vr256x = COPY $ymm1
394 ; CHECK: [[VPMULLQZ256rr:%[0-9]+]]:vr256x = VPMULLQZ256rr [[COPY]], [[COPY1]]
395 ; CHECK: $ymm0 = COPY [[VPMULLQZ256rr]]
396 ; CHECK: RET 0, implicit $ymm0
397 %0(<4 x s64>) = COPY $ymm0
398 %1(<4 x s64>) = COPY $ymm1
399 %2(<4 x s64>) = G_MUL %0, %1
400 $ymm0 = COPY %2(<4 x s64>)
401 RET 0, implicit $ymm0
405 name: test_mul_v32i16
408 regBankSelected: true
410 - { id: 0, class: vecr }
411 - { id: 1, class: vecr }
412 - { id: 2, class: vecr }
415 liveins: $zmm0, $zmm1
417 ; CHECK-LABEL: name: test_mul_v32i16
418 ; CHECK: [[COPY:%[0-9]+]]:vr512 = COPY $zmm0
419 ; CHECK: [[COPY1:%[0-9]+]]:vr512 = COPY $zmm1
420 ; CHECK: [[VPMULLWZrr:%[0-9]+]]:vr512 = VPMULLWZrr [[COPY]], [[COPY1]]
421 ; CHECK: $zmm0 = COPY [[VPMULLWZrr]]
422 ; CHECK: RET 0, implicit $zmm0
423 %0(<32 x s16>) = COPY $zmm0
424 %1(<32 x s16>) = COPY $zmm1
425 %2(<32 x s16>) = G_MUL %0, %1
426 $zmm0 = COPY %2(<32 x s16>)
427 RET 0, implicit $zmm0
431 name: test_mul_v16i32
434 regBankSelected: true
436 - { id: 0, class: vecr }
437 - { id: 1, class: vecr }
438 - { id: 2, class: vecr }
441 liveins: $zmm0, $zmm1
443 ; CHECK-LABEL: name: test_mul_v16i32
444 ; CHECK: [[COPY:%[0-9]+]]:vr512 = COPY $zmm0
445 ; CHECK: [[COPY1:%[0-9]+]]:vr512 = COPY $zmm1
446 ; CHECK: [[VPMULLDZrr:%[0-9]+]]:vr512 = VPMULLDZrr [[COPY]], [[COPY1]]
447 ; CHECK: $zmm0 = COPY [[VPMULLDZrr]]
448 ; CHECK: RET 0, implicit $zmm0
449 %0(<16 x s32>) = COPY $zmm0
450 %1(<16 x s32>) = COPY $zmm1
451 %2(<16 x s32>) = G_MUL %0, %1
452 $zmm0 = COPY %2(<16 x s32>)
453 RET 0, implicit $zmm0
460 regBankSelected: true
462 - { id: 0, class: vecr }
463 - { id: 1, class: vecr }
464 - { id: 2, class: vecr }
467 liveins: $zmm0, $zmm1
469 ; CHECK-LABEL: name: test_mul_v8i64
470 ; CHECK: [[COPY:%[0-9]+]]:vr512 = COPY $zmm0
471 ; CHECK: [[COPY1:%[0-9]+]]:vr512 = COPY $zmm1
472 ; CHECK: [[VPMULLQZrr:%[0-9]+]]:vr512 = VPMULLQZrr [[COPY]], [[COPY1]]
473 ; CHECK: $zmm0 = COPY [[VPMULLQZrr]]
474 ; CHECK: RET 0, implicit $zmm0
475 %0(<8 x s64>) = COPY $zmm0
476 %1(<8 x s64>) = COPY $zmm1
477 %2(<8 x s64>) = G_MUL %0, %1
478 $zmm0 = COPY %2(<8 x s64>)
479 RET 0, implicit $zmm0