1 // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx800 -show-encoding %s 2>&1 | FileCheck %s 2 // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck %s 3 // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx906 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=GFX906 4 5 // 6 // Test unsupported GPUs. 7 // 8 9 // CHECK: error: instruction not supported on this GPU 10 v_fmac_f32 v0, v1, v2 11 // CHECK: error: instruction not supported on this GPU 12 v_xnor_b32 v0, v1, v2 13 // CHECK: error: instruction not supported on this GPU 14 v_dot2_f32_f16 v0, v1, v2, v3 15 // CHECK: error: instruction not supported on this GPU 16 v_dot2_i32_i16 v0, v1, v2, v3 17 // CHECK: error: instruction not supported on this GPU 18 v_dot2_u32_u16 v0, v1, v2, v3 19 // CHECK: error: instruction not supported on this GPU 20 v_dot4_i32_i8 v0, v1, v2, v3 21 // CHECK: error: instruction not supported on this GPU 22 v_dot4_u32_u8 v0, v1, v2, v3 23 // CHECK: error: instruction not supported on this GPU 24 v_dot8_i32_i4 v0, v1, v2, v3 25 // CHECK: error: instruction not supported on this GPU 26 v_dot8_u32_u4 v0, v1, v2, v3 27 28 // 29 // Test invalid operands. 30 // 31 32 // GFX906: error: failed parsing operand 33 v_dot2_f32_f16 v0, v1, v2, v3 op_sel 34 // GFX906: error: failed parsing operand 35 v_dot2_f32_f16 v0, v1, v2, v3 op_sel: 36 // GFX906: error: failed parsing operand 37 v_dot2_f32_f16 v0, v1, v2, v3 op_sel:[ 38 // GFX906: error: failed parsing operand 39 v_dot2_f32_f16 v0, v1, v2, v3 op_sel:] 40 // GFX906: error: failed parsing operand 41 v_dot2_f32_f16 v0, v1, v2, v3 op_sel:[] 42 // GFX906: error: failed parsing operand 43 v_dot2_f32_f16 v0, v1, v2, v3 op_sel:[,] 44 // GFX906: error: failed parsing operand 45 v_dot2_f32_f16 v0, v1, v2, v3 op_sel:[,0] 46 // GFX906: error: failed parsing operand 47 v_dot2_f32_f16 v0, v1, v2, v3 op_sel:[0,2] 48 // GFX906: error: failed parsing operand 49 v_dot2_f32_f16 v0, v1, v2, v3 op_sel:[2,0] 50 // GFX906: error: failed parsing operand 51 v_dot2_f32_f16 v0, v1, v2, v3 op_sel:[2,2] 52 // GFX906: error: failed parsing operand 53 v_dot2_f32_f16 v0, v1, v2, v3 op_sel:[0,-1] 54 // GFX906: error: failed parsing operand 55 v_dot2_f32_f16 v0, v1, v2, v3 op_sel:[-1,0] 56 // GFX906: error: failed parsing operand 57 v_dot2_f32_f16 v0, v1, v2, v3 op_sel:[-1,-1] 58 // GFX906: error: not a valid operand 59 v_dot2_f32_f16 v0, v1, v2, v3 op_sel:[0,0,0,0,0] 60 // GFX906: error: failed parsing operand 61 v_dot2_f32_f16 v0, v1, v2, v3 op_sel_hi 62 // GFX906: error: failed parsing operand 63 v_dot2_f32_f16 v0, v1, v2, v3 op_sel_hi: 64 // GFX906: error: failed parsing operand 65 v_dot2_f32_f16 v0, v1, v2, v3 op_sel_hi:[ 66 // GFX906: error: failed parsing operand 67 v_dot2_f32_f16 v0, v1, v2, v3 op_sel_hi:] 68 // GFX906: error: failed parsing operand 69 v_dot2_f32_f16 v0, v1, v2, v3 op_sel_hi:[] 70 // GFX906: error: failed parsing operand 71 v_dot2_f32_f16 v0, v1, v2, v3 op_sel_hi:[,] 72 // GFX906: error: failed parsing operand 73 v_dot2_f32_f16 v0, v1, v2, v3 op_sel_hi:[,0] 74 // GFX906: error: failed parsing operand 75 v_dot2_f32_f16 v0, v1, v2, v3 op_sel_hi:[0,2] 76 // GFX906: error: failed parsing operand 77 v_dot2_f32_f16 v0, v1, v2, v3 op_sel_hi:[2,0] 78 // GFX906: error: failed parsing operand 79 v_dot2_f32_f16 v0, v1, v2, v3 op_sel_hi:[2,2] 80 // GFX906: error: failed parsing operand 81 v_dot2_f32_f16 v0, v1, v2, v3 op_sel_hi:[0,-1] 82 // GFX906: error: failed parsing operand 83 v_dot2_f32_f16 v0, v1, v2, v3 op_sel_hi:[-1,0] 84 // GFX906: error: failed parsing operand 85 v_dot2_f32_f16 v0, v1, v2, v3 op_sel_hi:[-1,-1] 86 // GFX906: error: not a valid operand 87 v_dot2_f32_f16 v0, v1, v2, v3 op_sel_hi:[0,0,0,0,0] 88 // GFX906: error: failed parsing operand 89 v_dot2_f32_f16 v0, v1, v2, v3 neg_lo 90 // GFX906: error: failed parsing operand 91 v_dot2_f32_f16 v0, v1, v2, v3 neg_lo: 92 // GFX906: error: failed parsing operand 93 v_dot2_f32_f16 v0, v1, v2, v3 neg_lo:[ 94 // GFX906: error: failed parsing operand 95 v_dot2_f32_f16 v0, v1, v2, v3 neg_lo:] 96 // GFX906: error: failed parsing operand 97 v_dot2_f32_f16 v0, v1, v2, v3 neg_lo:[] 98 // GFX906: error: failed parsing operand 99 v_dot2_f32_f16 v0, v1, v2, v3 neg_lo:[,] 100 // GFX906: error: failed parsing operand 101 v_dot2_f32_f16 v0, v1, v2, v3 neg_lo:[,0] 102 // GFX906: error: failed parsing operand 103 v_dot2_f32_f16 v0, v1, v2, v3 neg_lo:[0,2] 104 // GFX906: error: failed parsing operand 105 v_dot2_f32_f16 v0, v1, v2, v3 neg_lo:[2,0] 106 // GFX906: error: failed parsing operand 107 v_dot2_f32_f16 v0, v1, v2, v3 neg_lo:[2,2] 108 // GFX906: error: failed parsing operand 109 v_dot2_f32_f16 v0, v1, v2, v3 neg_lo:[0,-1] 110 // GFX906: error: failed parsing operand 111 v_dot2_f32_f16 v0, v1, v2, v3 neg_lo:[-1,0] 112 // GFX906: error: failed parsing operand 113 v_dot2_f32_f16 v0, v1, v2, v3 neg_lo:[-1,-1] 114 // GFX906: error: not a valid operand 115 v_dot2_f32_f16 v0, v1, v2, v3 neg_lo:[0,0,0,0,0] 116 // GFX906: error: failed parsing operand 117 v_dot2_f32_f16 v0, v1, v2, v3 neg_hi 118 // GFX906: error: failed parsing operand 119 v_dot2_f32_f16 v0, v1, v2, v3 neg_hi: 120 // GFX906: error: failed parsing operand 121 v_dot2_f32_f16 v0, v1, v2, v3 neg_hi:[ 122 // GFX906: error: failed parsing operand 123 v_dot2_f32_f16 v0, v1, v2, v3 neg_hi:] 124 // GFX906: error: failed parsing operand 125 v_dot2_f32_f16 v0, v1, v2, v3 neg_hi:[] 126 // GFX906: error: failed parsing operand 127 v_dot2_f32_f16 v0, v1, v2, v3 neg_hi:[,] 128 // GFX906: error: failed parsing operand 129 v_dot2_f32_f16 v0, v1, v2, v3 neg_hi:[,0] 130 // GFX906: error: failed parsing operand 131 v_dot2_f32_f16 v0, v1, v2, v3 neg_hi:[0,2] 132 // GFX906: error: failed parsing operand 133 v_dot2_f32_f16 v0, v1, v2, v3 neg_hi:[2,0] 134 // GFX906: error: failed parsing operand 135 v_dot2_f32_f16 v0, v1, v2, v3 neg_hi:[2,2] 136 // GFX906: error: failed parsing operand 137 v_dot2_f32_f16 v0, v1, v2, v3 neg_hi:[0,-1] 138 // GFX906: error: failed parsing operand 139 v_dot2_f32_f16 v0, v1, v2, v3 neg_hi:[-1,0] 140 // GFX906: error: failed parsing operand 141 v_dot2_f32_f16 v0, v1, v2, v3 neg_hi:[-1,-1] 142 // GFX906: error: not a valid operand 143 v_dot2_f32_f16 v0, v1, v2, v3 neg_hi:[0,0,0,0,0] 144 // GFX906: error: failed parsing operand 145 v_dot2_i32_i16 v0, v1, v2, v3 op_sel 146 // GFX906: error: failed parsing operand 147 v_dot2_i32_i16 v0, v1, v2, v3 op_sel: 148 // GFX906: error: failed parsing operand 149 v_dot2_i32_i16 v0, v1, v2, v3 op_sel:[ 150 // GFX906: error: failed parsing operand 151 v_dot2_i32_i16 v0, v1, v2, v3 op_sel:] 152 // GFX906: error: failed parsing operand 153 v_dot2_i32_i16 v0, v1, v2, v3 op_sel:[] 154 // GFX906: error: failed parsing operand 155 v_dot2_i32_i16 v0, v1, v2, v3 op_sel:[,] 156 // GFX906: error: failed parsing operand 157 v_dot2_i32_i16 v0, v1, v2, v3 op_sel:[,0] 158 // GFX906: error: failed parsing operand 159 v_dot2_i32_i16 v0, v1, v2, v3 op_sel:[0,2] 160 // GFX906: error: failed parsing operand 161 v_dot2_i32_i16 v0, v1, v2, v3 op_sel:[2,0] 162 // GFX906: error: failed parsing operand 163 v_dot2_i32_i16 v0, v1, v2, v3 op_sel:[2,2] 164 // GFX906: error: failed parsing operand 165 v_dot2_i32_i16 v0, v1, v2, v3 op_sel:[0,-1] 166 // GFX906: error: failed parsing operand 167 v_dot2_i32_i16 v0, v1, v2, v3 op_sel:[-1,0] 168 // GFX906: error: failed parsing operand 169 v_dot2_i32_i16 v0, v1, v2, v3 op_sel:[-1,-1] 170 // GFX906: error: not a valid operand 171 v_dot2_i32_i16 v0, v1, v2, v3 op_sel:[0,0,0,0,0] 172 // GFX906: error: failed parsing operand 173 v_dot2_i32_i16 v0, v1, v2, v3 op_sel_hi 174 // GFX906: error: failed parsing operand 175 v_dot2_i32_i16 v0, v1, v2, v3 op_sel_hi: 176 // GFX906: error: failed parsing operand 177 v_dot2_i32_i16 v0, v1, v2, v3 op_sel_hi:[ 178 // GFX906: error: failed parsing operand 179 v_dot2_i32_i16 v0, v1, v2, v3 op_sel_hi:] 180 // GFX906: error: failed parsing operand 181 v_dot2_i32_i16 v0, v1, v2, v3 op_sel_hi:[] 182 // GFX906: error: failed parsing operand 183 v_dot2_i32_i16 v0, v1, v2, v3 op_sel_hi:[,] 184 // GFX906: error: failed parsing operand 185 v_dot2_i32_i16 v0, v1, v2, v3 op_sel_hi:[,0] 186 // GFX906: error: failed parsing operand 187 v_dot2_i32_i16 v0, v1, v2, v3 op_sel_hi:[0,2] 188 // GFX906: error: failed parsing operand 189 v_dot2_i32_i16 v0, v1, v2, v3 op_sel_hi:[2,0] 190 // GFX906: error: failed parsing operand 191 v_dot2_i32_i16 v0, v1, v2, v3 op_sel_hi:[2,2] 192 // GFX906: error: failed parsing operand 193 v_dot2_i32_i16 v0, v1, v2, v3 op_sel_hi:[0,-1] 194 // GFX906: error: failed parsing operand 195 v_dot2_i32_i16 v0, v1, v2, v3 op_sel_hi:[-1,0] 196 // GFX906: error: failed parsing operand 197 v_dot2_i32_i16 v0, v1, v2, v3 op_sel_hi:[-1,-1] 198 // GFX906: error: not a valid operand 199 v_dot2_i32_i16 v0, v1, v2, v3 op_sel_hi:[0,0,0,0,0] 200 // FIXME-GFX906: error: invalid operand for instruction 201 v_dot2_i32_i16 v0, v1, v2, v3 neg_lo:[0,0] 202 // FIXME-GFX906: error: invalid operand for instruction 203 v_dot2_i32_i16 v0, v1, v2, v3 neg_hi:[0,0] 204 // GFX906: error: failed parsing operand 205 v_dot2_u32_u16 v0, v1, v2, v3 op_sel 206 // GFX906: error: failed parsing operand 207 v_dot2_u32_u16 v0, v1, v2, v3 op_sel: 208 // GFX906: error: failed parsing operand 209 v_dot2_u32_u16 v0, v1, v2, v3 op_sel:[ 210 // GFX906: error: failed parsing operand 211 v_dot2_u32_u16 v0, v1, v2, v3 op_sel:] 212 // GFX906: error: failed parsing operand 213 v_dot2_u32_u16 v0, v1, v2, v3 op_sel:[] 214 // GFX906: error: failed parsing operand 215 v_dot2_u32_u16 v0, v1, v2, v3 op_sel:[,] 216 // GFX906: error: failed parsing operand 217 v_dot2_u32_u16 v0, v1, v2, v3 op_sel:[,0] 218 // GFX906: error: failed parsing operand 219 v_dot2_u32_u16 v0, v1, v2, v3 op_sel:[0,2] 220 // GFX906: error: failed parsing operand 221 v_dot2_u32_u16 v0, v1, v2, v3 op_sel:[2,0] 222 // GFX906: error: failed parsing operand 223 v_dot2_u32_u16 v0, v1, v2, v3 op_sel:[2,2] 224 // GFX906: error: failed parsing operand 225 v_dot2_u32_u16 v0, v1, v2, v3 op_sel:[0,-1] 226 // GFX906: error: failed parsing operand 227 v_dot2_u32_u16 v0, v1, v2, v3 op_sel:[-1,0] 228 // GFX906: error: failed parsing operand 229 v_dot2_u32_u16 v0, v1, v2, v3 op_sel:[-1,-1] 230 // GFX906: error: not a valid operand 231 v_dot2_u32_u16 v0, v1, v2, v3 op_sel:[0,0,0,0,0] 232 // GFX906: error: failed parsing operand 233 v_dot2_u32_u16 v0, v1, v2, v3 op_sel_hi 234 // GFX906: error: failed parsing operand 235 v_dot2_u32_u16 v0, v1, v2, v3 op_sel_hi: 236 // GFX906: error: failed parsing operand 237 v_dot2_u32_u16 v0, v1, v2, v3 op_sel_hi:[ 238 // GFX906: error: failed parsing operand 239 v_dot2_u32_u16 v0, v1, v2, v3 op_sel_hi:] 240 // GFX906: error: failed parsing operand 241 v_dot2_u32_u16 v0, v1, v2, v3 op_sel_hi:[] 242 // GFX906: error: failed parsing operand 243 v_dot2_u32_u16 v0, v1, v2, v3 op_sel_hi:[,] 244 // GFX906: error: failed parsing operand 245 v_dot2_u32_u16 v0, v1, v2, v3 op_sel_hi:[,0] 246 // GFX906: error: failed parsing operand 247 v_dot2_u32_u16 v0, v1, v2, v3 op_sel_hi:[0,2] 248 // GFX906: error: failed parsing operand 249 v_dot2_u32_u16 v0, v1, v2, v3 op_sel_hi:[2,0] 250 // GFX906: error: failed parsing operand 251 v_dot2_u32_u16 v0, v1, v2, v3 op_sel_hi:[2,2] 252 // GFX906: error: failed parsing operand 253 v_dot2_u32_u16 v0, v1, v2, v3 op_sel_hi:[0,-1] 254 // GFX906: error: failed parsing operand 255 v_dot2_u32_u16 v0, v1, v2, v3 op_sel_hi:[-1,0] 256 // GFX906: error: failed parsing operand 257 v_dot2_u32_u16 v0, v1, v2, v3 op_sel_hi:[-1,-1] 258 // GFX906: error: not a valid operand 259 v_dot2_u32_u16 v0, v1, v2, v3 op_sel_hi:[0,0,0,0,0] 260 // FIXME-GFX906: error: invalid operand for instruction 261 v_dot2_u32_u16 v0, v1, v2, v3 neg_lo:[0,0] 262 // FIXME-GFX906: error: invalid operand for instruction 263 v_dot2_u32_u16 v0, v1, v2, v3 neg_hi:[0,0] 264 265 // 266 // Test regular modifiers. 267 // 268 269 // GFX906: error: not a valid operand 270 v_dot2_f32_f16 v0, |v1|, v2, v3 271 // GFX906: error: not a valid operand 272 v_dot2_f32_f16 v0, v1, |v2|, v3 273 // GFX906: error: not a valid operand 274 v_dot2_f32_f16 v0, v1, v2, |v3| 275 // GFX906: error: not a valid operand 276 v_dot2_f32_f16 v0, |v1|, |v2|, v3 277 // GFX906: error: not a valid operand 278 v_dot2_f32_f16 v0, |v1|, v2, |v3| 279 // GFX906: error: not a valid operand 280 v_dot2_f32_f16 v0, |v1|, |v2|, |v3| 281 // GFX906: error: invalid operand for instruction 282 v_dot2_f32_f16 v0, abs(v1), v2, v3 283 // GFX906: error: invalid operand for instruction 284 v_dot2_f32_f16 v0, v1, abs(v2), v3 285 // GFX906: error: invalid operand for instruction 286 v_dot2_f32_f16 v0, v1, v2, abs(v3) 287 // GFX906: error: invalid operand for instruction 288 v_dot2_f32_f16 v0, abs(v1), abs(v2), v3 289 // GFX906: error: invalid operand for instruction 290 v_dot2_f32_f16 v0, abs(v1), v2, abs(v3) 291 // GFX906: error: invalid operand for instruction 292 v_dot2_f32_f16 v0, abs(v1), abs(v2), abs(v3) 293 // GFX906: error: invalid operand for instruction 294 v_dot2_f32_f16 v0, -v1, v2, v3 295 // GFX906: error: invalid operand for instruction 296 v_dot2_f32_f16 v0, v1, -v2, v3 297 // GFX906: error: invalid operand for instruction 298 v_dot2_f32_f16 v0, v1, v2, -v3 299 // GFX906: error: invalid operand for instruction 300 v_dot2_f32_f16 v0, -v1, -v2, v3 301 // GFX906: error: invalid operand for instruction 302 v_dot2_f32_f16 v0, -v1, v2, -v3 303 // GFX906: error: invalid operand for instruction 304 v_dot2_f32_f16 v0, -v1, -v2, -v3 305 // GFX906: error: not a valid operand 306 v_dot2_i32_i16 v0, |v1|, v2, v3 307 // GFX906: error: not a valid operand 308 v_dot2_i32_i16 v0, v1, |v2|, v3 309 // GFX906: error: not a valid operand 310 v_dot2_i32_i16 v0, v1, v2, |v3| 311 // GFX906: error: not a valid operand 312 v_dot2_i32_i16 v0, |v1|, |v2|, v3 313 // GFX906: error: not a valid operand 314 v_dot2_i32_i16 v0, |v1|, v2, |v3| 315 // GFX906: error: not a valid operand 316 v_dot2_i32_i16 v0, |v1|, |v2|, |v3| 317 // GFX906: error: invalid operand for instruction 318 v_dot2_i32_i16 v0, abs(v1), v2, v3 319 // GFX906: error: invalid operand for instruction 320 v_dot2_i32_i16 v0, v1, abs(v2), v3 321 // GFX906: error: invalid operand for instruction 322 v_dot2_i32_i16 v0, v1, v2, abs(v3) 323 // GFX906: error: invalid operand for instruction 324 v_dot2_i32_i16 v0, abs(v1), abs(v2), v3 325 // GFX906: error: invalid operand for instruction 326 v_dot2_i32_i16 v0, abs(v1), v2, abs(v3) 327 // GFX906: error: invalid operand for instruction 328 v_dot2_i32_i16 v0, abs(v1), abs(v2), abs(v3) 329 // GFX906: error: invalid operand for instruction 330 v_dot2_i32_i16 v0, -v1, v2, v3 331 // GFX906: error: invalid operand for instruction 332 v_dot2_i32_i16 v0, v1, -v2, v3 333 // GFX906: error: invalid operand for instruction 334 v_dot2_i32_i16 v0, v1, v2, -v3 335 // GFX906: error: invalid operand for instruction 336 v_dot2_i32_i16 v0, -v1, -v2, v3 337 // GFX906: error: invalid operand for instruction 338 v_dot2_i32_i16 v0, -v1, v2, -v3 339 // GFX906: error: invalid operand for instruction 340 v_dot2_i32_i16 v0, -v1, -v2, -v3 341 // GFX906: error: not a valid operand 342 v_dot2_u32_u16 v0, |v1|, v2, v3 343 // GFX906: error: not a valid operand 344 v_dot2_u32_u16 v0, v1, |v2|, v3 345 // GFX906: error: not a valid operand 346 v_dot2_u32_u16 v0, v1, v2, |v3| 347 // GFX906: error: not a valid operand 348 v_dot2_u32_u16 v0, |v1|, |v2|, v3 349 // GFX906: error: not a valid operand 350 v_dot2_u32_u16 v0, |v1|, v2, |v3| 351 // GFX906: error: not a valid operand 352 v_dot2_u32_u16 v0, |v1|, |v2|, |v3| 353 // GFX906: error: invalid operand for instruction 354 v_dot2_u32_u16 v0, abs(v1), v2, v3 355 // GFX906: error: invalid operand for instruction 356 v_dot2_u32_u16 v0, v1, abs(v2), v3 357 // GFX906: error: invalid operand for instruction 358 v_dot2_u32_u16 v0, v1, v2, abs(v3) 359 // GFX906: error: invalid operand for instruction 360 v_dot2_u32_u16 v0, abs(v1), abs(v2), v3 361 // GFX906: error: invalid operand for instruction 362 v_dot2_u32_u16 v0, abs(v1), v2, abs(v3) 363 // GFX906: error: invalid operand for instruction 364 v_dot2_u32_u16 v0, abs(v1), abs(v2), abs(v3) 365 // GFX906: error: invalid operand for instruction 366 v_dot2_u32_u16 v0, -v1, v2, v3 367 // GFX906: error: invalid operand for instruction 368 v_dot2_u32_u16 v0, v1, -v2, v3 369 // GFX906: error: invalid operand for instruction 370 v_dot2_u32_u16 v0, v1, v2, -v3 371 // GFX906: error: invalid operand for instruction 372 v_dot2_u32_u16 v0, -v1, -v2, v3 373 // GFX906: error: invalid operand for instruction 374 v_dot2_u32_u16 v0, -v1, v2, -v3 375 // GFX906: error: invalid operand for instruction 376 v_dot2_u32_u16 v0, -v1, -v2, -v3 377 378 // 379 // Test constant bus restrictions. 380 // 381 382 // GFX906: error: invalid operand (violates constant bus restrictions) 383 v_dot2_f32_f16 v255, s1, s2, s3 384 // GFX906: error: invalid operand (violates constant bus restrictions) 385 v_dot2_i32_i16 v255, s1, s2, s3 386 // GFX906: error: invalid operand (violates constant bus restrictions) 387 v_dot2_u32_u16 v255, s1, s2, s3 388