[ARM] Better OR's for MVE compares
[llvm-core.git] / test / MC / AMDGPU / mimg.s
blob83835270a1d4afb0d26fe496e36d6801c9663cc6
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
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
15 //===----------------------------------------------------------------------===//
16 // Image Load/Store
17 //===----------------------------------------------------------------------===//
19 image_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]
22 image_load v4, v237, s[28:35]
23 // GCN: image_load v4, v237, s[28:35] ; encoding: [0x00,0x00,0x00,0xf0,0xed,0x04,0x07,0x00]
25 image_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]
28 image_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]
31 image_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]
34 image_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]
37 // Verify support of all possible modifiers.
38 // FIXME: This test is incorrect because r128 assumes a 128-bit SRSRC.
39 image_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
44 image_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]
48 image_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
52 image_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]
55 image_store v193, v237, s[28:35]
56 // GCN: image_store v193, v237, s[28:35] ; encoding: [0x00,0x00,0x20,0xf0,0xed,0xc1,0x07,0x00]
58 image_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]
61 image_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]
64 image_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]
67 image_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]
70 // Verify support of all possible modifiers.
71 // FIXME: This test is incorrect because r128 assumes a 128-bit SRSRC.
72 image_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
77 image_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]
81 // FIXME: This test is incorrect because r128 assumes a 128-bit SRSRC.
82 image_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
86 //===----------------------------------------------------------------------===//
87 // Image Load/Store: d16 unpacked
88 //===----------------------------------------------------------------------===//
90 image_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
96 image_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
102 image_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
108 image_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
114 image_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
120 //===----------------------------------------------------------------------===//
121 // Image Load/Store: d16 packed
122 //===----------------------------------------------------------------------===//
124 image_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]
130 image_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]
136 image_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]
142 image_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]
148 image_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]
154 image_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]
160 //===----------------------------------------------------------------------===//
161 // Image Load/Store: a16
162 //===----------------------------------------------------------------------===//
164 image_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
169 image_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
174 image_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
179 image_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
184 image_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
189 image_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
194 image_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
199 image_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
204 /===----------------------------------------------------------------------===//
205 // Image Load/Store: a16 & d16
206 //===----------------------------------------------------------------------===//
208 image_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
213 image_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
218 image_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
223 image_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
228 image_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
233 image_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
238 //===----------------------------------------------------------------------===//
239 // Image Load/Store: PCK variants
240 //===----------------------------------------------------------------------===//
242 image_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]
245 image_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]
248 image_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]
251 image_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]
254 image_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]
257 image_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]
260 image_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]
263 image_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]
266 image_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]
269 image_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
274 image_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
279 image_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]
282 image_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]
285 image_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]
288 image_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]
291 image_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]
294 image_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]
297 image_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
302 image_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
307 //===----------------------------------------------------------------------===//
308 // Image Sample
309 //===----------------------------------------------------------------------===//
311 image_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]
314 image_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]
317 image_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]
320 image_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]
323 image_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]
326 image_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]
329 // FIXME: This test is incorrect because r128 assumes a 128-bit SRSRC.
330 image_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
334 image_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]
338 //===----------------------------------------------------------------------===//
339 // Image Sample: d16 packed
340 //===----------------------------------------------------------------------===//
342 image_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
348 //===----------------------------------------------------------------------===//
349 // Image Sample: d16 unpacked
350 //===----------------------------------------------------------------------===//
352 image_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]
358 //===----------------------------------------------------------------------===//
359 // Image Sample: a16
360 //===----------------------------------------------------------------------===//
362 image_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
367 image_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
372 image_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
377 image_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
382 //===----------------------------------------------------------------------===//
383 // Image Atomics
384 //===----------------------------------------------------------------------===//
386 image_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]
390 image_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]
394 image_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]
398 image_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]
402 image_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]
406 image_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]
410 image_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]
414 image_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]
418 image_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]
422 image_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]
426 image_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]
430 image_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]
434 image_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]
438 image_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]
442 // FIXME: This test is incorrect because r128 assumes a 128-bit SRSRC.
443 image_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
448 //===----------------------------------------------------------------------===//
449 // Image Gather4
450 //===----------------------------------------------------------------------===//
452 image_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]
455 image_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]
458 image_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]
461 image_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]
464 image_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]
467 image_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]
470 image_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
476 image_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]
482 image_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
488 image_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
493 image_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