1 // RUN
: not llvm-mc
-arch
=amdgcn
-show-encoding
%s | FileCheck
--check-prefix
=GCN
--check-prefix
=SICI
%s
2 // RUN
: not llvm-mc
-arch
=amdgcn
-show-encoding
%s
2>&1 | FileCheck
%s
--check-prefix
=NOSICI
3 // RUN
: llvm-mc
-arch
=amdgcn
-mcpu
=fiji
-show-encoding
%s | FileCheck
--check-prefix
=GCN
--check-prefix
=VI
%s
5 //===----------------------------------------------------------------------===//
7 //===----------------------------------------------------------------------===//
10 // GCN
: s_nop
0 ; encoding
: [0x00,0x00,0x80,0xbf]
13 // GCN
: s_nop
0xffff ; encoding
: [0xff,0xff,0x80,0xbf]
15 //===----------------------------------------------------------------------===//
17 //===----------------------------------------------------------------------===//
20 // GCN
: s_nop
1 ; encoding
: [0x01,0x00,0x80,0xbf]
23 // GCN
: s_endpgm ; encoding
: [0x00,0x00,0x81,0xbf]
26 // GCN
: s_branch
2 ; encoding
: [0x02,0x00,0x82,0xbf]
29 // GCN
: s_cbranch_scc0
3 ; encoding
: [0x03,0x00,0x84,0xbf]
32 // GCN
: s_cbranch_scc1
4 ; encoding
: [0x04,0x00,0x85,0xbf]
35 // GCN
: s_cbranch_vccz
5 ; encoding
: [0x05,0x00,0x86,0xbf]
38 // GCN
: s_cbranch_vccnz
6 ; encoding
: [0x06,0x00,0x87,0xbf]
41 // GCN
: s_cbranch_execz
7 ; encoding
: [0x07,0x00,0x88,0xbf]
44 // GCN
: s_cbranch_execnz
8 ; encoding
: [0x08,0x00,0x89,0xbf]
47 // GCN
: s_cbranch_cdbgsys
9 ; encoding
: [0x09,0x00,0x97,0xbf]
49 s_cbranch_cdbgsys_and_user
10
50 // GCN
: s_cbranch_cdbgsys_and_user
10 ; encoding
: [0x0a,0x00,0x9a,0xbf]
52 s_cbranch_cdbgsys_or_user
11
53 // GCN
: s_cbranch_cdbgsys_or_user
11 ; encoding
: [0x0b,0x00,0x99,0xbf]
56 // GCN
: s_cbranch_cdbguser
12 ; encoding
: [0x0c,0x00,0x98,0xbf]
59 // GCN
: s_barrier ; encoding
: [0x00,0x00,0x8a,0xbf]
61 //===----------------------------------------------------------------------===//
63 //===----------------------------------------------------------------------===//
66 // GCN
: s_waitcnt vmcnt
(0) expcnt
(0) lgkmcnt
(0) ; encoding
: [0x00,0x00,0x8c,0xbf]
68 s_waitcnt vmcnt
(0) & expcnt
(0) & lgkmcnt
(0)
69 // GCN
: s_waitcnt vmcnt
(0) expcnt
(0) lgkmcnt
(0) ; encoding
: [0x00,0x00,0x8c,0xbf]
71 s_waitcnt vmcnt
(0) expcnt
(0) lgkmcnt
(0)
72 // GCN
: s_waitcnt vmcnt
(0) expcnt
(0) lgkmcnt
(0) ; encoding
: [0x00,0x00,0x8c,0xbf]
74 s_waitcnt vmcnt
(0), expcnt
(0), lgkmcnt
(0)
75 // GCN
: s_waitcnt vmcnt
(0) expcnt
(0) lgkmcnt
(0) ; encoding
: [0x00,0x00,0x8c,0xbf]
78 // GCN
: s_waitcnt vmcnt
(1) ; encoding
: [0x71,0x0f,0x8c,0xbf]
81 // GCN
: s_waitcnt vmcnt
(9) ; encoding
: [0x79,0x0f,0x8c,0xbf]
84 // GCN
: s_waitcnt ; encoding
: [0x7f,0x0f,0x8c,0xbf]
86 s_waitcnt vmcnt_sat
(9)
87 // GCN
: s_waitcnt vmcnt
(9) ; encoding
: [0x79,0x0f,0x8c,0xbf]
89 s_waitcnt vmcnt_sat
(15)
90 // GCN
: s_waitcnt ; encoding
: [0x7f,0x0f,0x8c,0xbf]
92 s_waitcnt vmcnt_sat
(16)
93 // GCN
: s_waitcnt ; encoding
: [0x7f,0x0f,0x8c,0xbf]
96 // GCN
: s_waitcnt expcnt
(2) ; encoding
: [0x2f,0x0f,0x8c,0xbf]
99 // GCN
: s_waitcnt ; encoding
: [0x7f,0x0f,0x8c,0xbf]
101 s_waitcnt expcnt_sat
(2)
102 // GCN
: s_waitcnt expcnt
(2) ; encoding
: [0x2f,0x0f,0x8c,0xbf]
104 s_waitcnt expcnt_sat
(7)
105 // GCN
: s_waitcnt ; encoding
: [0x7f,0x0f,0x8c,0xbf]
107 s_waitcnt expcnt_sat
(0xFFFF0000)
108 // GCN
: s_waitcnt ; encoding
: [0x7f,0x0f,0x8c,0xbf]
111 // GCN
: s_waitcnt lgkmcnt
(3) ; encoding
: [0x7f,0x03,0x8c,0xbf]
114 // GCN
: s_waitcnt lgkmcnt
(9) ; encoding
: [0x7f,0x09,0x8c,0xbf]
116 s_waitcnt lgkmcnt
(15)
117 // GCN
: s_waitcnt ; encoding
: [0x7f,0x0f,0x8c,0xbf]
119 s_waitcnt vmcnt
(0), expcnt
(0)
120 // GCN
: s_waitcnt vmcnt
(0) expcnt
(0) ; encoding
: [0x00,0x0f,0x8c,0xbf]
122 s_waitcnt lgkmcnt_sat
(3)
123 // GCN
: s_waitcnt lgkmcnt
(3) ; encoding
: [0x7f,0x03,0x8c,0xbf]
125 s_waitcnt lgkmcnt_sat
(9)
126 // GCN
: s_waitcnt lgkmcnt
(9) ; encoding
: [0x7f,0x09,0x8c,0xbf]
128 s_waitcnt lgkmcnt_sat
(15)
129 // GCN
: s_waitcnt ; encoding
: [0x7f,0x0f,0x8c,0xbf]
131 s_waitcnt lgkmcnt_sat
(16)
132 // GCN
: s_waitcnt ; encoding
: [0x7f,0x0f,0x8c,0xbf]
135 s_waitcnt lgkmcnt_sat
(x+
1)
136 // GCN
: s_waitcnt lgkmcnt
(2) ; encoding
: [0x7f,0x02,0x8c,0xbf]
138 s_waitcnt lgkmcnt_sat
(1+x
)
139 // GCN
: s_waitcnt lgkmcnt
(2) ; encoding
: [0x7f,0x02,0x8c,0xbf]
142 // GCN
: s_waitcnt vmcnt
(2) expcnt
(0) lgkmcnt
(0) ; encoding
: [0x02,0x00,0x8c,0xbf]
145 // GCN
: s_waitcnt vmcnt
(2) expcnt
(0) lgkmcnt
(0) ; encoding
: [0x02,0x00,0x8c,0xbf]
148 s_waitcnt lgkmcnt_sat
149 // GCN
: s_waitcnt vmcnt
(1) expcnt
(0) lgkmcnt
(0) ; encoding
: [0x01,0x00,0x8c,0xbf]
151 s_waitcnt lgkmcnt_sat+
1
152 // GCN
: s_waitcnt vmcnt
(2) expcnt
(0) lgkmcnt
(0) ; encoding
: [0x02,0x00,0x8c,0xbf]
154 //===----------------------------------------------------------------------===//
155 // misc sopp instructions
156 //===----------------------------------------------------------------------===//
159 // GCN
: s_sethalt
9 ; encoding
: [0x09,0x00,0x8d,0xbf]
162 // GCN
: s_setkill
7 ; encoding
: [0x07,0x00,0x8b,0xbf]
165 // GCN
: s_sleep
10 ; encoding
: [0x0a,0x00,0x8e,0xbf]
168 // GCN
: s_setprio
1 ; encoding
: [0x01,0x00,0x8f,0xbf]
170 //===----------------------------------------------------------------------===//
172 //===----------------------------------------------------------------------===//
175 // GCN
: s_sendmsg sendmsg
(MSG_INTERRUPT
) ; encoding
: [0x01,0x00,0x90,0xbf]
178 // GCN
: s_sendmsg sendmsg
(MSG_INTERRUPT
) ; encoding
: [0x01,0x00,0x90,0xbf]
180 s_sendmsg sendmsg
(MSG_INTERRUPT
)
181 // GCN
: s_sendmsg sendmsg
(MSG_INTERRUPT
) ; encoding
: [0x01,0x00,0x90,0xbf]
184 // GCN
: s_sendmsg sendmsg
(MSG_GS
, GS_OP_CUT
, 0) ; encoding
: [0x12,0x00,0x90,0xbf]
186 s_sendmsg sendmsg
(2, 1)
187 // GCN
: s_sendmsg sendmsg
(MSG_GS
, GS_OP_CUT
, 0) ; encoding
: [0x12,0x00,0x90,0xbf]
189 s_sendmsg sendmsg
(2, GS_OP_CUT
)
190 // GCN
: s_sendmsg sendmsg
(MSG_GS
, GS_OP_CUT
, 0) ; encoding
: [0x12,0x00,0x90,0xbf]
192 s_sendmsg sendmsg
(MSG_GS
, GS_OP_CUT
)
193 // GCN
: s_sendmsg sendmsg
(MSG_GS
, GS_OP_CUT
, 0) ; encoding
: [0x12,0x00,0x90,0xbf]
195 s_sendmsg sendmsg
(MSG_GS
, GS_OP_CUT
, 0)
196 // GCN
: s_sendmsg sendmsg
(MSG_GS
, GS_OP_CUT
, 0) ; encoding
: [0x12,0x00,0x90,0xbf]
198 s_sendmsg sendmsg
(MSG_GS
, 1)
199 // GCN
: s_sendmsg sendmsg
(MSG_GS
, GS_OP_CUT
, 0) ; encoding
: [0x12,0x00,0x90,0xbf]
201 s_sendmsg sendmsg
(MSG_GS
, 1, 1)
202 // GCN
: s_sendmsg sendmsg
(MSG_GS
, GS_OP_CUT
, 1) ; encoding
: [0x12,0x01,0x90,0xbf]
205 // GCN
: s_sendmsg sendmsg
(MSG_GS
, GS_OP_EMIT
, 1) ; encoding
: [0x22,0x01,0x90,0xbf]
207 s_sendmsg sendmsg
(2, 2, 1)
208 // GCN
: s_sendmsg sendmsg
(MSG_GS
, GS_OP_EMIT
, 1) ; encoding
: [0x22,0x01,0x90,0xbf]
210 s_sendmsg sendmsg
(MSG_GS
, GS_OP_EMIT
, 1)
211 // GCN
: s_sendmsg sendmsg
(MSG_GS
, GS_OP_EMIT
, 1) ; encoding
: [0x22,0x01,0x90,0xbf]
214 // GCN
: s_sendmsg sendmsg
(MSG_GS
, GS_OP_EMIT_CUT
, 2) ; encoding
: [0x32,0x02,0x90,0xbf]
216 s_sendmsg sendmsg
(2, 3, 2)
217 // GCN
: s_sendmsg sendmsg
(MSG_GS
, GS_OP_EMIT_CUT
, 2) ; encoding
: [0x32,0x02,0x90,0xbf]
219 s_sendmsg sendmsg
(MSG_GS
, GS_OP_EMIT_CUT
, 2)
220 // GCN
: s_sendmsg sendmsg
(MSG_GS
, GS_OP_EMIT_CUT
, 2) ; encoding
: [0x32,0x02,0x90,0xbf]
223 // GCN
: s_sendmsg sendmsg
(MSG_GS_DONE
, GS_OP_NOP
) ; encoding
: [0x03,0x00,0x90,0xbf]
225 s_sendmsg sendmsg
(3, 0)
226 // GCN
: s_sendmsg sendmsg
(MSG_GS_DONE
, GS_OP_NOP
) ; encoding
: [0x03,0x00,0x90,0xbf]
228 s_sendmsg sendmsg
(MSG_GS_DONE
, GS_OP_NOP
)
229 // GCN
: s_sendmsg sendmsg
(MSG_GS_DONE
, GS_OP_NOP
) ; encoding
: [0x03,0x00,0x90,0xbf]
232 // GCN
: s_sendmsg sendmsg
(MSG_SYSMSG
, SYSMSG_OP_ECC_ERR_INTERRUPT
) ; encoding
: [0x1f,0x00,0x90,0xbf]
234 s_sendmsg sendmsg
(15, 1)
235 // GCN
: s_sendmsg sendmsg
(MSG_SYSMSG
, SYSMSG_OP_ECC_ERR_INTERRUPT
) ; encoding
: [0x1f,0x00,0x90,0xbf]
237 s_sendmsg sendmsg
(MSG_SYSMSG
, SYSMSG_OP_ECC_ERR_INTERRUPT
)
238 // GCN
: s_sendmsg sendmsg
(MSG_SYSMSG
, SYSMSG_OP_ECC_ERR_INTERRUPT
) ; encoding
: [0x1f,0x00,0x90,0xbf]
241 // GCN
: s_sendmsghalt sendmsg
(MSG_GS_DONE
, GS_OP_NOP
) ; encoding
: [0x03,0x00,0x91,0xbf]
243 s_sendmsghalt sendmsg
(MSG_GS
, GS_OP_EMIT
, 1)
244 // GCN
: s_sendmsghalt sendmsg
(MSG_GS
, GS_OP_EMIT
, 1) ; encoding
: [0x22,0x01,0x91,0xbf]
246 //===----------------------------------------------------------------------===//
247 // s_sendmsg with
a numeric message id
(no validation
)
248 //===----------------------------------------------------------------------===//
251 // GCN
: s_sendmsg sendmsg
(2, 0, 0) ; encoding
: [0x02,0x00,0x90,0xbf]
254 // GCN
: s_sendmsg sendmsg
(4, 0, 0) ; encoding
: [0x04,0x00,0x90,0xbf]
257 // GCN
: s_sendmsg sendmsg
(9, 0, 0) ; encoding
: [0x09,0x00,0x90,0xbf]
260 // GCN
: s_sendmsg sendmsg
(11, 0, 0) ; encoding
: [0x0b,0x00,0x90,0xbf]
263 // GCN
: s_sendmsg sendmsg
(15, 6, 0) ; encoding
: [0x6f,0x00,0x90,0xbf]
265 s_sendmsg sendmsg
(1, 3)
266 // GCN
: s_sendmsg sendmsg
(1, 3, 0) ; encoding
: [0x31,0x00,0x90,0xbf]
268 s_sendmsg sendmsg
(1, 3, 2)
269 // GCN
: s_sendmsg sendmsg
(1, 3, 2) ; encoding
: [0x31,0x02,0x90,0xbf]
271 s_sendmsg sendmsg
(2, 0, 1)
272 // GCN
: s_sendmsg sendmsg
(2, 0, 1) ; encoding
: [0x02,0x01,0x90,0xbf]
274 s_sendmsg sendmsg
(15, 7, 3)
275 // GCN
: s_sendmsg sendmsg
(15, 7, 3) ; encoding
: [0x7f,0x03,0x90,0xbf]
278 // GCN
: s_sendmsg
4567 ; encoding
: [0xd7,0x11,0x90,0xbf]
280 //===----------------------------------------------------------------------===//
281 // s_sendmsg with expressions
282 //===----------------------------------------------------------------------===//
286 // GCN
: s_sendmsg sendmsg
(2, 0, 0) ; encoding
: [0x02,0x00,0x90,0xbf]
290 // GCN
: s_sendmsg sendmsg
(2, 0, 0) ; encoding
: [0x02,0x00,0x90,0xbf]
293 // GCN
: s_sendmsg sendmsg
(2, 0, 0) ; encoding
: [0x02,0x00,0x90,0xbf]
296 s_sendmsg sendmsg
(msg
)
297 // GCN
: s_sendmsg sendmsg
(MSG_INTERRUPT
) ; encoding
: [0x01,0x00,0x90,0xbf]
300 s_sendmsg sendmsg
(msg+
1)
301 // GCN
: s_sendmsg sendmsg
(MSG_INTERRUPT
) ; encoding
: [0x01,0x00,0x90,0xbf]
304 s_sendmsg sendmsg
(1+msg
)
305 // GCN
: s_sendmsg sendmsg
(MSG_INTERRUPT
) ; encoding
: [0x01,0x00,0x90,0xbf]
309 s_sendmsg sendmsg
(msg
, op
)
310 // GCN
: s_sendmsg sendmsg
(MSG_GS
, GS_OP_CUT
, 0) ; encoding
: [0x12,0x00,0x90,0xbf]
314 s_sendmsg sendmsg
(msg+
1, op+
1)
315 // GCN
: s_sendmsg sendmsg
(MSG_GS
, GS_OP_CUT
, 0) ; encoding
: [0x12,0x00,0x90,0xbf]
319 s_sendmsg sendmsg
(1+msg
, 1+op
)
320 // GCN
: s_sendmsg sendmsg
(MSG_GS
, GS_OP_CUT
, 0) ; encoding
: [0x12,0x00,0x90,0xbf]
325 s_sendmsg sendmsg
(msg+
1, op+
1, stream+
1)
326 // GCN
: s_sendmsg sendmsg
(MSG_GS
, GS_OP_EMIT_CUT
, 2) ; encoding
: [0x32,0x02,0x90,0xbf]
331 s_sendmsg sendmsg
(1+msg
, 1+op
, 1+stream
)
332 // GCN
: s_sendmsg sendmsg
(MSG_GS
, GS_OP_EMIT_CUT
, 2) ; encoding
: [0x32,0x02,0x90,0xbf]
336 s_sendmsghalt sendmsg
(MSG_GS
, GS_OP_EMIT
, 1)
337 // GCN
: s_sendmsghalt sendmsg
(MSG_GS
, GS_OP_EMIT
, 1) ; encoding
: [0x22,0x01,0x91,0xbf]
339 //===----------------------------------------------------------------------===//
340 // misc sopp instructions
341 //===----------------------------------------------------------------------===//
344 // GCN
: s_trap
4 ; encoding
: [0x04,0x00,0x92,0xbf]
347 // GCN
: s_icache_inv ; encoding
: [0x00,0x00,0x93,0xbf]
350 // GCN
: s_incperflevel
5 ; encoding
: [0x05,0x00,0x94,0xbf]
353 // GCN
: s_decperflevel
6 ; encoding
: [0x06,0x00,0x95,0xbf]
356 // GCN
: s_ttracedata ; encoding
: [0x00,0x00,0x96,0xbf]
359 // VI
: s_set_gpr_idx_off ; encoding
: [0x00,0x00,0x9c,0xbf]
363 // VI
: s_set_gpr_idx_mode gpr_idx
() ; encoding
: [0x00,0x00,0x9d,0xbf]
366 s_set_gpr_idx_mode gpr_idx
()
367 // VI
: s_set_gpr_idx_mode gpr_idx
() ; encoding
: [0x00,0x00,0x9d,0xbf]
370 s_set_gpr_idx_mode
15
371 // VI
: s_set_gpr_idx_mode gpr_idx
(SRC0
,SRC1
,SRC2
,DST) ; encoding
: [0x0f,0x00,0x9d,0xbf]
374 s_set_gpr_idx_mode gpr_idx
(SRC2
,SRC1
,SRC0
,DST)
375 // VI
: s_set_gpr_idx_mode gpr_idx
(SRC0
,SRC1
,SRC2
,DST) ; encoding
: [0x0f,0x00,0x9d,0xbf]
379 // VI
: s_endpgm_saved ; encoding
: [0x00,0x00,0x9b,0xbf]
380 // NOSICI
: error
: instruction
not supported on this GPU
383 // VI
: s_wakeup ; encoding
: [0x00,0x00,0x83,0xbf]
384 // NOSICI
: error
: instruction
not supported on this GPU
386 //===----------------------------------------------------------------------===//
387 // absolute expressions as branch offsets
388 //===----------------------------------------------------------------------===//
392 // GCN
: s_branch
4 ; encoding
: [0x04,0x00,0x82,0xbf]
396 // GCN
: s_branch
4 ; encoding
: [0x04,0x00,0x82,0xbf]