1// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck -check-prefix=GFX9 %s 2// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 2>&1 %s | FileCheck -check-prefix=GFX9-ERR --implicit-check-not=error: %s 3// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga 2>&1 %s | FileCheck -check-prefix=VI-ERR --implicit-check-not=error: %s 4 5// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s | FileCheck --check-prefix=GFX10 %s 6// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 %s 2>&1 | FileCheck --check-prefix=GFX10-ERR --implicit-check-not=error: %s 7 8scratch_load_ubyte v1, v2, off 9// GFX10: encoding: [0x00,0x40,0x20,0xdc,0x02,0x00,0x7d,0x01] 10// GFX9: scratch_load_ubyte v1, v2, off ; encoding: [0x00,0x40,0x40,0xdc,0x02,0x00,0x7f,0x01] 11// VI-ERR: error: instruction not supported on this GPU 12 13scratch_load_ubyte v1, v2, off dlc 14// GFX10: encoding: [0x00,0x50,0x20,0xdc,0x02,0x00,0x7d,0x01] 15// GFX9-ERR: error: dlc modifier is not supported on this GPU 16// VI-ERR: error: instruction not supported on this GPU 17 18scratch_load_sbyte v1, v2, off 19// GFX10: encoding: [0x00,0x40,0x24,0xdc,0x02,0x00,0x7d,0x01] 20// GFX9: scratch_load_sbyte v1, v2, off ; encoding: [0x00,0x40,0x44,0xdc,0x02,0x00,0x7f,0x01] 21// VI-ERR: error: instruction not supported on this GPU 22 23scratch_load_sbyte v1, v2, off dlc 24// GFX10: encoding: [0x00,0x50,0x24,0xdc,0x02,0x00,0x7d,0x01] 25// GFX9-ERR: error: dlc modifier is not supported on this GPU 26// VI-ERR: error: instruction not supported on this GPU 27 28scratch_load_ushort v1, v2, off 29// GFX10: encoding: [0x00,0x40,0x28,0xdc,0x02,0x00,0x7d,0x01] 30// GFX9: scratch_load_ushort v1, v2, off ; encoding: [0x00,0x40,0x48,0xdc,0x02,0x00,0x7f,0x01] 31// VI-ERR: error: instruction not supported on this GPU 32 33scratch_load_ushort v1, v2, off dlc 34// GFX10: encoding: [0x00,0x50,0x28,0xdc,0x02,0x00,0x7d,0x01] 35// GFX9-ERR: error: dlc modifier is not supported on this GPU 36// VI-ERR: error: instruction not supported on this GPU 37 38scratch_load_sshort v1, v2, off 39// GFX10: encoding: [0x00,0x40,0x2c,0xdc,0x02,0x00,0x7d,0x01] 40// GFX9: scratch_load_sshort v1, v2, off ; encoding: [0x00,0x40,0x4c,0xdc,0x02,0x00,0x7f,0x01] 41// VI-ERR: error: instruction not supported on this GPU 42 43scratch_load_sshort v1, v2, off dlc 44// GFX10: encoding: [0x00,0x50,0x2c,0xdc,0x02,0x00,0x7d,0x01] 45// GFX9-ERR: error: dlc modifier is not supported on this GPU 46// VI-ERR: error: instruction not supported on this GPU 47 48scratch_load_dword v1, v2, off 49// GFX10: encoding: [0x00,0x40,0x30,0xdc,0x02,0x00,0x7d,0x01] 50// GFX9: scratch_load_dword v1, v2, off ; encoding: [0x00,0x40,0x50,0xdc,0x02,0x00,0x7f,0x01] 51// VI-ERR: error: instruction not supported on this GPU 52 53scratch_load_dword v1, v2, off dlc 54// GFX10: encoding: [0x00,0x50,0x30,0xdc,0x02,0x00,0x7d,0x01] 55// GFX9-ERR: error: dlc modifier is not supported on this GPU 56// VI-ERR: error: instruction not supported on this GPU 57 58scratch_load_dwordx2 v[1:2], v3, off 59// GFX10: encoding: [0x00,0x40,0x34,0xdc,0x03,0x00,0x7d,0x01] 60// GFX9: scratch_load_dwordx2 v[1:2], v3, off ; encoding: [0x00,0x40,0x54,0xdc,0x03,0x00,0x7f,0x01] 61// VI-ERR: error: instruction not supported on this GPU 62 63scratch_load_dwordx2 v[1:2], v3, off dlc 64// GFX10: encoding: [0x00,0x50,0x34,0xdc,0x03,0x00,0x7d,0x01] 65// GFX9-ERR: error: dlc modifier is not supported on this GPU 66// VI-ERR: error: instruction not supported on this GPU 67 68scratch_load_dwordx3 v[1:3], v4, off 69// GFX10: encoding: [0x00,0x40,0x3c,0xdc,0x04,0x00,0x7d,0x01] 70// GFX9: scratch_load_dwordx3 v[1:3], v4, off ; encoding: [0x00,0x40,0x58,0xdc,0x04,0x00,0x7f,0x01] 71// VI-ERR: error: instruction not supported on this GPU 72 73scratch_load_dwordx3 v[1:3], v4, off dlc 74// GFX10: encoding: [0x00,0x50,0x3c,0xdc,0x04,0x00,0x7d,0x01] 75// GFX9-ERR: error: dlc modifier is not supported on this GPU 76// VI-ERR: error: instruction not supported on this GPU 77 78scratch_load_dwordx4 v[1:4], v5, off 79// GFX10: encoding: [0x00,0x40,0x38,0xdc,0x05,0x00,0x7d,0x01] 80// GFX9: scratch_load_dwordx4 v[1:4], v5, off ; encoding: [0x00,0x40,0x5c,0xdc,0x05,0x00,0x7f,0x01] 81// VI-ERR: error: instruction not supported on this GPU 82 83scratch_load_dwordx4 v[1:4], v5, off dlc 84// GFX10: encoding: [0x00,0x50,0x38,0xdc,0x05,0x00,0x7d,0x01] 85// GFX9-ERR: error: dlc modifier is not supported on this GPU 86// VI-ERR: error: instruction not supported on this GPU 87 88scratch_load_dword v1, v2, off offset:0 89// GFX10: encoding: [0x00,0x40,0x30,0xdc,0x02,0x00,0x7d,0x01] 90// GFX9: scratch_load_dword v1, v2, off ; encoding: [0x00,0x40,0x50,0xdc,0x02,0x00,0x7f,0x01] 91// VI-ERR: error: instruction not supported on this GPU 92 93scratch_load_dword v1, v2, off offset:4095 94// GFX10-ERR: :32: error: expected a 12-bit signed offset 95// GFX9: scratch_load_dword v1, v2, off offset:4095 ; encoding: [0xff,0x4f,0x50,0xdc,0x02,0x00,0x7f,0x01] 96// VI-ERR: :1: error: instruction not supported on this GPU 97 98scratch_load_dword v1, v2, off offset:-1 99// GFX10: encoding: [0xff,0x4f,0x30,0xdc,0x02,0x00,0x7d,0x01] 100// GFX9: scratch_load_dword v1, v2, off offset:-1 ; encoding: [0xff,0x5f,0x50,0xdc,0x02,0x00,0x7f,0x01] 101// VI-ERR: error: instruction not supported on this GPU 102 103scratch_load_dword v1, v2, off offset:-4096 104// GFX10-ERR: :32: error: expected a 12-bit signed offset 105// GFX9: scratch_load_dword v1, v2, off offset:-4096 ; encoding: [0x00,0x50,0x50,0xdc,0x02,0x00,0x7f,0x01] 106// VI-ERR: :1: error: instruction not supported on this GPU 107 108scratch_load_dword v1, v2, off offset:4096 109// GFX10-ERR: :32: error: expected a 12-bit signed offset 110// GFX9-ERR: :32: error: expected a 13-bit signed offset 111// VI-ERR: :1: error: instruction not supported on this GPU 112 113scratch_load_dword v1, v2, off offset:-4097 114// GFX10-ERR: :32: error: expected a 12-bit signed offset 115// GFX9-ERR: :32: error: expected a 13-bit signed offset 116// VI-ERR: :1: error: instruction not supported on this GPU 117 118scratch_load_dword v0, v1, off offset:-2049 glc slc 119// GFX10-ERR: :32: error: expected a 12-bit signed offset 120// GFX9: scratch_load_dword v0, v1, off offset:-2049 glc slc ; encoding: [0xff,0x57,0x53,0xdc,0x01,0x00,0x7f,0x00] 121// VI-ERR: :1: error: instruction not supported on this GPU 122 123scratch_load_dword v0, v1, off offset:-2048 glc slc 124// GFX10: scratch_load_dword v0, v1, off offset:-2048 glc slc ; encoding: [0x00,0x48,0x33,0xdc,0x01,0x00,0x7d,0x00] 125// GFX9: scratch_load_dword v0, v1, off offset:-2048 glc slc ; encoding: [0x00,0x58,0x53,0xdc,0x01,0x00,0x7f,0x00] 126// VI-ERR: :1: error: instruction not supported on this GPU 127 128scratch_load_dword v255, off, s1 offset:2047 129// GFX10: scratch_load_dword v255, off, s1 offset:2047 ; encoding: [0xff,0x47,0x30,0xdc,0x00,0x00,0x01,0xff] 130// GFX9: scratch_load_dword v255, off, s1 offset:2047 ; encoding: [0xff,0x47,0x50,0xdc,0x00,0x00,0x01,0xff] 131// VI-ERR: :1: error: instruction not supported on this GPU 132 133scratch_load_dword v255, off, s0 offset:2048 134// GFX10-ERR: :34: error: expected a 12-bit signed offset 135// GFX9: scratch_load_dword v255, off, s0 offset:2048 ; encoding: [0x00,0x48,0x50,0xdc,0x00,0x00,0x00,0xff] 136// VI-ERR: :1: error: instruction not supported on this GPU 137 138scratch_store_byte v1, v2, off 139// GFX10: encoding: [0x00,0x40,0x60,0xdc,0x01,0x02,0x7d,0x00] 140// GFX9: scratch_store_byte v1, v2, off ; encoding: [0x00,0x40,0x60,0xdc,0x01,0x02,0x7f,0x00] 141// VI-ERR: error: instruction not supported on this GPU 142 143scratch_store_byte v1, v2, off dlc 144// GFX10: encoding: [0x00,0x50,0x60,0xdc,0x01,0x02,0x7d,0x00] 145// GFX9-ERR: error: dlc modifier is not supported on this GPU 146// VI-ERR: error: instruction not supported on this GPU 147 148scratch_store_short v1, v2, off 149// GFX10: encoding: [0x00,0x40,0x68,0xdc,0x01,0x02,0x7d,0x00] 150// GFX9: scratch_store_short v1, v2, off ; encoding: [0x00,0x40,0x68,0xdc,0x01,0x02,0x7f,0x00] 151// VI-ERR: error: instruction not supported on this GPU 152 153scratch_store_short v1, v2, off dlc 154// GFX10: encoding: [0x00,0x50,0x68,0xdc,0x01,0x02,0x7d,0x00] 155// GFX9-ERR: error: dlc modifier is not supported on this GPU 156// VI-ERR: error: instruction not supported on this GPU 157 158scratch_store_dword v1, v2, off 159// GFX10: encoding: [0x00,0x40,0x70,0xdc,0x01,0x02,0x7d,0x00] 160// GFX9: scratch_store_dword v1, v2, off ; encoding: [0x00,0x40,0x70,0xdc,0x01,0x02,0x7f,0x00] 161// VI-ERR: error: instruction not supported on this GPU 162 163scratch_store_dword v1, v2, off dlc 164// GFX10: encoding: [0x00,0x50,0x70,0xdc,0x01,0x02,0x7d,0x00] 165// GFX9-ERR: error: dlc modifier is not supported on this GPU 166// VI-ERR: error: instruction not supported on this GPU 167 168scratch_store_dwordx2 v1, v[2:3], off 169// GFX10: encoding: [0x00,0x40,0x74,0xdc,0x01,0x02,0x7d,0x00] 170// GFX9: scratch_store_dwordx2 v1, v[2:3], off ; encoding: [0x00,0x40,0x74,0xdc,0x01,0x02,0x7f,0x00] 171// VI-ERR: error: instruction not supported on this GPU 172 173scratch_store_dwordx2 v1, v[2:3], off dlc 174// GFX10: encoding: [0x00,0x50,0x74,0xdc,0x01,0x02,0x7d,0x00] 175// GFX9-ERR: error: dlc modifier is not supported on this GPU 176// VI-ERR: error: instruction not supported on this GPU 177 178scratch_store_dwordx3 v1, v[2:4], off 179// GFX10: encoding: [0x00,0x40,0x7c,0xdc,0x01,0x02,0x7d,0x00] 180// GFX9: scratch_store_dwordx3 v1, v[2:4], off ; encoding: [0x00,0x40,0x78,0xdc,0x01,0x02,0x7f,0x00] 181// VI-ERR: error: instruction not supported on this GPU 182 183scratch_store_dwordx3 v1, v[2:4], off dlc 184// GFX10: encoding: [0x00,0x50,0x7c,0xdc,0x01,0x02,0x7d,0x00] 185// GFX9-ERR: error: dlc modifier is not supported on this GPU 186// VI-ERR: error: instruction not supported on this GPU 187 188scratch_store_dwordx4 v1, v[2:5], off 189// GFX10: encoding: [0x00,0x40,0x78,0xdc,0x01,0x02,0x7d,0x00] 190// GFX9: scratch_store_dwordx4 v1, v[2:5], off ; encoding: [0x00,0x40,0x7c,0xdc,0x01,0x02,0x7f,0x00] 191// VI-ERR: error: instruction not supported on this GPU 192 193scratch_store_dwordx4 v1, v[2:5], off dlc 194// GFX10: encoding: [0x00,0x50,0x78,0xdc,0x01,0x02,0x7d,0x00] 195// GFX9-ERR: error: dlc modifier is not supported on this GPU 196// VI-ERR: error: instruction not supported on this GPU 197 198scratch_store_dword v1, v2, off offset:12 199// GFX10: encoding: [0x0c,0x40,0x70,0xdc,0x01,0x02,0x7d,0x00] 200// GFX9: scratch_store_dword v1, v2, off offset:12 ; encoding: [0x0c,0x40,0x70,0xdc,0x01,0x02,0x7f,0x00] 201// VI-ERR: error: instruction not supported on this GPU 202 203scratch_load_dword v1, off, s1 204// GFX10: encoding: [0x00,0x40,0x30,0xdc,0x00,0x00,0x01,0x01] 205// GFX9: scratch_load_dword v1, off, s1 ; encoding: [0x00,0x40,0x50,0xdc,0x00,0x00,0x01,0x01] 206// VI-ERR: error: instruction not supported on this GPU 207 208scratch_load_dword v1, off, s1 offset:32 209// GFX10: encoding: [0x20,0x40,0x30,0xdc,0x00,0x00,0x01,0x01] 210// GFX9: scratch_load_dword v1, off, s1 offset:32 ; encoding: [0x20,0x40,0x50,0xdc,0x00,0x00,0x01,0x01] 211// VI-ERR: error: instruction not supported on this GPU 212 213scratch_store_dword off, v2, s1 214// GFX10: encoding: [0x00,0x40,0x70,0xdc,0x00,0x02,0x01,0x00] 215// GFX9: scratch_store_dword off, v2, s1 ; encoding: [0x00,0x40,0x70,0xdc,0x00,0x02,0x01,0x00] 216// VI-ERR: error: instruction not supported on this GPU 217 218scratch_store_dword off, v2, s1 offset:12 219// GFX10: encoding: [0x0c,0x40,0x70,0xdc,0x00,0x02,0x01,0x00] 220// GFX9: scratch_store_dword off, v2, s1 offset:12 ; encoding: [0x0c,0x40,0x70,0xdc,0x00,0x02,0x01,0x00] 221// VI-ERR: error: instruction not supported on this GPU 222 223// FIXME: Should error about multiple offsets 224scratch_load_dword v1, v2, s1 225// GFX10-ERR: error: invalid operand for instruction 226// GFX9-ERR: error: invalid operand for instruction 227// VI-ERR: error: instruction not supported on this GPU 228 229scratch_load_dword v1, v2, s1 offset:32 230// GFX10-ERR: error: invalid operand for instruction 231// GFX9-ERR: error: invalid operand for instruction 232// VI-ERR: error: instruction not supported on this GPU 233 234scratch_store_dword v1, v2, s1 235// GFX10-ERR: error: invalid operand for instruction 236// GFX9-ERR: error: invalid operand for instruction 237// VI-ERR: error: instruction not supported on this GPU 238 239scratch_store_dword v1, v2, s1 offset:32 240// GFX10-ERR: error: invalid operand for instruction 241// GFX9-ERR: error: invalid operand for instruction 242// VI-ERR: error: instruction not supported on this GPU 243 244scratch_load_dword v1, off, exec_hi 245// GFX10-ERR: error: invalid operand for instruction 246// GFX9-ERR: error: invalid operand for instruction 247// VI-ERR: error: instruction not supported on this GPU 248 249scratch_store_dword off, v2, exec_hi 250// GFX10-ERR: error: invalid operand for instruction 251// GFX9-ERR: error: invalid operand for instruction 252// VI-ERR: error: instruction not supported on this GPU 253 254scratch_load_dword v1, off, exec_lo 255// GFX10: encoding: [0x00,0x40,0x30,0xdc,0x00,0x00,0x7e,0x01] 256// GFX9: scratch_load_dword v1, off, exec_lo ; encoding: [0x00,0x40,0x50,0xdc,0x00,0x00,0x7e,0x01] 257// VI-ERR: error: instruction not supported on this GPU 258 259scratch_store_dword off, v2, exec_lo 260// GFX10: encoding: [0x00,0x40,0x70,0xdc,0x00,0x02,0x7e,0x00] 261// GFX9: scratch_store_dword off, v2, exec_lo ; encoding: [0x00,0x40,0x70,0xdc,0x00,0x02,0x7e,0x00] 262// VI-ERR: error: instruction not supported on this GPU 263 264scratch_load_dword v1, off, m0 265// GFX10: encoding: [0x00,0x40,0x30,0xdc,0x00,0x00,0x7c,0x01] 266// GFX9: scratch_load_dword v1, off, m0 ; encoding: [0x00,0x40,0x50,0xdc,0x00,0x00,0x7c,0x01] 267// VI-ERR: error: instruction not supported on this GPU 268 269scratch_store_dword off, v2, m0 270// GFX10: encoding: [0x00,0x40,0x70,0xdc,0x00,0x02,0x7c,0x00] 271// GFX9: scratch_store_dword off, v2, m0 ; encoding: [0x00,0x40,0x70,0xdc,0x00,0x02,0x7c,0x00] 272// VI-ERR: error: instruction not supported on this GPU 273 274scratch_load_ubyte_d16 v1, v2, off 275// GFX10: encoding: [0x00,0x40,0x80,0xdc,0x02,0x00,0x7d,0x01] 276// GFX9: scratch_load_ubyte_d16 v1, v2, off ; encoding: [0x00,0x40,0x80,0xdc,0x02,0x00,0x7f,0x01] 277// VI-ERR: error: instruction not supported on this GPU 278 279scratch_load_ubyte_d16_hi v1, v2, off 280// GFX10: encoding: [0x00,0x40,0x84,0xdc,0x02,0x00,0x7d,0x01] 281// GFX9: scratch_load_ubyte_d16_hi v1, v2, off ; encoding: [0x00,0x40,0x84,0xdc,0x02,0x00,0x7f,0x01] 282// VI-ERR: error: instruction not supported on this GPU 283 284scratch_load_sbyte_d16 v1, v2, off 285// GFX10: encoding: [0x00,0x40,0x88,0xdc,0x02,0x00,0x7d,0x01] 286// GFX9: scratch_load_sbyte_d16 v1, v2, off ; encoding: [0x00,0x40,0x88,0xdc,0x02,0x00,0x7f,0x01] 287// VI-ERR: error: instruction not supported on this GPU 288 289scratch_load_sbyte_d16_hi v1, v2, off 290// GFX10: encoding: [0x00,0x40,0x8c,0xdc,0x02,0x00,0x7d,0x01] 291// GFX9: scratch_load_sbyte_d16_hi v1, v2, off ; encoding: [0x00,0x40,0x8c,0xdc,0x02,0x00,0x7f,0x01] 292// VI-ERR: error: instruction not supported on this GPU 293 294scratch_load_short_d16 v1, v2, off 295// GFX10: encoding: [0x00,0x40,0x90,0xdc,0x02,0x00,0x7d,0x01] 296// GFX9: scratch_load_short_d16 v1, v2, off ; encoding: [0x00,0x40,0x90,0xdc,0x02,0x00,0x7f,0x01] 297// VI-ERR: error: instruction not supported on this GPU 298 299scratch_load_short_d16_hi v1, v2, off 300// GFX10: encoding: [0x00,0x40,0x94,0xdc,0x02,0x00,0x7d,0x01] 301// GFX9: scratch_load_short_d16_hi v1, v2, off ; encoding: [0x00,0x40,0x94,0xdc,0x02,0x00,0x7f,0x01] 302// VI-ERR: error: instruction not supported on this GPU 303 304scratch_store_byte_d16_hi off, v2, s1 305// GFX10: encoding: [0x00,0x40,0x64,0xdc,0x00,0x02,0x01,0x00] 306// GFX9: scratch_store_byte_d16_hi off, v2, s1 ; encoding: [0x00,0x40,0x64,0xdc,0x00,0x02,0x01,0x00] 307// VI-ERR: error: instruction not supported on this GPU 308 309scratch_store_short_d16_hi off, v2, s1 310// GFX10: encoding: [0x00,0x40,0x6c,0xdc,0x00,0x02,0x01,0x00] 311// GFX9: scratch_store_short_d16_hi off, v2, s1 ; encoding: [0x00,0x40,0x6c,0xdc,0x00,0x02,0x01,0x00] 312// VI-ERR: error: instruction not supported on this GPU 313