[llvm-readobj] - Simplify stack-sizes.test test case.
[llvm-complete.git] / test / MC / AMDGPU / flat-scratch-instructions.s
blob3d1339023f420dee67c0d1db65759b2e5879d9ad
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_store_byte v1, v2, off
119 // GFX10: encoding: [0x00,0x40,0x60,0xdc,0x01,0x02,0x7d,0x00]
120 // GFX9: scratch_store_byte v1, v2, off ; encoding: [0x00,0x40,0x60,0xdc,0x01,0x02,0x7f,0x00]
121 // VI-ERR: instruction not supported on this GPU
123 scratch_store_byte v1, v2, off dlc
124 // GFX10: encoding: [0x00,0x50,0x60,0xdc,0x01,0x02,0x7d,0x00]
125 // GFX9-ERR: error: failed parsing operand
126 // VI-ERR: error: invalid operand for instruction
128 scratch_store_short v1, v2, off
129 // GFX10: encoding: [0x00,0x40,0x68,0xdc,0x01,0x02,0x7d,0x00]
130 // GFX9: scratch_store_short v1, v2, off ; encoding: [0x00,0x40,0x68,0xdc,0x01,0x02,0x7f,0x00]
131 // VI-ERR: instruction not supported on this GPU
133 scratch_store_short v1, v2, off dlc
134 // GFX10: encoding: [0x00,0x50,0x68,0xdc,0x01,0x02,0x7d,0x00]
135 // GFX9-ERR: error: failed parsing operand
136 // VI-ERR: error: invalid operand for instruction
138 scratch_store_dword v1, v2, off
139 // GFX10: encoding: [0x00,0x40,0x70,0xdc,0x01,0x02,0x7d,0x00]
140 // GFX9: scratch_store_dword v1, v2, off ; encoding: [0x00,0x40,0x70,0xdc,0x01,0x02,0x7f,0x00]
141 // VI-ERR: instruction not supported on this GPU
143 scratch_store_dword v1, v2, off dlc
144 // GFX10: encoding: [0x00,0x50,0x70,0xdc,0x01,0x02,0x7d,0x00]
145 // GFX9-ERR: error: failed parsing operand
146 // VI-ERR: error: invalid operand for instruction
148 scratch_store_dwordx2 v1, v[2:3], off
149 // GFX10: encoding: [0x00,0x40,0x74,0xdc,0x01,0x02,0x7d,0x00]
150 // GFX9: scratch_store_dwordx2 v1, v[2:3], off ; encoding: [0x00,0x40,0x74,0xdc,0x01,0x02,0x7f,0x00]
151 // VI-ERR: instruction not supported on this GPU
153 scratch_store_dwordx2 v1, v[2:3], off dlc
154 // GFX10: encoding: [0x00,0x50,0x74,0xdc,0x01,0x02,0x7d,0x00]
155 // GFX9-ERR: error: failed parsing operand
156 // VI-ERR: error: invalid operand for instruction
158 scratch_store_dwordx3 v1, v[2:4], off
159 // GFX10: encoding: [0x00,0x40,0x7c,0xdc,0x01,0x02,0x7d,0x00]
160 // GFX9: scratch_store_dwordx3 v1, v[2:4], off ; encoding: [0x00,0x40,0x78,0xdc,0x01,0x02,0x7f,0x00]
161 // VI-ERR: instruction not supported on this GPU
163 scratch_store_dwordx3 v1, v[2:4], off dlc
164 // GFX10: encoding: [0x00,0x50,0x7c,0xdc,0x01,0x02,0x7d,0x00]
165 // GFX9-ERR: error: failed parsing operand
166 // VI-ERR: error: invalid operand for instruction
168 scratch_store_dwordx4 v1, v[2:5], off
169 // GFX10: encoding: [0x00,0x40,0x78,0xdc,0x01,0x02,0x7d,0x00]
170 // GFX9: scratch_store_dwordx4 v1, v[2:5], off ; encoding: [0x00,0x40,0x7c,0xdc,0x01,0x02,0x7f,0x00]
171 // VI-ERR: instruction not supported on this GPU
173 scratch_store_dwordx4 v1, v[2:5], off dlc
174 // GFX10: encoding: [0x00,0x50,0x78,0xdc,0x01,0x02,0x7d,0x00]
175 // GFX9-ERR: error: failed parsing operand
176 // VI-ERR: error: invalid operand for instruction
178 scratch_store_dword v1, v2, off offset:12
179 // GFX10: encoding: [0x0c,0x40,0x70,0xdc,0x01,0x02,0x7d,0x00]
180 // GFX9: scratch_store_dword v1, v2, off offset:12 ; encoding: [0x0c,0x40,0x70,0xdc,0x01,0x02,0x7f,0x00]
181 // VI-ERR: error: not a valid operand
183 scratch_load_dword v1, off, s1
184 // GFX10: encoding: [0x00,0x40,0x30,0xdc,0x00,0x00,0x01,0x01]
185 // GFX9: scratch_load_dword v1, off, s1 ; encoding: [0x00,0x40,0x50,0xdc,0x00,0x00,0x01,0x01]
186 // VI-ERR: instruction not supported on this GPU
188 scratch_load_dword v1, off, s1 offset:32
189 // GFX10: encoding: [0x20,0x40,0x30,0xdc,0x00,0x00,0x01,0x01]
190 // GFX9: scratch_load_dword v1, off, s1 offset:32 ; encoding: [0x20,0x40,0x50,0xdc,0x00,0x00,0x01,0x01]
191 // VI-ERR: error: not a valid operand
193 scratch_store_dword off, v2, s1
194 // GFX10: encoding: [0x00,0x40,0x70,0xdc,0x00,0x02,0x01,0x00]
195 // GFX9: scratch_store_dword off, v2, s1 ; encoding: [0x00,0x40,0x70,0xdc,0x00,0x02,0x01,0x00]
196 // VI-ERR: instruction not supported on this GPU
198 scratch_store_dword off, v2, s1 offset:12
199 // GFX10: encoding: [0x0c,0x40,0x70,0xdc,0x00,0x02,0x01,0x00]
200 // GFX9: scratch_store_dword off, v2, s1 offset:12 ; encoding: [0x0c,0x40,0x70,0xdc,0x00,0x02,0x01,0x00]
201 // VI-ERR: error: not a valid operand
203 // FIXME: Should error about multiple offsets
204 scratch_load_dword v1, v2, s1
205 // GFX10-ERR: error: invalid operand for instruction
206 // GFX9-ERR: error: invalid operand for instruction
207 // VI-ERR: error: invalid operand for instruction
209 scratch_load_dword v1, v2, s1 offset:32
210 // GFX10-ERR: error: invalid operand for instruction
211 // GFX9-ERR: error: invalid operand for instruction
212 // VI-ERR: error: not a valid operand
214 scratch_store_dword v1, v2, s1
215 // GFX10-ERR: error: invalid operand for instruction
216 // GFX9-ERR: error: invalid operand for instruction
217 // VI-ERR: error: invalid operand for instruction
219 scratch_store_dword v1, v2, s1 offset:32
220 // GFX10-ERR: error: invalid operand for instruction
221 // GFX9-ERR: error: invalid operand for instruction
222 // VI-ERR: error: not a valid operand
224 scratch_load_dword v1, off, exec_hi
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_store_dword off, v2, exec_hi
230 // GFX10-ERR: error: invalid operand for instruction
231 // GFX9-ERR: error: invalid operand for instruction
232 // VI-ERR: error: invalid operand for instruction
234 scratch_load_dword v1, off, exec_lo
235 // GFX10: encoding: [0x00,0x40,0x30,0xdc,0x00,0x00,0x7e,0x01]
236 // GFX9: scratch_load_dword v1, off, exec_lo ; encoding: [0x00,0x40,0x50,0xdc,0x00,0x00,0x7e,0x01]
237 // VI-ERR: instruction not supported on this GPU
239 scratch_store_dword off, v2, exec_lo
240 // GFX10: encoding: [0x00,0x40,0x70,0xdc,0x00,0x02,0x7e,0x00]
241 // GFX9: scratch_store_dword off, v2, exec_lo ; encoding: [0x00,0x40,0x70,0xdc,0x00,0x02,0x7e,0x00]
242 // VI-ERR: instruction not supported on this GPU
244 scratch_load_dword v1, off, m0
245 // GFX10: encoding: [0x00,0x40,0x30,0xdc,0x00,0x00,0x7c,0x01]
246 // GFX9: scratch_load_dword v1, off, m0 ; encoding: [0x00,0x40,0x50,0xdc,0x00,0x00,0x7c,0x01]
247 // VI-ERR: instruction not supported on this GPU
249 scratch_store_dword off, v2, m0
250 // GFX10: encoding: [0x00,0x40,0x70,0xdc,0x00,0x02,0x7c,0x00]
251 // GFX9: scratch_store_dword off, v2, m0 ; encoding: [0x00,0x40,0x70,0xdc,0x00,0x02,0x7c,0x00]
252 // VI-ERR: instruction not supported on this GPU
254 scratch_load_ubyte_d16 v1, v2, off
255 // GFX10: encoding: [0x00,0x40,0x80,0xdc,0x02,0x00,0x7d,0x01]
256 // GFX9: scratch_load_ubyte_d16 v1, v2, off ; encoding: [0x00,0x40,0x80,0xdc,0x02,0x00,0x7f,0x01]
257 // VI-ERR: instruction not supported on this GPU
259 scratch_load_ubyte_d16_hi v1, v2, off
260 // GFX10: encoding: [0x00,0x40,0x84,0xdc,0x02,0x00,0x7d,0x01]
261 // GFX9: scratch_load_ubyte_d16_hi v1, v2, off ; encoding: [0x00,0x40,0x84,0xdc,0x02,0x00,0x7f,0x01]
262 // VI-ERR: instruction not supported on this GPU
264 scratch_load_sbyte_d16 v1, v2, off
265 // GFX10: encoding: [0x00,0x40,0x88,0xdc,0x02,0x00,0x7d,0x01]
266 // GFX9: scratch_load_sbyte_d16 v1, v2, off ; encoding: [0x00,0x40,0x88,0xdc,0x02,0x00,0x7f,0x01]
267 // VI-ERR: instruction not supported on this GPU
269 scratch_load_sbyte_d16_hi v1, v2, off
270 // GFX10: encoding: [0x00,0x40,0x8c,0xdc,0x02,0x00,0x7d,0x01]
271 // GFX9: scratch_load_sbyte_d16_hi v1, v2, off ; encoding: [0x00,0x40,0x8c,0xdc,0x02,0x00,0x7f,0x01]
272 // VI-ERR: instruction not supported on this GPU
274 scratch_load_short_d16 v1, v2, off
275 // GFX10: encoding: [0x00,0x40,0x90,0xdc,0x02,0x00,0x7d,0x01]
276 // GFX9: scratch_load_short_d16 v1, v2, off ; encoding: [0x00,0x40,0x90,0xdc,0x02,0x00,0x7f,0x01]
277 // VI-ERR: instruction not supported on this GPU
279 scratch_load_short_d16_hi v1, v2, off
280 // GFX10: encoding: [0x00,0x40,0x94,0xdc,0x02,0x00,0x7d,0x01]
281 // GFX9: scratch_load_short_d16_hi v1, v2, off ; encoding: [0x00,0x40,0x94,0xdc,0x02,0x00,0x7f,0x01]
282 // VI-ERR: instruction not supported on this GPU
284 scratch_store_byte_d16_hi off, v2, s1
285 // GFX10: encoding: [0x00,0x40,0x64,0xdc,0x00,0x02,0x01,0x00]
286 // GFX9: scratch_store_byte_d16_hi off, v2, s1 ; encoding: [0x00,0x40,0x64,0xdc,0x00,0x02,0x01,0x00]
287 // VI-ERR: instruction not supported on this GPU
289 scratch_store_short_d16_hi off, v2, s1
290 // GFX10: encoding: [0x00,0x40,0x6c,0xdc,0x00,0x02,0x01,0x00]
291 // GFX9: scratch_store_short_d16_hi off, v2, s1 ; encoding: [0x00,0x40,0x6c,0xdc,0x00,0x02,0x01,0x00]
292 // VI-ERR: instruction not supported on this GPU