1// RUN: not llvm-mc -arch=amdgcn -show-encoding %s | FileCheck %s --check-prefix=GCN --check-prefix=SICI --check-prefix=SICIVI
2// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s | FileCheck %s --check-prefix=GCN --check-prefix=SICI --check-prefix=SICIVI
3// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s | FileCheck %s --check-prefix=GCN --check-prefix=SICI --check-prefix=SICIVI
4// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s | FileCheck %s --check-prefix=GCN  --check-prefix=SICIVI --check-prefix=VI --check-prefix=GFX89 --check-prefix=GFX8_0
5// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx810 -show-encoding %s | FileCheck %s --check-prefix=GCN  --check-prefix=SICIVI --check-prefix=VI --check-prefix=GFX89 --check-prefix=GFX8_1
6// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck %s --check-prefix=GCN --check-prefix=GFX9 --check-prefix=GFX89
7
8// RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck %s --check-prefix=NOSICI --implicit-check-not=error:
9// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck %s --check-prefix=NOSICI --implicit-check-not=error:
10// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire %s 2>&1 | FileCheck %s --check-prefix=NOSICI --implicit-check-not=error:
11// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji %s 2>&1 | FileCheck %s --check-prefix=NOVI --check-prefix=NOGFX8_0 --implicit-check-not=error:
12// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx810 %s 2>&1 | FileCheck %s --check-prefix=NOVI --check-prefix=NOGFX8_1 --implicit-check-not=error:
13// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck %s --check-prefix=NOGFX9 --implicit-check-not=error:
14
15//===----------------------------------------------------------------------===//
16// Image Load/Store
17//===----------------------------------------------------------------------===//
18
19image_load    v[4:6], v[237:240], s[28:35] dmask:0x7 unorm
20// GCN:  image_load v[4:6], v[237:240], s[28:35] dmask:0x7 unorm ; encoding: [0x00,0x17,0x00,0xf0,0xed,0x04,0x07,0x00]
21
22image_load    v4, v237, s[28:35]
23// GCN:  image_load v4, v237, s[28:35] ; encoding: [0x00,0x00,0x00,0xf0,0xed,0x04,0x07,0x00]
24
25image_load    v4, v[237:238], s[28:35]
26// GCN:  image_load v4, v[237:238], s[28:35] ; encoding: [0x00,0x00,0x00,0xf0,0xed,0x04,0x07,0x00]
27
28image_load    v4, v[237:239], s[28:35]
29// GCN:  image_load v4, v[237:239], s[28:35] ; encoding: [0x00,0x00,0x00,0xf0,0xed,0x04,0x07,0x00]
30
31image_load    v4, v[237:240], s[28:35]
32// GCN:  image_load v4, v[237:240], s[28:35] ; encoding: [0x00,0x00,0x00,0xf0,0xed,0x04,0x07,0x00]
33
34image_load    v[4:7], v[237:240], s[28:35] dmask:0x7 tfe
35// GCN:  image_load v[4:7], v[237:240], s[28:35] dmask:0x7 tfe ; encoding: [0x00,0x07,0x01,0xf0,0xed,0x04,0x07,0x00]
36
37// Verify support of all possible modifiers.
38// FIXME: This test is incorrect because r128 assumes a 128-bit SRSRC.
39image_load    v[5:6], v[1:4], s[8:15] dmask:0x1 unorm glc slc r128 tfe lwe da d16
40// NOSICI: error: d16 modifier is not supported on this GPU
41// VI:     image_load v[5:6], v[1:4], s[8:15] dmask:0x1 unorm glc slc r128 tfe lwe da d16 ; encoding: [0x00,0xf1,0x03,0xf2,0x01,0x05,0x02,0x80]
42// NOGFX9: error: r128 modifier is not supported on this GPU
43
44image_load v5, v[1:4], s[8:15] d16
45// NOSICI: error: d16 modifier is not supported on this GPU
46// GFX89:  image_load v5, v[1:4], s[8:15] d16 ; encoding: [0x00,0x00,0x00,0xf0,0x01,0x05,0x02,0x80]
47
48image_load v5, v[1:4], s[8:15] r128
49// SICIVI: image_load v5, v[1:4], s[8:15] r128 ; encoding: [0x00,0x80,0x00,0xf0,0x01,0x05,0x02,0x00]
50// NOGFX9: error: r128 modifier is not supported on this GPU
51
52image_store   v[193:195], v[237:240], s[28:35] dmask:0x7 unorm
53// GCN: image_store v[193:195], v[237:240], s[28:35] dmask:0x7 unorm ; encoding: [0x00,0x17,0x20,0xf0,0xed,0xc1,0x07,0x00]
54
55image_store   v193, v237, s[28:35]
56// GCN: image_store v193, v237, s[28:35] ; encoding: [0x00,0x00,0x20,0xf0,0xed,0xc1,0x07,0x00]
57
58image_store   v193, v[237:238], s[28:35]
59// GCN: image_store v193, v[237:238], s[28:35] ; encoding: [0x00,0x00,0x20,0xf0,0xed,0xc1,0x07,0x00]
60
61image_store   v193, v[237:239], s[28:35]
62// GCN: image_store v193, v[237:239], s[28:35] ; encoding: [0x00,0x00,0x20,0xf0,0xed,0xc1,0x07,0x00]
63
64image_store   v193, v[237:240], s[28:35]
65// GCN: image_store v193, v[237:240], s[28:35] ; encoding: [0x00,0x00,0x20,0xf0,0xed,0xc1,0x07,0x00]
66
67image_store   v[193:194], v[237:240], s[28:35] tfe
68// GCN: image_store v[193:194], v[237:240], s[28:35] tfe ; encoding: [0x00,0x00,0x21,0xf0,0xed,0xc1,0x07,0x00]
69
70// Verify support of all possible modifiers.
71// FIXME: This test is incorrect because r128 assumes a 128-bit SRSRC.
72image_store   v5, v[1:4], s[8:15] dmask:0x1 unorm glc slc r128 lwe da d16
73// NOSICI: error: d16 modifier is not supported on this GPU
74// VI:     image_store v5, v[1:4], s[8:15] dmask:0x1 unorm glc slc r128 lwe da d16 ; encoding: [0x00,0xf1,0x22,0xf2,0x01,0x05,0x02,0x80]
75// NOGFX9: error: r128 modifier is not supported on this GPU
76
77image_store    v5, v[1:4], s[8:15] d16
78// NOSICI: error: d16 modifier is not supported on this GPU
79// GFX89:  image_store v5, v[1:4], s[8:15] d16 ; encoding: [0x00,0x00,0x20,0xf0,0x01,0x05,0x02,0x80]
80
81// FIXME: This test is incorrect because r128 assumes a 128-bit SRSRC.
82image_store    v5, v[1:4], s[8:15] r128
83// SICIVI: image_store v5, v[1:4], s[8:15] r128 ; encoding: [0x00,0x80,0x20,0xf0,0x01,0x05,0x02,0x00]
84// NOGFX9: error: r128 modifier is not supported on this GPU
85
86//===----------------------------------------------------------------------===//
87// Image Load/Store: d16 unpacked
88//===----------------------------------------------------------------------===//
89
90image_load v[5:6], v[1:4], s[8:15] dmask:0x3 d16
91// NOSICI:   error: d16 modifier is not supported on this GPU
92// GFX8_0:   image_load v[5:6], v[1:4], s[8:15] dmask:0x3 d16 ; encoding: [0x00,0x03,0x00,0xf0,0x01,0x05,0x02,0x80]
93// NOGFX8_1: error: image data size does not match dmask and tfe
94// NOGFX9:   error: image data size does not match dmask and tfe
95
96image_load v[5:7], v[1:4], s[8:15] dmask:0x7 d16
97// NOSICI:   error: d16 modifier is not supported on this GPU
98// GFX8_0:   image_load v[5:7], v[1:4], s[8:15] dmask:0x7 d16 ; encoding: [0x00,0x07,0x00,0xf0,0x01,0x05,0x02,0x80]
99// NOGFX8_1: error: image data size does not match dmask and tfe
100// NOGFX9:   error: image data size does not match dmask and tfe
101
102image_load v[5:8], v[1:4], s[8:15] dmask:0xf d16
103// NOSICI:   error: d16 modifier is not supported on this GPU
104// GFX8_0:   image_load v[5:8], v[1:4], s[8:15] dmask:0xf d16 ; encoding: [0x00,0x0f,0x00,0xf0,0x01,0x05,0x02,0x80]
105// NOGFX8_1: error: image data size does not match dmask and tfe
106// NOGFX9:   error: image data size does not match dmask and tfe
107
108image_load v[5:7], v[1:4], s[8:15] dmask:0x3 tfe d16
109// NOSICI:   error: d16 modifier is not supported on this GPU
110// GFX8_0:   image_load v[5:7], v[1:4], s[8:15] dmask:0x3 tfe d16 ; encoding: [0x00,0x03,0x01,0xf0,0x01,0x05,0x02,0x80]
111// NOGFX8_1: error: image data size does not match dmask and tfe
112// NOGFX9:   error: image data size does not match dmask and tfe
113
114image_load v[5:8], v[1:4], s[8:15] dmask:0x7 tfe d16
115// NOSICI:   error: d16 modifier is not supported on this GPU
116// GFX8_0:   image_load v[5:8], v[1:4], s[8:15] dmask:0x7 tfe d16 ; encoding: [0x00,0x07,0x01,0xf0,0x01,0x05,0x02,0x80]
117// NOGFX8_1: error: image data size does not match dmask and tfe
118// NOGFX9:   error: image data size does not match dmask and tfe
119
120//===----------------------------------------------------------------------===//
121// Image Load/Store: d16 packed
122//===----------------------------------------------------------------------===//
123
124image_load v5, v[1:4], s[8:15] dmask:0x3 d16
125// NOSICI:   error: d16 modifier is not supported on this GPU
126// NOGFX8_0: error: image data size does not match dmask and tfe
127// GFX8_1:   image_load v5, v[1:4], s[8:15] dmask:0x3 d16 ; encoding: [0x00,0x03,0x00,0xf0,0x01,0x05,0x02,0x80]
128// GFX9:     image_load v5, v[1:4], s[8:15] dmask:0x3 d16 ; encoding: [0x00,0x03,0x00,0xf0,0x01,0x05,0x02,0x80]
129
130image_load v[5:6], v[1:4], s[8:15] dmask:0x7 d16
131// NOSICI:   error: d16 modifier is not supported on this GPU
132// NOGFX8_0: error: image data size does not match dmask and tfe
133// GFX8_1:   image_load v[5:6], v[1:4], s[8:15] dmask:0x7 d16 ; encoding: [0x00,0x07,0x00,0xf0,0x01,0x05,0x02,0x80]
134// GFX9:     image_load v[5:6], v[1:4], s[8:15] dmask:0x7 d16 ; encoding: [0x00,0x07,0x00,0xf0,0x01,0x05,0x02,0x80]
135
136image_load v[5:6], v[1:4], s[8:15] dmask:0xf d16
137// NOSICI:   error: d16 modifier is not supported on this GPU
138// NOGFX8_0: error: image data size does not match dmask and tfe
139// GFX8_1:   image_load v[5:6], v[1:4], s[8:15] dmask:0xf d16 ; encoding: [0x00,0x0f,0x00,0xf0,0x01,0x05,0x02,0x80]
140// GFX9:     image_load v[5:6], v[1:4], s[8:15] dmask:0xf d16 ; encoding: [0x00,0x0f,0x00,0xf0,0x01,0x05,0x02,0x80]
141
142image_load v[5:6], v[1:4], s[8:15] dmask:0x3 tfe d16
143// NOSICI:   error: d16 modifier is not supported on this GPU
144// NOGFX8_0: error: image data size does not match dmask and tfe
145// GFX8_1:   image_load v[5:6], v[1:4], s[8:15] dmask:0x3 tfe d16 ; encoding: [0x00,0x03,0x01,0xf0,0x01,0x05,0x02,0x80]
146// GFX9:     image_load v[5:6], v[1:4], s[8:15] dmask:0x3 tfe d16 ; encoding: [0x00,0x03,0x01,0xf0,0x01,0x05,0x02,0x80]
147
148image_load v[5:7], v[1:4], s[8:15] dmask:0x7 tfe d16
149// NOSICI:   error: d16 modifier is not supported on this GPU
150// NOGFX8_0: error: image data size does not match dmask and tfe
151// GFX8_1:   image_load v[5:7], v[1:4], s[8:15] dmask:0x7 tfe d16 ; encoding: [0x00,0x07,0x01,0xf0,0x01,0x05,0x02,0x80]
152// GFX9:     image_load v[5:7], v[1:4], s[8:15] dmask:0x7 tfe d16 ; encoding: [0x00,0x07,0x01,0xf0,0x01,0x05,0x02,0x80]
153
154image_load v[5:7], v[1:4], s[8:15] dmask:0xf tfe d16
155// NOSICI:   error: d16 modifier is not supported on this GPU
156// NOGFX8_0: error: image data size does not match dmask and tfe
157// GFX8_1:   image_load v[5:7], v[1:4], s[8:15] dmask:0xf tfe d16 ; encoding: [0x00,0x0f,0x01,0xf0,0x01,0x05,0x02,0x80]
158// GFX9:     image_load v[5:7], v[1:4], s[8:15] dmask:0xf tfe d16 ; encoding: [0x00,0x0f,0x01,0xf0,0x01,0x05,0x02,0x80]
159
160//===----------------------------------------------------------------------===//
161// Image Load/Store: a16
162//===----------------------------------------------------------------------===//
163
164image_load v5, v[1:2], s[8:15] unorm a16
165// GFX9:     image_load v5, v[1:2], s[8:15] unorm a16 ; encoding: [0x00,0x90,0x00,0xf0,0x01,0x05,0x02,0x00]
166// NOSICI:   error: a16 modifier is not supported on this GPU
167// NOVI:     error: a16 modifier is not supported on this GPU
168
169image_load v[5:6], v[1:2], s[8:15] dmask:0x3 unorm a16
170// GFX9:     image_load v[5:6], v[1:2], s[8:15] dmask:0x3 unorm a16 ; encoding: [0x00,0x93,0x00,0xf0,0x01,0x05,0x02,0x00]
171// NOSICI:   error: a16 modifier is not supported on this GPU
172// NOVI:     error: a16 modifier is not supported on this GPU
173
174image_load v[5:7], v[1:2], s[8:15] dmask:0x7 unorm a16
175// GFX9:     image_load v[5:7], v[1:2], s[8:15] dmask:0x7 unorm a16 ; encoding: [0x00,0x97,0x00,0xf0,0x01,0x05,0x02,0x00]
176// NOSICI:   error: a16 modifier is not supported on this GPU
177// NOVI:     error: a16 modifier is not supported on this GPU
178
179image_load v[5:8], v[1:2], s[8:15] dmask:0xf unorm a16
180// GFX9:     image_load v[5:8], v[1:2], s[8:15] dmask:0xf unorm a16 ; encoding: [0x00,0x9f,0x00,0xf0,0x01,0x05,0x02,0x00]
181// NOSICI:   error: a16 modifier is not supported on this GPU
182// NOVI:     error: a16 modifier is not supported on this GPU
183
184image_store v5, v[1:2], s[8:15] unorm a16
185// GFX9:     image_store v5, v[1:2], s[8:15] unorm a16 ; encoding: [0x00,0x90,0x20,0xf0,0x01,0x05,0x02,0x00]
186// NOSICI:   error: a16 modifier is not supported on this GPU
187// NOVI:     error: a16 modifier is not supported on this GPU
188
189image_store v[5:6], v[1:2], s[8:15] dmask:0x3 unorm a16
190// GFX9:     image_store v[5:6], v[1:2], s[8:15] dmask:0x3 unorm a16 ; encoding: [0x00,0x93,0x20,0xf0,0x01,0x05,0x02,0x00]
191// NOSICI:   error: a16 modifier is not supported on this GPU
192// NOVI:     error: a16 modifier is not supported on this GPU
193
194image_store v[5:7], v[1:2], s[8:15] dmask:0x7 unorm a16
195// GFX9:     image_store v[5:7], v[1:2], s[8:15] dmask:0x7 unorm a16 ; encoding: [0x00,0x97,0x20,0xf0,0x01,0x05,0x02,0x00]
196// NOSICI:   error: a16 modifier is not supported on this GPU
197// NOVI:     error: a16 modifier is not supported on this GPU
198
199image_store v[5:8], v[1:2], s[8:15] dmask:0xf unorm a16
200// GFX9:     image_store v[5:8], v[1:2], s[8:15] dmask:0xf unorm a16 ; encoding: [0x00,0x9f,0x20,0xf0,0x01,0x05,0x02,0x00]
201// NOSICI:   error: a16 modifier is not supported on this GPU
202// NOVI:     error: a16 modifier is not supported on this GPU
203
204//===----------------------------------------------------------------------===//
205// Image Load/Store: a16 & d16
206//===----------------------------------------------------------------------===//
207
208image_load v5, v[1:2], s[8:15] dmask:0x3 unorm a16 d16
209// GFX9:     image_load v5, v[1:2], s[8:15] dmask:0x3 unorm a16 d16 ; encoding: [0x00,0x93,0x00,0xf0,0x01,0x05,0x02,0x80]
210// NOSICI:   error: a16 modifier is not supported on this GPU
211// NOVI:     error: a16 modifier is not supported on this GPU
212
213image_load v[5:6], v[1:2], s[8:15] dmask:0x7 unorm a16 d16
214// GFX9:     image_load v[5:6], v[1:2], s[8:15] dmask:0x7 unorm a16 d16 ; encoding: [0x00,0x97,0x00,0xf0,0x01,0x05,0x02,0x80]
215// NOSICI:   error: a16 modifier is not supported on this GPU
216// NOVI:     error: a16 modifier is not supported on this GPU
217
218image_load v[5:6], v[1:2], s[8:15] dmask:0xf unorm a16 d16
219// GFX9:     image_load v[5:6], v[1:2], s[8:15] dmask:0xf unorm a16 d16 ; encoding: [0x00,0x9f,0x00,0xf0,0x01,0x05,0x02,0x80]
220// NOSICI:   error: a16 modifier is not supported on this GPU
221// NOVI:     error: a16 modifier is not supported on this GPU
222
223image_store v5, v[1:2], s[8:15] dmask:0x3 unorm a16 d16
224// GFX9:     image_store v5, v[1:2], s[8:15] dmask:0x3 unorm a16 d16 ; encoding: [0x00,0x93,0x20,0xf0,0x01,0x05,0x02,0x80]
225// NOSICI:   error: a16 modifier is not supported on this GPU
226// NOVI:     error: a16 modifier is not supported on this GPU
227
228image_store v[5:6], v[1:2], s[8:15] dmask:0x7 unorm a16 d16
229// GFX9:     image_store v[5:6], v[1:2], s[8:15] dmask:0x7 unorm a16 d16 ; encoding: [0x00,0x97,0x20,0xf0,0x01,0x05,0x02,0x80]
230// NOSICI:   error: a16 modifier is not supported on this GPU
231// NOVI:     error: a16 modifier is not supported on this GPU
232
233image_store v[5:6], v[1:2], s[8:15] dmask:0xf unorm a16 d16
234// GFX9:     image_store v[5:6], v[1:2], s[8:15] dmask:0xf unorm a16 d16 ; encoding: [0x00,0x9f,0x20,0xf0,0x01,0x05,0x02,0x80]
235// NOSICI:   error: a16 modifier is not supported on this GPU
236// NOVI:     error: a16 modifier is not supported on this GPU
237
238//===----------------------------------------------------------------------===//
239// Image Load/Store: PCK variants
240//===----------------------------------------------------------------------===//
241
242image_load_mip_pck v5, v1, s[8:15] dmask:0x1
243// GCN: image_load_mip_pck v5, v1, s[8:15] dmask:0x1 ; encoding: [0x00,0x01,0x10,0xf0,0x01,0x05,0x02,0x00]
244
245image_load_mip_pck v5, v[1:2], s[8:15] dmask:0x1
246// GCN: image_load_mip_pck v5, v[1:2], s[8:15] dmask:0x1 ; encoding: [0x00,0x01,0x10,0xf0,0x01,0x05,0x02,0x00]
247
248image_load_mip_pck v5, v[1:3], s[8:15] dmask:0x1
249// GCN: image_load_mip_pck v5, v[1:3], s[8:15] dmask:0x1 ; encoding: [0x00,0x01,0x10,0xf0,0x01,0x05,0x02,0x00]
250
251image_load_mip_pck v5, v[1:4], s[8:15] dmask:0x1
252// GCN: image_load_mip_pck v5, v[1:4], s[8:15] dmask:0x1 ; encoding: [0x00,0x01,0x10,0xf0,0x01,0x05,0x02,0x00]
253
254image_load_mip_pck v[5:6], v[1:4], s[8:15] dmask:0x3
255// GCN: image_load_mip_pck v[5:6], v[1:4], s[8:15] dmask:0x3 ; encoding: [0x00,0x03,0x10,0xf0,0x01,0x05,0x02,0x00]
256
257image_load_mip_pck v[5:6], v[1:4], s[8:15] dmask:0x1 unorm glc slc tfe lwe da
258// GCN: image_load_mip_pck v[5:6], v[1:4], s[8:15] dmask:0x1 unorm glc slc tfe lwe da ; encoding: [0x00,0x71,0x13,0xf2,0x01,0x05,0x02,0x00]
259
260image_load_mip_pck_sgn v[5:6], v[1:4], s[8:15] dmask:0x5
261// GCN: image_load_mip_pck_sgn v[5:6], v[1:4], s[8:15] dmask:0x5 ; encoding: [0x00,0x05,0x14,0xf0,0x01,0x05,0x02,0x00]
262
263image_load_pck v5, v[1:4], s[8:15] dmask:0x1 glc
264// GCN: image_load_pck v5, v[1:4], s[8:15] dmask:0x1 glc ; encoding: [0x00,0x21,0x08,0xf0,0x01,0x05,0x02,0x00]
265
266image_load_pck_sgn v5, v[1:4], s[8:15] dmask:0x1 lwe
267// GCN: image_load_pck_sgn v5, v[1:4], s[8:15] dmask:0x1 lwe ; encoding: [0x00,0x01,0x0e,0xf0,0x01,0x05,0x02,0x00]
268
269image_load_mip_pck v5, v[1:4], s[8:15] dmask:0x1 d16
270// NOSICI: error: invalid operand for instruction
271// NOVI:   error: invalid operand for instruction
272// NOGFX9: error: invalid operand for instruction
273
274image_load_mip_pck v5, v[1:2], s[8:15] dmask:0x1 a16
275// GFX9:   image_load_mip_pck v5, v[1:2], s[8:15] dmask:0x1 a16 ; encoding: [0x00,0x81,0x10,0xf0,0x01,0x05,0x02,0x00]
276// NOSICI: error: a16 modifier is not supported on this GPU
277// NOVI:   error: a16 modifier is not supported on this GPU
278
279image_store_mip_pck v252, v2, s[12:19] dmask:0x1 unorm
280// GCN: image_store_mip_pck v252, v2, s[12:19] dmask:0x1 unorm ; encoding: [0x00,0x11,0x2c,0xf0,0x02,0xfc,0x03,0x00]
281
282image_store_mip_pck v252, v[2:3], s[12:19] dmask:0x1 unorm
283// GCN: image_store_mip_pck v252, v[2:3], s[12:19] dmask:0x1 unorm ; encoding: [0x00,0x11,0x2c,0xf0,0x02,0xfc,0x03,0x00]
284
285image_store_mip_pck v252, v[2:4], s[12:19] dmask:0x1 unorm
286// GCN: image_store_mip_pck v252, v[2:4], s[12:19] dmask:0x1 unorm ; encoding: [0x00,0x11,0x2c,0xf0,0x02,0xfc,0x03,0x00]
287
288image_store_mip_pck v252, v[2:5], s[12:19] dmask:0x1 unorm
289// GCN: image_store_mip_pck v252, v[2:5], s[12:19] dmask:0x1 unorm ; encoding: [0x00,0x11,0x2c,0xf0,0x02,0xfc,0x03,0x00]
290
291image_store_mip_pck v1, v[2:5], s[12:19] dmask:0x1 unorm glc slc lwe da
292// GCN: image_store_mip_pck v1, v[2:5], s[12:19] dmask:0x1 unorm glc slc lwe da ; encoding: [0x00,0x71,0x2e,0xf2,0x02,0x01,0x03,0x00]
293
294image_store_pck v1, v[2:5], s[12:19] dmask:0x1 unorm da
295// GCN: image_store_pck v1, v[2:5], s[12:19] dmask:0x1 unorm da ; encoding: [0x00,0x51,0x28,0xf0,0x02,0x01,0x03,0x00]
296
297image_store_mip_pck v252, v[2:5], s[12:19] dmask:0x1 d16
298// NOSICI: error: invalid operand for instruction
299// NOVI:   error: invalid operand for instruction
300// NOGFX9: error: invalid operand for instruction
301
302image_store_mip_pck v252, v[2:3], s[12:19] dmask:0x1 a16
303// GFX9:   image_store_mip_pck v252, v[2:3], s[12:19] dmask:0x1 a16 ; encoding: [0x00,0x81,0x2c,0xf0,0x02,0xfc,0x03,0x00]
304// NOSICI: error: a16 modifier is not supported on this GPU
305// NOVI:   error: a16 modifier is not supported on this GPU
306
307//===----------------------------------------------------------------------===//
308// Image Sample
309//===----------------------------------------------------------------------===//
310
311image_sample  v[193:195], v[237:240], s[28:35], s[4:7] dmask:0x7 unorm
312// GCN: image_sample v[193:195], v[237:240], s[28:35], s[4:7] dmask:0x7 unorm ; encoding: [0x00,0x17,0x80,0xf0,0xed,0xc1,0x27,0x00]
313
314image_sample  v193, v237, s[28:35], s[4:7]
315// GCN: image_sample v193, v237, s[28:35], s[4:7] ; encoding: [0x00,0x00,0x80,0xf0,0xed,0xc1,0x27,0x00]
316
317image_sample  v193, v[237:238], s[28:35], s[4:7]
318// GCN: image_sample v193, v[237:238], s[28:35], s[4:7] ; encoding: [0x00,0x00,0x80,0xf0,0xed,0xc1,0x27,0x00]
319
320image_sample  v193, v[237:239], s[28:35], s[4:7]
321// GCN: image_sample v193, v[237:239], s[28:35], s[4:7] ; encoding: [0x00,0x00,0x80,0xf0,0xed,0xc1,0x27,0x00]
322
323image_sample  v193, v[237:240], s[28:35], s[4:7]
324// GCN: image_sample v193, v[237:240], s[28:35], s[4:7] ; encoding: [0x00,0x00,0x80,0xf0,0xed,0xc1,0x27,0x00]
325
326image_sample  v[193:194], v[237:240], s[28:35], s[4:7] tfe
327// GCN: image_sample v[193:194], v[237:240], s[28:35], s[4:7] tfe ; encoding: [0x00,0x00,0x81,0xf0,0xed,0xc1,0x27,0x00]
328
329// FIXME: This test is incorrect because r128 assumes a 128-bit SRSRC.
330image_sample  v193, v[237:240], s[28:35], s[4:7] r128
331// SICIVI: image_sample v193, v[237:240], s[28:35], s[4:7] r128 ; encoding: [0x00,0x80,0x80,0xf0,0xed,0xc1,0x27,0x00]
332// NOGFX9: error: r128 modifier is not supported on this GPU
333
334image_sample  v193, v[237:240], s[28:35], s[4:7] d16
335// NOSICI: error: d16 modifier is not supported on this GPU
336// GFX89:  image_sample v193, v[237:240], s[28:35], s[4:7] d16 ; encoding: [0x00,0x00,0x80,0xf0,0xed,0xc1,0x27,0x80]
337
338//===----------------------------------------------------------------------===//
339// Image Sample: d16 packed
340//===----------------------------------------------------------------------===//
341
342image_sample  v[193:195], v[237:240], s[28:35], s[4:7] dmask:0x7 d16
343// NOSICI:   error: d16 modifier is not supported on this GPU
344// GFX8_0:   image_sample v[193:195], v[237:240], s[28:35], s[4:7] dmask:0x7 d16 ; encoding: [0x00,0x07,0x80,0xf0,0xed,0xc1,0x27,0x80]
345// NOGFX8_1: error: image data size does not match dmask and tfe
346// NOGFX9:   error: image data size does not match dmask and tfe
347
348//===----------------------------------------------------------------------===//
349// Image Sample: d16 unpacked
350//===----------------------------------------------------------------------===//
351
352image_sample  v[193:194], v[237:240], s[28:35], s[4:7] dmask:0x7 d16
353// NOSICI:   error: d16 modifier is not supported on this GPU
354// NOGFX8_0: error: image data size does not match dmask and tfe
355// GFX8_1:   image_sample v[193:194], v[237:240], s[28:35], s[4:7] dmask:0x7 d16 ; encoding: [0x00,0x07,0x80,0xf0,0xed,0xc1,0x27,0x80]
356// GFX9:     image_sample v[193:194], v[237:240], s[28:35], s[4:7] dmask:0x7 d16 ; encoding: [0x00,0x07,0x80,0xf0,0xed,0xc1,0x27,0x80]
357
358//===----------------------------------------------------------------------===//
359// Image Sample: a16
360//===----------------------------------------------------------------------===//
361
362image_sample v[193:196], v[237:240], s[28:35], s[4:7] dmask:0xf a16
363// GFX9:   image_sample v[193:196], v[237:240], s[28:35], s[4:7] dmask:0xf a16 ; encoding: [0x00,0x8f,0x80,0xf0,0xed,0xc1,0x27,0x00]
364// NOSICI:   error: a16 modifier is not supported on this GPU
365// NOVI:   error: a16 modifier is not supported on this GPU
366
367image_sample_d v[193:196], v[237:240], s[28:35], s[4:7] dmask:0xf a16
368// GFX9:   image_sample_d v[193:196], v[237:240], s[28:35], s[4:7] dmask:0xf a16 ; encoding: [0x00,0x8f,0x88,0xf0,0xed,0xc1,0x27,0x00]
369// NOSICI:   error: a16 modifier is not supported on this GPU
370// NOVI:   error: a16 modifier is not supported on this GPU
371
372image_sample_c_d v[193:196], v[237:240], s[28:35], s[4:7] dmask:0xf a16
373// GFX9:   image_sample_c_d v[193:196], v[237:240], s[28:35], s[4:7] dmask:0xf a16 ; encoding: [0x00,0x8f,0xa8,0xf0,0xed,0xc1,0x27,0x00]
374// NOSICI:   error: a16 modifier is not supported on this GPU
375// NOVI:   error: a16 modifier is not supported on this GPU
376
377image_sample_c_d_cl v[193:196], v[237:240], s[28:35], s[4:7] dmask:0xf a16
378// GFX9:   image_sample_c_d_cl v[193:196], v[237:240], s[28:35], s[4:7] dmask:0xf a16 ; encoding: [0x00,0x8f,0xac,0xf0,0xed,0xc1,0x27,0x00]
379// NOSICI:   error: a16 modifier is not supported on this GPU
380// NOVI:   error: a16 modifier is not supported on this GPU
381
382//===----------------------------------------------------------------------===//
383// Image Atomics
384//===----------------------------------------------------------------------===//
385
386image_atomic_add v4, v192, s[28:35] dmask:0x1 unorm glc
387// SICI:  image_atomic_add v4, v192, s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x44,0xf0,0xc0,0x04,0x07,0x00]
388// GFX89: image_atomic_add v4, v192, s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x48,0xf0,0xc0,0x04,0x07,0x00]
389
390image_atomic_add v4, v[192:193], s[28:35] dmask:0x1 unorm glc
391// SICI:  image_atomic_add v4, v[192:193], s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x44,0xf0,0xc0,0x04,0x07,0x00]
392// GFX89: image_atomic_add v4, v[192:193], s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x48,0xf0,0xc0,0x04,0x07,0x00]
393
394image_atomic_add v4, v[192:194], s[28:35] dmask:0x1 unorm glc
395// SICI:  image_atomic_add v4, v[192:194], s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x44,0xf0,0xc0,0x04,0x07,0x00]
396// GFX89: image_atomic_add v4, v[192:194], s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x48,0xf0,0xc0,0x04,0x07,0x00]
397
398image_atomic_add v4, v[192:195], s[28:35] dmask:0x1 unorm glc
399// SICI:  image_atomic_add v4, v[192:195], s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x44,0xf0,0xc0,0x04,0x07,0x00]
400// GFX89: image_atomic_add v4, v[192:195], s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x48,0xf0,0xc0,0x04,0x07,0x00]
401
402image_atomic_add v252, v2, s[8:15] dmask:0x1 unorm
403// SICI:  image_atomic_add v252, v2, s[8:15] dmask:0x1 unorm ; encoding: [0x00,0x11,0x44,0xf0,0x02,0xfc,0x02,0x00]
404// GFX89: image_atomic_add v252, v2, s[8:15] dmask:0x1 unorm ; encoding: [0x00,0x11,0x48,0xf0,0x02,0xfc,0x02,0x00]
405
406image_atomic_add v[6:7], v255, s[8:15] dmask:0x3
407// SICI:  image_atomic_add v[6:7], v255, s[8:15] dmask:0x3 ; encoding: [0x00,0x03,0x44,0xf0,0xff,0x06,0x02,0x00]
408// GFX89: image_atomic_add v[6:7], v255, s[8:15] dmask:0x3 ; encoding: [0x00,0x03,0x48,0xf0,0xff,0x06,0x02,0x00]
409
410image_atomic_add v7, v3, s[0:7] dmask:0x1 glc
411// SICI:  image_atomic_add v7, v3, s[0:7] dmask:0x1 glc ; encoding: [0x00,0x21,0x44,0xf0,0x03,0x07,0x00,0x00]
412// GFX89: image_atomic_add v7, v3, s[0:7] dmask:0x1 glc ; encoding: [0x00,0x21,0x48,0xf0,0x03,0x07,0x00,0x00]
413
414image_atomic_add v8, v4, s[8:15] dmask:0x1 slc
415// SICI:  image_atomic_add v8, v4, s[8:15] dmask:0x1 slc ; encoding: [0x00,0x01,0x44,0xf2,0x04,0x08,0x02,0x00]
416// GFX89: image_atomic_add v8, v4, s[8:15] dmask:0x1 slc ; encoding: [0x00,0x01,0x48,0xf2,0x04,0x08,0x02,0x00]
417
418image_atomic_add v9, v5, s[8:15] dmask:0x1 unorm glc slc lwe da
419// SICI:  image_atomic_add v9, v5, s[8:15] dmask:0x1 unorm glc slc lwe da ; encoding: [0x00,0x71,0x46,0xf2,0x05,0x09,0x02,0x00]
420// GFX89: image_atomic_add v9, v5, s[8:15] dmask:0x1 unorm glc slc lwe da ; encoding: [0x00,0x71,0x4a,0xf2,0x05,0x09,0x02,0x00]
421
422image_atomic_add v10, v6, s[8:15] dmask:0x1 lwe
423// SICI:  image_atomic_add v10, v6, s[8:15] dmask:0x1 lwe ; encoding: [0x00,0x01,0x46,0xf0,0x06,0x0a,0x02,0x00]
424// GFX89: image_atomic_add v10, v6, s[8:15] dmask:0x1 lwe ; encoding: [0x00,0x01,0x4a,0xf0,0x06,0x0a,0x02,0x00]
425
426image_atomic_add v11, v7, s[8:15] dmask:0x1 da
427// SICI:  image_atomic_add v11, v7, s[8:15] dmask:0x1 da ; encoding: [0x00,0x41,0x44,0xf0,0x07,0x0b,0x02,0x00]
428// GFX89: image_atomic_add v11, v7, s[8:15] dmask:0x1 da ; encoding: [0x00,0x41,0x48,0xf0,0x07,0x0b,0x02,0x00]
429
430image_atomic_swap v4, v[192:195], s[28:35] dmask:0x1 unorm glc
431// SICI:  image_atomic_swap v4, v[192:195], s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x3c,0xf0,0xc0,0x04,0x07,0x00]
432// GFX89: image_atomic_swap v4, v[192:195], s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x40,0xf0,0xc0,0x04,0x07,0x00]
433
434image_atomic_cmpswap v[4:5], v[192:195], s[28:35] dmask:0x3 unorm glc
435// SICI:  image_atomic_cmpswap v[4:5], v[192:195], s[28:35] dmask:0x3 unorm glc ; encoding: [0x00,0x33,0x40,0xf0,0xc0,0x04,0x07,0x00]
436// GFX89: image_atomic_cmpswap v[4:5], v[192:195], s[28:35] dmask:0x3 unorm glc ; encoding: [0x00,0x33,0x44,0xf0,0xc0,0x04,0x07,0x00]
437
438image_atomic_cmpswap v[4:7], v[192:195], s[28:35] dmask:0xf unorm glc
439// SICI:  image_atomic_cmpswap v[4:7], v[192:195], s[28:35] dmask:0xf unorm glc ; encoding: [0x00,0x3f,0x40,0xf0,0xc0,0x04,0x07,0x00]
440// GFX89: image_atomic_cmpswap v[4:7], v[192:195], s[28:35] dmask:0xf unorm glc ; encoding: [0x00,0x3f,0x44,0xf0,0xc0,0x04,0x07,0x00]
441
442// FIXME: This test is incorrect because r128 assumes a 128-bit SRSRC.
443image_atomic_add v10, v6, s[8:15] dmask:0x1 r128
444// SICI: image_atomic_add v10, v6, s[8:15] dmask:0x1 r128 ; encoding: [0x00,0x81,0x44,0xf0,0x06,0x0a,0x02,0x00]
445// VI:   image_atomic_add v10, v6, s[8:15] dmask:0x1 r128 ; encoding: [0x00,0x81,0x48,0xf0,0x06,0x0a,0x02,0x00]
446// NOGFX9: error: r128 modifier is not supported on this GPU
447
448//===----------------------------------------------------------------------===//
449// Image Gather4
450//===----------------------------------------------------------------------===//
451
452image_gather4 v[5:8], v1, s[8:15], s[12:15] dmask:0x1
453// GCN: image_gather4 v[5:8], v1, s[8:15], s[12:15] dmask:0x1 ; encoding: [0x00,0x01,0x00,0xf1,0x01,0x05,0x62,0x00]
454
455image_gather4 v[5:8], v[1:2], s[8:15], s[12:15] dmask:0x1
456// GCN: image_gather4 v[5:8], v[1:2], s[8:15], s[12:15] dmask:0x1 ; encoding: [0x00,0x01,0x00,0xf1,0x01,0x05,0x62,0x00]
457
458image_gather4 v[5:8], v[1:3], s[8:15], s[12:15] dmask:0x1
459// GCN: image_gather4 v[5:8], v[1:3], s[8:15], s[12:15] dmask:0x1 ; encoding: [0x00,0x01,0x00,0xf1,0x01,0x05,0x62,0x00]
460
461image_gather4 v[5:8], v[1:4], s[8:15], s[12:15] dmask:0x2
462// GCN: image_gather4 v[5:8], v[1:4], s[8:15], s[12:15] dmask:0x2 ; encoding: [0x00,0x02,0x00,0xf1,0x01,0x05,0x62,0x00]
463
464image_gather4 v[5:8], v[1:4], s[8:15], s[12:15] dmask:0x4
465// GCN: image_gather4 v[5:8], v[1:4], s[8:15], s[12:15] dmask:0x4 ; encoding: [0x00,0x04,0x00,0xf1,0x01,0x05,0x62,0x00]
466
467image_gather4 v[5:8], v[1:4], s[8:15], s[12:15] dmask:0x8
468// GCN: image_gather4 v[5:8], v[1:4], s[8:15], s[12:15] dmask:0x8 ; encoding: [0x00,0x08,0x00,0xf1,0x01,0x05,0x62,0x00]
469
470image_gather4 v[5:8], v1, s[8:15], s[12:15] dmask:0x1 d16
471// NOSICI:   error: d16 modifier is not supported on this GPU
472// GFX8_0:   image_gather4 v[5:8], v1, s[8:15], s[12:15] dmask:0x1 d16 ; encoding: [0x00,0x01,0x00,0xf1,0x01,0x05,0x62,0x80]
473// NOGFX8_1: error: image data size does not match dmask and tfe
474// NOGFX9:   error: image data size does not match dmask and tfe
475
476image_gather4 v[5:6], v1, s[8:15], s[12:15] dmask:0x1 d16
477// NOSICI:   error: d16 modifier is not supported on this GPU
478// NOGFX8_0: error: image data size does not match dmask and tfe
479// GFX8_1:   image_gather4 v[5:6], v1, s[8:15], s[12:15] dmask:0x1 d16 ; encoding: [0x00,0x01,0x00,0xf1,0x01,0x05,0x62,0x80]
480// GFX9:     image_gather4 v[5:6], v1, s[8:15], s[12:15] dmask:0x1 d16 ; encoding: [0x00,0x01,0x00,0xf1,0x01,0x05,0x62,0x80]
481
482image_gather4 v[5:6], v1, s[8:15], s[12:15] dmask:0x1
483// NOSICI:   error: image data size does not match dmask and tfe
484// NOGFX8_0: error: image data size does not match dmask and tfe
485// NOGFX8_1: error: image data size does not match dmask and tfe
486// NOGFX9:   error: image data size does not match dmask and tfe
487
488image_gather4 v[5:8], v1, s[8:15], s[12:15] dmask:0x1 a16
489// GFX9:     image_gather4 v[5:8], v1, s[8:15], s[12:15] dmask:0x1 a16 ; encoding: [0x00,0x81,0x00,0xf1,0x01,0x05,0x62,0x00]
490// NOSICI:   error: a16 modifier is not supported on this GPU
491// NOVI:   error: a16 modifier is not supported on this GPU
492
493image_gather4_b_cl v[5:8], v[1:4], s[8:15], s[12:15] dmask:0x1 a16
494// GFX9:    image_gather4_b_cl v[5:8], v[1:4], s[8:15], s[12:15] dmask:0x1 a16 ; encoding: [0x00,0x81,0x18,0xf1,0x01,0x05,0x62,0x00]
495// NOSICI:   error: a16 modifier is not supported on this GPU
496// NOVI:   error: a16 modifier is not supported on this GPU
497