1 // RUN
: not llvm-mc
-arch
=amdgcn
-mcpu
=gfx900
-show-encoding
%s | FileCheck
-check-prefix
=GFX9
-check-prefix
=GCN
%s
2 // RUN
: not llvm-mc
-arch
=amdgcn
-mcpu
=gfx900
-show-encoding
2>&1 %s | FileCheck
-check-prefix
=GFX9-ERR
-check-prefix
=GCNERR
%s
3 // RUN
: not llvm-mc
-arch
=amdgcn
-mcpu
=tonga
-show-encoding
2>&1 %s | FileCheck
-check-prefix
=VI-ERR
-check-prefix
=GCNERR
%s
5 // RUN
: not llvm-mc
-arch
=amdgcn
-mcpu
=gfx1010
-show-encoding
%s | FileCheck
--check-prefixes
=GFX10
,W32
%s
6 // RUN
: not llvm-mc
-arch
=amdgcn
-mcpu
=gfx1010
-show-encoding
%s
2>&1 | FileCheck
--check-prefixes
=GFX10-ERR
,W32-ERR
%s
8 scratch_load_ubyte v1
, v2
, off
9 // GFX10
: encoding
: [0x00,0x40,0x20,0xdc,0x02,0x00,0x7d,0x01]
10 // GFX9
: scratch_load_ubyte v1
, v2
, off ; encoding
: [0x00,0x40,0x40,0xdc,0x02,0x00,0x7f,0x01]
11 // VI-ERR
: instruction
not supported on this GPU
13 scratch_load_ubyte v1
, v2
, off dlc
14 // GFX10
: encoding
: [0x00,0x50,0x20,0xdc,0x02,0x00,0x7d,0x01]
15 // GFX9-ERR
: error
: failed parsing operand
16 // VI-ERR
: error
: invalid operand for instruction
18 scratch_load_sbyte v1
, v2
, off
19 // GFX10
: encoding
: [0x00,0x40,0x24,0xdc,0x02,0x00,0x7d,0x01]
20 // GFX9
: scratch_load_sbyte v1
, v2
, off ; encoding
: [0x00,0x40,0x44,0xdc,0x02,0x00,0x7f,0x01]
21 // VI-ERR
: instruction
not supported on this GPU
23 scratch_load_sbyte v1
, v2
, off dlc
24 // GFX10
: encoding
: [0x00,0x50,0x24,0xdc,0x02,0x00,0x7d,0x01]
25 // GFX9-ERR
: error
: failed parsing operand
26 // VI-ERR
: error
: invalid operand for instruction
28 scratch_load_ushort v1
, v2
, off
29 // GFX10
: encoding
: [0x00,0x40,0x28,0xdc,0x02,0x00,0x7d,0x01]
30 // GFX9
: scratch_load_ushort v1
, v2
, off ; encoding
: [0x00,0x40,0x48,0xdc,0x02,0x00,0x7f,0x01]
31 // VI-ERR
: instruction
not supported on this GPU
33 scratch_load_ushort v1
, v2
, off dlc
34 // GFX10
: encoding
: [0x00,0x50,0x28,0xdc,0x02,0x00,0x7d,0x01]
35 // GFX9-ERR
: error
: failed parsing operand
36 // VI-ERR
: error
: invalid operand for instruction
38 scratch_load_sshort v1
, v2
, off
39 // GFX10
: encoding
: [0x00,0x40,0x2c,0xdc,0x02,0x00,0x7d,0x01]
40 // GFX9
: scratch_load_sshort v1
, v2
, off ; encoding
: [0x00,0x40,0x4c,0xdc,0x02,0x00,0x7f,0x01]
41 // VI-ERR
: instruction
not supported on this GPU
43 scratch_load_sshort v1
, v2
, off dlc
44 // GFX10
: encoding
: [0x00,0x50,0x2c,0xdc,0x02,0x00,0x7d,0x01]
45 // GFX9-ERR
: error
: failed parsing operand
46 // VI-ERR
: error
: invalid operand for instruction
48 scratch_load_dword v1
, v2
, off
49 // GFX10
: encoding
: [0x00,0x40,0x30,0xdc,0x02,0x00,0x7d,0x01]
50 // GFX9
: scratch_load_dword v1
, v2
, off ; encoding
: [0x00,0x40,0x50,0xdc,0x02,0x00,0x7f,0x01]
51 // VI-ERR
: instruction
not supported on this GPU
53 scratch_load_dword v1
, v2
, off dlc
54 // GFX10
: encoding
: [0x00,0x50,0x30,0xdc,0x02,0x00,0x7d,0x01]
55 // GFX9-ERR
: error
: failed parsing operand
56 // VI-ERR
: error
: invalid operand for instruction
58 scratch_load_dwordx2 v
[1:2], v3
, off
59 // GFX10
: encoding
: [0x00,0x40,0x34,0xdc,0x03,0x00,0x7d,0x01]
60 // GFX9
: scratch_load_dwordx2 v
[1:2], v3
, off ; encoding
: [0x00,0x40,0x54,0xdc,0x03,0x00,0x7f,0x01]
61 // VI-ERR
: instruction
not supported on this GPU
63 scratch_load_dwordx2 v
[1:2], v3
, off dlc
64 // GFX10
: encoding
: [0x00,0x50,0x34,0xdc,0x03,0x00,0x7d,0x01]
65 // GFX9-ERR
: error
: failed parsing operand
66 // VI-ERR
: error
: invalid operand for instruction
68 scratch_load_dwordx3 v
[1:3], v4
, off
69 // GFX10
: encoding
: [0x00,0x40,0x3c,0xdc,0x04,0x00,0x7d,0x01]
70 // GFX9
: scratch_load_dwordx3 v
[1:3], v4
, off ; encoding
: [0x00,0x40,0x58,0xdc,0x04,0x00,0x7f,0x01]
71 // VI-ERR
: instruction
not supported on this GPU
73 scratch_load_dwordx3 v
[1:3], v4
, off dlc
74 // GFX10
: encoding
: [0x00,0x50,0x3c,0xdc,0x04,0x00,0x7d,0x01]
75 // GFX9-ERR
: error
: failed parsing operand
76 // VI-ERR
: error
: invalid operand for instruction
78 scratch_load_dwordx4 v
[1:4], v5
, off
79 // GFX10
: encoding
: [0x00,0x40,0x38,0xdc,0x05,0x00,0x7d,0x01]
80 // GFX9
: scratch_load_dwordx4 v
[1:4], v5
, off ; encoding
: [0x00,0x40,0x5c,0xdc,0x05,0x00,0x7f,0x01]
81 // VI-ERR
: instruction
not supported on this GPU
83 scratch_load_dwordx4 v
[1:4], v5
, off dlc
84 // GFX10
: encoding
: [0x00,0x50,0x38,0xdc,0x05,0x00,0x7d,0x01]
85 // GFX9-ERR
: error
: failed parsing operand
86 // VI-ERR
: error
: invalid operand for instruction
88 scratch_load_dword v1
, v2
, off offset
:0
89 // GFX10
: encoding
: [0x00,0x40,0x30,0xdc,0x02,0x00,0x7d,0x01]
90 // GFX9
: scratch_load_dword v1
, v2
, off ; encoding
: [0x00,0x40,0x50,0xdc,0x02,0x00,0x7f,0x01]
91 // VI-ERR
: error
: not a valid operand.
93 scratch_load_dword v1
, v2
, off offset
:4095
94 // GFX10-ERR
: :32: error
: expected
a 12-bit signed offset
95 // GFX9
: scratch_load_dword v1
, v2
, off offset
:4095 ; encoding
: [0xff,0x4f,0x50,0xdc,0x02,0x00,0x7f,0x01]
96 // VI-ERR
: :32: error
: not a valid operand.
98 scratch_load_dword v1
, v2
, off offset
:-1
99 // GFX10
: encoding
: [0xff,0x4f,0x30,0xdc,0x02,0x00,0x7d,0x01]
100 // GFX9
: scratch_load_dword v1
, v2
, off offset
:-1 ; encoding
: [0xff,0x5f,0x50,0xdc,0x02,0x00,0x7f,0x01]
101 // VI-ERR
: error
: not a valid operand.
103 scratch_load_dword v1
, v2
, off offset
:-4096
104 // GFX10-ERR
: :32: error
: expected
a 12-bit signed offset
105 // GFX9
: scratch_load_dword v1
, v2
, off offset
:-4096 ; encoding
: [0x00,0x50,0x50,0xdc,0x02,0x00,0x7f,0x01]
106 // VI-ERR
: :32: error
: not a valid operand.
108 scratch_load_dword v1
, v2
, off offset
:4096
109 // GFX10-ERR
: :32: error
: expected
a 12-bit signed offset
110 // GFX9-ERR
: :32: error
: expected
a 13-bit signed offset
111 // VI-ERR
: :32: error
: not a valid operand.
113 scratch_load_dword v1
, v2
, off offset
:-4097
114 // GFX10-ERR
: :32: error
: expected
a 12-bit signed offset
115 // GFX9-ERR
: :32: error
: expected
a 13-bit signed offset
116 // VI-ERR
: :32: error
: not a valid operand.
118 scratch_load_dword v0
, v1
, off offset
:-2049 glc slc
119 // GFX10-ERR
: :32: error
: expected
a 12-bit signed offset
120 // GFX9
: scratch_load_dword v0
, v1
, off offset
:-2049 glc slc ; encoding
: [0xff,0x57,0x53,0xdc,0x01,0x00,0x7f,0x00]
121 // VI-ERR
: :32: error
: not a valid operand.
123 scratch_load_dword v0
, v1
, off offset
:-2048 glc slc
124 // GFX10
: scratch_load_dword v0
, v1
, off offset
:-2048 glc slc ; encoding
: [0x00,0x48,0x33,0xdc,0x01,0x00,0x7d,0x00]
125 // GFX9
: scratch_load_dword v0
, v1
, off offset
:-2048 glc slc ; encoding
: [0x00,0x58,0x53,0xdc,0x01,0x00,0x7f,0x00]
126 // VI-ERR
: :32: error
: not a valid operand.
128 scratch_load_dword v255
, off
, s1 offset
:2047
129 // GFX10
: scratch_load_dword v255
, off
, s1 offset
:2047 ; encoding
: [0xff,0x47,0x30,0xdc,0x00,0x00,0x01,0xff]
130 // GFX9
: scratch_load_dword v255
, off
, s1 offset
:2047 ; encoding
: [0xff,0x47,0x50,0xdc,0x00,0x00,0x01,0xff]
131 // VI-ERR
: :34: error
: not a valid operand.
133 scratch_load_dword v255
, off
, s0 offset
:2048
134 // GFX10-ERR
: :34: error
: expected
a 12-bit signed offset
135 // GFX9
: scratch_load_dword v255
, off
, s0 offset
:2048 ; encoding
: [0x00,0x48,0x50,0xdc,0x00,0x00,0x00,0xff]
136 // VI-ERR
: :34: error
: not a valid operand.
138 scratch_store_byte v1
, v2
, off
139 // GFX10
: encoding
: [0x00,0x40,0x60,0xdc,0x01,0x02,0x7d,0x00]
140 // GFX9
: scratch_store_byte v1
, v2
, off ; encoding
: [0x00,0x40,0x60,0xdc,0x01,0x02,0x7f,0x00]
141 // VI-ERR
: instruction
not supported on this GPU
143 scratch_store_byte v1
, v2
, off dlc
144 // GFX10
: encoding
: [0x00,0x50,0x60,0xdc,0x01,0x02,0x7d,0x00]
145 // GFX9-ERR
: error
: failed parsing operand
146 // VI-ERR
: error
: invalid operand for instruction
148 scratch_store_short v1
, v2
, off
149 // GFX10
: encoding
: [0x00,0x40,0x68,0xdc,0x01,0x02,0x7d,0x00]
150 // GFX9
: scratch_store_short v1
, v2
, off ; encoding
: [0x00,0x40,0x68,0xdc,0x01,0x02,0x7f,0x00]
151 // VI-ERR
: instruction
not supported on this GPU
153 scratch_store_short v1
, v2
, off dlc
154 // GFX10
: encoding
: [0x00,0x50,0x68,0xdc,0x01,0x02,0x7d,0x00]
155 // GFX9-ERR
: error
: failed parsing operand
156 // VI-ERR
: error
: invalid operand for instruction
158 scratch_store_dword v1
, v2
, off
159 // GFX10
: encoding
: [0x00,0x40,0x70,0xdc,0x01,0x02,0x7d,0x00]
160 // GFX9
: scratch_store_dword v1
, v2
, off ; encoding
: [0x00,0x40,0x70,0xdc,0x01,0x02,0x7f,0x00]
161 // VI-ERR
: instruction
not supported on this GPU
163 scratch_store_dword v1
, v2
, off dlc
164 // GFX10
: encoding
: [0x00,0x50,0x70,0xdc,0x01,0x02,0x7d,0x00]
165 // GFX9-ERR
: error
: failed parsing operand
166 // VI-ERR
: error
: invalid operand for instruction
168 scratch_store_dwordx2 v1
, v
[2:3], off
169 // GFX10
: encoding
: [0x00,0x40,0x74,0xdc,0x01,0x02,0x7d,0x00]
170 // GFX9
: scratch_store_dwordx2 v1
, v
[2:3], off ; encoding
: [0x00,0x40,0x74,0xdc,0x01,0x02,0x7f,0x00]
171 // VI-ERR
: instruction
not supported on this GPU
173 scratch_store_dwordx2 v1
, v
[2:3], off dlc
174 // GFX10
: encoding
: [0x00,0x50,0x74,0xdc,0x01,0x02,0x7d,0x00]
175 // GFX9-ERR
: error
: failed parsing operand
176 // VI-ERR
: error
: invalid operand for instruction
178 scratch_store_dwordx3 v1
, v
[2:4], off
179 // GFX10
: encoding
: [0x00,0x40,0x7c,0xdc,0x01,0x02,0x7d,0x00]
180 // GFX9
: scratch_store_dwordx3 v1
, v
[2:4], off ; encoding
: [0x00,0x40,0x78,0xdc,0x01,0x02,0x7f,0x00]
181 // VI-ERR
: instruction
not supported on this GPU
183 scratch_store_dwordx3 v1
, v
[2:4], off dlc
184 // GFX10
: encoding
: [0x00,0x50,0x7c,0xdc,0x01,0x02,0x7d,0x00]
185 // GFX9-ERR
: error
: failed parsing operand
186 // VI-ERR
: error
: invalid operand for instruction
188 scratch_store_dwordx4 v1
, v
[2:5], off
189 // GFX10
: encoding
: [0x00,0x40,0x78,0xdc,0x01,0x02,0x7d,0x00]
190 // GFX9
: scratch_store_dwordx4 v1
, v
[2:5], off ; encoding
: [0x00,0x40,0x7c,0xdc,0x01,0x02,0x7f,0x00]
191 // VI-ERR
: instruction
not supported on this GPU
193 scratch_store_dwordx4 v1
, v
[2:5], off dlc
194 // GFX10
: encoding
: [0x00,0x50,0x78,0xdc,0x01,0x02,0x7d,0x00]
195 // GFX9-ERR
: error
: failed parsing operand
196 // VI-ERR
: error
: invalid operand for instruction
198 scratch_store_dword v1
, v2
, off offset
:12
199 // GFX10
: encoding
: [0x0c,0x40,0x70,0xdc,0x01,0x02,0x7d,0x00]
200 // GFX9
: scratch_store_dword v1
, v2
, off offset
:12 ; encoding
: [0x0c,0x40,0x70,0xdc,0x01,0x02,0x7f,0x00]
201 // VI-ERR
: error
: not a valid operand
203 scratch_load_dword v1
, off
, s1
204 // GFX10
: encoding
: [0x00,0x40,0x30,0xdc,0x00,0x00,0x01,0x01]
205 // GFX9
: scratch_load_dword v1
, off
, s1 ; encoding
: [0x00,0x40,0x50,0xdc,0x00,0x00,0x01,0x01]
206 // VI-ERR
: instruction
not supported on this GPU
208 scratch_load_dword v1
, off
, s1 offset
:32
209 // GFX10
: encoding
: [0x20,0x40,0x30,0xdc,0x00,0x00,0x01,0x01]
210 // GFX9
: scratch_load_dword v1
, off
, s1 offset
:32 ; encoding
: [0x20,0x40,0x50,0xdc,0x00,0x00,0x01,0x01]
211 // VI-ERR
: error
: not a valid operand
213 scratch_store_dword off
, v2
, s1
214 // GFX10
: encoding
: [0x00,0x40,0x70,0xdc,0x00,0x02,0x01,0x00]
215 // GFX9
: scratch_store_dword off
, v2
, s1 ; encoding
: [0x00,0x40,0x70,0xdc,0x00,0x02,0x01,0x00]
216 // VI-ERR
: instruction
not supported on this GPU
218 scratch_store_dword off
, v2
, s1 offset
:12
219 // GFX10
: encoding
: [0x0c,0x40,0x70,0xdc,0x00,0x02,0x01,0x00]
220 // GFX9
: scratch_store_dword off
, v2
, s1 offset
:12 ; encoding
: [0x0c,0x40,0x70,0xdc,0x00,0x02,0x01,0x00]
221 // VI-ERR
: error
: not a valid operand
223 // FIXME
: Should error about multiple offsets
224 scratch_load_dword v1
, v2
, s1
225 // GFX10-ERR
: error
: invalid operand for instruction
226 // GFX9-ERR
: error
: invalid operand for instruction
227 // VI-ERR
: error
: invalid operand for instruction
229 scratch_load_dword v1
, v2
, s1 offset
:32
230 // GFX10-ERR
: error
: invalid operand for instruction
231 // GFX9-ERR
: error
: invalid operand for instruction
232 // VI-ERR
: error
: not a valid operand
234 scratch_store_dword v1
, v2
, s1
235 // GFX10-ERR
: error
: invalid operand for instruction
236 // GFX9-ERR
: error
: invalid operand for instruction
237 // VI-ERR
: error
: invalid operand for instruction
239 scratch_store_dword v1
, v2
, s1 offset
:32
240 // GFX10-ERR
: error
: invalid operand for instruction
241 // GFX9-ERR
: error
: invalid operand for instruction
242 // VI-ERR
: error
: not a valid operand
244 scratch_load_dword v1
, off
, exec_hi
245 // GFX10-ERR
: error
: invalid operand for instruction
246 // GFX9-ERR
: error
: invalid operand for instruction
247 // VI-ERR
: error
: invalid operand for instruction
249 scratch_store_dword off
, v2
, exec_hi
250 // GFX10-ERR
: error
: invalid operand for instruction
251 // GFX9-ERR
: error
: invalid operand for instruction
252 // VI-ERR
: error
: invalid operand for instruction
254 scratch_load_dword v1
, off
, exec_lo
255 // GFX10
: encoding
: [0x00,0x40,0x30,0xdc,0x00,0x00,0x7e,0x01]
256 // GFX9
: scratch_load_dword v1
, off
, exec_lo ; encoding
: [0x00,0x40,0x50,0xdc,0x00,0x00,0x7e,0x01]
257 // VI-ERR
: instruction
not supported on this GPU
259 scratch_store_dword off
, v2
, exec_lo
260 // GFX10
: encoding
: [0x00,0x40,0x70,0xdc,0x00,0x02,0x7e,0x00]
261 // GFX9
: scratch_store_dword off
, v2
, exec_lo ; encoding
: [0x00,0x40,0x70,0xdc,0x00,0x02,0x7e,0x00]
262 // VI-ERR
: instruction
not supported on this GPU
264 scratch_load_dword v1
, off
, m0
265 // GFX10
: encoding
: [0x00,0x40,0x30,0xdc,0x00,0x00,0x7c,0x01]
266 // GFX9
: scratch_load_dword v1
, off
, m0 ; encoding
: [0x00,0x40,0x50,0xdc,0x00,0x00,0x7c,0x01]
267 // VI-ERR
: instruction
not supported on this GPU
269 scratch_store_dword off
, v2
, m0
270 // GFX10
: encoding
: [0x00,0x40,0x70,0xdc,0x00,0x02,0x7c,0x00]
271 // GFX9
: scratch_store_dword off
, v2
, m0 ; encoding
: [0x00,0x40,0x70,0xdc,0x00,0x02,0x7c,0x00]
272 // VI-ERR
: instruction
not supported on this GPU
274 scratch_load_ubyte_d16 v1
, v2
, off
275 // GFX10
: encoding
: [0x00,0x40,0x80,0xdc,0x02,0x00,0x7d,0x01]
276 // GFX9
: scratch_load_ubyte_d16 v1
, v2
, off ; encoding
: [0x00,0x40,0x80,0xdc,0x02,0x00,0x7f,0x01]
277 // VI-ERR
: instruction
not supported on this GPU
279 scratch_load_ubyte_d16_hi v1
, v2
, off
280 // GFX10
: encoding
: [0x00,0x40,0x84,0xdc,0x02,0x00,0x7d,0x01]
281 // GFX9
: scratch_load_ubyte_d16_hi v1
, v2
, off ; encoding
: [0x00,0x40,0x84,0xdc,0x02,0x00,0x7f,0x01]
282 // VI-ERR
: instruction
not supported on this GPU
284 scratch_load_sbyte_d16 v1
, v2
, off
285 // GFX10
: encoding
: [0x00,0x40,0x88,0xdc,0x02,0x00,0x7d,0x01]
286 // GFX9
: scratch_load_sbyte_d16 v1
, v2
, off ; encoding
: [0x00,0x40,0x88,0xdc,0x02,0x00,0x7f,0x01]
287 // VI-ERR
: instruction
not supported on this GPU
289 scratch_load_sbyte_d16_hi v1
, v2
, off
290 // GFX10
: encoding
: [0x00,0x40,0x8c,0xdc,0x02,0x00,0x7d,0x01]
291 // GFX9
: scratch_load_sbyte_d16_hi v1
, v2
, off ; encoding
: [0x00,0x40,0x8c,0xdc,0x02,0x00,0x7f,0x01]
292 // VI-ERR
: instruction
not supported on this GPU
294 scratch_load_short_d16 v1
, v2
, off
295 // GFX10
: encoding
: [0x00,0x40,0x90,0xdc,0x02,0x00,0x7d,0x01]
296 // GFX9
: scratch_load_short_d16 v1
, v2
, off ; encoding
: [0x00,0x40,0x90,0xdc,0x02,0x00,0x7f,0x01]
297 // VI-ERR
: instruction
not supported on this GPU
299 scratch_load_short_d16_hi v1
, v2
, off
300 // GFX10
: encoding
: [0x00,0x40,0x94,0xdc,0x02,0x00,0x7d,0x01]
301 // GFX9
: scratch_load_short_d16_hi v1
, v2
, off ; encoding
: [0x00,0x40,0x94,0xdc,0x02,0x00,0x7f,0x01]
302 // VI-ERR
: instruction
not supported on this GPU
304 scratch_store_byte_d16_hi off
, v2
, s1
305 // GFX10
: encoding
: [0x00,0x40,0x64,0xdc,0x00,0x02,0x01,0x00]
306 // GFX9
: scratch_store_byte_d16_hi off
, v2
, s1 ; encoding
: [0x00,0x40,0x64,0xdc,0x00,0x02,0x01,0x00]
307 // VI-ERR
: instruction
not supported on this GPU
309 scratch_store_short_d16_hi off
, v2
, s1
310 // GFX10
: encoding
: [0x00,0x40,0x6c,0xdc,0x00,0x02,0x01,0x00]
311 // GFX9
: scratch_store_short_d16_hi off
, v2
, s1 ; encoding
: [0x00,0x40,0x6c,0xdc,0x00,0x02,0x01,0x00]
312 // VI-ERR
: instruction
not supported on this GPU