• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSICI
9// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSICI
10// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSICI
11// RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOVI --check-prefix=NOGFX8_0
12// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx810 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOVI --check-prefix=NOGFX8_1
13// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOGFX9
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: PCK variants
162//===----------------------------------------------------------------------===//
163
164image_load_mip_pck v5, v1, s[8:15] dmask:0x1
165// GCN: image_load_mip_pck v5, v1, s[8:15] dmask:0x1 ; encoding: [0x00,0x01,0x10,0xf0,0x01,0x05,0x02,0x00]
166
167image_load_mip_pck v5, v[1:2], s[8:15] dmask:0x1
168// GCN: image_load_mip_pck v5, v[1:2], s[8:15] dmask:0x1 ; encoding: [0x00,0x01,0x10,0xf0,0x01,0x05,0x02,0x00]
169
170image_load_mip_pck v5, v[1:3], s[8:15] dmask:0x1
171// GCN: image_load_mip_pck v5, v[1:3], s[8:15] dmask:0x1 ; encoding: [0x00,0x01,0x10,0xf0,0x01,0x05,0x02,0x00]
172
173image_load_mip_pck v5, v[1:4], s[8:15] dmask:0x1
174// GCN: image_load_mip_pck v5, v[1:4], s[8:15] dmask:0x1 ; encoding: [0x00,0x01,0x10,0xf0,0x01,0x05,0x02,0x00]
175
176image_load_mip_pck v[5:6], v[1:4], s[8:15] dmask:0x3
177// 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]
178
179image_load_mip_pck v[5:6], v[1:4], s[8:15] dmask:0x1 unorm glc slc tfe lwe da
180// 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]
181
182image_load_mip_pck_sgn v[5:6], v[1:4], s[8:15] dmask:0x5
183// 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]
184
185image_load_pck v5, v[1:4], s[8:15] dmask:0x1 glc
186// GCN: image_load_pck v5, v[1:4], s[8:15] dmask:0x1 glc ; encoding: [0x00,0x21,0x08,0xf0,0x01,0x05,0x02,0x00]
187
188image_load_pck_sgn v5, v[1:4], s[8:15] dmask:0x1 lwe
189// GCN: image_load_pck_sgn v5, v[1:4], s[8:15] dmask:0x1 lwe ; encoding: [0x00,0x01,0x0e,0xf0,0x01,0x05,0x02,0x00]
190
191image_load_mip_pck v5, v[1:4], s[8:15] dmask:0x1 d16
192// NOSICI: error: invalid operand for instruction
193// NOVI:   error: invalid operand for instruction
194// NOGFX9: error: invalid operand for instruction
195
196image_store_mip_pck v252, v2, s[12:19] dmask:0x1 unorm
197// GCN: image_store_mip_pck v252, v2, s[12:19] dmask:0x1 unorm ; encoding: [0x00,0x11,0x2c,0xf0,0x02,0xfc,0x03,0x00]
198
199image_store_mip_pck v252, v[2:3], s[12:19] dmask:0x1 unorm
200// GCN: image_store_mip_pck v252, v[2:3], s[12:19] dmask:0x1 unorm ; encoding: [0x00,0x11,0x2c,0xf0,0x02,0xfc,0x03,0x00]
201
202image_store_mip_pck v252, v[2:4], s[12:19] dmask:0x1 unorm
203// GCN: image_store_mip_pck v252, v[2:4], s[12:19] dmask:0x1 unorm ; encoding: [0x00,0x11,0x2c,0xf0,0x02,0xfc,0x03,0x00]
204
205image_store_mip_pck v252, v[2:5], s[12:19] dmask:0x1 unorm
206// GCN: image_store_mip_pck v252, v[2:5], s[12:19] dmask:0x1 unorm ; encoding: [0x00,0x11,0x2c,0xf0,0x02,0xfc,0x03,0x00]
207
208image_store_mip_pck v1, v[2:5], s[12:19] dmask:0x1 unorm glc slc lwe da
209// 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]
210
211image_store_pck v1, v[2:5], s[12:19] dmask:0x1 unorm da
212// GCN: image_store_pck v1, v[2:5], s[12:19] dmask:0x1 unorm da ; encoding: [0x00,0x51,0x28,0xf0,0x02,0x01,0x03,0x00]
213
214image_store_mip_pck v252, v[2:5], s[12:19] dmask:0x1 d16
215// NOSICI: error: invalid operand for instruction
216// NOVI:   error: invalid operand for instruction
217// NOGFX9: error: invalid operand for instruction
218
219//===----------------------------------------------------------------------===//
220// Image Sample
221//===----------------------------------------------------------------------===//
222
223image_sample  v[193:195], v[237:240], s[28:35], s[4:7] dmask:0x7 unorm
224// 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]
225
226image_sample  v193, v237, s[28:35], s[4:7]
227// GCN: image_sample v193, v237, s[28:35], s[4:7] ; encoding: [0x00,0x00,0x80,0xf0,0xed,0xc1,0x27,0x00]
228
229image_sample  v193, v[237:238], s[28:35], s[4:7]
230// GCN: image_sample v193, v[237:238], s[28:35], s[4:7] ; encoding: [0x00,0x00,0x80,0xf0,0xed,0xc1,0x27,0x00]
231
232image_sample  v193, v[237:239], s[28:35], s[4:7]
233// GCN: image_sample v193, v[237:239], s[28:35], s[4:7] ; encoding: [0x00,0x00,0x80,0xf0,0xed,0xc1,0x27,0x00]
234
235image_sample  v193, v[237:240], s[28:35], s[4:7]
236// GCN: image_sample v193, v[237:240], s[28:35], s[4:7] ; encoding: [0x00,0x00,0x80,0xf0,0xed,0xc1,0x27,0x00]
237
238image_sample  v[193:194], v[237:240], s[28:35], s[4:7] tfe
239// 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]
240
241// FIXME: This test is incorrect because r128 assumes a 128-bit SRSRC.
242image_sample  v193, v[237:240], s[28:35], s[4:7] r128
243// SICIVI: image_sample v193, v[237:240], s[28:35], s[4:7] r128 ; encoding: [0x00,0x80,0x80,0xf0,0xed,0xc1,0x27,0x00]
244// NOGFX9: error: r128 modifier is not supported on this GPU
245
246image_sample  v193, v[237:240], s[28:35], s[4:7] d16
247// NOSICI: error: d16 modifier is not supported on this GPU
248// GFX89:  image_sample v193, v[237:240], s[28:35], s[4:7] d16 ; encoding: [0x00,0x00,0x80,0xf0,0xed,0xc1,0x27,0x80]
249
250//===----------------------------------------------------------------------===//
251// Image Sample: d16 packed
252//===----------------------------------------------------------------------===//
253
254image_sample  v[193:195], v[237:240], s[28:35], s[4:7] dmask:0x7 d16
255// NOSICI:   error: d16 modifier is not supported on this GPU
256// 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]
257// NOGFX8_1: error: image data size does not match dmask and tfe
258// NOGFX9:   error: image data size does not match dmask and tfe
259
260//===----------------------------------------------------------------------===//
261// Image Sample: d16 unpacked
262//===----------------------------------------------------------------------===//
263
264image_sample  v[193:194], v[237:240], s[28:35], s[4:7] dmask:0x7 d16
265// NOSICI:   error: d16 modifier is not supported on this GPU
266// NOGFX8_0: error: image data size does not match dmask and tfe
267// 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]
268// 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]
269
270//===----------------------------------------------------------------------===//
271// Image Atomics
272//===----------------------------------------------------------------------===//
273
274image_atomic_add v4, v192, s[28:35] dmask:0x1 unorm glc
275// SICI:  image_atomic_add v4, v192, s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x44,0xf0,0xc0,0x04,0x07,0x00]
276// GFX89: image_atomic_add v4, v192, s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x48,0xf0,0xc0,0x04,0x07,0x00]
277
278image_atomic_add v4, v[192:193], s[28:35] dmask:0x1 unorm glc
279// SICI:  image_atomic_add v4, v[192:193], s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x44,0xf0,0xc0,0x04,0x07,0x00]
280// GFX89: image_atomic_add v4, v[192:193], s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x48,0xf0,0xc0,0x04,0x07,0x00]
281
282image_atomic_add v4, v[192:194], s[28:35] dmask:0x1 unorm glc
283// SICI:  image_atomic_add v4, v[192:194], s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x44,0xf0,0xc0,0x04,0x07,0x00]
284// GFX89: image_atomic_add v4, v[192:194], s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x48,0xf0,0xc0,0x04,0x07,0x00]
285
286image_atomic_add v4, v[192:195], s[28:35] dmask:0x1 unorm glc
287// SICI:  image_atomic_add v4, v[192:195], s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x44,0xf0,0xc0,0x04,0x07,0x00]
288// GFX89: image_atomic_add v4, v[192:195], s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x48,0xf0,0xc0,0x04,0x07,0x00]
289
290image_atomic_add v252, v2, s[8:15] dmask:0x1 unorm
291// SICI:  image_atomic_add v252, v2, s[8:15] dmask:0x1 unorm ; encoding: [0x00,0x11,0x44,0xf0,0x02,0xfc,0x02,0x00]
292// GFX89: image_atomic_add v252, v2, s[8:15] dmask:0x1 unorm ; encoding: [0x00,0x11,0x48,0xf0,0x02,0xfc,0x02,0x00]
293
294image_atomic_add v[6:7], v255, s[8:15] dmask:0x3
295// SICI:  image_atomic_add v[6:7], v255, s[8:15] dmask:0x3 ; encoding: [0x00,0x03,0x44,0xf0,0xff,0x06,0x02,0x00]
296// GFX89: image_atomic_add v[6:7], v255, s[8:15] dmask:0x3 ; encoding: [0x00,0x03,0x48,0xf0,0xff,0x06,0x02,0x00]
297
298image_atomic_add v7, v3, s[0:7] dmask:0x1 glc
299// SICI:  image_atomic_add v7, v3, s[0:7] dmask:0x1 glc ; encoding: [0x00,0x21,0x44,0xf0,0x03,0x07,0x00,0x00]
300// GFX89: image_atomic_add v7, v3, s[0:7] dmask:0x1 glc ; encoding: [0x00,0x21,0x48,0xf0,0x03,0x07,0x00,0x00]
301
302image_atomic_add v8, v4, s[8:15] dmask:0x1 slc
303// SICI:  image_atomic_add v8, v4, s[8:15] dmask:0x1 slc ; encoding: [0x00,0x01,0x44,0xf2,0x04,0x08,0x02,0x00]
304// GFX89: image_atomic_add v8, v4, s[8:15] dmask:0x1 slc ; encoding: [0x00,0x01,0x48,0xf2,0x04,0x08,0x02,0x00]
305
306image_atomic_add v9, v5, s[8:15] dmask:0x1 unorm glc slc lwe da
307// 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]
308// 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]
309
310image_atomic_add v10, v6, s[8:15] dmask:0x1 lwe
311// SICI:  image_atomic_add v10, v6, s[8:15] dmask:0x1 lwe ; encoding: [0x00,0x01,0x46,0xf0,0x06,0x0a,0x02,0x00]
312// GFX89: image_atomic_add v10, v6, s[8:15] dmask:0x1 lwe ; encoding: [0x00,0x01,0x4a,0xf0,0x06,0x0a,0x02,0x00]
313
314image_atomic_add v11, v7, s[8:15] dmask:0x1 da
315// SICI:  image_atomic_add v11, v7, s[8:15] dmask:0x1 da ; encoding: [0x00,0x41,0x44,0xf0,0x07,0x0b,0x02,0x00]
316// GFX89: image_atomic_add v11, v7, s[8:15] dmask:0x1 da ; encoding: [0x00,0x41,0x48,0xf0,0x07,0x0b,0x02,0x00]
317
318image_atomic_swap v4, v[192:195], s[28:35] dmask:0x1 unorm glc
319// SICI:  image_atomic_swap v4, v[192:195], s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x3c,0xf0,0xc0,0x04,0x07,0x00]
320// GFX89: image_atomic_swap v4, v[192:195], s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x40,0xf0,0xc0,0x04,0x07,0x00]
321
322image_atomic_cmpswap v[4:5], v[192:195], s[28:35] dmask:0x3 unorm glc
323// 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]
324// 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]
325
326image_atomic_cmpswap v[4:7], v[192:195], s[28:35] dmask:0xf unorm glc
327// 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]
328// 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]
329
330// FIXME: This test is incorrect because r128 assumes a 128-bit SRSRC.
331image_atomic_add v10, v6, s[8:15] dmask:0x1 r128
332// SICI: image_atomic_add v10, v6, s[8:15] dmask:0x1 r128 ; encoding: [0x00,0x81,0x44,0xf0,0x06,0x0a,0x02,0x00]
333// VI:   image_atomic_add v10, v6, s[8:15] dmask:0x1 r128 ; encoding: [0x00,0x81,0x48,0xf0,0x06,0x0a,0x02,0x00]
334// NOGFX9: error: r128 modifier is not supported on this GPU
335
336//===----------------------------------------------------------------------===//
337// Image Gather4
338//===----------------------------------------------------------------------===//
339
340image_gather4 v[5:8], v1, s[8:15], s[12:15] dmask:0x1
341// GCN: image_gather4 v[5:8], v1, s[8:15], s[12:15] dmask:0x1 ; encoding: [0x00,0x01,0x00,0xf1,0x01,0x05,0x62,0x00]
342
343image_gather4 v[5:8], v[1:2], s[8:15], s[12:15] dmask:0x1
344// 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]
345
346image_gather4 v[5:8], v[1:3], s[8:15], s[12:15] dmask:0x1
347// 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]
348
349image_gather4 v[5:8], v[1:4], s[8:15], s[12:15] dmask:0x2
350// 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]
351
352image_gather4 v[5:8], v[1:4], s[8:15], s[12:15] dmask:0x4
353// 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]
354
355image_gather4 v[5:8], v[1:4], s[8:15], s[12:15] dmask:0x8
356// 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]
357
358image_gather4 v[5:8], v1, s[8:15], s[12:15] dmask:0x1 d16
359// NOSICI:   error: d16 modifier is not supported on this GPU
360// 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]
361// NOGFX8_1: error: image data size does not match dmask and tfe
362// NOGFX9:   error: image data size does not match dmask and tfe
363
364image_gather4 v[5:6], v1, s[8:15], s[12:15] dmask:0x1 d16
365// NOSICI:   error: d16 modifier is not supported on this GPU
366// NOGFX8_0: error: image data size does not match dmask and tfe
367// 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]
368// 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]
369
370image_gather4 v[5:6], v1, s[8:15], s[12:15] dmask:0x1
371// NOSICI:   error: image data size does not match dmask and tfe
372// NOGFX8_0: error: image data size does not match dmask and tfe
373// NOGFX8_1: error: image data size does not match dmask and tfe
374// NOGFX9:   error: image data size does not match dmask and tfe
375