1// RUN: not llvm-mc -triple=amdgcn -mcpu=tahiti -show-encoding %s | FileCheck %s --check-prefix=GCN --check-prefix=SICI --check-prefix=SICIVI 2// RUN: not llvm-mc -triple=amdgcn -mcpu=bonaire -show-encoding %s | FileCheck %s --check-prefix=GCN --check-prefix=SICI --check-prefix=SICIVI 3// RUN: not llvm-mc -triple=amdgcn -mcpu=fiji -show-encoding %s | FileCheck %s --check-prefix=GCN --check-prefix=SICIVI --check-prefix=VI --check-prefix=GFX89 --check-prefix=GFX8_0 4// RUN: not llvm-mc -triple=amdgcn -mcpu=gfx810 -show-encoding %s | FileCheck %s --check-prefix=GCN --check-prefix=SICIVI --check-prefix=VI --check-prefix=GFX89 --check-prefix=GFX8_1 5// RUN: not llvm-mc -triple=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck %s --check-prefix=GCN --check-prefix=GFX9 --check-prefix=GFX89 6 7// RUN: not llvm-mc -triple=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck %s --check-prefix=NOSICI --implicit-check-not=error: 8// RUN: not llvm-mc -triple=amdgcn -mcpu=bonaire %s 2>&1 | FileCheck %s --check-prefix=NOSICI --implicit-check-not=error: 9// RUN: not llvm-mc -triple=amdgcn -mcpu=fiji %s 2>&1 | FileCheck %s --check-prefix=NOVI --check-prefix=NOGFX8_0 --implicit-check-not=error: 10// RUN: not llvm-mc -triple=amdgcn -mcpu=gfx810 %s 2>&1 | FileCheck %s --check-prefix=NOVI --check-prefix=NOGFX8_1 --implicit-check-not=error: 11// RUN: not llvm-mc -triple=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck %s --check-prefix=NOGFX9 --implicit-check-not=error: 12 13//===----------------------------------------------------------------------===// 14// Image Load/Store 15//===----------------------------------------------------------------------===// 16 17image_load v[4:6], v[237:240], s[28:35] dmask:0x7 unorm 18// GCN: image_load v[4:6], v[237:240], s[28:35] dmask:0x7 unorm ; encoding: [0x00,0x17,0x00,0xf0,0xed,0x04,0x07,0x00] 19 20image_load v4, v237, s[28:35] 21// GCN: image_load v4, v237, s[28:35] ; encoding: [0x00,0x00,0x00,0xf0,0xed,0x04,0x07,0x00] 22 23image_load v4, v[237:238], s[28:35] 24// GCN: image_load v4, v[237:238], s[28:35] ; encoding: [0x00,0x00,0x00,0xf0,0xed,0x04,0x07,0x00] 25 26image_load v4, v[237:239], s[28:35] 27// GCN: image_load v4, v[237:239], s[28:35] ; encoding: [0x00,0x00,0x00,0xf0,0xed,0x04,0x07,0x00] 28 29image_load v4, v[237:240], s[28:35] 30// GCN: image_load v4, v[237:240], s[28:35] ; encoding: [0x00,0x00,0x00,0xf0,0xed,0x04,0x07,0x00] 31 32image_load v[4:7], v[237:240], s[28:35] dmask:0x7 tfe 33// GCN: image_load v[4:7], v[237:240], s[28:35] dmask:0x7 tfe ; encoding: [0x00,0x07,0x01,0xf0,0xed,0x04,0x07,0x00] 34 35// Verify support of all possible modifiers. 36// FIXME: This test is incorrect because r128 assumes a 128-bit SRSRC. 37image_load v[5:6], v[1:4], s[8:15] dmask:0x1 unorm glc slc r128 tfe lwe da d16 38// NOSICI: :[[@LINE-1]]:{{[0-9]+}}: error: d16 modifier is not supported on this GPU 39// 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] 40// NOGFX9: :[[@LINE-3]]:{{[0-9]+}}: error: r128 modifier is not supported on this GPU 41 42image_load v5, v[1:4], s[8:15] d16 43// NOSICI: :[[@LINE-1]]:{{[0-9]+}}: error: d16 modifier is not supported on this GPU 44// GFX89: image_load v5, v[1:4], s[8:15] d16 ; encoding: [0x00,0x00,0x00,0xf0,0x01,0x05,0x02,0x80] 45 46image_load v5, v[1:4], s[8:15] r128 47// SICIVI: image_load v5, v[1:4], s[8:15] r128 ; encoding: [0x00,0x80,0x00,0xf0,0x01,0x05,0x02,0x00] 48// NOGFX9: :[[@LINE-2]]:{{[0-9]+}}: error: r128 modifier is not supported on this GPU 49 50image_store v[193:195], v[237:240], s[28:35] dmask:0x7 unorm 51// GCN: image_store v[193:195], v[237:240], s[28:35] dmask:0x7 unorm ; encoding: [0x00,0x17,0x20,0xf0,0xed,0xc1,0x07,0x00] 52 53image_store v193, v237, s[28:35] 54// GCN: image_store v193, v237, s[28:35] ; encoding: [0x00,0x00,0x20,0xf0,0xed,0xc1,0x07,0x00] 55 56image_store v193, v[237:238], s[28:35] 57// GCN: image_store v193, v[237:238], s[28:35] ; encoding: [0x00,0x00,0x20,0xf0,0xed,0xc1,0x07,0x00] 58 59image_store v193, v[237:239], s[28:35] 60// GCN: image_store v193, v[237:239], s[28:35] ; encoding: [0x00,0x00,0x20,0xf0,0xed,0xc1,0x07,0x00] 61 62image_store v193, v[237:240], s[28:35] 63// GCN: image_store v193, v[237:240], s[28:35] ; encoding: [0x00,0x00,0x20,0xf0,0xed,0xc1,0x07,0x00] 64 65image_store v[193:194], v[237:240], s[28:35] tfe 66// GCN: image_store v[193:194], v[237:240], s[28:35] tfe ; encoding: [0x00,0x00,0x21,0xf0,0xed,0xc1,0x07,0x00] 67 68// Verify support of all possible modifiers. 69// FIXME: This test is incorrect because r128 assumes a 128-bit SRSRC. 70image_store v5, v[1:4], s[8:15] dmask:0x1 unorm glc slc r128 lwe da d16 71// NOSICI: :[[@LINE-1]]:{{[0-9]+}}: error: d16 modifier is not supported on this GPU 72// 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] 73// NOGFX9: :[[@LINE-3]]:{{[0-9]+}}: error: r128 modifier is not supported on this GPU 74 75image_store v5, v[1:4], s[8:15] d16 76// NOSICI: :[[@LINE-1]]:{{[0-9]+}}: error: d16 modifier is not supported on this GPU 77// GFX89: image_store v5, v[1:4], s[8:15] d16 ; encoding: [0x00,0x00,0x20,0xf0,0x01,0x05,0x02,0x80] 78 79// FIXME: This test is incorrect because r128 assumes a 128-bit SRSRC. 80image_store v5, v[1:4], s[8:15] r128 81// SICIVI: image_store v5, v[1:4], s[8:15] r128 ; encoding: [0x00,0x80,0x20,0xf0,0x01,0x05,0x02,0x00] 82// NOGFX9: :[[@LINE-2]]:{{[0-9]+}}: error: r128 modifier is not supported on this GPU 83 84//===----------------------------------------------------------------------===// 85// Image Load/Store: d16 unpacked 86//===----------------------------------------------------------------------===// 87 88image_load v[5:6], v[1:4], s[8:15] dmask:0x3 d16 89// NOSICI: error: d16 modifier is not supported on this GPU 90// 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] 91// NOGFX8_1: :[[@LINE-3]]:{{[0-9]+}}: error: image data size does not match dmask, d16 and tfe 92// NOGFX9: error: image data size does not match dmask, d16 and tfe 93 94image_load v[5:7], v[1:4], s[8:15] dmask:0x7 d16 95// NOSICI: error: d16 modifier is not supported on this GPU 96// 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] 97// NOGFX8_1: :[[@LINE-3]]:{{[0-9]+}}: error: image data size does not match dmask, d16 and tfe 98// NOGFX9: error: image data size does not match dmask, d16 and tfe 99 100image_load v[5:8], v[1:4], s[8:15] dmask:0xf d16 101// NOSICI: error: d16 modifier is not supported on this GPU 102// 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] 103// NOGFX8_1: :[[@LINE-3]]:{{[0-9]+}}: error: image data size does not match dmask, d16 and tfe 104// NOGFX9: error: image data size does not match dmask, d16 and tfe 105 106image_load v[5:7], v[1:4], s[8:15] dmask:0x3 tfe d16 107// NOSICI: error: d16 modifier is not supported on this GPU 108// 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] 109// NOGFX8_1: :[[@LINE-3]]:{{[0-9]+}}: error: image data size does not match dmask, d16 and tfe 110// NOGFX9: error: image data size does not match dmask, d16 and tfe 111 112image_load v[5:8], v[1:4], s[8:15] dmask:0x7 tfe d16 113// NOSICI: error: d16 modifier is not supported on this GPU 114// 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] 115// NOGFX8_1: :[[@LINE-3]]:{{[0-9]+}}: error: image data size does not match dmask, d16 and tfe 116// NOGFX9: error: image data size does not match dmask, d16 and tfe 117 118//===----------------------------------------------------------------------===// 119// Image Load/Store: d16 packed 120//===----------------------------------------------------------------------===// 121 122image_load v5, v[1:4], s[8:15] dmask:0x3 d16 123// NOSICI: error: d16 modifier is not supported on this GPU 124// NOGFX8_0: :[[@LINE-2]]:{{[0-9]+}}: error: image data size does not match dmask and tfe 125// GFX8_1: image_load v5, v[1:4], s[8:15] dmask:0x3 d16 ; encoding: [0x00,0x03,0x00,0xf0,0x01,0x05,0x02,0x80] 126// GFX9: image_load v5, v[1:4], s[8:15] dmask:0x3 d16 ; encoding: [0x00,0x03,0x00,0xf0,0x01,0x05,0x02,0x80] 127 128image_load v[5:6], v[1:4], s[8:15] dmask:0x7 d16 129// NOSICI: error: d16 modifier is not supported on this GPU 130// NOGFX8_0: :[[@LINE-2]]:{{[0-9]+}}: error: image data size does not match dmask and tfe 131// 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] 132// GFX9: image_load v[5:6], v[1:4], s[8:15] dmask:0x7 d16 ; encoding: [0x00,0x07,0x00,0xf0,0x01,0x05,0x02,0x80] 133 134image_load v[5:6], v[1:4], s[8:15] dmask:0xf d16 135// NOSICI: error: d16 modifier is not supported on this GPU 136// NOGFX8_0: :[[@LINE-2]]:{{[0-9]+}}: error: image data size does not match dmask and tfe 137// 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] 138// GFX9: image_load v[5:6], v[1:4], s[8:15] dmask:0xf d16 ; encoding: [0x00,0x0f,0x00,0xf0,0x01,0x05,0x02,0x80] 139 140image_load v[5:6], v[1:4], s[8:15] dmask:0x3 tfe d16 141// NOSICI: error: d16 modifier is not supported on this GPU 142// NOGFX8_0: :[[@LINE-2]]:{{[0-9]+}}: error: image data size does not match dmask and tfe 143// 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] 144// 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] 145 146image_load v[5:7], v[1:4], s[8:15] dmask:0x7 tfe d16 147// NOSICI: error: d16 modifier is not supported on this GPU 148// NOGFX8_0: :[[@LINE-2]]:{{[0-9]+}}: error: image data size does not match dmask and tfe 149// 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] 150// 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] 151 152image_load v[5:7], v[1:4], s[8:15] dmask:0xf tfe d16 153// NOSICI: error: d16 modifier is not supported on this GPU 154// NOGFX8_0: :[[@LINE-2]]:{{[0-9]+}}: error: image data size does not match dmask and tfe 155// 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] 156// 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] 157 158//===----------------------------------------------------------------------===// 159// Image Load/Store: a16 160//===----------------------------------------------------------------------===// 161 162image_load v5, v[1:2], s[8:15] unorm a16 163// GFX9: image_load v5, v[1:2], s[8:15] unorm a16 ; encoding: [0x00,0x90,0x00,0xf0,0x01,0x05,0x02,0x00] 164// NOSICI: error: a16 modifier is not supported on this GPU 165// NOVI: error: a16 modifier is not supported on this GPU 166 167image_load v[5:6], v[1:2], s[8:15] dmask:0x3 unorm a16 168// 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] 169// NOSICI: error: a16 modifier is not supported on this GPU 170// NOVI: error: a16 modifier is not supported on this GPU 171 172image_load v[5:7], v[1:2], s[8:15] dmask:0x7 unorm a16 173// 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] 174// NOSICI: error: a16 modifier is not supported on this GPU 175// NOVI: error: a16 modifier is not supported on this GPU 176 177image_load v[5:8], v[1:2], s[8:15] dmask:0xf unorm a16 178// 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] 179// NOSICI: error: a16 modifier is not supported on this GPU 180// NOVI: error: a16 modifier is not supported on this GPU 181 182image_store v5, v[1:2], s[8:15] unorm a16 183// GFX9: image_store v5, v[1:2], s[8:15] unorm a16 ; encoding: [0x00,0x90,0x20,0xf0,0x01,0x05,0x02,0x00] 184// NOSICI: error: a16 modifier is not supported on this GPU 185// NOVI: error: a16 modifier is not supported on this GPU 186 187image_store v[5:6], v[1:2], s[8:15] dmask:0x3 unorm a16 188// 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] 189// NOSICI: error: a16 modifier is not supported on this GPU 190// NOVI: error: a16 modifier is not supported on this GPU 191 192image_store v[5:7], v[1:2], s[8:15] dmask:0x7 unorm a16 193// 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] 194// NOSICI: error: a16 modifier is not supported on this GPU 195// NOVI: error: a16 modifier is not supported on this GPU 196 197image_store v[5:8], v[1:2], s[8:15] dmask:0xf unorm a16 198// 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] 199// NOSICI: error: a16 modifier is not supported on this GPU 200// NOVI: error: a16 modifier is not supported on this GPU 201 202//===----------------------------------------------------------------------===// 203// Image Load/Store: a16 & d16 204//===----------------------------------------------------------------------===// 205 206image_load v5, v[1:2], s[8:15] dmask:0x3 unorm a16 d16 207// GFX9: image_load v5, v[1:2], s[8:15] dmask:0x3 unorm a16 d16 ; encoding: [0x00,0x93,0x00,0xf0,0x01,0x05,0x02,0x80] 208// NOSICI: error: a16 modifier is not supported on this GPU 209// NOVI: error: a16 modifier is not supported on this GPU 210 211image_load v[5:6], v[1:2], s[8:15] dmask:0x7 unorm a16 d16 212// 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] 213// NOSICI: error: a16 modifier is not supported on this GPU 214// NOVI: error: a16 modifier is not supported on this GPU 215 216image_load v[5:6], v[1:2], s[8:15] dmask:0xf unorm a16 d16 217// 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] 218// NOSICI: error: a16 modifier is not supported on this GPU 219// NOVI: error: a16 modifier is not supported on this GPU 220 221image_store v5, v[1:2], s[8:15] dmask:0x3 unorm a16 d16 222// GFX9: image_store v5, v[1:2], s[8:15] dmask:0x3 unorm a16 d16 ; encoding: [0x00,0x93,0x20,0xf0,0x01,0x05,0x02,0x80] 223// NOSICI: error: a16 modifier is not supported on this GPU 224// NOVI: error: a16 modifier is not supported on this GPU 225 226image_store v[5:6], v[1:2], s[8:15] dmask:0x7 unorm a16 d16 227// 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] 228// NOSICI: error: a16 modifier is not supported on this GPU 229// NOVI: error: a16 modifier is not supported on this GPU 230 231image_store v[5:6], v[1:2], s[8:15] dmask:0xf unorm a16 d16 232// 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] 233// NOSICI: error: a16 modifier is not supported on this GPU 234// NOVI: error: a16 modifier is not supported on this GPU 235 236//===----------------------------------------------------------------------===// 237// Image Load/Store: PCK variants 238//===----------------------------------------------------------------------===// 239 240image_load_mip_pck v5, v1, s[8:15] dmask:0x1 241// GCN: image_load_mip_pck v5, v1, s[8:15] dmask:0x1 ; encoding: [0x00,0x01,0x10,0xf0,0x01,0x05,0x02,0x00] 242 243image_load_mip_pck v5, v[1:2], s[8:15] dmask:0x1 244// GCN: image_load_mip_pck v5, v[1:2], s[8:15] dmask:0x1 ; encoding: [0x00,0x01,0x10,0xf0,0x01,0x05,0x02,0x00] 245 246image_load_mip_pck v5, v[1:3], s[8:15] dmask:0x1 247// GCN: image_load_mip_pck v5, v[1:3], s[8:15] dmask:0x1 ; encoding: [0x00,0x01,0x10,0xf0,0x01,0x05,0x02,0x00] 248 249image_load_mip_pck v5, v[1:4], s[8:15] dmask:0x1 250// GCN: image_load_mip_pck v5, v[1:4], s[8:15] dmask:0x1 ; encoding: [0x00,0x01,0x10,0xf0,0x01,0x05,0x02,0x00] 251 252image_load_mip_pck v[5:6], v[1:4], s[8:15] dmask:0x3 253// 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] 254 255image_load_mip_pck v[5:6], v[1:4], s[8:15] dmask:0x1 unorm glc slc tfe lwe da 256// 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] 257 258image_load_mip_pck_sgn v[5:6], v[1:4], s[8:15] dmask:0x5 259// 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] 260 261image_load_pck v5, v[1:4], s[8:15] dmask:0x1 glc 262// GCN: image_load_pck v5, v[1:4], s[8:15] dmask:0x1 glc ; encoding: [0x00,0x21,0x08,0xf0,0x01,0x05,0x02,0x00] 263 264image_load_pck_sgn v5, v[1:4], s[8:15] dmask:0x1 lwe 265// GCN: image_load_pck_sgn v5, v[1:4], s[8:15] dmask:0x1 lwe ; encoding: [0x00,0x01,0x0e,0xf0,0x01,0x05,0x02,0x00] 266 267image_load_mip_pck v5, v[1:4], s[8:15] dmask:0x1 d16 268// NOSICI: :[[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction 269// NOVI: error: invalid operand for instruction 270// NOGFX9: :[[@LINE-3]]:{{[0-9]+}}: error: invalid operand for instruction 271 272image_load_mip_pck v5, v[1:2], s[8:15] dmask:0x1 a16 273// GFX9: image_load_mip_pck v5, v[1:2], s[8:15] dmask:0x1 a16 ; encoding: [0x00,0x81,0x10,0xf0,0x01,0x05,0x02,0x00] 274// NOSICI: :[[@LINE-2]]:{{[0-9]+}}: error: a16 modifier is not supported on this GPU 275// NOVI: error: a16 modifier is not supported on this GPU 276 277image_store_mip_pck v252, v2, s[12:19] dmask:0x1 unorm 278// GCN: image_store_mip_pck v252, v2, s[12:19] dmask:0x1 unorm ; encoding: [0x00,0x11,0x2c,0xf0,0x02,0xfc,0x03,0x00] 279 280image_store_mip_pck v252, v[2:3], s[12:19] dmask:0x1 unorm 281// GCN: image_store_mip_pck v252, v[2:3], s[12:19] dmask:0x1 unorm ; encoding: [0x00,0x11,0x2c,0xf0,0x02,0xfc,0x03,0x00] 282 283image_store_mip_pck v252, v[2:4], s[12:19] dmask:0x1 unorm 284// GCN: image_store_mip_pck v252, v[2:4], s[12:19] dmask:0x1 unorm ; encoding: [0x00,0x11,0x2c,0xf0,0x02,0xfc,0x03,0x00] 285 286image_store_mip_pck v252, v[2:5], s[12:19] dmask:0x1 unorm 287// GCN: image_store_mip_pck v252, v[2:5], s[12:19] dmask:0x1 unorm ; encoding: [0x00,0x11,0x2c,0xf0,0x02,0xfc,0x03,0x00] 288 289image_store_mip_pck v1, v[2:5], s[12:19] dmask:0x1 unorm glc slc lwe da 290// 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] 291 292image_store_pck v1, v[2:5], s[12:19] dmask:0x1 unorm da 293// GCN: image_store_pck v1, v[2:5], s[12:19] dmask:0x1 unorm da ; encoding: [0x00,0x51,0x28,0xf0,0x02,0x01,0x03,0x00] 294 295image_store_mip_pck v252, v[2:5], s[12:19] dmask:0x1 d16 296// NOSICI: :[[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction 297// NOVI: error: invalid operand for instruction 298// NOGFX9: :[[@LINE-3]]:{{[0-9]+}}: error: invalid operand for instruction 299 300image_store_mip_pck v252, v[2:3], s[12:19] dmask:0x1 a16 301// GFX9: image_store_mip_pck v252, v[2:3], s[12:19] dmask:0x1 a16 ; encoding: [0x00,0x81,0x2c,0xf0,0x02,0xfc,0x03,0x00] 302// NOSICI: :[[@LINE-2]]:{{[0-9]+}}: error: a16 modifier is not supported on this GPU 303// NOVI: error: a16 modifier is not supported on this GPU 304 305//===----------------------------------------------------------------------===// 306// Image Sample 307//===----------------------------------------------------------------------===// 308 309image_sample v[193:195], v[237:240], s[28:35], s[4:7] dmask:0x7 unorm 310// 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] 311 312image_sample v193, v237, s[28:35], s[4:7] 313// GCN: image_sample v193, v237, s[28:35], s[4:7] ; encoding: [0x00,0x00,0x80,0xf0,0xed,0xc1,0x27,0x00] 314 315image_sample v193, v[237:238], s[28:35], s[4:7] 316// GCN: image_sample v193, v[237:238], s[28:35], s[4:7] ; encoding: [0x00,0x00,0x80,0xf0,0xed,0xc1,0x27,0x00] 317 318image_sample v193, v[237:239], s[28:35], s[4:7] 319// GCN: image_sample v193, v[237:239], s[28:35], s[4:7] ; encoding: [0x00,0x00,0x80,0xf0,0xed,0xc1,0x27,0x00] 320 321image_sample v193, v[237:240], s[28:35], s[4:7] 322// GCN: image_sample v193, v[237:240], s[28:35], s[4:7] ; encoding: [0x00,0x00,0x80,0xf0,0xed,0xc1,0x27,0x00] 323 324image_sample v[193:194], v[237:240], s[28:35], s[4:7] tfe 325// 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] 326 327// FIXME: This test is incorrect because r128 assumes a 128-bit SRSRC. 328image_sample v193, v[237:240], s[28:35], s[4:7] r128 329// SICIVI: image_sample v193, v[237:240], s[28:35], s[4:7] r128 ; encoding: [0x00,0x80,0x80,0xf0,0xed,0xc1,0x27,0x00] 330// NOGFX9: :[[@LINE-2]]:{{[0-9]+}}: error: r128 modifier is not supported on this GPU 331 332image_sample v193, v[237:240], s[28:35], s[4:7] d16 333// NOSICI: :[[@LINE-1]]:{{[0-9]+}}: error: d16 modifier is not supported on this GPU 334// GFX89: image_sample v193, v[237:240], s[28:35], s[4:7] d16 ; encoding: [0x00,0x00,0x80,0xf0,0xed,0xc1,0x27,0x80] 335 336//===----------------------------------------------------------------------===// 337// Image Sample: d16 packed 338//===----------------------------------------------------------------------===// 339 340image_sample v[193:195], v[237:240], s[28:35], s[4:7] dmask:0x7 d16 341// NOSICI: error: d16 modifier is not supported on this GPU 342// 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] 343// NOGFX8_1: :[[@LINE-3]]:{{[0-9]+}}: error: image data size does not match dmask, d16 and tfe 344// NOGFX9: error: image data size does not match dmask, d16 and tfe 345 346//===----------------------------------------------------------------------===// 347// Image Sample: d16 unpacked 348//===----------------------------------------------------------------------===// 349 350image_sample v[193:194], v[237:240], s[28:35], s[4:7] dmask:0x7 d16 351// NOSICI: error: d16 modifier is not supported on this GPU 352// NOGFX8_0: :[[@LINE-2]]:{{[0-9]+}}: error: image data size does not match dmask and tfe 353// 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] 354// 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] 355 356//===----------------------------------------------------------------------===// 357// Image Sample: a16 358//===----------------------------------------------------------------------===// 359 360image_sample v[193:196], v[237:240], s[28:35], s[4:7] dmask:0xf a16 361// 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] 362// NOSICI: error: a16 modifier is not supported on this GPU 363// NOVI: error: a16 modifier is not supported on this GPU 364 365image_sample_d v[193:196], v[237:240], s[28:35], s[4:7] dmask:0xf a16 366// 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] 367// NOSICI: error: a16 modifier is not supported on this GPU 368// NOVI: error: a16 modifier is not supported on this GPU 369 370image_sample_c_d v[193:196], v[237:240], s[28:35], s[4:7] dmask:0xf a16 371// 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] 372// NOSICI: error: a16 modifier is not supported on this GPU 373// NOVI: error: a16 modifier is not supported on this GPU 374 375image_sample_c_d_cl v[193:196], v[237:240], s[28:35], s[4:7] dmask:0xf a16 376// 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] 377// NOSICI: error: a16 modifier is not supported on this GPU 378// NOVI: error: a16 modifier is not supported on this GPU 379 380//===----------------------------------------------------------------------===// 381// Image Atomics 382//===----------------------------------------------------------------------===// 383 384image_atomic_add v4, v192, s[28:35] dmask:0x1 unorm glc 385// SICI: image_atomic_add v4, v192, s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x44,0xf0,0xc0,0x04,0x07,0x00] 386// GFX89: image_atomic_add v4, v192, s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x48,0xf0,0xc0,0x04,0x07,0x00] 387 388image_atomic_add v4, v[192:193], s[28:35] dmask:0x1 unorm glc 389// SICI: image_atomic_add v4, v[192:193], s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x44,0xf0,0xc0,0x04,0x07,0x00] 390// GFX89: image_atomic_add v4, v[192:193], s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x48,0xf0,0xc0,0x04,0x07,0x00] 391 392image_atomic_add v4, v[192:194], s[28:35] dmask:0x1 unorm glc 393// SICI: image_atomic_add v4, v[192:194], s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x44,0xf0,0xc0,0x04,0x07,0x00] 394// GFX89: image_atomic_add v4, v[192:194], s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x48,0xf0,0xc0,0x04,0x07,0x00] 395 396image_atomic_add v4, v[192:195], s[28:35] dmask:0x1 unorm glc 397// SICI: image_atomic_add v4, v[192:195], s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x44,0xf0,0xc0,0x04,0x07,0x00] 398// GFX89: image_atomic_add v4, v[192:195], s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x48,0xf0,0xc0,0x04,0x07,0x00] 399 400image_atomic_add v252, v2, s[8:15] dmask:0x1 unorm 401// SICI: image_atomic_add v252, v2, s[8:15] dmask:0x1 unorm ; encoding: [0x00,0x11,0x44,0xf0,0x02,0xfc,0x02,0x00] 402// GFX89: image_atomic_add v252, v2, s[8:15] dmask:0x1 unorm ; encoding: [0x00,0x11,0x48,0xf0,0x02,0xfc,0x02,0x00] 403 404image_atomic_add v[6:7], v255, s[8:15] dmask:0x3 405// SICI: image_atomic_add v[6:7], v255, s[8:15] dmask:0x3 ; encoding: [0x00,0x03,0x44,0xf0,0xff,0x06,0x02,0x00] 406// GFX89: image_atomic_add v[6:7], v255, s[8:15] dmask:0x3 ; encoding: [0x00,0x03,0x48,0xf0,0xff,0x06,0x02,0x00] 407 408image_atomic_add v7, v3, s[0:7] dmask:0x1 glc 409// SICI: image_atomic_add v7, v3, s[0:7] dmask:0x1 glc ; encoding: [0x00,0x21,0x44,0xf0,0x03,0x07,0x00,0x00] 410// GFX89: image_atomic_add v7, v3, s[0:7] dmask:0x1 glc ; encoding: [0x00,0x21,0x48,0xf0,0x03,0x07,0x00,0x00] 411 412image_atomic_add v8, v4, s[8:15] dmask:0x1 slc 413// SICI: image_atomic_add v8, v4, s[8:15] dmask:0x1 slc ; encoding: [0x00,0x01,0x44,0xf2,0x04,0x08,0x02,0x00] 414// GFX89: image_atomic_add v8, v4, s[8:15] dmask:0x1 slc ; encoding: [0x00,0x01,0x48,0xf2,0x04,0x08,0x02,0x00] 415 416image_atomic_add v9, v5, s[8:15] dmask:0x1 unorm glc slc lwe da 417// 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] 418// 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] 419 420image_atomic_add v10, v6, s[8:15] dmask:0x1 lwe 421// SICI: image_atomic_add v10, v6, s[8:15] dmask:0x1 lwe ; encoding: [0x00,0x01,0x46,0xf0,0x06,0x0a,0x02,0x00] 422// GFX89: image_atomic_add v10, v6, s[8:15] dmask:0x1 lwe ; encoding: [0x00,0x01,0x4a,0xf0,0x06,0x0a,0x02,0x00] 423 424image_atomic_add v11, v7, s[8:15] dmask:0x1 da 425// SICI: image_atomic_add v11, v7, s[8:15] dmask:0x1 da ; encoding: [0x00,0x41,0x44,0xf0,0x07,0x0b,0x02,0x00] 426// GFX89: image_atomic_add v11, v7, s[8:15] dmask:0x1 da ; encoding: [0x00,0x41,0x48,0xf0,0x07,0x0b,0x02,0x00] 427 428image_atomic_swap v4, v[192:195], s[28:35] dmask:0x1 unorm glc 429// SICI: image_atomic_swap v4, v[192:195], s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x3c,0xf0,0xc0,0x04,0x07,0x00] 430// GFX89: image_atomic_swap v4, v[192:195], s[28:35] dmask:0x1 unorm glc ; encoding: [0x00,0x31,0x40,0xf0,0xc0,0x04,0x07,0x00] 431 432image_atomic_cmpswap v[4:5], v[192:195], s[28:35] dmask:0x3 unorm glc 433// 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] 434// 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] 435 436image_atomic_cmpswap v[4:7], v[192:195], s[28:35] dmask:0xf unorm glc 437// 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] 438// 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] 439 440; Test dmask + tfe for image_atomic instructions 441image_atomic_add v4, v10, s[8:15] dmask:0x1 442// SICI: image_atomic_add v4, v10, s[8:15] dmask:0x1 ; encoding: [0x00,0x01,0x44,0xf0,0x0a,0x04,0x02,0x00] 443// GFX89: image_atomic_add v4, v10, s[8:15] dmask:0x1 ; encoding: [0x00,0x01,0x48,0xf0,0x0a,0x04,0x02,0x00] 444 445image_atomic_add v[4:5], v10, s[8:15] dmask:0x1 tfe 446// SICI: image_atomic_add v[4:5], v10, s[8:15] dmask:0x1 tfe ; encoding: [0x00,0x01,0x45,0xf0,0x0a,0x04,0x02,0x00] 447// GFX89: image_atomic_add v[4:5], v10, s[8:15] dmask:0x1 tfe ; encoding: [0x00,0x01,0x49,0xf0,0x0a,0x04,0x02,0x00] 448 449image_atomic_add v[4:5], v10, s[8:15] dmask:0x3 450// SICI: image_atomic_add v[4:5], v10, s[8:15] dmask:0x3 ; encoding: [0x00,0x03,0x44,0xf0,0x0a,0x04,0x02,0x00] 451// GFX89: image_atomic_add v[4:5], v10, s[8:15] dmask:0x3 ; encoding: [0x00,0x03,0x48,0xf0,0x0a,0x04,0x02,0x00] 452 453image_atomic_add v[4:6], v10, s[8:15] dmask:0x3 tfe 454// SICI: image_atomic_add v[4:6], v10, s[8:15] dmask:0x3 tfe ; encoding: [0x00,0x03,0x45,0xf0,0x0a,0x04,0x02,0x00] 455// GFX89: image_atomic_add v[4:6], v10, s[8:15] dmask:0x3 tfe ; encoding: [0x00,0x03,0x49,0xf0,0x0a,0x04,0x02,0x00] 456 457image_atomic_swap v4, v[192:195], s[28:35] dmask:0x1 458// SICI: image_atomic_swap v4, v[192:195], s[28:35] dmask:0x1 ; encoding: [0x00,0x01,0x3c,0xf0,0xc0,0x04,0x07,0x00] 459// GFX89: image_atomic_swap v4, v[192:195], s[28:35] dmask:0x1 ; encoding: [0x00,0x01,0x40,0xf0,0xc0,0x04,0x07,0x00] 460 461image_atomic_swap v[4:5], v[192:195], s[28:35] dmask:0x1 tfe 462// SICI: image_atomic_swap v[4:5], v[192:195], s[28:35] dmask:0x1 tfe ; encoding: [0x00,0x01,0x3d,0xf0,0xc0,0x04,0x07,0x00] 463// GFX89: image_atomic_swap v[4:5], v[192:195], s[28:35] dmask:0x1 tfe ; encoding: [0x00,0x01,0x41,0xf0,0xc0,0x04,0x07,0x00] 464 465image_atomic_swap v[4:5], v[192:195], s[28:35] dmask:0x3 466// SICI: image_atomic_swap v[4:5], v[192:195], s[28:35] dmask:0x3 ; encoding: [0x00,0x03,0x3c,0xf0,0xc0,0x04,0x07,0x00] 467// GFX89: image_atomic_swap v[4:5], v[192:195], s[28:35] dmask:0x3 ; encoding: [0x00,0x03,0x40,0xf0,0xc0,0x04,0x07,0x00] 468 469image_atomic_swap v[4:6], v[192:195], s[28:35] dmask:0x3 tfe 470// SICI: image_atomic_swap v[4:6], v[192:195], s[28:35] dmask:0x3 tfe ; encoding: [0x00,0x03,0x3d,0xf0,0xc0,0x04,0x07,0x00] 471// GFX89: image_atomic_swap v[4:6], v[192:195], s[28:35] dmask:0x3 tfe ; encoding: [0x00,0x03,0x41,0xf0,0xc0,0x04,0x07,0x00] 472 473image_atomic_sub v[4:5], v10, s[8:15] dmask:0x1 tfe 474// SICI: image_atomic_sub v[4:5], v10, s[8:15] dmask:0x1 tfe ; encoding: [0x00,0x01,0x49,0xf0,0x0a,0x04,0x02,0x00] 475// GFX89: image_atomic_sub v[4:5], v10, s[8:15] dmask:0x1 tfe ; encoding: [0x00,0x01,0x4d,0xf0,0x0a,0x04,0x02,0x00] 476 477image_atomic_sub v[4:6], v10, s[8:15] dmask:0x3 tfe 478// SICI: image_atomic_sub v[4:6], v10, s[8:15] dmask:0x3 tfe ; encoding: [0x00,0x03,0x49,0xf0,0x0a,0x04,0x02,0x00] 479// GFX89: image_atomic_sub v[4:6], v10, s[8:15] dmask:0x3 tfe ; encoding: [0x00,0x03,0x4d,0xf0,0x0a,0x04,0x02,0x00] 480 481image_atomic_smin v[4:5], v10, s[8:15] dmask:0x1 tfe 482// SICI: image_atomic_smin v[4:5], v10, s[8:15] dmask:0x1 tfe ; encoding: [0x00,0x01,0x51,0xf0,0x0a,0x04,0x02,0x00] 483// GFX89: image_atomic_smin v[4:5], v10, s[8:15] dmask:0x1 tfe ; encoding: [0x00,0x01,0x51,0xf0,0x0a,0x04,0x02,0x00] 484 485image_atomic_smin v[4:6], v10, s[8:15] dmask:0x3 tfe 486// SICI: image_atomic_smin v[4:6], v10, s[8:15] dmask:0x3 tfe ; encoding: [0x00,0x03,0x51,0xf0,0x0a,0x04,0x02,0x00] 487// GFX89: image_atomic_smin v[4:6], v10, s[8:15] dmask:0x3 tfe ; encoding: [0x00,0x03,0x51,0xf0,0x0a,0x04,0x02,0x00] 488 489image_atomic_umin v[4:5], v10, s[8:15] dmask:0x1 tfe 490// SICI: image_atomic_umin v[4:5], v10, s[8:15] dmask:0x1 tfe ; encoding: [0x00,0x01,0x55,0xf0,0x0a,0x04,0x02,0x00] 491// GFX89: image_atomic_umin v[4:5], v10, s[8:15] dmask:0x1 tfe ; encoding: [0x00,0x01,0x55,0xf0,0x0a,0x04,0x02,0x00] 492 493image_atomic_umin v[4:6], v10, s[8:15] dmask:0x3 tfe 494// SICI: image_atomic_umin v[4:6], v10, s[8:15] dmask:0x3 tfe ; encoding: [0x00,0x03,0x55,0xf0,0x0a,0x04,0x02,0x00] 495// GFX89: image_atomic_umin v[4:6], v10, s[8:15] dmask:0x3 tfe ; encoding: [0x00,0x03,0x55,0xf0,0x0a,0x04,0x02,0x00] 496 497image_atomic_smax v[4:5], v10, s[8:15] dmask:0x1 tfe 498// SICI: image_atomic_smax v[4:5], v10, s[8:15] dmask:0x1 tfe ; encoding: [0x00,0x01,0x59,0xf0,0x0a,0x04,0x02,0x00] 499// GFX89: image_atomic_smax v[4:5], v10, s[8:15] dmask:0x1 tfe ; encoding: [0x00,0x01,0x59,0xf0,0x0a,0x04,0x02,0x00] 500 501image_atomic_smax v[4:6], v10, s[8:15] dmask:0x3 tfe 502// SICI: image_atomic_smax v[4:6], v10, s[8:15] dmask:0x3 tfe ; encoding: [0x00,0x03,0x59,0xf0,0x0a,0x04,0x02,0x00] 503// GFX89: image_atomic_smax v[4:6], v10, s[8:15] dmask:0x3 tfe ; encoding: [0x00,0x03,0x59,0xf0,0x0a,0x04,0x02,0x00] 504 505image_atomic_umax v[4:5], v10, s[8:15] dmask:0x1 tfe 506// SICI: image_atomic_umax v[4:5], v10, s[8:15] dmask:0x1 tfe ; encoding: [0x00,0x01,0x5d,0xf0,0x0a,0x04,0x02,0x00] 507// GFX89: image_atomic_umax v[4:5], v10, s[8:15] dmask:0x1 tfe ; encoding: [0x00,0x01,0x5d,0xf0,0x0a,0x04,0x02,0x00] 508 509image_atomic_umax v[4:6], v10, s[8:15] dmask:0x3 tfe 510// SICI: image_atomic_umax v[4:6], v10, s[8:15] dmask:0x3 tfe ; encoding: [0x00,0x03,0x5d,0xf0,0x0a,0x04,0x02,0x00] 511// GFX89: image_atomic_umax v[4:6], v10, s[8:15] dmask:0x3 tfe ; encoding: [0x00,0x03,0x5d,0xf0,0x0a,0x04,0x02,0x00] 512 513image_atomic_and v[4:5], v10, s[8:15] dmask:0x1 tfe 514// SICI: image_atomic_and v[4:5], v10, s[8:15] dmask:0x1 tfe ; encoding: [0x00,0x01,0x61,0xf0,0x0a,0x04,0x02,0x00] 515// GFX89: image_atomic_and v[4:5], v10, s[8:15] dmask:0x1 tfe ; encoding: [0x00,0x01,0x61,0xf0,0x0a,0x04,0x02,0x00] 516 517image_atomic_and v[4:6], v10, s[8:15] dmask:0x3 tfe 518// SICI: image_atomic_and v[4:6], v10, s[8:15] dmask:0x3 tfe ; encoding: [0x00,0x03,0x61,0xf0,0x0a,0x04,0x02,0x00] 519// GFX89: image_atomic_and v[4:6], v10, s[8:15] dmask:0x3 tfe ; encoding: [0x00,0x03,0x61,0xf0,0x0a,0x04,0x02,0x00] 520 521image_atomic_or v[4:5], v10, s[8:15] dmask:0x1 tfe 522// SICI: image_atomic_or v[4:5], v10, s[8:15] dmask:0x1 tfe ; encoding: [0x00,0x01,0x65,0xf0,0x0a,0x04,0x02,0x00] 523// GFX89: image_atomic_or v[4:5], v10, s[8:15] dmask:0x1 tfe ; encoding: [0x00,0x01,0x65,0xf0,0x0a,0x04,0x02,0x00] 524 525image_atomic_or v[4:6], v10, s[8:15] dmask:0x3 tfe 526// SICI: image_atomic_or v[4:6], v10, s[8:15] dmask:0x3 tfe ; encoding: [0x00,0x03,0x65,0xf0,0x0a,0x04,0x02,0x00] 527// GFX89: image_atomic_or v[4:6], v10, s[8:15] dmask:0x3 tfe ; encoding: [0x00,0x03,0x65,0xf0,0x0a,0x04,0x02,0x00] 528 529image_atomic_xor v[4:5], v10, s[8:15] dmask:0x1 tfe 530// SICI: image_atomic_xor v[4:5], v10, s[8:15] dmask:0x1 tfe ; encoding: [0x00,0x01,0x69,0xf0,0x0a,0x04,0x02,0x00] 531// GFX89: image_atomic_xor v[4:5], v10, s[8:15] dmask:0x1 tfe ; encoding: [0x00,0x01,0x69,0xf0,0x0a,0x04,0x02,0x00] 532 533image_atomic_xor v[4:6], v10, s[8:15] dmask:0x3 tfe 534// SICI: image_atomic_xor v[4:6], v10, s[8:15] dmask:0x3 tfe ; encoding: [0x00,0x03,0x69,0xf0,0x0a,0x04,0x02,0x00] 535// GFX89: image_atomic_xor v[4:6], v10, s[8:15] dmask:0x3 tfe ; encoding: [0x00,0x03,0x69,0xf0,0x0a,0x04,0x02,0x00] 536 537image_atomic_inc v[4:5], v10, s[8:15] dmask:0x1 tfe 538// SICI: image_atomic_inc v[4:5], v10, s[8:15] dmask:0x1 tfe ; encoding: [0x00,0x01,0x6d,0xf0,0x0a,0x04,0x02,0x00] 539// GFX89: image_atomic_inc v[4:5], v10, s[8:15] dmask:0x1 tfe ; encoding: [0x00,0x01,0x6d,0xf0,0x0a,0x04,0x02,0x00] 540 541image_atomic_inc v[4:6], v10, s[8:15] dmask:0x3 tfe 542// SICI: image_atomic_inc v[4:6], v10, s[8:15] dmask:0x3 tfe ; encoding: [0x00,0x03,0x6d,0xf0,0x0a,0x04,0x02,0x00] 543// GFX89: image_atomic_inc v[4:6], v10, s[8:15] dmask:0x3 tfe ; encoding: [0x00,0x03,0x6d,0xf0,0x0a,0x04,0x02,0x00] 544 545image_atomic_dec v[4:5], v10, s[8:15] dmask:0x1 tfe 546// SICI: image_atomic_dec v[4:5], v10, s[8:15] dmask:0x1 tfe ; encoding: [0x00,0x01,0x71,0xf0,0x0a,0x04,0x02,0x00] 547// GFX89: image_atomic_dec v[4:5], v10, s[8:15] dmask:0x1 tfe ; encoding: [0x00,0x01,0x71,0xf0,0x0a,0x04,0x02,0x00] 548 549image_atomic_dec v[4:6], v10, s[8:15] dmask:0x3 tfe 550// SICI: image_atomic_dec v[4:6], v10, s[8:15] dmask:0x3 tfe ; encoding: [0x00,0x03,0x71,0xf0,0x0a,0x04,0x02,0x00] 551// GFX89: image_atomic_dec v[4:6], v10, s[8:15] dmask:0x3 tfe ; encoding: [0x00,0x03,0x71,0xf0,0x0a,0x04,0x02,0x00] 552 553image_atomic_cmpswap v[4:5], v[192:195], s[28:35] dmask:0x3 554// SICI: image_atomic_cmpswap v[4:5], v[192:195], s[28:35] dmask:0x3 ; encoding: [0x00,0x03,0x40,0xf0,0xc0,0x04,0x07,0x00] 555// GFX89: image_atomic_cmpswap v[4:5], v[192:195], s[28:35] dmask:0x3 ; encoding: [0x00,0x03,0x44,0xf0,0xc0,0x04,0x07,0x00] 556 557image_atomic_cmpswap v[4:6], v[192:195], s[28:35] dmask:0x3 tfe 558// SICI: image_atomic_cmpswap v[4:6], v[192:195], s[28:35] dmask:0x3 tfe ; encoding: [0x00,0x03,0x41,0xf0,0xc0,0x04,0x07,0x00] 559// GFX89: image_atomic_cmpswap v[4:6], v[192:195], s[28:35] dmask:0x3 tfe ; encoding: [0x00,0x03,0x45,0xf0,0xc0,0x04,0x07,0x00] 560 561image_atomic_cmpswap v[4:7], v[192:195], s[28:35] dmask:0xf 562// SICI: image_atomic_cmpswap v[4:7], v[192:195], s[28:35] dmask:0xf ; encoding: [0x00,0x0f,0x40,0xf0,0xc0,0x04,0x07,0x00] 563// GFX89: image_atomic_cmpswap v[4:7], v[192:195], s[28:35] dmask:0xf ; encoding: [0x00,0x0f,0x44,0xf0,0xc0,0x04,0x07,0x00] 564 565image_atomic_cmpswap v[4:8], v[192:195], s[28:35] dmask:0xf tfe 566// SICI: image_atomic_cmpswap v[4:8], v[192:195], s[28:35] dmask:0xf tfe ; encoding: [0x00,0x0f,0x41,0xf0,0xc0,0x04,0x07,0x00] 567// GFX89: image_atomic_cmpswap v[4:8], v[192:195], s[28:35] dmask:0xf tfe ; encoding: [0x00,0x0f,0x45,0xf0,0xc0,0x04,0x07,0x00] 568 569// FIXME: This test is incorrect because r128 assumes a 128-bit SRSRC. 570image_atomic_add v10, v6, s[8:15] dmask:0x1 r128 571// SICI: image_atomic_add v10, v6, s[8:15] dmask:0x1 r128 ; encoding: [0x00,0x81,0x44,0xf0,0x06,0x0a,0x02,0x00] 572// VI: image_atomic_add v10, v6, s[8:15] dmask:0x1 r128 ; encoding: [0x00,0x81,0x48,0xf0,0x06,0x0a,0x02,0x00] 573// NOGFX9: :[[@LINE-3]]:{{[0-9]+}}: error: r128 modifier is not supported on this GPU 574 575//===----------------------------------------------------------------------===// 576// Image Gather4 577//===----------------------------------------------------------------------===// 578 579image_gather4 v[5:8], v1, s[8:15], s[12:15] dmask:0x1 580// GCN: image_gather4 v[5:8], v1, s[8:15], s[12:15] dmask:0x1 ; encoding: [0x00,0x01,0x00,0xf1,0x01,0x05,0x62,0x00] 581 582image_gather4 v[5:8], v[1:2], s[8:15], s[12:15] dmask:0x1 583// 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] 584 585image_gather4 v[5:8], v[1:3], s[8:15], s[12:15] dmask:0x1 586// 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] 587 588image_gather4 v[5:8], v[1:4], s[8:15], s[12:15] dmask:0x2 589// 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] 590 591image_gather4 v[5:8], v[1:4], s[8:15], s[12:15] dmask:0x4 592// 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] 593 594image_gather4 v[5:8], v[1:4], s[8:15], s[12:15] dmask:0x8 595// 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] 596 597image_gather4 v[5:8], v1, s[8:15], s[12:15] dmask:0x1 d16 598// NOSICI: error: d16 modifier is not supported on this GPU 599// 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] 600// NOGFX8_1: :[[@LINE-3]]:{{[0-9]+}}: error: image data size does not match dmask, d16 and tfe 601// NOGFX9: error: image data size does not match dmask, d16 and tfe 602 603image_gather4 v[5:6], v1, s[8:15], s[12:15] dmask:0x1 d16 604// NOSICI: error: d16 modifier is not supported on this GPU 605// NOGFX8_0: :[[@LINE-2]]:{{[0-9]+}}: error: image data size does not match dmask and tfe 606// 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] 607// 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] 608 609image_gather4 v[5:6], v1, s[8:15], s[12:15] dmask:0x1 610// NOSICI: error: image data size does not match dmask and tfe 611// NOGFX8_0: :[[@LINE-2]]:{{[0-9]+}}: error: image data size does not match dmask and tfe 612// NOGFX8_1: :[[@LINE-3]]:{{[0-9]+}}: error: image data size does not match dmask, d16 and tfe 613// NOGFX9: error: image data size does not match dmask, d16 and tfe 614 615image_gather4 v[5:8], v1, s[8:15], s[12:15] dmask:0x1 a16 616// 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] 617// NOSICI: error: a16 modifier is not supported on this GPU 618// NOVI: error: a16 modifier is not supported on this GPU 619 620image_gather4_b_cl v[5:8], v[1:4], s[8:15], s[12:15] dmask:0x1 a16 621// 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] 622// NOSICI: error: a16 modifier is not supported on this GPU 623// NOVI: error: a16 modifier is not supported on this GPU 624