• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: llvm-mc -arch=amdgcn -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s
2// RUN: llvm-mc -arch=amdgcn -mcpu=SI -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SICI %s
3// RUN: llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=VI %s
4
5//===----------------------------------------------------------------------===//
6// Edge Cases
7//===----------------------------------------------------------------------===//
8
9s_nop 0
10// GCN: s_nop 0 ; encoding: [0x00,0x00,0x80,0xbf]
11
12s_nop 0xffff
13// GCN: s_nop 0xffff ; encoding: [0xff,0xff,0x80,0xbf]
14
15//===----------------------------------------------------------------------===//
16// Instructions
17//===----------------------------------------------------------------------===//
18
19s_nop 1
20// GCN: s_nop 1 ; encoding: [0x01,0x00,0x80,0xbf]
21
22s_endpgm
23// GCN: s_endpgm ; encoding: [0x00,0x00,0x81,0xbf]
24
25s_branch 2
26// GCN: s_branch 2 ; encoding: [0x02,0x00,0x82,0xbf]
27
28s_cbranch_scc0 3
29// GCN: s_cbranch_scc0 3 ; encoding: [0x03,0x00,0x84,0xbf]
30
31s_cbranch_scc1 4
32// GCN: s_cbranch_scc1 4 ; encoding: [0x04,0x00,0x85,0xbf]
33
34s_cbranch_vccz 5
35// GCN: s_cbranch_vccz 5 ; encoding: [0x05,0x00,0x86,0xbf]
36
37s_cbranch_vccnz 6
38// GCN: s_cbranch_vccnz 6 ; encoding: [0x06,0x00,0x87,0xbf]
39
40s_cbranch_execz 7
41// GCN: s_cbranch_execz 7 ; encoding: [0x07,0x00,0x88,0xbf]
42
43s_cbranch_execnz 8
44// GCN: s_cbranch_execnz 8 ; encoding: [0x08,0x00,0x89,0xbf]
45
46s_barrier
47// GCN: s_barrier ; encoding: [0x00,0x00,0x8a,0xbf]
48
49//===----------------------------------------------------------------------===//
50// s_waitcnt
51//===----------------------------------------------------------------------===//
52
53s_waitcnt 0
54// GCN: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
55
56s_waitcnt vmcnt(0) & expcnt(0) & lgkmcnt(0)
57// GCN: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
58
59s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
60// GCN: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
61
62s_waitcnt vmcnt(0), expcnt(0), lgkmcnt(0)
63// GCN: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) ; encoding: [0x00,0x00,0x8c,0xbf]
64
65s_waitcnt vmcnt(1)
66// GCN: s_waitcnt vmcnt(1) ; encoding: [0x71,0x0f,0x8c,0xbf]
67
68s_waitcnt vmcnt(9)
69// GCN: s_waitcnt vmcnt(9) ; encoding: [0x79,0x0f,0x8c,0xbf]
70
71s_waitcnt expcnt(2)
72// GCN: s_waitcnt expcnt(2) ; encoding: [0x2f,0x0f,0x8c,0xbf]
73
74s_waitcnt lgkmcnt(3)
75// GCN: s_waitcnt lgkmcnt(3) ; encoding: [0x7f,0x03,0x8c,0xbf]
76
77s_waitcnt lgkmcnt(9)
78// GCN: s_waitcnt lgkmcnt(9) ; encoding: [0x7f,0x09,0x8c,0xbf]
79
80s_waitcnt vmcnt(0), expcnt(0)
81// GCN: s_waitcnt vmcnt(0) expcnt(0) ; encoding: [0x00,0x0f,0x8c,0xbf]
82
83
84s_sethalt 9
85// GCN: s_sethalt 9 ; encoding: [0x09,0x00,0x8d,0xbf]
86
87s_sleep 10
88// GCN: s_sleep 10 ; encoding: [0x0a,0x00,0x8e,0xbf]
89
90s_setprio 1
91// GCN: s_setprio 1 ; encoding: [0x01,0x00,0x8f,0xbf]
92
93s_sendmsg 2
94// GCN: s_sendmsg 2 ; encoding: [0x02,0x00,0x90,0xbf]
95
96s_sendmsg 0x1
97// GCN: s_sendmsg sendmsg(MSG_INTERRUPT) ; encoding: [0x01,0x00,0x90,0xbf]
98
99s_sendmsg sendmsg(1)
100// GCN: s_sendmsg sendmsg(MSG_INTERRUPT) ; encoding: [0x01,0x00,0x90,0xbf]
101
102s_sendmsg sendmsg(MSG_INTERRUPT)
103// GCN: s_sendmsg sendmsg(MSG_INTERRUPT) ; encoding: [0x01,0x00,0x90,0xbf]
104
105s_sendmsg 0x12
106// GCN: s_sendmsg sendmsg(MSG_GS, GS_OP_CUT, 0) ; encoding: [0x12,0x00,0x90,0xbf]
107
108s_sendmsg sendmsg(2, 1)
109// GCN: s_sendmsg sendmsg(MSG_GS, GS_OP_CUT, 0) ; encoding: [0x12,0x00,0x90,0xbf]
110
111s_sendmsg sendmsg(MSG_GS, GS_OP_CUT, 0)
112// GCN: s_sendmsg sendmsg(MSG_GS, GS_OP_CUT, 0) ; encoding: [0x12,0x00,0x90,0xbf]
113
114s_sendmsg 0x122
115// GCN: s_sendmsg sendmsg(MSG_GS, GS_OP_EMIT, 1) ; encoding: [0x22,0x01,0x90,0xbf]
116
117s_sendmsg sendmsg(2, 2, 1)
118// GCN: s_sendmsg sendmsg(MSG_GS, GS_OP_EMIT, 1) ; encoding: [0x22,0x01,0x90,0xbf]
119
120s_sendmsg sendmsg(MSG_GS, GS_OP_EMIT, 1)
121// GCN: s_sendmsg sendmsg(MSG_GS, GS_OP_EMIT, 1) ; encoding: [0x22,0x01,0x90,0xbf]
122
123s_sendmsg 0x232
124// GCN: s_sendmsg sendmsg(MSG_GS, GS_OP_EMIT_CUT, 2) ; encoding: [0x32,0x02,0x90,0xbf]
125
126s_sendmsg sendmsg(2, 3, 2)
127// GCN: s_sendmsg sendmsg(MSG_GS, GS_OP_EMIT_CUT, 2) ; encoding: [0x32,0x02,0x90,0xbf]
128
129s_sendmsg sendmsg(MSG_GS, GS_OP_EMIT_CUT, 2)
130// GCN: s_sendmsg sendmsg(MSG_GS, GS_OP_EMIT_CUT, 2) ; encoding: [0x32,0x02,0x90,0xbf]
131
132s_sendmsg 0x3
133// GCN: s_sendmsg sendmsg(MSG_GS_DONE, GS_OP_NOP) ; encoding: [0x03,0x00,0x90,0xbf]
134
135s_sendmsg sendmsg(3, 0)
136// GCN: s_sendmsg sendmsg(MSG_GS_DONE, GS_OP_NOP) ; encoding: [0x03,0x00,0x90,0xbf]
137
138s_sendmsg sendmsg(MSG_GS_DONE, GS_OP_NOP)
139// GCN: s_sendmsg sendmsg(MSG_GS_DONE, GS_OP_NOP) ; encoding: [0x03,0x00,0x90,0xbf]
140
141s_sendmsg 0x4
142// GCN: s_sendmsg 4 ; encoding: [0x04,0x00,0x90,0xbf]
143
144s_sendmsg 11
145// GCN: s_sendmsg 11 ; encoding: [0x0b,0x00,0x90,0xbf]
146
147s_sendmsg 0x1f
148// GCN: s_sendmsg sendmsg(MSG_SYSMSG, SYSMSG_OP_ECC_ERR_INTERRUPT) ; encoding: [0x1f,0x00,0x90,0xbf]
149
150s_sendmsg sendmsg(15, 1)
151// GCN: s_sendmsg sendmsg(MSG_SYSMSG, SYSMSG_OP_ECC_ERR_INTERRUPT) ; encoding: [0x1f,0x00,0x90,0xbf]
152
153s_sendmsg sendmsg(MSG_SYSMSG, SYSMSG_OP_ECC_ERR_INTERRUPT)
154// GCN: s_sendmsg sendmsg(MSG_SYSMSG, SYSMSG_OP_ECC_ERR_INTERRUPT) ; encoding: [0x1f,0x00,0x90,0xbf]
155
156s_sendmsg 0x6f
157// GCN: s_sendmsg 111 ; encoding: [0x6f,0x00,0x90,0xbf]
158
159s_sendmsghalt 3
160// GCN: s_sendmsghalt sendmsg(MSG_GS_DONE, GS_OP_NOP) ; encoding: [0x03,0x00,0x91,0xbf]
161
162s_sendmsghalt sendmsg(MSG_GS, GS_OP_EMIT, 1)
163// GCN: s_sendmsghalt sendmsg(MSG_GS, GS_OP_EMIT, 1) ; encoding: [0x22,0x01,0x91,0xbf]
164
165s_trap 4
166// GCN: s_trap 4 ; encoding: [0x04,0x00,0x92,0xbf]
167
168s_icache_inv
169// GCN: s_icache_inv ; encoding: [0x00,0x00,0x93,0xbf]
170
171s_incperflevel 5
172// GCN: s_incperflevel 5 ; encoding: [0x05,0x00,0x94,0xbf]
173
174s_decperflevel 6
175// GCN: s_decperflevel 6 ; encoding: [0x06,0x00,0x95,0xbf]
176
177s_ttracedata
178// GCN: s_ttracedata ; encoding: [0x00,0x00,0x96,0xbf]
179