1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -march=amdgcn -mcpu=gfx1100 -mattr="+wavefrontsize64" -verify-machineinstrs < %s | FileCheck -check-prefixes=GCN,GFX11,SDAG-GFX11 %s
3 ; RUN: llc -march=amdgcn -mcpu=fiji -verify-machineinstrs < %s | FileCheck -check-prefixes=GCN,VI,SDAG-VI %s
4 ; RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck -check-prefixes=GCN,GFX9,SDAG-GFX9 %s
6 ; RUN: llc -global-isel -global-isel-abort=2 -march=amdgcn -mcpu=gfx1100 -mattr="+wavefrontsize64" -verify-machineinstrs < %s 2>%t | FileCheck -check-prefixes=GCN,GFX11,GISEL-GFX11 %s
7 ; RUN: FileCheck --check-prefix=ERR %s < %t
8 ; RUN: llc -global-isel -global-isel-abort=2 -march=amdgcn -mcpu=fiji -verify-machineinstrs < %s 2>%t | FileCheck -check-prefixes=GCN,VI,GISEL-VI %s
9 ; RUN: FileCheck --check-prefix=ERR %s < %t
10 ; RUN: llc -global-isel -global-isel-abort=2 -march=amdgcn -mcpu=gfx900 -verify-machineinstrs < %s 2>%t | FileCheck -check-prefixes=GCN,GFX9,GISEL-GFX9 %s
11 ; RUN: FileCheck --check-prefix=ERR %s < %t
13 ; Note: GlobalISel abort is disabled so we don't crash on i1 inputs.
14 ; They are allowed in DAGISel but we (intentionally) don't support them
17 ; ERR: warning: Instruction selection used fallback path for v_icmp_i1_ne0
19 declare i64 @llvm.amdgcn.icmp.i32(i32, i32, i32) #0
20 declare i64 @llvm.amdgcn.icmp.i64(i64, i64, i32) #0
21 declare i64 @llvm.amdgcn.icmp.i16(i16, i16, i32) #0
22 declare i64 @llvm.amdgcn.icmp.i1(i1, i1, i32) #0
24 define amdgpu_kernel void @v_icmp_i32_eq(ptr addrspace(1) %out, i32 %src) {
25 ; GFX11-LABEL: v_icmp_i32_eq:
27 ; GFX11-NEXT: s_clause 0x1
28 ; GFX11-NEXT: s_load_b32 s2, s[0:1], 0x2c
29 ; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x24
30 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
31 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
32 ; GFX11-NEXT: v_cmp_eq_u32_e64 s[2:3], 0x64, s2
33 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
34 ; GFX11-NEXT: v_mov_b32_e32 v0, s2
35 ; GFX11-NEXT: v_mov_b32_e32 v1, s3
36 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
38 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
39 ; GFX11-NEXT: s_endpgm
41 ; SDAG-VI-LABEL: v_icmp_i32_eq:
43 ; SDAG-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
44 ; SDAG-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
45 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, 0x64
46 ; SDAG-VI-NEXT: s_waitcnt lgkmcnt(0)
47 ; SDAG-VI-NEXT: v_cmp_eq_u32_e64 s[2:3], s2, v0
48 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, s0
49 ; SDAG-VI-NEXT: v_mov_b32_e32 v2, s2
50 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, s1
51 ; SDAG-VI-NEXT: v_mov_b32_e32 v3, s3
52 ; SDAG-VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3]
53 ; SDAG-VI-NEXT: s_endpgm
55 ; GFX9-LABEL: v_icmp_i32_eq:
57 ; GFX9-NEXT: s_load_dword s4, s[0:1], 0x2c
58 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
59 ; GFX9-NEXT: v_mov_b32_e32 v0, 0x64
60 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
61 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
62 ; GFX9-NEXT: v_cmp_eq_u32_e64 s[0:1], s4, v0
63 ; GFX9-NEXT: v_mov_b32_e32 v0, s0
64 ; GFX9-NEXT: v_mov_b32_e32 v1, s1
65 ; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[2:3]
68 ; GISEL-VI-LABEL: v_icmp_i32_eq:
70 ; GISEL-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
71 ; GISEL-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
72 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, 0x64
73 ; GISEL-VI-NEXT: s_waitcnt lgkmcnt(0)
74 ; GISEL-VI-NEXT: v_cmp_eq_u32_e64 s[2:3], s2, v0
75 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, s2
76 ; GISEL-VI-NEXT: v_mov_b32_e32 v3, s1
77 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, s3
78 ; GISEL-VI-NEXT: v_mov_b32_e32 v2, s0
79 ; GISEL-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
80 ; GISEL-VI-NEXT: s_endpgm
81 %result = call i64 @llvm.amdgcn.icmp.i32(i32 %src, i32 100, i32 32)
82 store i64 %result, ptr addrspace(1) %out
86 define amdgpu_kernel void @v_icmp_i32(ptr addrspace(1) %out, i32 %src) {
87 ; SDAG-GFX11-LABEL: v_icmp_i32:
88 ; SDAG-GFX11: ; %bb.0:
89 ; SDAG-GFX11-NEXT: s_endpgm
91 ; SDAG-VI-LABEL: v_icmp_i32:
93 ; SDAG-VI-NEXT: s_endpgm
95 ; SDAG-GFX9-LABEL: v_icmp_i32:
97 ; SDAG-GFX9-NEXT: s_endpgm
99 ; GISEL-GFX11-LABEL: v_icmp_i32:
100 ; GISEL-GFX11: ; %bb.0:
101 ; GISEL-GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x24
102 ; GISEL-GFX11-NEXT: v_mov_b32_e32 v0, 0
103 ; GISEL-GFX11-NEXT: s_waitcnt lgkmcnt(0)
104 ; GISEL-GFX11-NEXT: global_store_b64 v0, v[0:1], s[0:1]
105 ; GISEL-GFX11-NEXT: s_nop 0
106 ; GISEL-GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
107 ; GISEL-GFX11-NEXT: s_endpgm
109 ; GISEL-VI-LABEL: v_icmp_i32:
111 ; GISEL-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
112 ; GISEL-VI-NEXT: s_waitcnt lgkmcnt(0)
113 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, s0
114 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, s1
115 ; GISEL-VI-NEXT: flat_store_dwordx2 v[0:1], v[0:1]
116 ; GISEL-VI-NEXT: s_endpgm
118 ; GISEL-GFX9-LABEL: v_icmp_i32:
119 ; GISEL-GFX9: ; %bb.0:
120 ; GISEL-GFX9-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
121 ; GISEL-GFX9-NEXT: v_mov_b32_e32 v0, 0
122 ; GISEL-GFX9-NEXT: s_waitcnt lgkmcnt(0)
123 ; GISEL-GFX9-NEXT: global_store_dwordx2 v0, v[0:1], s[0:1]
124 ; GISEL-GFX9-NEXT: s_endpgm
125 %result = call i64 @llvm.amdgcn.icmp.i32(i32 %src, i32 100, i32 30)
126 store i64 %result, ptr addrspace(1) %out
130 define amdgpu_kernel void @v_icmp_i32_ne(ptr addrspace(1) %out, i32 %src) {
131 ; GFX11-LABEL: v_icmp_i32_ne:
133 ; GFX11-NEXT: s_clause 0x1
134 ; GFX11-NEXT: s_load_b32 s2, s[0:1], 0x2c
135 ; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x24
136 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
137 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
138 ; GFX11-NEXT: v_cmp_ne_u32_e64 s[2:3], 0x64, s2
139 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
140 ; GFX11-NEXT: v_mov_b32_e32 v0, s2
141 ; GFX11-NEXT: v_mov_b32_e32 v1, s3
142 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
143 ; GFX11-NEXT: s_nop 0
144 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
145 ; GFX11-NEXT: s_endpgm
147 ; SDAG-VI-LABEL: v_icmp_i32_ne:
149 ; SDAG-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
150 ; SDAG-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
151 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, 0x64
152 ; SDAG-VI-NEXT: s_waitcnt lgkmcnt(0)
153 ; SDAG-VI-NEXT: v_cmp_ne_u32_e64 s[2:3], s2, v0
154 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, s0
155 ; SDAG-VI-NEXT: v_mov_b32_e32 v2, s2
156 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, s1
157 ; SDAG-VI-NEXT: v_mov_b32_e32 v3, s3
158 ; SDAG-VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3]
159 ; SDAG-VI-NEXT: s_endpgm
161 ; GFX9-LABEL: v_icmp_i32_ne:
163 ; GFX9-NEXT: s_load_dword s4, s[0:1], 0x2c
164 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
165 ; GFX9-NEXT: v_mov_b32_e32 v0, 0x64
166 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
167 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
168 ; GFX9-NEXT: v_cmp_ne_u32_e64 s[0:1], s4, v0
169 ; GFX9-NEXT: v_mov_b32_e32 v0, s0
170 ; GFX9-NEXT: v_mov_b32_e32 v1, s1
171 ; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[2:3]
172 ; GFX9-NEXT: s_endpgm
174 ; GISEL-VI-LABEL: v_icmp_i32_ne:
176 ; GISEL-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
177 ; GISEL-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
178 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, 0x64
179 ; GISEL-VI-NEXT: s_waitcnt lgkmcnt(0)
180 ; GISEL-VI-NEXT: v_cmp_ne_u32_e64 s[2:3], s2, v0
181 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, s2
182 ; GISEL-VI-NEXT: v_mov_b32_e32 v3, s1
183 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, s3
184 ; GISEL-VI-NEXT: v_mov_b32_e32 v2, s0
185 ; GISEL-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
186 ; GISEL-VI-NEXT: s_endpgm
187 %result = call i64 @llvm.amdgcn.icmp.i32(i32 %src, i32 100, i32 33)
188 store i64 %result, ptr addrspace(1) %out
192 define amdgpu_kernel void @v_icmp_i32_ugt(ptr addrspace(1) %out, i32 %src) {
193 ; GFX11-LABEL: v_icmp_i32_ugt:
195 ; GFX11-NEXT: s_clause 0x1
196 ; GFX11-NEXT: s_load_b32 s2, s[0:1], 0x2c
197 ; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x24
198 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
199 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
200 ; GFX11-NEXT: v_cmp_lt_u32_e64 s[2:3], 0x64, s2
201 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
202 ; GFX11-NEXT: v_mov_b32_e32 v0, s2
203 ; GFX11-NEXT: v_mov_b32_e32 v1, s3
204 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
205 ; GFX11-NEXT: s_nop 0
206 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
207 ; GFX11-NEXT: s_endpgm
209 ; SDAG-VI-LABEL: v_icmp_i32_ugt:
211 ; SDAG-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
212 ; SDAG-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
213 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, 0x64
214 ; SDAG-VI-NEXT: s_waitcnt lgkmcnt(0)
215 ; SDAG-VI-NEXT: v_cmp_gt_u32_e64 s[2:3], s2, v0
216 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, s0
217 ; SDAG-VI-NEXT: v_mov_b32_e32 v2, s2
218 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, s1
219 ; SDAG-VI-NEXT: v_mov_b32_e32 v3, s3
220 ; SDAG-VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3]
221 ; SDAG-VI-NEXT: s_endpgm
223 ; GFX9-LABEL: v_icmp_i32_ugt:
225 ; GFX9-NEXT: s_load_dword s4, s[0:1], 0x2c
226 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
227 ; GFX9-NEXT: v_mov_b32_e32 v0, 0x64
228 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
229 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
230 ; GFX9-NEXT: v_cmp_gt_u32_e64 s[0:1], s4, v0
231 ; GFX9-NEXT: v_mov_b32_e32 v0, s0
232 ; GFX9-NEXT: v_mov_b32_e32 v1, s1
233 ; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[2:3]
234 ; GFX9-NEXT: s_endpgm
236 ; GISEL-VI-LABEL: v_icmp_i32_ugt:
238 ; GISEL-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
239 ; GISEL-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
240 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, 0x64
241 ; GISEL-VI-NEXT: s_waitcnt lgkmcnt(0)
242 ; GISEL-VI-NEXT: v_cmp_gt_u32_e64 s[2:3], s2, v0
243 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, s2
244 ; GISEL-VI-NEXT: v_mov_b32_e32 v3, s1
245 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, s3
246 ; GISEL-VI-NEXT: v_mov_b32_e32 v2, s0
247 ; GISEL-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
248 ; GISEL-VI-NEXT: s_endpgm
249 %result = call i64 @llvm.amdgcn.icmp.i32(i32 %src, i32 100, i32 34)
250 store i64 %result, ptr addrspace(1) %out
254 define amdgpu_kernel void @v_icmp_i32_uge(ptr addrspace(1) %out, i32 %src) {
255 ; GFX11-LABEL: v_icmp_i32_uge:
257 ; GFX11-NEXT: s_clause 0x1
258 ; GFX11-NEXT: s_load_b32 s2, s[0:1], 0x2c
259 ; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x24
260 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
261 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
262 ; GFX11-NEXT: v_cmp_le_u32_e64 s[2:3], 0x64, s2
263 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
264 ; GFX11-NEXT: v_mov_b32_e32 v0, s2
265 ; GFX11-NEXT: v_mov_b32_e32 v1, s3
266 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
267 ; GFX11-NEXT: s_nop 0
268 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
269 ; GFX11-NEXT: s_endpgm
271 ; SDAG-VI-LABEL: v_icmp_i32_uge:
273 ; SDAG-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
274 ; SDAG-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
275 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, 0x64
276 ; SDAG-VI-NEXT: s_waitcnt lgkmcnt(0)
277 ; SDAG-VI-NEXT: v_cmp_ge_u32_e64 s[2:3], s2, v0
278 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, s0
279 ; SDAG-VI-NEXT: v_mov_b32_e32 v2, s2
280 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, s1
281 ; SDAG-VI-NEXT: v_mov_b32_e32 v3, s3
282 ; SDAG-VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3]
283 ; SDAG-VI-NEXT: s_endpgm
285 ; GFX9-LABEL: v_icmp_i32_uge:
287 ; GFX9-NEXT: s_load_dword s4, s[0:1], 0x2c
288 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
289 ; GFX9-NEXT: v_mov_b32_e32 v0, 0x64
290 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
291 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
292 ; GFX9-NEXT: v_cmp_ge_u32_e64 s[0:1], s4, v0
293 ; GFX9-NEXT: v_mov_b32_e32 v0, s0
294 ; GFX9-NEXT: v_mov_b32_e32 v1, s1
295 ; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[2:3]
296 ; GFX9-NEXT: s_endpgm
298 ; GISEL-VI-LABEL: v_icmp_i32_uge:
300 ; GISEL-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
301 ; GISEL-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
302 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, 0x64
303 ; GISEL-VI-NEXT: s_waitcnt lgkmcnt(0)
304 ; GISEL-VI-NEXT: v_cmp_ge_u32_e64 s[2:3], s2, v0
305 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, s2
306 ; GISEL-VI-NEXT: v_mov_b32_e32 v3, s1
307 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, s3
308 ; GISEL-VI-NEXT: v_mov_b32_e32 v2, s0
309 ; GISEL-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
310 ; GISEL-VI-NEXT: s_endpgm
311 %result = call i64 @llvm.amdgcn.icmp.i32(i32 %src, i32 100, i32 35)
312 store i64 %result, ptr addrspace(1) %out
316 define amdgpu_kernel void @v_icmp_i32_ult(ptr addrspace(1) %out, i32 %src) {
317 ; GFX11-LABEL: v_icmp_i32_ult:
319 ; GFX11-NEXT: s_clause 0x1
320 ; GFX11-NEXT: s_load_b32 s2, s[0:1], 0x2c
321 ; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x24
322 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
323 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
324 ; GFX11-NEXT: v_cmp_gt_u32_e64 s[2:3], 0x64, s2
325 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
326 ; GFX11-NEXT: v_mov_b32_e32 v0, s2
327 ; GFX11-NEXT: v_mov_b32_e32 v1, s3
328 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
329 ; GFX11-NEXT: s_nop 0
330 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
331 ; GFX11-NEXT: s_endpgm
333 ; SDAG-VI-LABEL: v_icmp_i32_ult:
335 ; SDAG-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
336 ; SDAG-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
337 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, 0x64
338 ; SDAG-VI-NEXT: s_waitcnt lgkmcnt(0)
339 ; SDAG-VI-NEXT: v_cmp_lt_u32_e64 s[2:3], s2, v0
340 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, s0
341 ; SDAG-VI-NEXT: v_mov_b32_e32 v2, s2
342 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, s1
343 ; SDAG-VI-NEXT: v_mov_b32_e32 v3, s3
344 ; SDAG-VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3]
345 ; SDAG-VI-NEXT: s_endpgm
347 ; GFX9-LABEL: v_icmp_i32_ult:
349 ; GFX9-NEXT: s_load_dword s4, s[0:1], 0x2c
350 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
351 ; GFX9-NEXT: v_mov_b32_e32 v0, 0x64
352 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
353 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
354 ; GFX9-NEXT: v_cmp_lt_u32_e64 s[0:1], s4, v0
355 ; GFX9-NEXT: v_mov_b32_e32 v0, s0
356 ; GFX9-NEXT: v_mov_b32_e32 v1, s1
357 ; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[2:3]
358 ; GFX9-NEXT: s_endpgm
360 ; GISEL-VI-LABEL: v_icmp_i32_ult:
362 ; GISEL-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
363 ; GISEL-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
364 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, 0x64
365 ; GISEL-VI-NEXT: s_waitcnt lgkmcnt(0)
366 ; GISEL-VI-NEXT: v_cmp_lt_u32_e64 s[2:3], s2, v0
367 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, s2
368 ; GISEL-VI-NEXT: v_mov_b32_e32 v3, s1
369 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, s3
370 ; GISEL-VI-NEXT: v_mov_b32_e32 v2, s0
371 ; GISEL-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
372 ; GISEL-VI-NEXT: s_endpgm
373 %result = call i64 @llvm.amdgcn.icmp.i32(i32 %src, i32 100, i32 36)
374 store i64 %result, ptr addrspace(1) %out
378 define amdgpu_kernel void @v_icmp_i32_ule(ptr addrspace(1) %out, i32 %src) {
379 ; GFX11-LABEL: v_icmp_i32_ule:
381 ; GFX11-NEXT: s_clause 0x1
382 ; GFX11-NEXT: s_load_b32 s2, s[0:1], 0x2c
383 ; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x24
384 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
385 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
386 ; GFX11-NEXT: v_cmp_ge_u32_e64 s[2:3], 0x64, s2
387 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
388 ; GFX11-NEXT: v_mov_b32_e32 v0, s2
389 ; GFX11-NEXT: v_mov_b32_e32 v1, s3
390 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
391 ; GFX11-NEXT: s_nop 0
392 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
393 ; GFX11-NEXT: s_endpgm
395 ; SDAG-VI-LABEL: v_icmp_i32_ule:
397 ; SDAG-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
398 ; SDAG-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
399 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, 0x64
400 ; SDAG-VI-NEXT: s_waitcnt lgkmcnt(0)
401 ; SDAG-VI-NEXT: v_cmp_le_u32_e64 s[2:3], s2, v0
402 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, s0
403 ; SDAG-VI-NEXT: v_mov_b32_e32 v2, s2
404 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, s1
405 ; SDAG-VI-NEXT: v_mov_b32_e32 v3, s3
406 ; SDAG-VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3]
407 ; SDAG-VI-NEXT: s_endpgm
409 ; GFX9-LABEL: v_icmp_i32_ule:
411 ; GFX9-NEXT: s_load_dword s4, s[0:1], 0x2c
412 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
413 ; GFX9-NEXT: v_mov_b32_e32 v0, 0x64
414 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
415 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
416 ; GFX9-NEXT: v_cmp_le_u32_e64 s[0:1], s4, v0
417 ; GFX9-NEXT: v_mov_b32_e32 v0, s0
418 ; GFX9-NEXT: v_mov_b32_e32 v1, s1
419 ; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[2:3]
420 ; GFX9-NEXT: s_endpgm
422 ; GISEL-VI-LABEL: v_icmp_i32_ule:
424 ; GISEL-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
425 ; GISEL-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
426 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, 0x64
427 ; GISEL-VI-NEXT: s_waitcnt lgkmcnt(0)
428 ; GISEL-VI-NEXT: v_cmp_le_u32_e64 s[2:3], s2, v0
429 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, s2
430 ; GISEL-VI-NEXT: v_mov_b32_e32 v3, s1
431 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, s3
432 ; GISEL-VI-NEXT: v_mov_b32_e32 v2, s0
433 ; GISEL-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
434 ; GISEL-VI-NEXT: s_endpgm
435 %result = call i64 @llvm.amdgcn.icmp.i32(i32 %src, i32 100, i32 37)
436 store i64 %result, ptr addrspace(1) %out
440 define amdgpu_kernel void @v_icmp_i32_sgt(ptr addrspace(1) %out, i32 %src) #1 {
441 ; GFX11-LABEL: v_icmp_i32_sgt:
443 ; GFX11-NEXT: s_clause 0x1
444 ; GFX11-NEXT: s_load_b32 s2, s[0:1], 0x2c
445 ; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x24
446 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
447 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
448 ; GFX11-NEXT: v_cmp_lt_i32_e64 s[2:3], 0x64, s2
449 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
450 ; GFX11-NEXT: v_mov_b32_e32 v0, s2
451 ; GFX11-NEXT: v_mov_b32_e32 v1, s3
452 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
453 ; GFX11-NEXT: s_nop 0
454 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
455 ; GFX11-NEXT: s_endpgm
457 ; SDAG-VI-LABEL: v_icmp_i32_sgt:
459 ; SDAG-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
460 ; SDAG-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
461 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, 0x64
462 ; SDAG-VI-NEXT: s_waitcnt lgkmcnt(0)
463 ; SDAG-VI-NEXT: v_cmp_gt_i32_e64 s[2:3], s2, v0
464 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, s0
465 ; SDAG-VI-NEXT: v_mov_b32_e32 v2, s2
466 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, s1
467 ; SDAG-VI-NEXT: v_mov_b32_e32 v3, s3
468 ; SDAG-VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3]
469 ; SDAG-VI-NEXT: s_endpgm
471 ; GFX9-LABEL: v_icmp_i32_sgt:
473 ; GFX9-NEXT: s_load_dword s4, s[0:1], 0x2c
474 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
475 ; GFX9-NEXT: v_mov_b32_e32 v0, 0x64
476 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
477 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
478 ; GFX9-NEXT: v_cmp_gt_i32_e64 s[0:1], s4, v0
479 ; GFX9-NEXT: v_mov_b32_e32 v0, s0
480 ; GFX9-NEXT: v_mov_b32_e32 v1, s1
481 ; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[2:3]
482 ; GFX9-NEXT: s_endpgm
484 ; GISEL-VI-LABEL: v_icmp_i32_sgt:
486 ; GISEL-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
487 ; GISEL-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
488 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, 0x64
489 ; GISEL-VI-NEXT: s_waitcnt lgkmcnt(0)
490 ; GISEL-VI-NEXT: v_cmp_gt_i32_e64 s[2:3], s2, v0
491 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, s2
492 ; GISEL-VI-NEXT: v_mov_b32_e32 v3, s1
493 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, s3
494 ; GISEL-VI-NEXT: v_mov_b32_e32 v2, s0
495 ; GISEL-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
496 ; GISEL-VI-NEXT: s_endpgm
497 %result = call i64 @llvm.amdgcn.icmp.i32(i32 %src, i32 100, i32 38)
498 store i64 %result, ptr addrspace(1) %out
502 define amdgpu_kernel void @v_icmp_i32_sge(ptr addrspace(1) %out, i32 %src) {
503 ; GFX11-LABEL: v_icmp_i32_sge:
505 ; GFX11-NEXT: s_clause 0x1
506 ; GFX11-NEXT: s_load_b32 s2, s[0:1], 0x2c
507 ; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x24
508 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
509 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
510 ; GFX11-NEXT: v_cmp_le_i32_e64 s[2:3], 0x64, s2
511 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
512 ; GFX11-NEXT: v_mov_b32_e32 v0, s2
513 ; GFX11-NEXT: v_mov_b32_e32 v1, s3
514 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
515 ; GFX11-NEXT: s_nop 0
516 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
517 ; GFX11-NEXT: s_endpgm
519 ; SDAG-VI-LABEL: v_icmp_i32_sge:
521 ; SDAG-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
522 ; SDAG-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
523 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, 0x64
524 ; SDAG-VI-NEXT: s_waitcnt lgkmcnt(0)
525 ; SDAG-VI-NEXT: v_cmp_ge_i32_e64 s[2:3], s2, v0
526 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, s0
527 ; SDAG-VI-NEXT: v_mov_b32_e32 v2, s2
528 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, s1
529 ; SDAG-VI-NEXT: v_mov_b32_e32 v3, s3
530 ; SDAG-VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3]
531 ; SDAG-VI-NEXT: s_endpgm
533 ; GFX9-LABEL: v_icmp_i32_sge:
535 ; GFX9-NEXT: s_load_dword s4, s[0:1], 0x2c
536 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
537 ; GFX9-NEXT: v_mov_b32_e32 v0, 0x64
538 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
539 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
540 ; GFX9-NEXT: v_cmp_ge_i32_e64 s[0:1], s4, v0
541 ; GFX9-NEXT: v_mov_b32_e32 v0, s0
542 ; GFX9-NEXT: v_mov_b32_e32 v1, s1
543 ; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[2:3]
544 ; GFX9-NEXT: s_endpgm
546 ; GISEL-VI-LABEL: v_icmp_i32_sge:
548 ; GISEL-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
549 ; GISEL-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
550 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, 0x64
551 ; GISEL-VI-NEXT: s_waitcnt lgkmcnt(0)
552 ; GISEL-VI-NEXT: v_cmp_ge_i32_e64 s[2:3], s2, v0
553 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, s2
554 ; GISEL-VI-NEXT: v_mov_b32_e32 v3, s1
555 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, s3
556 ; GISEL-VI-NEXT: v_mov_b32_e32 v2, s0
557 ; GISEL-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
558 ; GISEL-VI-NEXT: s_endpgm
559 %result = call i64 @llvm.amdgcn.icmp.i32(i32 %src, i32 100, i32 39)
560 store i64 %result, ptr addrspace(1) %out
564 define amdgpu_kernel void @v_icmp_i32_slt(ptr addrspace(1) %out, i32 %src) {
565 ; GFX11-LABEL: v_icmp_i32_slt:
567 ; GFX11-NEXT: s_clause 0x1
568 ; GFX11-NEXT: s_load_b32 s2, s[0:1], 0x2c
569 ; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x24
570 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
571 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
572 ; GFX11-NEXT: v_cmp_gt_i32_e64 s[2:3], 0x64, s2
573 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
574 ; GFX11-NEXT: v_mov_b32_e32 v0, s2
575 ; GFX11-NEXT: v_mov_b32_e32 v1, s3
576 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
577 ; GFX11-NEXT: s_nop 0
578 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
579 ; GFX11-NEXT: s_endpgm
581 ; SDAG-VI-LABEL: v_icmp_i32_slt:
583 ; SDAG-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
584 ; SDAG-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
585 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, 0x64
586 ; SDAG-VI-NEXT: s_waitcnt lgkmcnt(0)
587 ; SDAG-VI-NEXT: v_cmp_lt_i32_e64 s[2:3], s2, v0
588 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, s0
589 ; SDAG-VI-NEXT: v_mov_b32_e32 v2, s2
590 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, s1
591 ; SDAG-VI-NEXT: v_mov_b32_e32 v3, s3
592 ; SDAG-VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3]
593 ; SDAG-VI-NEXT: s_endpgm
595 ; GFX9-LABEL: v_icmp_i32_slt:
597 ; GFX9-NEXT: s_load_dword s4, s[0:1], 0x2c
598 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
599 ; GFX9-NEXT: v_mov_b32_e32 v0, 0x64
600 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
601 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
602 ; GFX9-NEXT: v_cmp_lt_i32_e64 s[0:1], s4, v0
603 ; GFX9-NEXT: v_mov_b32_e32 v0, s0
604 ; GFX9-NEXT: v_mov_b32_e32 v1, s1
605 ; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[2:3]
606 ; GFX9-NEXT: s_endpgm
608 ; GISEL-VI-LABEL: v_icmp_i32_slt:
610 ; GISEL-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
611 ; GISEL-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
612 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, 0x64
613 ; GISEL-VI-NEXT: s_waitcnt lgkmcnt(0)
614 ; GISEL-VI-NEXT: v_cmp_lt_i32_e64 s[2:3], s2, v0
615 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, s2
616 ; GISEL-VI-NEXT: v_mov_b32_e32 v3, s1
617 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, s3
618 ; GISEL-VI-NEXT: v_mov_b32_e32 v2, s0
619 ; GISEL-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
620 ; GISEL-VI-NEXT: s_endpgm
621 %result = call i64 @llvm.amdgcn.icmp.i32(i32 %src, i32 100, i32 40)
622 store i64 %result, ptr addrspace(1) %out
626 define amdgpu_kernel void @v_icmp_i32_sle(ptr addrspace(1) %out, i32 %src) {
627 ; GFX11-LABEL: v_icmp_i32_sle:
629 ; GFX11-NEXT: s_clause 0x1
630 ; GFX11-NEXT: s_load_b32 s2, s[0:1], 0x2c
631 ; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x24
632 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
633 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
634 ; GFX11-NEXT: v_cmp_ge_i32_e64 s[2:3], 0x64, s2
635 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
636 ; GFX11-NEXT: v_mov_b32_e32 v0, s2
637 ; GFX11-NEXT: v_mov_b32_e32 v1, s3
638 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
639 ; GFX11-NEXT: s_nop 0
640 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
641 ; GFX11-NEXT: s_endpgm
643 ; SDAG-VI-LABEL: v_icmp_i32_sle:
645 ; SDAG-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
646 ; SDAG-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
647 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, 0x64
648 ; SDAG-VI-NEXT: s_waitcnt lgkmcnt(0)
649 ; SDAG-VI-NEXT: v_cmp_le_i32_e64 s[2:3], s2, v0
650 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, s0
651 ; SDAG-VI-NEXT: v_mov_b32_e32 v2, s2
652 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, s1
653 ; SDAG-VI-NEXT: v_mov_b32_e32 v3, s3
654 ; SDAG-VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3]
655 ; SDAG-VI-NEXT: s_endpgm
657 ; GFX9-LABEL: v_icmp_i32_sle:
659 ; GFX9-NEXT: s_load_dword s4, s[0:1], 0x2c
660 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
661 ; GFX9-NEXT: v_mov_b32_e32 v0, 0x64
662 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
663 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
664 ; GFX9-NEXT: v_cmp_le_i32_e64 s[0:1], s4, v0
665 ; GFX9-NEXT: v_mov_b32_e32 v0, s0
666 ; GFX9-NEXT: v_mov_b32_e32 v1, s1
667 ; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[2:3]
668 ; GFX9-NEXT: s_endpgm
670 ; GISEL-VI-LABEL: v_icmp_i32_sle:
672 ; GISEL-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
673 ; GISEL-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
674 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, 0x64
675 ; GISEL-VI-NEXT: s_waitcnt lgkmcnt(0)
676 ; GISEL-VI-NEXT: v_cmp_le_i32_e64 s[2:3], s2, v0
677 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, s2
678 ; GISEL-VI-NEXT: v_mov_b32_e32 v3, s1
679 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, s3
680 ; GISEL-VI-NEXT: v_mov_b32_e32 v2, s0
681 ; GISEL-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
682 ; GISEL-VI-NEXT: s_endpgm
683 %result = call i64 @llvm.amdgcn.icmp.i32(i32 %src, i32 100, i32 41)
684 store i64 %result, ptr addrspace(1) %out
688 define amdgpu_kernel void @v_icmp_i64_eq(ptr addrspace(1) %out, i64 %src) {
689 ; GFX11-LABEL: v_icmp_i64_eq:
691 ; GFX11-NEXT: s_load_b128 s[0:3], s[0:1], 0x24
692 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
693 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
694 ; GFX11-NEXT: v_cmp_eq_u64_e64 s[2:3], 0x64, s[2:3]
695 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
696 ; GFX11-NEXT: v_mov_b32_e32 v0, s2
697 ; GFX11-NEXT: v_mov_b32_e32 v1, s3
698 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
699 ; GFX11-NEXT: s_nop 0
700 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
701 ; GFX11-NEXT: s_endpgm
703 ; SDAG-VI-LABEL: v_icmp_i64_eq:
705 ; SDAG-VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
706 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, 0x64
707 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, 0
708 ; SDAG-VI-NEXT: s_waitcnt lgkmcnt(0)
709 ; SDAG-VI-NEXT: v_cmp_eq_u64_e64 s[2:3], s[2:3], v[0:1]
710 ; SDAG-VI-NEXT: v_mov_b32_e32 v2, s0
711 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, s2
712 ; SDAG-VI-NEXT: v_mov_b32_e32 v3, s1
713 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, s3
714 ; SDAG-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
715 ; SDAG-VI-NEXT: s_endpgm
717 ; GFX9-LABEL: v_icmp_i64_eq:
719 ; GFX9-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
720 ; GFX9-NEXT: v_mov_b32_e32 v0, 0x64
721 ; GFX9-NEXT: v_mov_b32_e32 v1, 0
722 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
723 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
724 ; GFX9-NEXT: v_cmp_eq_u64_e64 s[2:3], s[2:3], v[0:1]
725 ; GFX9-NEXT: v_mov_b32_e32 v0, s2
726 ; GFX9-NEXT: v_mov_b32_e32 v1, s3
727 ; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[0:1]
728 ; GFX9-NEXT: s_endpgm
730 ; GISEL-VI-LABEL: v_icmp_i64_eq:
732 ; GISEL-VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
733 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, 0x64
734 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, 0
735 ; GISEL-VI-NEXT: s_waitcnt lgkmcnt(0)
736 ; GISEL-VI-NEXT: v_cmp_eq_u64_e64 s[2:3], s[2:3], v[0:1]
737 ; GISEL-VI-NEXT: v_mov_b32_e32 v3, s1
738 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, s2
739 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, s3
740 ; GISEL-VI-NEXT: v_mov_b32_e32 v2, s0
741 ; GISEL-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
742 ; GISEL-VI-NEXT: s_endpgm
743 %result = call i64 @llvm.amdgcn.icmp.i64(i64 %src, i64 100, i32 32)
744 store i64 %result, ptr addrspace(1) %out
748 define amdgpu_kernel void @v_icmp_i64_ne(ptr addrspace(1) %out, i64 %src) {
749 ; GFX11-LABEL: v_icmp_i64_ne:
751 ; GFX11-NEXT: s_load_b128 s[0:3], s[0:1], 0x24
752 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
753 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
754 ; GFX11-NEXT: v_cmp_ne_u64_e64 s[2:3], 0x64, s[2:3]
755 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
756 ; GFX11-NEXT: v_mov_b32_e32 v0, s2
757 ; GFX11-NEXT: v_mov_b32_e32 v1, s3
758 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
759 ; GFX11-NEXT: s_nop 0
760 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
761 ; GFX11-NEXT: s_endpgm
763 ; SDAG-VI-LABEL: v_icmp_i64_ne:
765 ; SDAG-VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
766 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, 0x64
767 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, 0
768 ; SDAG-VI-NEXT: s_waitcnt lgkmcnt(0)
769 ; SDAG-VI-NEXT: v_cmp_ne_u64_e64 s[2:3], s[2:3], v[0:1]
770 ; SDAG-VI-NEXT: v_mov_b32_e32 v2, s0
771 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, s2
772 ; SDAG-VI-NEXT: v_mov_b32_e32 v3, s1
773 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, s3
774 ; SDAG-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
775 ; SDAG-VI-NEXT: s_endpgm
777 ; GFX9-LABEL: v_icmp_i64_ne:
779 ; GFX9-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
780 ; GFX9-NEXT: v_mov_b32_e32 v0, 0x64
781 ; GFX9-NEXT: v_mov_b32_e32 v1, 0
782 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
783 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
784 ; GFX9-NEXT: v_cmp_ne_u64_e64 s[2:3], s[2:3], v[0:1]
785 ; GFX9-NEXT: v_mov_b32_e32 v0, s2
786 ; GFX9-NEXT: v_mov_b32_e32 v1, s3
787 ; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[0:1]
788 ; GFX9-NEXT: s_endpgm
790 ; GISEL-VI-LABEL: v_icmp_i64_ne:
792 ; GISEL-VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
793 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, 0x64
794 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, 0
795 ; GISEL-VI-NEXT: s_waitcnt lgkmcnt(0)
796 ; GISEL-VI-NEXT: v_cmp_ne_u64_e64 s[2:3], s[2:3], v[0:1]
797 ; GISEL-VI-NEXT: v_mov_b32_e32 v3, s1
798 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, s2
799 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, s3
800 ; GISEL-VI-NEXT: v_mov_b32_e32 v2, s0
801 ; GISEL-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
802 ; GISEL-VI-NEXT: s_endpgm
803 %result = call i64 @llvm.amdgcn.icmp.i64(i64 %src, i64 100, i32 33)
804 store i64 %result, ptr addrspace(1) %out
808 define amdgpu_kernel void @v_icmp_u64_ugt(ptr addrspace(1) %out, i64 %src) {
809 ; GFX11-LABEL: v_icmp_u64_ugt:
811 ; GFX11-NEXT: s_load_b128 s[0:3], s[0:1], 0x24
812 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
813 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
814 ; GFX11-NEXT: v_cmp_lt_u64_e64 s[2:3], 0x64, s[2:3]
815 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
816 ; GFX11-NEXT: v_mov_b32_e32 v0, s2
817 ; GFX11-NEXT: v_mov_b32_e32 v1, s3
818 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
819 ; GFX11-NEXT: s_nop 0
820 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
821 ; GFX11-NEXT: s_endpgm
823 ; SDAG-VI-LABEL: v_icmp_u64_ugt:
825 ; SDAG-VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
826 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, 0x64
827 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, 0
828 ; SDAG-VI-NEXT: s_waitcnt lgkmcnt(0)
829 ; SDAG-VI-NEXT: v_cmp_gt_u64_e64 s[2:3], s[2:3], v[0:1]
830 ; SDAG-VI-NEXT: v_mov_b32_e32 v2, s0
831 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, s2
832 ; SDAG-VI-NEXT: v_mov_b32_e32 v3, s1
833 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, s3
834 ; SDAG-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
835 ; SDAG-VI-NEXT: s_endpgm
837 ; GFX9-LABEL: v_icmp_u64_ugt:
839 ; GFX9-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
840 ; GFX9-NEXT: v_mov_b32_e32 v0, 0x64
841 ; GFX9-NEXT: v_mov_b32_e32 v1, 0
842 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
843 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
844 ; GFX9-NEXT: v_cmp_gt_u64_e64 s[2:3], s[2:3], v[0:1]
845 ; GFX9-NEXT: v_mov_b32_e32 v0, s2
846 ; GFX9-NEXT: v_mov_b32_e32 v1, s3
847 ; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[0:1]
848 ; GFX9-NEXT: s_endpgm
850 ; GISEL-VI-LABEL: v_icmp_u64_ugt:
852 ; GISEL-VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
853 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, 0x64
854 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, 0
855 ; GISEL-VI-NEXT: s_waitcnt lgkmcnt(0)
856 ; GISEL-VI-NEXT: v_cmp_gt_u64_e64 s[2:3], s[2:3], v[0:1]
857 ; GISEL-VI-NEXT: v_mov_b32_e32 v3, s1
858 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, s2
859 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, s3
860 ; GISEL-VI-NEXT: v_mov_b32_e32 v2, s0
861 ; GISEL-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
862 ; GISEL-VI-NEXT: s_endpgm
863 %result = call i64 @llvm.amdgcn.icmp.i64(i64 %src, i64 100, i32 34)
864 store i64 %result, ptr addrspace(1) %out
868 define amdgpu_kernel void @v_icmp_u64_uge(ptr addrspace(1) %out, i64 %src) {
869 ; GFX11-LABEL: v_icmp_u64_uge:
871 ; GFX11-NEXT: s_load_b128 s[0:3], s[0:1], 0x24
872 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
873 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
874 ; GFX11-NEXT: v_cmp_le_u64_e64 s[2:3], 0x64, s[2:3]
875 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
876 ; GFX11-NEXT: v_mov_b32_e32 v0, s2
877 ; GFX11-NEXT: v_mov_b32_e32 v1, s3
878 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
879 ; GFX11-NEXT: s_nop 0
880 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
881 ; GFX11-NEXT: s_endpgm
883 ; SDAG-VI-LABEL: v_icmp_u64_uge:
885 ; SDAG-VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
886 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, 0x64
887 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, 0
888 ; SDAG-VI-NEXT: s_waitcnt lgkmcnt(0)
889 ; SDAG-VI-NEXT: v_cmp_ge_u64_e64 s[2:3], s[2:3], v[0:1]
890 ; SDAG-VI-NEXT: v_mov_b32_e32 v2, s0
891 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, s2
892 ; SDAG-VI-NEXT: v_mov_b32_e32 v3, s1
893 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, s3
894 ; SDAG-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
895 ; SDAG-VI-NEXT: s_endpgm
897 ; GFX9-LABEL: v_icmp_u64_uge:
899 ; GFX9-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
900 ; GFX9-NEXT: v_mov_b32_e32 v0, 0x64
901 ; GFX9-NEXT: v_mov_b32_e32 v1, 0
902 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
903 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
904 ; GFX9-NEXT: v_cmp_ge_u64_e64 s[2:3], s[2:3], v[0:1]
905 ; GFX9-NEXT: v_mov_b32_e32 v0, s2
906 ; GFX9-NEXT: v_mov_b32_e32 v1, s3
907 ; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[0:1]
908 ; GFX9-NEXT: s_endpgm
910 ; GISEL-VI-LABEL: v_icmp_u64_uge:
912 ; GISEL-VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
913 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, 0x64
914 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, 0
915 ; GISEL-VI-NEXT: s_waitcnt lgkmcnt(0)
916 ; GISEL-VI-NEXT: v_cmp_ge_u64_e64 s[2:3], s[2:3], v[0:1]
917 ; GISEL-VI-NEXT: v_mov_b32_e32 v3, s1
918 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, s2
919 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, s3
920 ; GISEL-VI-NEXT: v_mov_b32_e32 v2, s0
921 ; GISEL-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
922 ; GISEL-VI-NEXT: s_endpgm
923 %result = call i64 @llvm.amdgcn.icmp.i64(i64 %src, i64 100, i32 35)
924 store i64 %result, ptr addrspace(1) %out
928 define amdgpu_kernel void @v_icmp_u64_ult(ptr addrspace(1) %out, i64 %src) {
929 ; GFX11-LABEL: v_icmp_u64_ult:
931 ; GFX11-NEXT: s_load_b128 s[0:3], s[0:1], 0x24
932 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
933 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
934 ; GFX11-NEXT: v_cmp_gt_u64_e64 s[2:3], 0x64, s[2:3]
935 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
936 ; GFX11-NEXT: v_mov_b32_e32 v0, s2
937 ; GFX11-NEXT: v_mov_b32_e32 v1, s3
938 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
939 ; GFX11-NEXT: s_nop 0
940 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
941 ; GFX11-NEXT: s_endpgm
943 ; SDAG-VI-LABEL: v_icmp_u64_ult:
945 ; SDAG-VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
946 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, 0x64
947 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, 0
948 ; SDAG-VI-NEXT: s_waitcnt lgkmcnt(0)
949 ; SDAG-VI-NEXT: v_cmp_lt_u64_e64 s[2:3], s[2:3], v[0:1]
950 ; SDAG-VI-NEXT: v_mov_b32_e32 v2, s0
951 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, s2
952 ; SDAG-VI-NEXT: v_mov_b32_e32 v3, s1
953 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, s3
954 ; SDAG-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
955 ; SDAG-VI-NEXT: s_endpgm
957 ; GFX9-LABEL: v_icmp_u64_ult:
959 ; GFX9-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
960 ; GFX9-NEXT: v_mov_b32_e32 v0, 0x64
961 ; GFX9-NEXT: v_mov_b32_e32 v1, 0
962 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
963 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
964 ; GFX9-NEXT: v_cmp_lt_u64_e64 s[2:3], s[2:3], v[0:1]
965 ; GFX9-NEXT: v_mov_b32_e32 v0, s2
966 ; GFX9-NEXT: v_mov_b32_e32 v1, s3
967 ; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[0:1]
968 ; GFX9-NEXT: s_endpgm
970 ; GISEL-VI-LABEL: v_icmp_u64_ult:
972 ; GISEL-VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
973 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, 0x64
974 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, 0
975 ; GISEL-VI-NEXT: s_waitcnt lgkmcnt(0)
976 ; GISEL-VI-NEXT: v_cmp_lt_u64_e64 s[2:3], s[2:3], v[0:1]
977 ; GISEL-VI-NEXT: v_mov_b32_e32 v3, s1
978 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, s2
979 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, s3
980 ; GISEL-VI-NEXT: v_mov_b32_e32 v2, s0
981 ; GISEL-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
982 ; GISEL-VI-NEXT: s_endpgm
983 %result = call i64 @llvm.amdgcn.icmp.i64(i64 %src, i64 100, i32 36)
984 store i64 %result, ptr addrspace(1) %out
988 define amdgpu_kernel void @v_icmp_u64_ule(ptr addrspace(1) %out, i64 %src) {
989 ; GFX11-LABEL: v_icmp_u64_ule:
991 ; GFX11-NEXT: s_load_b128 s[0:3], s[0:1], 0x24
992 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
993 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
994 ; GFX11-NEXT: v_cmp_ge_u64_e64 s[2:3], 0x64, s[2:3]
995 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
996 ; GFX11-NEXT: v_mov_b32_e32 v0, s2
997 ; GFX11-NEXT: v_mov_b32_e32 v1, s3
998 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
999 ; GFX11-NEXT: s_nop 0
1000 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1001 ; GFX11-NEXT: s_endpgm
1003 ; SDAG-VI-LABEL: v_icmp_u64_ule:
1005 ; SDAG-VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
1006 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, 0x64
1007 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, 0
1008 ; SDAG-VI-NEXT: s_waitcnt lgkmcnt(0)
1009 ; SDAG-VI-NEXT: v_cmp_le_u64_e64 s[2:3], s[2:3], v[0:1]
1010 ; SDAG-VI-NEXT: v_mov_b32_e32 v2, s0
1011 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, s2
1012 ; SDAG-VI-NEXT: v_mov_b32_e32 v3, s1
1013 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, s3
1014 ; SDAG-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
1015 ; SDAG-VI-NEXT: s_endpgm
1017 ; GFX9-LABEL: v_icmp_u64_ule:
1019 ; GFX9-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
1020 ; GFX9-NEXT: v_mov_b32_e32 v0, 0x64
1021 ; GFX9-NEXT: v_mov_b32_e32 v1, 0
1022 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
1023 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
1024 ; GFX9-NEXT: v_cmp_le_u64_e64 s[2:3], s[2:3], v[0:1]
1025 ; GFX9-NEXT: v_mov_b32_e32 v0, s2
1026 ; GFX9-NEXT: v_mov_b32_e32 v1, s3
1027 ; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[0:1]
1028 ; GFX9-NEXT: s_endpgm
1030 ; GISEL-VI-LABEL: v_icmp_u64_ule:
1031 ; GISEL-VI: ; %bb.0:
1032 ; GISEL-VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
1033 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, 0x64
1034 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, 0
1035 ; GISEL-VI-NEXT: s_waitcnt lgkmcnt(0)
1036 ; GISEL-VI-NEXT: v_cmp_le_u64_e64 s[2:3], s[2:3], v[0:1]
1037 ; GISEL-VI-NEXT: v_mov_b32_e32 v3, s1
1038 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, s2
1039 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, s3
1040 ; GISEL-VI-NEXT: v_mov_b32_e32 v2, s0
1041 ; GISEL-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
1042 ; GISEL-VI-NEXT: s_endpgm
1043 %result = call i64 @llvm.amdgcn.icmp.i64(i64 %src, i64 100, i32 37)
1044 store i64 %result, ptr addrspace(1) %out
1048 define amdgpu_kernel void @v_icmp_i64_sgt(ptr addrspace(1) %out, i64 %src) {
1049 ; GFX11-LABEL: v_icmp_i64_sgt:
1051 ; GFX11-NEXT: s_load_b128 s[0:3], s[0:1], 0x24
1052 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
1053 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
1054 ; GFX11-NEXT: v_cmp_lt_i64_e64 s[2:3], 0x64, s[2:3]
1055 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
1056 ; GFX11-NEXT: v_mov_b32_e32 v0, s2
1057 ; GFX11-NEXT: v_mov_b32_e32 v1, s3
1058 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
1059 ; GFX11-NEXT: s_nop 0
1060 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1061 ; GFX11-NEXT: s_endpgm
1063 ; SDAG-VI-LABEL: v_icmp_i64_sgt:
1065 ; SDAG-VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
1066 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, 0x64
1067 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, 0
1068 ; SDAG-VI-NEXT: s_waitcnt lgkmcnt(0)
1069 ; SDAG-VI-NEXT: v_cmp_gt_i64_e64 s[2:3], s[2:3], v[0:1]
1070 ; SDAG-VI-NEXT: v_mov_b32_e32 v2, s0
1071 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, s2
1072 ; SDAG-VI-NEXT: v_mov_b32_e32 v3, s1
1073 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, s3
1074 ; SDAG-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
1075 ; SDAG-VI-NEXT: s_endpgm
1077 ; GFX9-LABEL: v_icmp_i64_sgt:
1079 ; GFX9-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
1080 ; GFX9-NEXT: v_mov_b32_e32 v0, 0x64
1081 ; GFX9-NEXT: v_mov_b32_e32 v1, 0
1082 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
1083 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
1084 ; GFX9-NEXT: v_cmp_gt_i64_e64 s[2:3], s[2:3], v[0:1]
1085 ; GFX9-NEXT: v_mov_b32_e32 v0, s2
1086 ; GFX9-NEXT: v_mov_b32_e32 v1, s3
1087 ; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[0:1]
1088 ; GFX9-NEXT: s_endpgm
1090 ; GISEL-VI-LABEL: v_icmp_i64_sgt:
1091 ; GISEL-VI: ; %bb.0:
1092 ; GISEL-VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
1093 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, 0x64
1094 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, 0
1095 ; GISEL-VI-NEXT: s_waitcnt lgkmcnt(0)
1096 ; GISEL-VI-NEXT: v_cmp_gt_i64_e64 s[2:3], s[2:3], v[0:1]
1097 ; GISEL-VI-NEXT: v_mov_b32_e32 v3, s1
1098 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, s2
1099 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, s3
1100 ; GISEL-VI-NEXT: v_mov_b32_e32 v2, s0
1101 ; GISEL-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
1102 ; GISEL-VI-NEXT: s_endpgm
1103 %result = call i64 @llvm.amdgcn.icmp.i64(i64 %src, i64 100, i32 38)
1104 store i64 %result, ptr addrspace(1) %out
1108 define amdgpu_kernel void @v_icmp_i64_sge(ptr addrspace(1) %out, i64 %src) {
1109 ; GFX11-LABEL: v_icmp_i64_sge:
1111 ; GFX11-NEXT: s_load_b128 s[0:3], s[0:1], 0x24
1112 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
1113 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
1114 ; GFX11-NEXT: v_cmp_le_i64_e64 s[2:3], 0x64, s[2:3]
1115 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
1116 ; GFX11-NEXT: v_mov_b32_e32 v0, s2
1117 ; GFX11-NEXT: v_mov_b32_e32 v1, s3
1118 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
1119 ; GFX11-NEXT: s_nop 0
1120 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1121 ; GFX11-NEXT: s_endpgm
1123 ; SDAG-VI-LABEL: v_icmp_i64_sge:
1125 ; SDAG-VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
1126 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, 0x64
1127 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, 0
1128 ; SDAG-VI-NEXT: s_waitcnt lgkmcnt(0)
1129 ; SDAG-VI-NEXT: v_cmp_ge_i64_e64 s[2:3], s[2:3], v[0:1]
1130 ; SDAG-VI-NEXT: v_mov_b32_e32 v2, s0
1131 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, s2
1132 ; SDAG-VI-NEXT: v_mov_b32_e32 v3, s1
1133 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, s3
1134 ; SDAG-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
1135 ; SDAG-VI-NEXT: s_endpgm
1137 ; GFX9-LABEL: v_icmp_i64_sge:
1139 ; GFX9-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
1140 ; GFX9-NEXT: v_mov_b32_e32 v0, 0x64
1141 ; GFX9-NEXT: v_mov_b32_e32 v1, 0
1142 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
1143 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
1144 ; GFX9-NEXT: v_cmp_ge_i64_e64 s[2:3], s[2:3], v[0:1]
1145 ; GFX9-NEXT: v_mov_b32_e32 v0, s2
1146 ; GFX9-NEXT: v_mov_b32_e32 v1, s3
1147 ; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[0:1]
1148 ; GFX9-NEXT: s_endpgm
1150 ; GISEL-VI-LABEL: v_icmp_i64_sge:
1151 ; GISEL-VI: ; %bb.0:
1152 ; GISEL-VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
1153 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, 0x64
1154 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, 0
1155 ; GISEL-VI-NEXT: s_waitcnt lgkmcnt(0)
1156 ; GISEL-VI-NEXT: v_cmp_ge_i64_e64 s[2:3], s[2:3], v[0:1]
1157 ; GISEL-VI-NEXT: v_mov_b32_e32 v3, s1
1158 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, s2
1159 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, s3
1160 ; GISEL-VI-NEXT: v_mov_b32_e32 v2, s0
1161 ; GISEL-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
1162 ; GISEL-VI-NEXT: s_endpgm
1163 %result = call i64 @llvm.amdgcn.icmp.i64(i64 %src, i64 100, i32 39)
1164 store i64 %result, ptr addrspace(1) %out
1168 define amdgpu_kernel void @v_icmp_i64_slt(ptr addrspace(1) %out, i64 %src) {
1169 ; GFX11-LABEL: v_icmp_i64_slt:
1171 ; GFX11-NEXT: s_load_b128 s[0:3], s[0:1], 0x24
1172 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
1173 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
1174 ; GFX11-NEXT: v_cmp_gt_i64_e64 s[2:3], 0x64, s[2:3]
1175 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
1176 ; GFX11-NEXT: v_mov_b32_e32 v0, s2
1177 ; GFX11-NEXT: v_mov_b32_e32 v1, s3
1178 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
1179 ; GFX11-NEXT: s_nop 0
1180 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1181 ; GFX11-NEXT: s_endpgm
1183 ; SDAG-VI-LABEL: v_icmp_i64_slt:
1185 ; SDAG-VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
1186 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, 0x64
1187 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, 0
1188 ; SDAG-VI-NEXT: s_waitcnt lgkmcnt(0)
1189 ; SDAG-VI-NEXT: v_cmp_lt_i64_e64 s[2:3], s[2:3], v[0:1]
1190 ; SDAG-VI-NEXT: v_mov_b32_e32 v2, s0
1191 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, s2
1192 ; SDAG-VI-NEXT: v_mov_b32_e32 v3, s1
1193 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, s3
1194 ; SDAG-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
1195 ; SDAG-VI-NEXT: s_endpgm
1197 ; GFX9-LABEL: v_icmp_i64_slt:
1199 ; GFX9-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
1200 ; GFX9-NEXT: v_mov_b32_e32 v0, 0x64
1201 ; GFX9-NEXT: v_mov_b32_e32 v1, 0
1202 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
1203 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
1204 ; GFX9-NEXT: v_cmp_lt_i64_e64 s[2:3], s[2:3], v[0:1]
1205 ; GFX9-NEXT: v_mov_b32_e32 v0, s2
1206 ; GFX9-NEXT: v_mov_b32_e32 v1, s3
1207 ; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[0:1]
1208 ; GFX9-NEXT: s_endpgm
1210 ; GISEL-VI-LABEL: v_icmp_i64_slt:
1211 ; GISEL-VI: ; %bb.0:
1212 ; GISEL-VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
1213 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, 0x64
1214 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, 0
1215 ; GISEL-VI-NEXT: s_waitcnt lgkmcnt(0)
1216 ; GISEL-VI-NEXT: v_cmp_lt_i64_e64 s[2:3], s[2:3], v[0:1]
1217 ; GISEL-VI-NEXT: v_mov_b32_e32 v3, s1
1218 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, s2
1219 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, s3
1220 ; GISEL-VI-NEXT: v_mov_b32_e32 v2, s0
1221 ; GISEL-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
1222 ; GISEL-VI-NEXT: s_endpgm
1223 %result = call i64 @llvm.amdgcn.icmp.i64(i64 %src, i64 100, i32 40)
1224 store i64 %result, ptr addrspace(1) %out
1228 define amdgpu_kernel void @v_icmp_i64_sle(ptr addrspace(1) %out, i64 %src) {
1229 ; GFX11-LABEL: v_icmp_i64_sle:
1231 ; GFX11-NEXT: s_load_b128 s[0:3], s[0:1], 0x24
1232 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
1233 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
1234 ; GFX11-NEXT: v_cmp_ge_i64_e64 s[2:3], 0x64, s[2:3]
1235 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
1236 ; GFX11-NEXT: v_mov_b32_e32 v0, s2
1237 ; GFX11-NEXT: v_mov_b32_e32 v1, s3
1238 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
1239 ; GFX11-NEXT: s_nop 0
1240 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1241 ; GFX11-NEXT: s_endpgm
1243 ; SDAG-VI-LABEL: v_icmp_i64_sle:
1245 ; SDAG-VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
1246 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, 0x64
1247 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, 0
1248 ; SDAG-VI-NEXT: s_waitcnt lgkmcnt(0)
1249 ; SDAG-VI-NEXT: v_cmp_le_i64_e64 s[2:3], s[2:3], v[0:1]
1250 ; SDAG-VI-NEXT: v_mov_b32_e32 v2, s0
1251 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, s2
1252 ; SDAG-VI-NEXT: v_mov_b32_e32 v3, s1
1253 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, s3
1254 ; SDAG-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
1255 ; SDAG-VI-NEXT: s_endpgm
1257 ; GFX9-LABEL: v_icmp_i64_sle:
1259 ; GFX9-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
1260 ; GFX9-NEXT: v_mov_b32_e32 v0, 0x64
1261 ; GFX9-NEXT: v_mov_b32_e32 v1, 0
1262 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
1263 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
1264 ; GFX9-NEXT: v_cmp_le_i64_e64 s[2:3], s[2:3], v[0:1]
1265 ; GFX9-NEXT: v_mov_b32_e32 v0, s2
1266 ; GFX9-NEXT: v_mov_b32_e32 v1, s3
1267 ; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[0:1]
1268 ; GFX9-NEXT: s_endpgm
1270 ; GISEL-VI-LABEL: v_icmp_i64_sle:
1271 ; GISEL-VI: ; %bb.0:
1272 ; GISEL-VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
1273 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, 0x64
1274 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, 0
1275 ; GISEL-VI-NEXT: s_waitcnt lgkmcnt(0)
1276 ; GISEL-VI-NEXT: v_cmp_le_i64_e64 s[2:3], s[2:3], v[0:1]
1277 ; GISEL-VI-NEXT: v_mov_b32_e32 v3, s1
1278 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, s2
1279 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, s3
1280 ; GISEL-VI-NEXT: v_mov_b32_e32 v2, s0
1281 ; GISEL-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
1282 ; GISEL-VI-NEXT: s_endpgm
1283 %result = call i64 @llvm.amdgcn.icmp.i64(i64 %src, i64 100, i32 41)
1284 store i64 %result, ptr addrspace(1) %out
1288 define amdgpu_kernel void @v_icmp_i16_eq(ptr addrspace(1) %out, i16 %src) {
1289 ; GFX11-LABEL: v_icmp_i16_eq:
1291 ; GFX11-NEXT: s_clause 0x1
1292 ; GFX11-NEXT: s_load_b32 s2, s[0:1], 0x2c
1293 ; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x24
1294 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
1295 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
1296 ; GFX11-NEXT: v_cmp_eq_u16_e64 s[2:3], 0x64, s2
1297 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
1298 ; GFX11-NEXT: v_mov_b32_e32 v0, s2
1299 ; GFX11-NEXT: v_mov_b32_e32 v1, s3
1300 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
1301 ; GFX11-NEXT: s_nop 0
1302 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1303 ; GFX11-NEXT: s_endpgm
1305 ; SDAG-VI-LABEL: v_icmp_i16_eq:
1307 ; SDAG-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
1308 ; SDAG-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1309 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, 0x64
1310 ; SDAG-VI-NEXT: s_waitcnt lgkmcnt(0)
1311 ; SDAG-VI-NEXT: v_cmp_eq_u16_e64 s[2:3], s2, v0
1312 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, s0
1313 ; SDAG-VI-NEXT: v_mov_b32_e32 v2, s2
1314 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, s1
1315 ; SDAG-VI-NEXT: v_mov_b32_e32 v3, s3
1316 ; SDAG-VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3]
1317 ; SDAG-VI-NEXT: s_endpgm
1319 ; GFX9-LABEL: v_icmp_i16_eq:
1321 ; GFX9-NEXT: s_load_dword s4, s[0:1], 0x2c
1322 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
1323 ; GFX9-NEXT: v_mov_b32_e32 v0, 0x64
1324 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
1325 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
1326 ; GFX9-NEXT: v_cmp_eq_u16_e64 s[0:1], s4, v0
1327 ; GFX9-NEXT: v_mov_b32_e32 v0, s0
1328 ; GFX9-NEXT: v_mov_b32_e32 v1, s1
1329 ; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[2:3]
1330 ; GFX9-NEXT: s_endpgm
1332 ; GISEL-VI-LABEL: v_icmp_i16_eq:
1333 ; GISEL-VI: ; %bb.0:
1334 ; GISEL-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
1335 ; GISEL-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1336 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, 0x64
1337 ; GISEL-VI-NEXT: s_waitcnt lgkmcnt(0)
1338 ; GISEL-VI-NEXT: v_cmp_eq_u16_e64 s[2:3], s2, v0
1339 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, s2
1340 ; GISEL-VI-NEXT: v_mov_b32_e32 v3, s1
1341 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, s3
1342 ; GISEL-VI-NEXT: v_mov_b32_e32 v2, s0
1343 ; GISEL-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
1344 ; GISEL-VI-NEXT: s_endpgm
1345 %result = call i64 @llvm.amdgcn.icmp.i16(i16 %src, i16 100, i32 32)
1346 store i64 %result, ptr addrspace(1) %out
1350 define amdgpu_kernel void @v_icmp_i16(ptr addrspace(1) %out, i16 %src) {
1351 ; SDAG-GFX11-LABEL: v_icmp_i16:
1352 ; SDAG-GFX11: ; %bb.0:
1353 ; SDAG-GFX11-NEXT: s_endpgm
1355 ; SDAG-VI-LABEL: v_icmp_i16:
1357 ; SDAG-VI-NEXT: s_endpgm
1359 ; SDAG-GFX9-LABEL: v_icmp_i16:
1360 ; SDAG-GFX9: ; %bb.0:
1361 ; SDAG-GFX9-NEXT: s_endpgm
1363 ; GISEL-GFX11-LABEL: v_icmp_i16:
1364 ; GISEL-GFX11: ; %bb.0:
1365 ; GISEL-GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x24
1366 ; GISEL-GFX11-NEXT: v_mov_b32_e32 v0, 0
1367 ; GISEL-GFX11-NEXT: s_waitcnt lgkmcnt(0)
1368 ; GISEL-GFX11-NEXT: global_store_b64 v0, v[0:1], s[0:1]
1369 ; GISEL-GFX11-NEXT: s_nop 0
1370 ; GISEL-GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1371 ; GISEL-GFX11-NEXT: s_endpgm
1373 ; GISEL-VI-LABEL: v_icmp_i16:
1374 ; GISEL-VI: ; %bb.0:
1375 ; GISEL-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1376 ; GISEL-VI-NEXT: s_waitcnt lgkmcnt(0)
1377 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, s0
1378 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, s1
1379 ; GISEL-VI-NEXT: flat_store_dwordx2 v[0:1], v[0:1]
1380 ; GISEL-VI-NEXT: s_endpgm
1382 ; GISEL-GFX9-LABEL: v_icmp_i16:
1383 ; GISEL-GFX9: ; %bb.0:
1384 ; GISEL-GFX9-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1385 ; GISEL-GFX9-NEXT: v_mov_b32_e32 v0, 0
1386 ; GISEL-GFX9-NEXT: s_waitcnt lgkmcnt(0)
1387 ; GISEL-GFX9-NEXT: global_store_dwordx2 v0, v[0:1], s[0:1]
1388 ; GISEL-GFX9-NEXT: s_endpgm
1389 %result = call i64 @llvm.amdgcn.icmp.i16(i16 %src, i16 100, i32 30)
1390 store i64 %result, ptr addrspace(1) %out
1394 define amdgpu_kernel void @v_icmp_i16_ne(ptr addrspace(1) %out, i16 %src) {
1395 ; GFX11-LABEL: v_icmp_i16_ne:
1397 ; GFX11-NEXT: s_clause 0x1
1398 ; GFX11-NEXT: s_load_b32 s2, s[0:1], 0x2c
1399 ; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x24
1400 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
1401 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
1402 ; GFX11-NEXT: v_cmp_ne_u16_e64 s[2:3], 0x64, s2
1403 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
1404 ; GFX11-NEXT: v_mov_b32_e32 v0, s2
1405 ; GFX11-NEXT: v_mov_b32_e32 v1, s3
1406 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
1407 ; GFX11-NEXT: s_nop 0
1408 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1409 ; GFX11-NEXT: s_endpgm
1411 ; SDAG-VI-LABEL: v_icmp_i16_ne:
1413 ; SDAG-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
1414 ; SDAG-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1415 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, 0x64
1416 ; SDAG-VI-NEXT: s_waitcnt lgkmcnt(0)
1417 ; SDAG-VI-NEXT: v_cmp_ne_u16_e64 s[2:3], s2, v0
1418 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, s0
1419 ; SDAG-VI-NEXT: v_mov_b32_e32 v2, s2
1420 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, s1
1421 ; SDAG-VI-NEXT: v_mov_b32_e32 v3, s3
1422 ; SDAG-VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3]
1423 ; SDAG-VI-NEXT: s_endpgm
1425 ; GFX9-LABEL: v_icmp_i16_ne:
1427 ; GFX9-NEXT: s_load_dword s4, s[0:1], 0x2c
1428 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
1429 ; GFX9-NEXT: v_mov_b32_e32 v0, 0x64
1430 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
1431 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
1432 ; GFX9-NEXT: v_cmp_ne_u16_e64 s[0:1], s4, v0
1433 ; GFX9-NEXT: v_mov_b32_e32 v0, s0
1434 ; GFX9-NEXT: v_mov_b32_e32 v1, s1
1435 ; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[2:3]
1436 ; GFX9-NEXT: s_endpgm
1438 ; GISEL-VI-LABEL: v_icmp_i16_ne:
1439 ; GISEL-VI: ; %bb.0:
1440 ; GISEL-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
1441 ; GISEL-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1442 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, 0x64
1443 ; GISEL-VI-NEXT: s_waitcnt lgkmcnt(0)
1444 ; GISEL-VI-NEXT: v_cmp_ne_u16_e64 s[2:3], s2, v0
1445 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, s2
1446 ; GISEL-VI-NEXT: v_mov_b32_e32 v3, s1
1447 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, s3
1448 ; GISEL-VI-NEXT: v_mov_b32_e32 v2, s0
1449 ; GISEL-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
1450 ; GISEL-VI-NEXT: s_endpgm
1451 %result = call i64 @llvm.amdgcn.icmp.i16(i16 %src, i16 100, i32 33)
1452 store i64 %result, ptr addrspace(1) %out
1456 define amdgpu_kernel void @v_icmp_i16_ugt(ptr addrspace(1) %out, i16 %src) {
1457 ; GFX11-LABEL: v_icmp_i16_ugt:
1459 ; GFX11-NEXT: s_clause 0x1
1460 ; GFX11-NEXT: s_load_b32 s2, s[0:1], 0x2c
1461 ; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x24
1462 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
1463 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
1464 ; GFX11-NEXT: v_cmp_lt_u16_e64 s[2:3], 0x64, s2
1465 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
1466 ; GFX11-NEXT: v_mov_b32_e32 v0, s2
1467 ; GFX11-NEXT: v_mov_b32_e32 v1, s3
1468 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
1469 ; GFX11-NEXT: s_nop 0
1470 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1471 ; GFX11-NEXT: s_endpgm
1473 ; SDAG-VI-LABEL: v_icmp_i16_ugt:
1475 ; SDAG-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
1476 ; SDAG-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1477 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, 0x64
1478 ; SDAG-VI-NEXT: s_waitcnt lgkmcnt(0)
1479 ; SDAG-VI-NEXT: v_cmp_gt_u16_e64 s[2:3], s2, v0
1480 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, s0
1481 ; SDAG-VI-NEXT: v_mov_b32_e32 v2, s2
1482 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, s1
1483 ; SDAG-VI-NEXT: v_mov_b32_e32 v3, s3
1484 ; SDAG-VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3]
1485 ; SDAG-VI-NEXT: s_endpgm
1487 ; GFX9-LABEL: v_icmp_i16_ugt:
1489 ; GFX9-NEXT: s_load_dword s4, s[0:1], 0x2c
1490 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
1491 ; GFX9-NEXT: v_mov_b32_e32 v0, 0x64
1492 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
1493 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
1494 ; GFX9-NEXT: v_cmp_gt_u16_e64 s[0:1], s4, v0
1495 ; GFX9-NEXT: v_mov_b32_e32 v0, s0
1496 ; GFX9-NEXT: v_mov_b32_e32 v1, s1
1497 ; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[2:3]
1498 ; GFX9-NEXT: s_endpgm
1500 ; GISEL-VI-LABEL: v_icmp_i16_ugt:
1501 ; GISEL-VI: ; %bb.0:
1502 ; GISEL-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
1503 ; GISEL-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1504 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, 0x64
1505 ; GISEL-VI-NEXT: s_waitcnt lgkmcnt(0)
1506 ; GISEL-VI-NEXT: v_cmp_gt_u16_e64 s[2:3], s2, v0
1507 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, s2
1508 ; GISEL-VI-NEXT: v_mov_b32_e32 v3, s1
1509 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, s3
1510 ; GISEL-VI-NEXT: v_mov_b32_e32 v2, s0
1511 ; GISEL-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
1512 ; GISEL-VI-NEXT: s_endpgm
1513 %result = call i64 @llvm.amdgcn.icmp.i16(i16 %src, i16 100, i32 34)
1514 store i64 %result, ptr addrspace(1) %out
1518 define amdgpu_kernel void @v_icmp_i16_uge(ptr addrspace(1) %out, i16 %src) {
1519 ; GFX11-LABEL: v_icmp_i16_uge:
1521 ; GFX11-NEXT: s_clause 0x1
1522 ; GFX11-NEXT: s_load_b32 s2, s[0:1], 0x2c
1523 ; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x24
1524 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
1525 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
1526 ; GFX11-NEXT: v_cmp_le_u16_e64 s[2:3], 0x64, s2
1527 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
1528 ; GFX11-NEXT: v_mov_b32_e32 v0, s2
1529 ; GFX11-NEXT: v_mov_b32_e32 v1, s3
1530 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
1531 ; GFX11-NEXT: s_nop 0
1532 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1533 ; GFX11-NEXT: s_endpgm
1535 ; SDAG-VI-LABEL: v_icmp_i16_uge:
1537 ; SDAG-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
1538 ; SDAG-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1539 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, 0x64
1540 ; SDAG-VI-NEXT: s_waitcnt lgkmcnt(0)
1541 ; SDAG-VI-NEXT: v_cmp_ge_u16_e64 s[2:3], s2, v0
1542 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, s0
1543 ; SDAG-VI-NEXT: v_mov_b32_e32 v2, s2
1544 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, s1
1545 ; SDAG-VI-NEXT: v_mov_b32_e32 v3, s3
1546 ; SDAG-VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3]
1547 ; SDAG-VI-NEXT: s_endpgm
1549 ; GFX9-LABEL: v_icmp_i16_uge:
1551 ; GFX9-NEXT: s_load_dword s4, s[0:1], 0x2c
1552 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
1553 ; GFX9-NEXT: v_mov_b32_e32 v0, 0x64
1554 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
1555 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
1556 ; GFX9-NEXT: v_cmp_ge_u16_e64 s[0:1], s4, v0
1557 ; GFX9-NEXT: v_mov_b32_e32 v0, s0
1558 ; GFX9-NEXT: v_mov_b32_e32 v1, s1
1559 ; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[2:3]
1560 ; GFX9-NEXT: s_endpgm
1562 ; GISEL-VI-LABEL: v_icmp_i16_uge:
1563 ; GISEL-VI: ; %bb.0:
1564 ; GISEL-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
1565 ; GISEL-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1566 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, 0x64
1567 ; GISEL-VI-NEXT: s_waitcnt lgkmcnt(0)
1568 ; GISEL-VI-NEXT: v_cmp_ge_u16_e64 s[2:3], s2, v0
1569 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, s2
1570 ; GISEL-VI-NEXT: v_mov_b32_e32 v3, s1
1571 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, s3
1572 ; GISEL-VI-NEXT: v_mov_b32_e32 v2, s0
1573 ; GISEL-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
1574 ; GISEL-VI-NEXT: s_endpgm
1575 %result = call i64 @llvm.amdgcn.icmp.i16(i16 %src, i16 100, i32 35)
1576 store i64 %result, ptr addrspace(1) %out
1580 define amdgpu_kernel void @v_icmp_i16_ult(ptr addrspace(1) %out, i16 %src) {
1581 ; GFX11-LABEL: v_icmp_i16_ult:
1583 ; GFX11-NEXT: s_clause 0x1
1584 ; GFX11-NEXT: s_load_b32 s2, s[0:1], 0x2c
1585 ; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x24
1586 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
1587 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
1588 ; GFX11-NEXT: v_cmp_gt_u16_e64 s[2:3], 0x64, s2
1589 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
1590 ; GFX11-NEXT: v_mov_b32_e32 v0, s2
1591 ; GFX11-NEXT: v_mov_b32_e32 v1, s3
1592 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
1593 ; GFX11-NEXT: s_nop 0
1594 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1595 ; GFX11-NEXT: s_endpgm
1597 ; SDAG-VI-LABEL: v_icmp_i16_ult:
1599 ; SDAG-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
1600 ; SDAG-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1601 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, 0x64
1602 ; SDAG-VI-NEXT: s_waitcnt lgkmcnt(0)
1603 ; SDAG-VI-NEXT: v_cmp_lt_u16_e64 s[2:3], s2, v0
1604 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, s0
1605 ; SDAG-VI-NEXT: v_mov_b32_e32 v2, s2
1606 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, s1
1607 ; SDAG-VI-NEXT: v_mov_b32_e32 v3, s3
1608 ; SDAG-VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3]
1609 ; SDAG-VI-NEXT: s_endpgm
1611 ; GFX9-LABEL: v_icmp_i16_ult:
1613 ; GFX9-NEXT: s_load_dword s4, s[0:1], 0x2c
1614 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
1615 ; GFX9-NEXT: v_mov_b32_e32 v0, 0x64
1616 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
1617 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
1618 ; GFX9-NEXT: v_cmp_lt_u16_e64 s[0:1], s4, v0
1619 ; GFX9-NEXT: v_mov_b32_e32 v0, s0
1620 ; GFX9-NEXT: v_mov_b32_e32 v1, s1
1621 ; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[2:3]
1622 ; GFX9-NEXT: s_endpgm
1624 ; GISEL-VI-LABEL: v_icmp_i16_ult:
1625 ; GISEL-VI: ; %bb.0:
1626 ; GISEL-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
1627 ; GISEL-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1628 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, 0x64
1629 ; GISEL-VI-NEXT: s_waitcnt lgkmcnt(0)
1630 ; GISEL-VI-NEXT: v_cmp_lt_u16_e64 s[2:3], s2, v0
1631 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, s2
1632 ; GISEL-VI-NEXT: v_mov_b32_e32 v3, s1
1633 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, s3
1634 ; GISEL-VI-NEXT: v_mov_b32_e32 v2, s0
1635 ; GISEL-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
1636 ; GISEL-VI-NEXT: s_endpgm
1637 %result = call i64 @llvm.amdgcn.icmp.i16(i16 %src, i16 100, i32 36)
1638 store i64 %result, ptr addrspace(1) %out
1642 define amdgpu_kernel void @v_icmp_i16_ule(ptr addrspace(1) %out, i16 %src) {
1643 ; GFX11-LABEL: v_icmp_i16_ule:
1645 ; GFX11-NEXT: s_clause 0x1
1646 ; GFX11-NEXT: s_load_b32 s2, s[0:1], 0x2c
1647 ; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x24
1648 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
1649 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
1650 ; GFX11-NEXT: v_cmp_ge_u16_e64 s[2:3], 0x64, s2
1651 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
1652 ; GFX11-NEXT: v_mov_b32_e32 v0, s2
1653 ; GFX11-NEXT: v_mov_b32_e32 v1, s3
1654 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
1655 ; GFX11-NEXT: s_nop 0
1656 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1657 ; GFX11-NEXT: s_endpgm
1659 ; SDAG-VI-LABEL: v_icmp_i16_ule:
1661 ; SDAG-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
1662 ; SDAG-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1663 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, 0x64
1664 ; SDAG-VI-NEXT: s_waitcnt lgkmcnt(0)
1665 ; SDAG-VI-NEXT: v_cmp_le_u16_e64 s[2:3], s2, v0
1666 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, s0
1667 ; SDAG-VI-NEXT: v_mov_b32_e32 v2, s2
1668 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, s1
1669 ; SDAG-VI-NEXT: v_mov_b32_e32 v3, s3
1670 ; SDAG-VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3]
1671 ; SDAG-VI-NEXT: s_endpgm
1673 ; GFX9-LABEL: v_icmp_i16_ule:
1675 ; GFX9-NEXT: s_load_dword s4, s[0:1], 0x2c
1676 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
1677 ; GFX9-NEXT: v_mov_b32_e32 v0, 0x64
1678 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
1679 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
1680 ; GFX9-NEXT: v_cmp_le_u16_e64 s[0:1], s4, v0
1681 ; GFX9-NEXT: v_mov_b32_e32 v0, s0
1682 ; GFX9-NEXT: v_mov_b32_e32 v1, s1
1683 ; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[2:3]
1684 ; GFX9-NEXT: s_endpgm
1686 ; GISEL-VI-LABEL: v_icmp_i16_ule:
1687 ; GISEL-VI: ; %bb.0:
1688 ; GISEL-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
1689 ; GISEL-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1690 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, 0x64
1691 ; GISEL-VI-NEXT: s_waitcnt lgkmcnt(0)
1692 ; GISEL-VI-NEXT: v_cmp_le_u16_e64 s[2:3], s2, v0
1693 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, s2
1694 ; GISEL-VI-NEXT: v_mov_b32_e32 v3, s1
1695 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, s3
1696 ; GISEL-VI-NEXT: v_mov_b32_e32 v2, s0
1697 ; GISEL-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
1698 ; GISEL-VI-NEXT: s_endpgm
1699 %result = call i64 @llvm.amdgcn.icmp.i16(i16 %src, i16 100, i32 37)
1700 store i64 %result, ptr addrspace(1) %out
1704 define amdgpu_kernel void @v_icmp_i16_sgt(ptr addrspace(1) %out, i16 %src) #1 {
1705 ; GFX11-LABEL: v_icmp_i16_sgt:
1707 ; GFX11-NEXT: s_clause 0x1
1708 ; GFX11-NEXT: s_load_b32 s2, s[0:1], 0x2c
1709 ; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x24
1710 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
1711 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
1712 ; GFX11-NEXT: v_cmp_lt_i16_e64 s[2:3], 0x64, s2
1713 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
1714 ; GFX11-NEXT: v_mov_b32_e32 v0, s2
1715 ; GFX11-NEXT: v_mov_b32_e32 v1, s3
1716 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
1717 ; GFX11-NEXT: s_nop 0
1718 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1719 ; GFX11-NEXT: s_endpgm
1721 ; SDAG-VI-LABEL: v_icmp_i16_sgt:
1723 ; SDAG-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
1724 ; SDAG-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1725 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, 0x64
1726 ; SDAG-VI-NEXT: s_waitcnt lgkmcnt(0)
1727 ; SDAG-VI-NEXT: v_cmp_gt_i16_e64 s[2:3], s2, v0
1728 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, s0
1729 ; SDAG-VI-NEXT: v_mov_b32_e32 v2, s2
1730 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, s1
1731 ; SDAG-VI-NEXT: v_mov_b32_e32 v3, s3
1732 ; SDAG-VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3]
1733 ; SDAG-VI-NEXT: s_endpgm
1735 ; GFX9-LABEL: v_icmp_i16_sgt:
1737 ; GFX9-NEXT: s_load_dword s4, s[0:1], 0x2c
1738 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
1739 ; GFX9-NEXT: v_mov_b32_e32 v0, 0x64
1740 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
1741 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
1742 ; GFX9-NEXT: v_cmp_gt_i16_e64 s[0:1], s4, v0
1743 ; GFX9-NEXT: v_mov_b32_e32 v0, s0
1744 ; GFX9-NEXT: v_mov_b32_e32 v1, s1
1745 ; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[2:3]
1746 ; GFX9-NEXT: s_endpgm
1748 ; GISEL-VI-LABEL: v_icmp_i16_sgt:
1749 ; GISEL-VI: ; %bb.0:
1750 ; GISEL-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
1751 ; GISEL-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1752 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, 0x64
1753 ; GISEL-VI-NEXT: s_waitcnt lgkmcnt(0)
1754 ; GISEL-VI-NEXT: v_cmp_gt_i16_e64 s[2:3], s2, v0
1755 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, s2
1756 ; GISEL-VI-NEXT: v_mov_b32_e32 v3, s1
1757 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, s3
1758 ; GISEL-VI-NEXT: v_mov_b32_e32 v2, s0
1759 ; GISEL-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
1760 ; GISEL-VI-NEXT: s_endpgm
1761 %result = call i64 @llvm.amdgcn.icmp.i16(i16 %src, i16 100, i32 38)
1762 store i64 %result, ptr addrspace(1) %out
1766 define amdgpu_kernel void @v_icmp_i16_sge(ptr addrspace(1) %out, i16 %src) {
1767 ; GFX11-LABEL: v_icmp_i16_sge:
1769 ; GFX11-NEXT: s_clause 0x1
1770 ; GFX11-NEXT: s_load_b32 s2, s[0:1], 0x2c
1771 ; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x24
1772 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
1773 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
1774 ; GFX11-NEXT: v_cmp_le_i16_e64 s[2:3], 0x64, s2
1775 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
1776 ; GFX11-NEXT: v_mov_b32_e32 v0, s2
1777 ; GFX11-NEXT: v_mov_b32_e32 v1, s3
1778 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
1779 ; GFX11-NEXT: s_nop 0
1780 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1781 ; GFX11-NEXT: s_endpgm
1783 ; SDAG-VI-LABEL: v_icmp_i16_sge:
1785 ; SDAG-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
1786 ; SDAG-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1787 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, 0x64
1788 ; SDAG-VI-NEXT: s_waitcnt lgkmcnt(0)
1789 ; SDAG-VI-NEXT: v_cmp_ge_i16_e64 s[2:3], s2, v0
1790 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, s0
1791 ; SDAG-VI-NEXT: v_mov_b32_e32 v2, s2
1792 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, s1
1793 ; SDAG-VI-NEXT: v_mov_b32_e32 v3, s3
1794 ; SDAG-VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3]
1795 ; SDAG-VI-NEXT: s_endpgm
1797 ; GFX9-LABEL: v_icmp_i16_sge:
1799 ; GFX9-NEXT: s_load_dword s4, s[0:1], 0x2c
1800 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
1801 ; GFX9-NEXT: v_mov_b32_e32 v0, 0x64
1802 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
1803 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
1804 ; GFX9-NEXT: v_cmp_ge_i16_e64 s[0:1], s4, v0
1805 ; GFX9-NEXT: v_mov_b32_e32 v0, s0
1806 ; GFX9-NEXT: v_mov_b32_e32 v1, s1
1807 ; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[2:3]
1808 ; GFX9-NEXT: s_endpgm
1810 ; GISEL-VI-LABEL: v_icmp_i16_sge:
1811 ; GISEL-VI: ; %bb.0:
1812 ; GISEL-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
1813 ; GISEL-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1814 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, 0x64
1815 ; GISEL-VI-NEXT: s_waitcnt lgkmcnt(0)
1816 ; GISEL-VI-NEXT: v_cmp_ge_i16_e64 s[2:3], s2, v0
1817 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, s2
1818 ; GISEL-VI-NEXT: v_mov_b32_e32 v3, s1
1819 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, s3
1820 ; GISEL-VI-NEXT: v_mov_b32_e32 v2, s0
1821 ; GISEL-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
1822 ; GISEL-VI-NEXT: s_endpgm
1823 %result = call i64 @llvm.amdgcn.icmp.i16(i16 %src, i16 100, i32 39)
1824 store i64 %result, ptr addrspace(1) %out
1828 define amdgpu_kernel void @v_icmp_i16_slt(ptr addrspace(1) %out, i16 %src) {
1829 ; GFX11-LABEL: v_icmp_i16_slt:
1831 ; GFX11-NEXT: s_clause 0x1
1832 ; GFX11-NEXT: s_load_b32 s2, s[0:1], 0x2c
1833 ; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x24
1834 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
1835 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
1836 ; GFX11-NEXT: v_cmp_gt_i16_e64 s[2:3], 0x64, s2
1837 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
1838 ; GFX11-NEXT: v_mov_b32_e32 v0, s2
1839 ; GFX11-NEXT: v_mov_b32_e32 v1, s3
1840 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
1841 ; GFX11-NEXT: s_nop 0
1842 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1843 ; GFX11-NEXT: s_endpgm
1845 ; SDAG-VI-LABEL: v_icmp_i16_slt:
1847 ; SDAG-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
1848 ; SDAG-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1849 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, 0x64
1850 ; SDAG-VI-NEXT: s_waitcnt lgkmcnt(0)
1851 ; SDAG-VI-NEXT: v_cmp_lt_i16_e64 s[2:3], s2, v0
1852 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, s0
1853 ; SDAG-VI-NEXT: v_mov_b32_e32 v2, s2
1854 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, s1
1855 ; SDAG-VI-NEXT: v_mov_b32_e32 v3, s3
1856 ; SDAG-VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3]
1857 ; SDAG-VI-NEXT: s_endpgm
1859 ; GFX9-LABEL: v_icmp_i16_slt:
1861 ; GFX9-NEXT: s_load_dword s4, s[0:1], 0x2c
1862 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
1863 ; GFX9-NEXT: v_mov_b32_e32 v0, 0x64
1864 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
1865 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
1866 ; GFX9-NEXT: v_cmp_lt_i16_e64 s[0:1], s4, v0
1867 ; GFX9-NEXT: v_mov_b32_e32 v0, s0
1868 ; GFX9-NEXT: v_mov_b32_e32 v1, s1
1869 ; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[2:3]
1870 ; GFX9-NEXT: s_endpgm
1872 ; GISEL-VI-LABEL: v_icmp_i16_slt:
1873 ; GISEL-VI: ; %bb.0:
1874 ; GISEL-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
1875 ; GISEL-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1876 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, 0x64
1877 ; GISEL-VI-NEXT: s_waitcnt lgkmcnt(0)
1878 ; GISEL-VI-NEXT: v_cmp_lt_i16_e64 s[2:3], s2, v0
1879 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, s2
1880 ; GISEL-VI-NEXT: v_mov_b32_e32 v3, s1
1881 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, s3
1882 ; GISEL-VI-NEXT: v_mov_b32_e32 v2, s0
1883 ; GISEL-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
1884 ; GISEL-VI-NEXT: s_endpgm
1885 %result = call i64 @llvm.amdgcn.icmp.i16(i16 %src, i16 100, i32 40)
1886 store i64 %result, ptr addrspace(1) %out
1890 define amdgpu_kernel void @v_icmp_i16_sle(ptr addrspace(1) %out, i16 %src) {
1891 ; GFX11-LABEL: v_icmp_i16_sle:
1893 ; GFX11-NEXT: s_clause 0x1
1894 ; GFX11-NEXT: s_load_b32 s2, s[0:1], 0x2c
1895 ; GFX11-NEXT: s_load_b64 s[0:1], s[0:1], 0x24
1896 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
1897 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
1898 ; GFX11-NEXT: v_cmp_ge_i16_e64 s[2:3], 0x64, s2
1899 ; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
1900 ; GFX11-NEXT: v_mov_b32_e32 v0, s2
1901 ; GFX11-NEXT: v_mov_b32_e32 v1, s3
1902 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
1903 ; GFX11-NEXT: s_nop 0
1904 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1905 ; GFX11-NEXT: s_endpgm
1907 ; SDAG-VI-LABEL: v_icmp_i16_sle:
1909 ; SDAG-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
1910 ; SDAG-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1911 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, 0x64
1912 ; SDAG-VI-NEXT: s_waitcnt lgkmcnt(0)
1913 ; SDAG-VI-NEXT: v_cmp_le_i16_e64 s[2:3], s2, v0
1914 ; SDAG-VI-NEXT: v_mov_b32_e32 v0, s0
1915 ; SDAG-VI-NEXT: v_mov_b32_e32 v2, s2
1916 ; SDAG-VI-NEXT: v_mov_b32_e32 v1, s1
1917 ; SDAG-VI-NEXT: v_mov_b32_e32 v3, s3
1918 ; SDAG-VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3]
1919 ; SDAG-VI-NEXT: s_endpgm
1921 ; GFX9-LABEL: v_icmp_i16_sle:
1923 ; GFX9-NEXT: s_load_dword s4, s[0:1], 0x2c
1924 ; GFX9-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
1925 ; GFX9-NEXT: v_mov_b32_e32 v0, 0x64
1926 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
1927 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
1928 ; GFX9-NEXT: v_cmp_le_i16_e64 s[0:1], s4, v0
1929 ; GFX9-NEXT: v_mov_b32_e32 v0, s0
1930 ; GFX9-NEXT: v_mov_b32_e32 v1, s1
1931 ; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[2:3]
1932 ; GFX9-NEXT: s_endpgm
1934 ; GISEL-VI-LABEL: v_icmp_i16_sle:
1935 ; GISEL-VI: ; %bb.0:
1936 ; GISEL-VI-NEXT: s_load_dword s2, s[0:1], 0x2c
1937 ; GISEL-VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
1938 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, 0x64
1939 ; GISEL-VI-NEXT: s_waitcnt lgkmcnt(0)
1940 ; GISEL-VI-NEXT: v_cmp_le_i16_e64 s[2:3], s2, v0
1941 ; GISEL-VI-NEXT: v_mov_b32_e32 v0, s2
1942 ; GISEL-VI-NEXT: v_mov_b32_e32 v3, s1
1943 ; GISEL-VI-NEXT: v_mov_b32_e32 v1, s3
1944 ; GISEL-VI-NEXT: v_mov_b32_e32 v2, s0
1945 ; GISEL-VI-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
1946 ; GISEL-VI-NEXT: s_endpgm
1947 %result = call i64 @llvm.amdgcn.icmp.i16(i16 %src, i16 100, i32 41)
1948 store i64 %result, ptr addrspace(1) %out
1952 define amdgpu_kernel void @v_icmp_i1_ne0(ptr addrspace(1) %out, i32 %a, i32 %b) {
1953 ; GFX11-LABEL: v_icmp_i1_ne0:
1955 ; GFX11-NEXT: s_load_b128 s[0:3], s[0:1], 0x24
1956 ; GFX11-NEXT: v_mov_b32_e32 v2, 0
1957 ; GFX11-NEXT: s_waitcnt lgkmcnt(0)
1958 ; GFX11-NEXT: s_cmp_gt_u32 s2, 1
1959 ; GFX11-NEXT: s_cselect_b64 s[4:5], -1, 0
1960 ; GFX11-NEXT: s_cmp_gt_u32 s3, 2
1961 ; GFX11-NEXT: s_cselect_b64 s[2:3], -1, 0
1962 ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)
1963 ; GFX11-NEXT: s_and_b64 s[2:3], s[4:5], s[2:3]
1964 ; GFX11-NEXT: v_mov_b32_e32 v0, s2
1965 ; GFX11-NEXT: v_mov_b32_e32 v1, s3
1966 ; GFX11-NEXT: global_store_b64 v2, v[0:1], s[0:1]
1967 ; GFX11-NEXT: s_nop 0
1968 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1969 ; GFX11-NEXT: s_endpgm
1971 ; VI-LABEL: v_icmp_i1_ne0:
1973 ; VI-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
1974 ; VI-NEXT: s_waitcnt lgkmcnt(0)
1975 ; VI-NEXT: s_cmp_gt_u32 s2, 1
1976 ; VI-NEXT: s_cselect_b64 s[4:5], -1, 0
1977 ; VI-NEXT: s_cmp_gt_u32 s3, 2
1978 ; VI-NEXT: s_cselect_b64 s[2:3], -1, 0
1979 ; VI-NEXT: s_and_b64 s[2:3], s[4:5], s[2:3]
1980 ; VI-NEXT: v_mov_b32_e32 v0, s0
1981 ; VI-NEXT: v_mov_b32_e32 v2, s2
1982 ; VI-NEXT: v_mov_b32_e32 v1, s1
1983 ; VI-NEXT: v_mov_b32_e32 v3, s3
1984 ; VI-NEXT: flat_store_dwordx2 v[0:1], v[2:3]
1987 ; GFX9-LABEL: v_icmp_i1_ne0:
1989 ; GFX9-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
1990 ; GFX9-NEXT: v_mov_b32_e32 v2, 0
1991 ; GFX9-NEXT: s_waitcnt lgkmcnt(0)
1992 ; GFX9-NEXT: s_cmp_gt_u32 s2, 1
1993 ; GFX9-NEXT: s_cselect_b64 s[4:5], -1, 0
1994 ; GFX9-NEXT: s_cmp_gt_u32 s3, 2
1995 ; GFX9-NEXT: s_cselect_b64 s[2:3], -1, 0
1996 ; GFX9-NEXT: s_and_b64 s[2:3], s[4:5], s[2:3]
1997 ; GFX9-NEXT: v_mov_b32_e32 v0, s2
1998 ; GFX9-NEXT: v_mov_b32_e32 v1, s3
1999 ; GFX9-NEXT: global_store_dwordx2 v2, v[0:1], s[0:1]
2000 ; GFX9-NEXT: s_endpgm
2001 %c0 = icmp ugt i32 %a, 1
2002 %c1 = icmp ugt i32 %b, 2
2003 %src = and i1 %c0, %c1
2004 %result = call i64 @llvm.amdgcn.icmp.i1(i1 %src, i1 false, i32 33)
2005 store i64 %result, ptr addrspace(1) %out
2009 define amdgpu_ps void @test_intr_icmp_i32_invalid_cc(ptr addrspace(1) %out, i32 %src) {
2010 ; SDAG-GFX11-LABEL: test_intr_icmp_i32_invalid_cc:
2011 ; SDAG-GFX11: ; %bb.0:
2012 ; SDAG-GFX11-NEXT: s_endpgm
2014 ; SDAG-VI-LABEL: test_intr_icmp_i32_invalid_cc:
2016 ; SDAG-VI-NEXT: s_endpgm
2018 ; SDAG-GFX9-LABEL: test_intr_icmp_i32_invalid_cc:
2019 ; SDAG-GFX9: ; %bb.0:
2020 ; SDAG-GFX9-NEXT: s_endpgm
2022 ; GISEL-GFX11-LABEL: test_intr_icmp_i32_invalid_cc:
2023 ; GISEL-GFX11: ; %bb.0:
2024 ; GISEL-GFX11-NEXT: global_store_b64 v[0:1], v[0:1], off
2025 ; GISEL-GFX11-NEXT: s_nop 0
2026 ; GISEL-GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
2027 ; GISEL-GFX11-NEXT: s_endpgm
2029 ; GISEL-VI-LABEL: test_intr_icmp_i32_invalid_cc:
2030 ; GISEL-VI: ; %bb.0:
2031 ; GISEL-VI-NEXT: flat_store_dwordx2 v[0:1], v[0:1]
2032 ; GISEL-VI-NEXT: s_endpgm
2034 ; GISEL-GFX9-LABEL: test_intr_icmp_i32_invalid_cc:
2035 ; GISEL-GFX9: ; %bb.0:
2036 ; GISEL-GFX9-NEXT: global_store_dwordx2 v[0:1], v[0:1], off
2037 ; GISEL-GFX9-NEXT: s_endpgm
2038 %result = call i64 @llvm.amdgcn.icmp.i32(i32 %src, i32 100, i32 9999)
2039 store i64 %result, ptr addrspace(1) %out
2043 attributes #0 = { nounwind readnone convergent }
2044 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: