1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -disable-peephole -mtriple=x86_64-unknown-unknown -mattr=+avx512vnni,+avx512vl,+avx512bw | FileCheck %s --check-prefixes=CHECK
4 define <16 x i32> @test_pmaddwd_v32i16_add_v16i32(<16 x i32> %a0, <32 x i16> %a1, <32 x i16> %a2) {
5 ; CHECK-LABEL: test_pmaddwd_v32i16_add_v16i32:
7 ; CHECK-NEXT: vpdpwssd %zmm2, %zmm1, %zmm0
9 %1 = call <16 x i32> @llvm.x86.avx512.pmaddw.d.512(<32 x i16> %a1, <32 x i16> %a2)
10 %2 = add <16 x i32> %1, %a0
14 define <16 x i32> @test_pmaddwd_v32i16_add_v16i32_commute(<16 x i32> %a0, <32 x i16> %a1, <32 x i16> %a2) {
15 ; CHECK-LABEL: test_pmaddwd_v32i16_add_v16i32_commute:
17 ; CHECK-NEXT: vpdpwssd %zmm2, %zmm1, %zmm0
19 %1 = call <16 x i32> @llvm.x86.avx512.pmaddw.d.512(<32 x i16> %a1, <32 x i16> %a2)
20 %2 = add <16 x i32> %a0, %1
24 define <16 x i32> @test_pmaddwd_v32i16_add_v16i32_load1(<16 x i32> %a0, ptr %p1, <32 x i16> %a2) {
25 ; CHECK-LABEL: test_pmaddwd_v32i16_add_v16i32_load1:
27 ; CHECK-NEXT: vpdpwssd (%rdi), %zmm1, %zmm0
29 %a1 = load <32 x i16>, ptr %p1
30 %1 = call <16 x i32> @llvm.x86.avx512.pmaddw.d.512(<32 x i16> %a1, <32 x i16> %a2)
31 %2 = add <16 x i32> %1, %a0
35 define <16 x i32> @test_pmaddwd_v32i16_add_v16i32_load2(<16 x i32> %a0, <32 x i16> %a1, ptr %p2) {
36 ; CHECK-LABEL: test_pmaddwd_v32i16_add_v16i32_load2:
38 ; CHECK-NEXT: vpdpwssd (%rdi), %zmm1, %zmm0
40 %a2 = load <32 x i16>, ptr %p2
41 %1 = call <16 x i32> @llvm.x86.avx512.pmaddw.d.512(<32 x i16> %a1, <32 x i16> %a2)
42 %2 = add <16 x i32> %1, %a0
46 define <16 x i32> @test_pmaddwd_v32i16_add_v16i32_commute_load1(<16 x i32> %a0, ptr %p1, <32 x i16> %a2) {
47 ; CHECK-LABEL: test_pmaddwd_v32i16_add_v16i32_commute_load1:
49 ; CHECK-NEXT: vpdpwssd (%rdi), %zmm1, %zmm0
51 %a1 = load <32 x i16>, ptr %p1
52 %1 = call <16 x i32> @llvm.x86.avx512.pmaddw.d.512(<32 x i16> %a1, <32 x i16> %a2)
53 %2 = add <16 x i32> %a0, %1
57 define <16 x i32> @test_pmaddwd_v32i16_add_v16i32_commute_load2(<16 x i32> %a0, <32 x i16> %a1, ptr %p2) {
58 ; CHECK-LABEL: test_pmaddwd_v32i16_add_v16i32_commute_load2:
60 ; CHECK-NEXT: vpdpwssd (%rdi), %zmm1, %zmm0
62 %a2 = load <32 x i16>, ptr %p2
63 %1 = call <16 x i32> @llvm.x86.avx512.pmaddw.d.512(<32 x i16> %a1, <32 x i16> %a2)
64 %2 = add <16 x i32> %a0, %1
68 declare <16 x i32> @llvm.x86.avx512.pmaddw.d.512(<32 x i16>, <32 x i16>)