xref: /llvm-project/llvm/test/MC/AMDGPU/gfx12_asm_sopp.s (revision 396f6775143ffa80b9f0e72e7250613092d88124)
1// RUN: llvm-mc -triple=amdgcn -show-encoding -mcpu=gfx1200 %s | FileCheck --check-prefix=GFX12 %s
2
3s_wait_loadcnt 0x1234
4// GFX12: encoding: [0x34,0x12,0xc0,0xbf]
5
6s_wait_loadcnt 0xc1d1
7// GFX12: encoding: [0xd1,0xc1,0xc0,0xbf]
8
9s_wait_storecnt 0x1234
10// GFX12: encoding: [0x34,0x12,0xc1,0xbf]
11
12s_wait_storecnt 0xc1d1
13// GFX12: encoding: [0xd1,0xc1,0xc1,0xbf]
14
15s_wait_samplecnt 0x1234
16// GFX12: encoding: [0x34,0x12,0xc2,0xbf]
17
18s_wait_samplecnt 0xc1d1
19// GFX12: encoding: [0xd1,0xc1,0xc2,0xbf]
20
21s_wait_bvhcnt 0x1234
22// GFX12: encoding: [0x34,0x12,0xc3,0xbf]
23
24s_wait_bvhcnt 0xc1d1
25// GFX12: encoding: [0xd1,0xc1,0xc3,0xbf]
26
27s_wait_expcnt 0x1234
28// GFX12: encoding: [0x34,0x12,0xc4,0xbf]
29
30s_wait_expcnt 0xc1d1
31// GFX12: encoding: [0xd1,0xc1,0xc4,0xbf]
32
33s_wait_dscnt 0x1234
34// GFX12: encoding: [0x34,0x12,0xc6,0xbf]
35
36s_wait_dscnt 0xc1d1
37// GFX12: encoding: [0xd1,0xc1,0xc6,0xbf]
38
39s_wait_kmcnt 0x1234
40// GFX12: encoding: [0x34,0x12,0xc7,0xbf]
41
42s_wait_kmcnt 0xc1d1
43// GFX12: encoding: [0xd1,0xc1,0xc7,0xbf]
44
45s_wait_loadcnt_dscnt 0x1234
46// GFX12: encoding: [0x34,0x12,0xc8,0xbf]
47
48s_wait_loadcnt_dscnt 0xc1d1
49// GFX12: encoding: [0xd1,0xc1,0xc8,0xbf]
50
51s_wait_storecnt_dscnt 0x1234
52// GFX12: encoding: [0x34,0x12,0xc9,0xbf]
53
54s_wait_storecnt_dscnt 0xc1d1
55// GFX12: encoding: [0xd1,0xc1,0xc9,0xbf]
56
57s_wait_alu 0xfffe
58// GFX12: encoding: [0xfe,0xff,0x88,0xbf]
59
60s_wait_alu 0
61// GFX12: encoding: [0x00,0x00,0x88,0xbf]
62
63s_wait_alu depctr_va_sdst(0)
64// GFX12: encoding: [0x9f,0xf1,0x88,0xbf]
65
66s_wait_alu depctr_va_sdst(3)
67// GFX12: encoding: [0x9f,0xf7,0x88,0xbf]
68
69s_wait_alu depctr_va_vdst(14) depctr_va_sdst(6) depctr_vm_vsrc(6)
70// GFX12: encoding: [0x9b,0xed,0x88,0xbf]
71
72s_barrier_wait 0xffff
73// GFX12: encoding: [0xff,0xff,0x94,0xbf]
74
75s_barrier_wait 1
76// GFX12: encoding: [0x01,0x00,0x94,0xbf]
77
78s_barrier_leave
79// GFX12: encoding: [0x00,0x00,0x95,0xbf]
80
81//===----------------------------------------------------------------------===//
82// s_waitcnt
83//===----------------------------------------------------------------------===//
84
85s_waitcnt 0
86// GFX12: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]
87
88s_waitcnt 0x1234
89// GFX12: s_waitcnt vmcnt(4) expcnt(4) lgkmcnt(35) ; encoding: [0x34,0x12,0x89,0xbf]
90
91s_waitcnt vmcnt(0) & expcnt(0) & lgkmcnt(0)
92// GFX12: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]
93
94s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
95// GFX12: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]
96
97s_waitcnt vmcnt(0), expcnt(0), lgkmcnt(0)
98// GFX12: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x89,0xbf]
99
100s_waitcnt vmcnt(1)
101// GFX12: s_waitcnt vmcnt(1) ; encoding: [0xf7,0x07,0x89,0xbf]
102
103s_waitcnt vmcnt(9)
104// GFX12: s_waitcnt vmcnt(9) ; encoding: [0xf7,0x27,0x89,0xbf]
105
106s_waitcnt expcnt(2)
107// GFX12: s_waitcnt expcnt(2) ; encoding: [0xf2,0xff,0x89,0xbf]
108
109s_waitcnt lgkmcnt(3)
110// GFX12: s_waitcnt lgkmcnt(3) ; encoding: [0x37,0xfc,0x89,0xbf]
111
112s_waitcnt lgkmcnt(9)
113// GFX12: s_waitcnt lgkmcnt(9) ; encoding: [0x97,0xfc,0x89,0xbf]
114
115s_waitcnt vmcnt(0), expcnt(0)
116// GFX12: s_waitcnt vmcnt(0) expcnt(0) ; encoding: [0xf0,0x03,0x89,0xbf]
117
118s_waitcnt vmcnt(15)
119// GFX12: s_waitcnt vmcnt(15) ; encoding: [0xf7,0x3f,0x89,0xbf]
120
121s_waitcnt vmcnt(15) expcnt(6)
122// GFX12: s_waitcnt vmcnt(15) expcnt(6) ; encoding: [0xf6,0x3f,0x89,0xbf]
123
124s_waitcnt vmcnt(15) lgkmcnt(14)
125// GFX12: s_waitcnt vmcnt(15) lgkmcnt(14) ; encoding: [0xe7,0x3c,0x89,0xbf]
126
127s_waitcnt vmcnt(15) expcnt(6) lgkmcnt(14)
128// GFX12: s_waitcnt vmcnt(15) expcnt(6) lgkmcnt(14) ; encoding: [0xe6,0x3c,0x89,0xbf]
129
130s_waitcnt vmcnt(31)
131// GFX12: s_waitcnt vmcnt(31) ; encoding: [0xf7,0x7f,0x89,0xbf]
132
133s_waitcnt vmcnt(31) expcnt(6)
134// GFX12: s_waitcnt vmcnt(31) expcnt(6) ; encoding: [0xf6,0x7f,0x89,0xbf]
135
136s_waitcnt vmcnt(31) lgkmcnt(14)
137// GFX12: s_waitcnt vmcnt(31) lgkmcnt(14) ; encoding: [0xe7,0x7c,0x89,0xbf]
138
139s_waitcnt vmcnt(31) expcnt(6) lgkmcnt(14)
140// GFX12: s_waitcnt vmcnt(31) expcnt(6) lgkmcnt(14) ; encoding: [0xe6,0x7c,0x89,0xbf]
141
142s_waitcnt vmcnt(62)
143// GFX12: s_waitcnt vmcnt(62) ; encoding: [0xf7,0xfb,0x89,0xbf]
144
145s_waitcnt vmcnt(62) expcnt(6)
146// GFX12: s_waitcnt vmcnt(62) expcnt(6) ; encoding: [0xf6,0xfb,0x89,0xbf]
147
148s_waitcnt vmcnt(62) lgkmcnt(14)
149// GFX12: s_waitcnt vmcnt(62) lgkmcnt(14) ; encoding: [0xe7,0xf8,0x89,0xbf]
150
151s_waitcnt vmcnt(62) expcnt(6) lgkmcnt(14)
152// GFX12: s_waitcnt vmcnt(62) expcnt(6) lgkmcnt(14) ; encoding: [0xe6,0xf8,0x89,0xbf]
153
154//===----------------------------------------------------------------------===//
155// s_sendmsg
156//===----------------------------------------------------------------------===//
157
158s_sendmsg 2
159// GFX12: s_sendmsg sendmsg(MSG_HS_TESSFACTOR) ; encoding: [0x02,0x00,0xb6,0xbf]
160
161s_sendmsg 0xc1d1
162// GFX12: s_sendmsg 49617                      ; encoding: [0xd1,0xc1,0xb6,0xbf]
163
164s_sendmsg sendmsg(MSG_HS_TESSFACTOR)
165// GFX12: s_sendmsg sendmsg(MSG_HS_TESSFACTOR) ; encoding: [0x02,0x00,0xb6,0xbf]
166
167s_sendmsg 3
168// GFX12: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS) ; encoding: [0x03,0x00,0xb6,0xbf]
169
170s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
171// GFX12: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS) ; encoding: [0x03,0x00,0xb6,0xbf]
172
173//===----------------------------------------------------------------------===//
174// s_delay_alu
175//===----------------------------------------------------------------------===//
176
177s_delay_alu 0
178// GFX12: s_delay_alu 0                           ; encoding: [0x00,0x00,0x87,0xbf]
179
180s_delay_alu 0x91
181// GFX12: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1) ; encoding: [0x91,0x00,0x87,0xbf]
182
183s_delay_alu instid0(VALU_DEP_1)
184// GFX12: s_delay_alu instid0(VALU_DEP_1)         ; encoding: [0x01,0x00,0x87,0xbf]
185
186s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
187// GFX12: s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1) ; encoding: [0x81,0x04,0x87,0xbf]
188
189s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3)
190// GFX12: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_3) ; encoding: [0x91,0x01,0x87,0xbf]
191
192s_delay_alu instid1(SALU_CYCLE_2)
193// GFX12: s_delay_alu instid1(SALU_CYCLE_2) ; encoding: [0x00,0x05,0x87,0xbf]
194
195s_delay_alu instid1(SALU_CYCLE_3)
196// GFX12: s_delay_alu instid1(SALU_CYCLE_3) ; encoding: [0x80,0x05,0x87,0xbf]
197
198s_wait_idle
199// GFX12: s_wait_idle ; encoding: [0x00,0x00,0x8a,0xbf]
200
201s_nop 0x0
202// GFX12: s_nop 0 ; encoding: [0x00,0x00,0x80,0xbf]
203
204s_nop 0x1234
205// GFX12: s_nop 0x1234 ; encoding: [0x34,0x12,0x80,0xbf]
206
207s_nop 0xc1d1
208// GFX12: s_nop 0xc1d1 ; encoding: [0xd1,0xc1,0x80,0xbf]
209
210s_endpgm
211// GFX12: s_endpgm ; encoding: [0x00,0x00,0xb0,0xbf]
212
213s_endpgm 1
214// GFX12: s_endpgm 1 ; encoding: [0x01,0x00,0xb0,0xbf]
215
216s_endpgm 65535
217// GFX12: s_endpgm 65535 ; encoding: [0xff,0xff,0xb0,0xbf]
218
219s_branch 0x0
220// GFX12: s_branch 0 ; encoding: [0x00,0x00,0xa0,0xbf]
221
222s_branch 0x1234
223// GFX12: s_branch 4660 ; encoding: [0x34,0x12,0xa0,0xbf]
224
225s_wakeup
226// GFX12: s_wakeup ; encoding: [0x00,0x00,0xb4,0xbf]
227
228s_cbranch_scc0 0x0
229// GFX12: s_cbranch_scc0 0 ; encoding: [0x00,0x00,0xa1,0xbf]
230
231s_cbranch_scc0 0x1234
232// GFX12: s_cbranch_scc0 4660 ; encoding: [0x34,0x12,0xa1,0xbf]
233
234s_cbranch_scc1 0x0
235// GFX12: s_cbranch_scc1 0 ; encoding: [0x00,0x00,0xa2,0xbf]
236
237s_cbranch_scc1 0x1234
238// GFX12: s_cbranch_scc1 4660 ; encoding: [0x34,0x12,0xa2,0xbf]
239
240s_cbranch_vccz 0x0
241// GFX12: s_cbranch_vccz 0 ; encoding: [0x00,0x00,0xa3,0xbf]
242
243s_cbranch_vccz 0x1234
244// GFX12: s_cbranch_vccz 4660 ; encoding: [0x34,0x12,0xa3,0xbf]
245
246s_cbranch_vccnz 0x0
247// GFX12: s_cbranch_vccnz 0 ; encoding: [0x00,0x00,0xa4,0xbf]
248
249s_cbranch_vccnz 0x1234
250// GFX12: s_cbranch_vccnz 4660 ; encoding: [0x34,0x12,0xa4,0xbf]
251
252s_cbranch_execz 0x0
253// GFX12: s_cbranch_execz 0 ; encoding: [0x00,0x00,0xa5,0xbf]
254
255s_cbranch_execz 0x1234
256// GFX12: s_cbranch_execz 4660 ; encoding: [0x34,0x12,0xa5,0xbf]
257
258s_cbranch_execnz 0x0
259// GFX12: s_cbranch_execnz 0 ; encoding: [0x00,0x00,0xa6,0xbf]
260
261s_cbranch_execnz 0x1234
262// GFX12: s_cbranch_execnz 4660 ; encoding: [0x34,0x12,0xa6,0xbf]
263
264s_setkill 0x0
265// GFX12: s_setkill 0 ; encoding: [0x00,0x00,0x81,0xbf]
266
267s_setkill 0x1234
268// GFX12: s_setkill 0x1234 ; encoding: [0x34,0x12,0x81,0xbf]
269
270s_setkill 0xc1d1
271// GFX12: s_setkill 0xc1d1 ; encoding: [0xd1,0xc1,0x81,0xbf]
272
273s_sethalt 0x0
274// GFX12: s_sethalt 0 ; encoding: [0x00,0x00,0x82,0xbf]
275
276s_sethalt 0x1234
277// GFX12: s_sethalt 0x1234 ; encoding: [0x34,0x12,0x82,0xbf]
278
279s_sethalt 0xc1d1
280// GFX12: s_sethalt 0xc1d1 ; encoding: [0xd1,0xc1,0x82,0xbf]
281
282s_sleep 0x0
283// GFX12: s_sleep 0 ; encoding: [0x00,0x00,0x83,0xbf]
284
285s_sleep 0x1234
286// GFX12: s_sleep 0x1234 ; encoding: [0x34,0x12,0x83,0xbf]
287
288s_sleep 0xc1d1
289// GFX12: s_sleep 0xc1d1 ; encoding: [0xd1,0xc1,0x83,0xbf]
290
291s_setprio 0x0
292// GFX12: s_setprio 0 ; encoding: [0x00,0x00,0xb5,0xbf]
293
294s_setprio 0x1234
295// GFX12: s_setprio 0x1234 ; encoding: [0x34,0x12,0xb5,0xbf]
296
297s_setprio 0xc1d1
298// GFX12: s_setprio 0xc1d1 ; encoding: [0xd1,0xc1,0xb5,0xbf]
299
300s_sendmsghalt 0x0
301// GFX12: s_sendmsghalt sendmsg(0, 0, 0) ; encoding: [0x00,0x00,0xb7,0xbf]
302
303s_sendmsghalt 0x1234
304// GFX12: s_sendmsghalt 4660 ; encoding: [0x34,0x12,0xb7,0xbf]
305
306s_sendmsghalt 0xc1d1
307// GFX12: s_sendmsghalt 49617 ; encoding: [0xd1,0xc1,0xb7,0xbf]
308
309s_trap 0x0
310// GFX12: s_trap 0 ; encoding: [0x00,0x00,0x90,0xbf]
311
312s_trap 0x1234
313// GFX12: s_trap 0x1234 ; encoding: [0x34,0x12,0x90,0xbf]
314
315s_trap 0xc1d1
316// GFX12: s_trap 0xc1d1 ; encoding: [0xd1,0xc1,0x90,0xbf]
317
318s_icache_inv
319// GFX12: s_icache_inv ; encoding: [0x00,0x00,0xbc,0xbf]
320
321s_incperflevel 0x0
322// GFX12: s_incperflevel 0 ; encoding: [0x00,0x00,0xb8,0xbf]
323
324s_incperflevel 0x1234
325// GFX12: s_incperflevel 0x1234 ; encoding: [0x34,0x12,0xb8,0xbf]
326
327s_incperflevel 0xc1d1
328// GFX12: s_incperflevel 0xc1d1 ; encoding: [0xd1,0xc1,0xb8,0xbf]
329
330s_decperflevel 0x0
331// GFX12: s_decperflevel 0 ; encoding: [0x00,0x00,0xb9,0xbf]
332
333s_decperflevel 0x1234
334// GFX12: s_decperflevel 0x1234 ; encoding: [0x34,0x12,0xb9,0xbf]
335
336s_decperflevel 0xc1d1
337// GFX12: s_decperflevel 0xc1d1 ; encoding: [0xd1,0xc1,0xb9,0xbf]
338
339s_ttracedata
340// GFX12: s_ttracedata ; encoding: [0x00,0x00,0xba,0xbf]
341
342s_endpgm_saved
343// GFX12: s_endpgm_saved ; encoding: [0x00,0x00,0xb1,0xbf]
344
345s_code_end
346// GFX12: s_code_end ; encoding: [0x00,0x00,0x9f,0xbf]
347
348s_clause 0x0
349// GFX12: s_clause 0x0 ; encoding: [0x00,0x00,0x85,0xbf]
350
351s_clause 0x1234
352// GFX12: s_clause 0x1234 ; encoding: [0x34,0x12,0x85,0xbf]
353
354s_clause 0xc1d1
355// GFX12: s_clause 0xc1d1 ; encoding: [0xd1,0xc1,0x85,0xbf]
356
357s_round_mode 0x0
358// GFX12: s_round_mode 0x0 ; encoding: [0x00,0x00,0x91,0xbf]
359
360s_round_mode 0x1234
361// GFX12: s_round_mode 0x1234 ; encoding: [0x34,0x12,0x91,0xbf]
362
363s_round_mode 0xc1d1
364// GFX12: s_round_mode 0xc1d1 ; encoding: [0xd1,0xc1,0x91,0xbf]
365
366s_denorm_mode 0x0
367// GFX12: s_denorm_mode 0 ; encoding: [0x00,0x00,0x92,0xbf]
368
369s_denorm_mode 0x1234
370// GFX12: s_denorm_mode 0x1234 ; encoding: [0x34,0x12,0x92,0xbf]
371
372s_denorm_mode 0xc1d1
373// GFX12: s_denorm_mode 0xc1d1 ; encoding: [0xd1,0xc1,0x92,0xbf]
374
375s_ttracedata_imm 0x0
376// GFX12: s_ttracedata_imm 0x0 ; encoding: [0x00,0x00,0xbb,0xbf]
377
378s_ttracedata_imm 0x1234
379// GFX12: s_ttracedata_imm 0x1234 ; encoding: [0x34,0x12,0xbb,0xbf]
380
381s_ttracedata_imm 0xc1d1
382// GFX12: s_ttracedata_imm 0xc1d1 ; encoding: [0xd1,0xc1,0xbb,0xbf]
383
384s_wait_event 0x3141
385// GFX12: s_wait_event 0x3141 ; encoding: [0x41,0x31,0x8b,0xbf]
386
387s_wait_event 0xc1d1
388// GFX12: s_wait_event 0xc1d1 ; encoding: [0xd1,0xc1,0x8b,0xbf]
389