1 // RUN: not llvm-mc -arch=amdgcn -show-encoding %s | FileCheck %s --check-prefix=GCN --check-prefix=SI --check-prefix=SICI
2 // RUN: not llvm-mc -arch=amdgcn -mcpu=SI -show-encoding %s | FileCheck %s --check-prefix=GCN --check-prefix=SI --check-prefix=SICI
3 // RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s | FileCheck %s --check-prefix=GCN --check-prefix=SICI --check-prefix=CIVI
4 // RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s | FileCheck %s --check-prefix=GCN --check-prefix=CIVI --check-prefix=VI
6 // RUN: not llvm-mc -arch=amdgcn -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSI --check-prefix=NOSICI
7 // RUN: not llvm-mc -arch=amdgcn -mcpu=SI -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSI --check-prefix=NOSICI
8 // RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSICI
9 // RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s 2>&1 | FileCheck %s -check-prefix=NOVI
12 // GCN: v_nop ; encoding: [0x00,0x00,0x00,0x7e]
15 // GCN: v_mov_b32_e32 v1, v2 ; encoding: [0x02,0x03,0x02,0x7e]
18 // GCN: v_readfirstlane_b32 s1, v2 ; encoding: [0x02,0x05,0x02,0x7e]
19 v_readfirstlane_b32 s1, v2
21 // GCN: v_cvt_i32_f64_e32 v1, v[2:3] ; encoding: [0x02,0x07,0x02,0x7e]
22 v_cvt_i32_f64 v1, v[2:3]
24 // GCN: v_cvt_f64_i32_e32 v[1:2], v2 ; encoding: [0x02,0x09,0x02,0x7e]
25 v_cvt_f64_i32 v[1:2], v2
27 // GCN: v_cvt_f32_i32_e32 v1, v2 ; encoding: [0x02,0x0b,0x02,0x7e]
30 // GCN: v_cvt_f32_u32_e32 v1, v2 ; encoding: [0x02,0x0d,0x02,0x7e]
33 // GCN: v_cvt_u32_f32_e32 v1, v2 ; encoding: [0x02,0x0f,0x02,0x7e
36 // GCN: v_cvt_i32_f32_e32 v1, v2 ; encoding: [0x02,0x11,0x02,0x7e]
39 // SICI: v_mov_fed_b32_e32 v1, v2 ; encoding: [0x02,0x13,0x02,0x7e]
40 // NOVI: error: instruction not supported on this GPU
43 // GCN: v_cvt_f16_f32_e32 v1, v2 ; encoding: [0x02,0x15,0x02,0x7e]
46 // GCN: v_cvt_f32_f16_e32 v1, v2 ; encoding: [0x02,0x17,0x02,0x7e]
49 // GCN: v_cvt_rpi_i32_f32_e32 v1, v2 ; encoding: [0x02,0x19,0x02,0x7e]
50 v_cvt_rpi_i32_f32 v1, v2
52 // GCN: v_cvt_flr_i32_f32_e32 v1, v2 ; encoding: [0x02,0x1b,0x02,0x7e]
53 v_cvt_flr_i32_f32 v1, v2
55 // GCN: v_cvt_off_f32_i4_e32 v1, v2 ; encoding: [0x02,0x1d,0x02,0x7e]
56 v_cvt_off_f32_i4_e32 v1, v2
58 // GCN: v_cvt_f32_f64_e32 v1, v[2:3] ; encoding: [0x02,0x1f,0x02,0x7e]
59 v_cvt_f32_f64 v1, v[2:3]
61 // GCN: v_cvt_f64_f32_e32 v[1:2], v2 ; encoding: [0x02,0x21,0x02,0x7e]
62 v_cvt_f64_f32 v[1:2], v2
64 // GCN: v_cvt_f32_ubyte0_e32 v1, v2 ; encoding: [0x02,0x23,0x02,0x7e]
65 v_cvt_f32_ubyte0 v1, v2
67 // GCN: v_cvt_f32_ubyte1_e32 v1, v2 ; encoding: [0x02,0x25,0x02,0x7e]
68 v_cvt_f32_ubyte1_e32 v1, v2
70 // GCN: v_cvt_f32_ubyte2_e32 v1, v2 ; encoding: [0x02,0x27,0x02,0x7e]
71 v_cvt_f32_ubyte2 v1, v2
73 // GCN: v_cvt_f32_ubyte3_e32 v1, v2 ; encoding: [0x02,0x29,0x02,0x7e]
74 v_cvt_f32_ubyte3 v1, v2
76 // GCN: v_cvt_u32_f64_e32 v1, v[2:3] ; encoding: [0x02,0x2b,0x02,0x7e]
77 v_cvt_u32_f64 v1, v[2:3]
79 // GCN: v_cvt_f64_u32_e32 v[1:2], v2 ; encoding: [0x02,0x2d,0x02,0x7e]
80 v_cvt_f64_u32 v[1:2], v2
82 // NOSI: error: instruction not supported on this GPU
83 // NOSI: v_trunc_f64_e32 v[1:2], v[2:3]
84 // CIVI: v_trunc_f64_e32 v[1:2], v[2:3] ; encoding: [0x02,0x2f,0x02,0x7e]
85 v_trunc_f64_e32 v[1:2], v[2:3]
87 // NOSI: error: instruction not supported on this GPU
88 // NOSI: v_ceil_f64_e32 v[1:2], v[2:3]
89 // CIVI: v_ceil_f64_e32 v[1:2], v[2:3] ; encoding: [0x02,0x31,0x02,0x7e]
90 v_ceil_f64_e32 v[1:2], v[2:3]
92 // NOSI: error: instruction not supported on this GPU
93 // NOSI: v_rndne_f64_e32 v[1:2], v[2:3]
94 // CIVI: v_rndne_f64_e32 v[1:2], v[2:3] ; encoding: [0x02,0x33,0x02,0x7e]
95 v_rndne_f64_e32 v[1:2], v[2:3]
97 // NOSI: error: instruction not supported on this GPU
98 // NOSI: v_floor_f64_e32 v[1:2], v[2:3]
99 // CIVI: v_floor_f64_e32 v[1:2], v[2:3] ; encoding: [0x02,0x35,0x02,0x7e]
100 v_floor_f64_e32 v[1:2], v[2:3]
102 // SICI: v_fract_f32_e32 v1, v2 ; encoding: [0x02,0x41,0x02,0x7e]
103 // VI: v_fract_f32_e32 v1, v2 ; encoding: [0x02,0x37,0x02,0x7e]
106 // SICI: v_trunc_f32_e32 v1, v2 ; encoding: [0x02,0x43,0x02,0x7e]
107 // VI: v_trunc_f32_e32 v1, v2 ; encoding: [0x02,0x39,0x02,0x7e]
110 // SICI: v_ceil_f32_e32 v1, v2 ; encoding: [0x02,0x45,0x02,0x7e]
111 // VI: v_ceil_f32_e32 v1, v2 ; encoding: [0x02,0x3b,0x02,0x7e]
114 // SICI: v_rndne_f32_e32 v1, v2 ; encoding: [0x02,0x47,0x02,0x7e]
115 // VI: v_rndne_f32_e32 v1, v2 ; encoding: [0x02,0x3d,0x02,0x7e]
118 // SICI: v_floor_f32_e32 v1, v2 ; encoding: [0x02,0x49,0x02,0x7e]
119 // VI: v_floor_f32_e32 v1, v2 ; encoding: [0x02,0x3f,0x02,0x7e]
120 v_floor_f32_e32 v1, v2
122 // SICI: v_exp_f32_e32 v1, v2 ; encoding: [0x02,0x4b,0x02,0x7e]
123 // VI: v_exp_f32_e32 v1, v2 ; encoding: [0x02,0x41,0x02,0x7e]
126 // SICI: v_log_clamp_f32_e32 v1, v2 ; encoding: [0x02,0x4d,0x02,0x7e]
127 // NOVI: error: instruction not supported on this GPU
128 // NOVI: v_log_clamp_f32 v1, v2
129 v_log_clamp_f32 v1, v2
131 // SICI: v_log_f32_e32 v1, v2 ; encoding: [0x02,0x4f,0x02,0x7e]
132 // VI: v_log_f32_e32 v1, v2 ; encoding: [0x02,0x43,0x02,0x7e]
135 // SICI: v_rcp_clamp_f32_e32 v1, v2 ; encoding: [0x02,0x51,0x02,0x7e]
136 // NOVI: error: instruction not supported on this GPU
137 // NOVI: v_rcp_clamp_f32 v1, v2
138 v_rcp_clamp_f32 v1, v2
140 // SICI: v_rcp_legacy_f32_e32 v1, v2 ; encoding: [0x02,0x53,0x02,0x7e]
141 // NOVI: error: instruction not supported on this GPU
142 // NOVI: v_rcp_legacy_f32 v1, v2
143 v_rcp_legacy_f32 v1, v2
145 // SICI: v_rcp_f32_e32 v1, v2 ; encoding: [0x02,0x55,0x02,0x7e]
146 // VI: v_rcp_f32_e32 v1, v2 ; encoding: [0x02,0x45,0x02,0x7e]
149 // SICI: v_rcp_iflag_f32_e32 v1, v2 ; encoding: [0x02,0x57,0x02,0x7e]
150 // VI: v_rcp_iflag_f32_e32 v1, v2 ; encoding: [0x02,0x47,0x02,0x7e]
151 v_rcp_iflag_f32 v1, v2
153 // SICI: v_rsq_clamp_f32_e32 v1, v2 ; encoding: [0x02,0x59,0x02,0x7e]
154 // NOVI: error: instruction not supported on this GPU
155 // NOVI: v_rsq_clamp_f32 v1, v2
156 v_rsq_clamp_f32 v1, v2
158 // SICI: v_rsq_legacy_f32_e32 v1, v2 ; encoding: [0x02,0x5b,0x02,0x7e]
159 // NOVI: error: instruction not supported on this GPU
160 // NOVI: v_rsq_legacy_f32 v1, v2
161 v_rsq_legacy_f32 v1, v2
163 // SICI: v_rsq_f32_e32 v1, v2 ; encoding: [0x02,0x5d,0x02,0x7e]
164 // VI: v_rsq_f32_e32 v1, v2 ; encoding: [0x02,0x49,0x02,0x7e]
167 // SICI: v_rcp_f64_e32 v[1:2], v[2:3] ; encoding: [0x02,0x5f,0x02,0x7e]
168 // VI: v_rcp_f64_e32 v[1:2], v[2:3] ; encoding: [0x02,0x4b,0x02,0x7e]
169 v_rcp_f64 v[1:2], v[2:3]
171 // SICI: v_rcp_clamp_f64_e32 v[1:2], v[2:3] ; encoding: [0x02,0x61,0x02,0x7e]
172 // NOVI: error: instruction not supported on this GPU
173 // NOVI: v_rcp_clamp_f64 v[1:2], v[2:3]
174 v_rcp_clamp_f64 v[1:2], v[2:3]
176 // SICI: v_rsq_f64_e32 v[1:2], v[2:3] ; encoding: [0x02,0x63,0x02,0x7e]
177 // VI: v_rsq_f64_e32 v[1:2], v[2:3] ; encoding: [0x02,0x4d,0x02,0x7e]
178 v_rsq_f64 v[1:2], v[2:3]
180 // SICI: v_rsq_clamp_f64_e32 v[1:2], v[2:3] ; encoding: [0x02,0x65,0x02,0x7e]
181 // NOVI: error: instruction not supported on this GPU
182 // NOVI: v_rsq_clamp_f64 v[1:2], v[2:3]
183 v_rsq_clamp_f64 v[1:2], v[2:3]
185 // SICI: v_sqrt_f32_e32 v1, v2 ; encoding: [0x02,0x67,0x02,0x7e]
186 // VI: v_sqrt_f32_e32 v1, v2 ; encoding: [0x02,0x4f,0x02,0x7e]
189 // SICI: v_sqrt_f64_e32 v[1:2], v[2:3] ; encoding: [0x02,0x69,0x02,0x7e]
190 // VI: v_sqrt_f64_e32 v[1:2], v[2:3] ; encoding: [0x02,0x51,0x02,0x7e]
191 v_sqrt_f64 v[1:2], v[2:3]
193 // SICI: v_sin_f32_e32 v1, v2 ; encoding: [0x02,0x6b,0x02,0x7e]
194 // VI: v_sin_f32_e32 v1, v2 ; encoding: [0x02,0x53,0x02,0x7e]
197 // SICI: v_cos_f32_e32 v1, v2 ; encoding: [0x02,0x6d,0x02,0x7e]
198 // VI: v_cos_f32_e32 v1, v2 ; encoding: [0x02,0x55,0x02,0x7e]
201 // SICI: v_not_b32_e32 v1, v2 ; encoding: [0x02,0x6f,0x02,0x7e]
202 // VI: v_not_b32_e32 v1, v2 ; encoding: [0x02,0x57,0x02,0x7e]
205 // SICI: v_bfrev_b32_e32 v1, v2 ; encoding: [0x02,0x71,0x02,0x7e]
206 // VI: v_bfrev_b32_e32 v1, v2 ; encoding: [0x02,0x59,0x02,0x7e]
209 // SICI: v_ffbh_u32_e32 v1, v2 ; encoding: [0x02,0x73,0x02,0x7e]
210 // VI: v_ffbh_u32_e32 v1, v2 ; encoding: [0x02,0x5b,0x02,0x7e]
213 // SICI: v_ffbl_b32_e32 v1, v2 ; encoding: [0x02,0x75,0x02,0x7e]
214 // VI: v_ffbl_b32_e32 v1, v2 ; encoding: [0x02,0x5d,0x02,0x7e]
217 // SICI: v_ffbh_i32_e32 v1, v2 ; encoding: [0x02,0x77,0x02,0x7e]
218 // VI: v_ffbh_i32_e32 v1, v2 ; encoding: [0x02,0x5f,0x02,0x7e]
219 v_ffbh_i32_e32 v1, v2
221 // SICI: v_frexp_exp_i32_f64_e32 v1, v[2:3] ; encoding: [0x02,0x79,0x02,0x7e]
222 // VI: v_frexp_exp_i32_f64_e32 v1, v[2:3] ; encoding: [0x02,0x61,0x02,0x7e]
223 v_frexp_exp_i32_f64 v1, v[2:3]
225 // SICI: v_frexp_mant_f64_e32 v[1:2], v[2:3] ; encoding: [0x02,0x7b,0x02,0x7e]
226 // VI; v_frexp_mant_f64_e32 v[1:2], v[2:3] ; encoding: [0x02,0x63,0x02,0x7e]
227 v_frexp_mant_f64 v[1:2], v[2:3]
229 // SICI: v_fract_f64_e32 v[1:2], v[2:3] ; encoding: [0x02,0x7d,0x02,0x7e]
230 // VI: v_fract_f64_e32 v[1:2], v[2:3] ; encoding: [0x02,0x65,0x02,0x7e]
231 v_fract_f64 v[1:2], v[2:3]
233 // SICI: v_frexp_exp_i32_f32_e32 v1, v2 ; encoding: [0x02,0x7f,0x02,0x7e]
234 // VI: v_frexp_exp_i32_f32_e32 v1, v2 ; encoding: [0x02,0x67,0x02,0x7e]
235 v_frexp_exp_i32_f32 v1, v2
237 // SICI: v_frexp_mant_f32_e32 v1, v2 ; encoding: [0x02,0x81,0x02,0x7e]
238 // VI: v_frexp_mant_f32_e32 v1, v2 ; encoding: [0x02,0x69,0x02,0x7e]
239 v_frexp_mant_f32 v1, v2
241 // SICI: v_clrexcp ; encoding: [0x00,0x82,0x00,0x7e]
242 // VI: v_clrexcp ; encoding: [0x00,0x6a,0x00,0x7e]
245 // SICI: v_movreld_b32_e32 v1, v2 ; encoding: [0x02,0x85,0x02,0x7e]
246 // VI: v_movreld_b32_e32 v1, v2 ; encoding: [0x02,0x6d,0x02,0x7e]
249 // SICI: v_movrels_b32_e32 v1, v2 ; encoding: [0x02,0x87,0x02,0x7e]
250 // VI: v_movrels_b32_e32 v1, v2 ; encoding: [0x02,0x6f,0x02,0x7e]
253 // SICI: v_movrelsd_b32_e32 v1, v2 ; encoding: [0x02,0x89,0x02,0x7e]
254 // VI: v_movrelsd_b32_e32 v1, v2 ; encoding: [0x02,0x71,0x02,0x7e]
255 v_movrelsd_b32 v1, v2
257 // NOSI: error: instruction not supported on this GPU
258 // NOSI: v_log_legacy_f32 v1, v2
259 // CI: v_log_legacy_f32_e32 v1, v2 ; encoding: [0x02,0x8b,0x02,0x7e]
260 // VI: v_log_legacy_f32_e32 v1, v2 ; encoding: [0x02,0x99,0x02,0x7e]
261 v_log_legacy_f32 v1, v2
263 // NOSI: error: instruction not supported on this GPU
264 // NOSI: v_exp_legacy_f32 v1, v2
265 // CI: v_exp_legacy_f32_e32 v1, v2 ; encoding: [0x02,0x8d,0x02,0x7e]
266 // VI: v_exp_legacy_f32_e32 v1, v2 ; encoding: [0x02,0x97,0x02,0x7e]
267 v_exp_legacy_f32 v1, v2
269 // NOSICI: error: instruction not supported on this GPU
270 // NOSICI: v_cvt_f16_u16 v1, v2
271 // VI: v_cvt_f16_u16_e32 v1, v2 ; encoding: [0x02,0x73,0x02,0x7e]
274 // NOSICI: error: instruction not supported on this GPU
275 // NOSICI: v_cvt_f16_i16 v1, v2
276 // VI: v_cvt_f16_i16_e32 v1, v2 ; encoding: [0x02,0x75,0x02,0x7e]
279 // NOSICI: error: instruction not supported on this GPU
280 // NOSICI: v_cvt_u16_f16 v1, v2
281 // VI: v_cvt_u16_f16_e32 v1, v2 ; encoding: [0x02,0x77,0x02,0x7e]
284 // NOSICI: error: instruction not supported on this GPU
285 // NOSICI: v_cvt_i16_f16 v1, v2
286 // VI: v_cvt_i16_f16_e32 v1, v2 ; encoding: [0x02,0x79,0x02,0x7e]
289 // NOSICI: error: instruction not supported on this GPU
290 // NOSICI: v_rcp_f16 v1, v2
291 // VI: v_rcp_f16_e32 v1, v2 ; encoding: [0x02,0x7b,0x02,0x7e]
294 // NOSICI: error: instruction not supported on this GPU
295 // NOSICI: v_sqrt_f16 v1, v2
296 // VI: v_sqrt_f16_e32 v1, v2 ; encoding: [0x02,0x7d,0x02,0x7e]
299 // NOSICI: error: instruction not supported on this GPU
300 // NOSICI: v_rsq_f16 v1, v2
301 // VI: v_rsq_f16_e32 v1, v2 ; encoding: [0x02,0x7f,0x02,0x7e]
304 // NOSICI: error: instruction not supported on this GPU
305 // NOSICI: v_log_f16 v1, v2
306 // VI: v_log_f16_e32 v1, v2 ; encoding: [0x02,0x81,0x02,0x7e]
309 // NOSICI: error: instruction not supported on this GPU
310 // NOSICI: v_exp_f16 v1, v2
311 // VI: v_exp_f16_e32 v1, v2 ; encoding: [0x02,0x83,0x02,0x7e]
314 // NOSICI: error: instruction not supported on this GPU
315 // NOSICI: v_frexp_mant_f16 v1, v2
316 // VI: v_frexp_mant_f16_e32 v1, v2 ; encoding: [0x02,0x85,0x02,0x7e]
317 v_frexp_mant_f16 v1, v2
319 // NOSICI: error: instruction not supported on this GPU
320 // NOSICI: v_frexp_exp_i16_f16 v1, v2
321 // VI: v_frexp_exp_i16_f16_e32 v1, v2 ; encoding: [0x02,0x87,0x02,0x7e]
322 v_frexp_exp_i16_f16 v1, v2
324 // NOSICI: error: instruction not supported on this GPU
325 // NOSICI: v_floor_f16 v1, v2
326 // VI: v_floor_f16_e32 v1, v2 ; encoding: [0x02,0x89,0x02,0x7e]
329 // NOSICI: error: instruction not supported on this GPU
330 // NOSICI: v_ceil_f16 v1, v2
331 // VI: v_ceil_f16_e32 v1, v2 ; encoding: [0x02,0x8b,0x02,0x7e]
334 // NOSICI: error: instruction not supported on this GPU
335 // NOSICI: v_trunc_f16 v1, v2
336 // VI: v_trunc_f16_e32 v1, v2 ; encoding: [0x02,0x8d,0x02,0x7e]
339 // NOSICI: error: instruction not supported on this GPU
340 // NOSICI: v_rndne_f16 v1, v2
341 // VI: v_rndne_f16_e32 v1, v2 ; encoding: [0x02,0x8f,0x02,0x7e]
344 // NOSICI: error: instruction not supported on this GPU
345 // NOSICI: v_fract_f16 v1, v2
346 // VI: v_fract_f16_e32 v1, v2 ; encoding: [0x02,0x91,0x02,0x7e]
349 // NOSICI: error: instruction not supported on this GPU
350 // NOSICI: v_sin_f16 v1, v2
351 // VI: v_sin_f16_e32 v1, v2 ; encoding: [0x02,0x93,0x02,0x7e]
354 // NOSICI: error: instruction not supported on this GPU
355 // NOSICI: v_cos_f16 v1, v2
356 // VI: v_cos_f16_e32 v1, v2 ; encoding: [0x02,0x95,0x02,0x7e]