1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown -mattr=+avx512cd | FileCheck %s --check-prefixes=CHECK,X86
3 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+avx512cd | FileCheck %s --check-prefixes=CHECK,X64
5 declare <16 x i32> @llvm.x86.avx512.mask.conflict.d.512(<16 x i32>, <16 x i32>, i16) nounwind readonly
7 define <16 x i32> @test_conflict_d(<16 x i32> %a) {
8 ; CHECK-LABEL: test_conflict_d:
10 ; CHECK-NEXT: vpconflictd %zmm0, %zmm0
11 ; CHECK-NEXT: ret{{[l|q]}}
12 %res = call <16 x i32> @llvm.x86.avx512.mask.conflict.d.512(<16 x i32> %a, <16 x i32> undef, i16 -1)
16 define <16 x i32> @test_mask_conflict_d(<16 x i32> %a, <16 x i32> %b, i16 %mask) {
17 ; X86-LABEL: test_mask_conflict_d:
19 ; X86-NEXT: kmovw {{[0-9]+}}(%esp), %k1
20 ; X86-NEXT: vpconflictd %zmm0, %zmm1 {%k1}
21 ; X86-NEXT: vmovdqa64 %zmm1, %zmm0
24 ; X64-LABEL: test_mask_conflict_d:
26 ; X64-NEXT: kmovw %edi, %k1
27 ; X64-NEXT: vpconflictd %zmm0, %zmm1 {%k1}
28 ; X64-NEXT: vmovdqa64 %zmm1, %zmm0
30 %res = call <16 x i32> @llvm.x86.avx512.mask.conflict.d.512(<16 x i32> %a, <16 x i32> %b, i16 %mask)
34 define <16 x i32> @test_maskz_conflict_d(<16 x i32> %a, i16 %mask) {
35 ; X86-LABEL: test_maskz_conflict_d:
37 ; X86-NEXT: kmovw {{[0-9]+}}(%esp), %k1
38 ; X86-NEXT: vpconflictd %zmm0, %zmm0 {%k1} {z}
41 ; X64-LABEL: test_maskz_conflict_d:
43 ; X64-NEXT: kmovw %edi, %k1
44 ; X64-NEXT: vpconflictd %zmm0, %zmm0 {%k1} {z}
46 %res = call <16 x i32> @llvm.x86.avx512.mask.conflict.d.512(<16 x i32> %a, <16 x i32> zeroinitializer, i16 %mask)
50 declare <8 x i64> @llvm.x86.avx512.mask.conflict.q.512(<8 x i64>, <8 x i64>, i8) nounwind readonly
52 define <8 x i64> @test_conflict_q(<8 x i64> %a) {
53 ; CHECK-LABEL: test_conflict_q:
55 ; CHECK-NEXT: vpconflictq %zmm0, %zmm0
56 ; CHECK-NEXT: ret{{[l|q]}}
57 %res = call <8 x i64> @llvm.x86.avx512.mask.conflict.q.512(<8 x i64> %a, <8 x i64> undef, i8 -1)
61 define <8 x i64> @test_mask_conflict_q(<8 x i64> %a, <8 x i64> %b, i8 %mask) {
62 ; X86-LABEL: test_mask_conflict_q:
64 ; X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
65 ; X86-NEXT: kmovw %eax, %k1
66 ; X86-NEXT: vpconflictq %zmm0, %zmm1 {%k1}
67 ; X86-NEXT: vmovdqa64 %zmm1, %zmm0
70 ; X64-LABEL: test_mask_conflict_q:
72 ; X64-NEXT: kmovw %edi, %k1
73 ; X64-NEXT: vpconflictq %zmm0, %zmm1 {%k1}
74 ; X64-NEXT: vmovdqa64 %zmm1, %zmm0
76 %res = call <8 x i64> @llvm.x86.avx512.mask.conflict.q.512(<8 x i64> %a, <8 x i64> %b, i8 %mask)
80 define <8 x i64> @test_maskz_conflict_q(<8 x i64> %a, i8 %mask) {
81 ; X86-LABEL: test_maskz_conflict_q:
83 ; X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
84 ; X86-NEXT: kmovw %eax, %k1
85 ; X86-NEXT: vpconflictq %zmm0, %zmm0 {%k1} {z}
88 ; X64-LABEL: test_maskz_conflict_q:
90 ; X64-NEXT: kmovw %edi, %k1
91 ; X64-NEXT: vpconflictq %zmm0, %zmm0 {%k1} {z}
93 %res = call <8 x i64> @llvm.x86.avx512.mask.conflict.q.512(<8 x i64> %a, <8 x i64> zeroinitializer, i8 %mask)
97 define <16 x i32> @test_lzcnt_d(<16 x i32> %a) {
98 ; CHECK-LABEL: test_lzcnt_d:
100 ; CHECK-NEXT: vplzcntd %zmm0, %zmm0
101 ; CHECK-NEXT: ret{{[l|q]}}
102 %res = call <16 x i32> @llvm.x86.avx512.mask.lzcnt.d.512(<16 x i32> %a, <16 x i32> zeroinitializer, i16 -1)
106 declare <16 x i32> @llvm.x86.avx512.mask.lzcnt.d.512(<16 x i32>, <16 x i32>, i16) nounwind readonly
108 define <8 x i64> @test_lzcnt_q(<8 x i64> %a) {
109 ; CHECK-LABEL: test_lzcnt_q:
111 ; CHECK-NEXT: vplzcntq %zmm0, %zmm0
112 ; CHECK-NEXT: ret{{[l|q]}}
113 %res = call <8 x i64> @llvm.x86.avx512.mask.lzcnt.q.512(<8 x i64> %a, <8 x i64> zeroinitializer, i8 -1)
117 declare <8 x i64> @llvm.x86.avx512.mask.lzcnt.q.512(<8 x i64>, <8 x i64>, i8) nounwind readonly
120 define <16 x i32> @test_mask_lzcnt_d(<16 x i32> %a, <16 x i32> %b, i16 %mask) {
121 ; X86-LABEL: test_mask_lzcnt_d:
123 ; X86-NEXT: kmovw {{[0-9]+}}(%esp), %k1
124 ; X86-NEXT: vplzcntd %zmm0, %zmm1 {%k1}
125 ; X86-NEXT: vmovdqa64 %zmm1, %zmm0
128 ; X64-LABEL: test_mask_lzcnt_d:
130 ; X64-NEXT: kmovw %edi, %k1
131 ; X64-NEXT: vplzcntd %zmm0, %zmm1 {%k1}
132 ; X64-NEXT: vmovdqa64 %zmm1, %zmm0
134 %res = call <16 x i32> @llvm.x86.avx512.mask.lzcnt.d.512(<16 x i32> %a, <16 x i32> %b, i16 %mask)
138 define <8 x i64> @test_mask_lzcnt_q(<8 x i64> %a, <8 x i64> %b, i8 %mask) {
139 ; X86-LABEL: test_mask_lzcnt_q:
141 ; X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
142 ; X86-NEXT: kmovw %eax, %k1
143 ; X86-NEXT: vplzcntq %zmm0, %zmm1 {%k1}
144 ; X86-NEXT: vmovdqa64 %zmm1, %zmm0
147 ; X64-LABEL: test_mask_lzcnt_q:
149 ; X64-NEXT: kmovw %edi, %k1
150 ; X64-NEXT: vplzcntq %zmm0, %zmm1 {%k1}
151 ; X64-NEXT: vmovdqa64 %zmm1, %zmm0
153 %res = call <8 x i64> @llvm.x86.avx512.mask.lzcnt.q.512(<8 x i64> %a, <8 x i64> %b, i8 %mask)
157 define <16 x i32> @test_x86_vbroadcastmw_512(i16 %a0) {
158 ; X86-LABEL: test_x86_vbroadcastmw_512:
160 ; X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax
161 ; X86-NEXT: vpbroadcastd %eax, %zmm0
164 ; X64-LABEL: test_x86_vbroadcastmw_512:
166 ; X64-NEXT: movzwl %di, %eax
167 ; X64-NEXT: vpbroadcastd %eax, %zmm0
169 %res = call <16 x i32> @llvm.x86.avx512.broadcastmw.512(i16 %a0)
172 declare <16 x i32> @llvm.x86.avx512.broadcastmw.512(i16)
174 define <8 x i64> @test_x86_broadcastmb_512(i8 %a0) {
175 ; X86-LABEL: test_x86_broadcastmb_512:
177 ; X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
178 ; X86-NEXT: vmovd %eax, %xmm0
179 ; X86-NEXT: vpbroadcastq %xmm0, %zmm0
182 ; X64-LABEL: test_x86_broadcastmb_512:
184 ; X64-NEXT: # kill: def $edi killed $edi def $rdi
185 ; X64-NEXT: movzbl %dil, %eax
186 ; X64-NEXT: vpbroadcastq %rax, %zmm0
188 %res = call <8 x i64> @llvm.x86.avx512.broadcastmb.512(i8 %a0)
191 declare <8 x i64> @llvm.x86.avx512.broadcastmb.512(i8)