1 //===-- AMDGPUAsmUtils.cpp - AsmParser/InstPrinter common -----------------===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 #include "AMDGPUAsmUtils.h" 9 #include "AMDGPUBaseInfo.h" 10 #include "SIDefines.h" 11 12 namespace llvm { 13 namespace AMDGPU { 14 15 namespace DepCtr { 16 17 // NOLINTBEGIN 18 const CustomOperandVal DepCtrInfo[] = { 19 // Name max dflt offset width constraint 20 {{"depctr_hold_cnt"}, 1, 1, 7, 1, isGFX10_BEncoding}, 21 {{"depctr_sa_sdst"}, 1, 1, 0, 1}, 22 {{"depctr_va_vdst"}, 15, 15, 12, 4}, 23 {{"depctr_va_sdst"}, 7, 7, 9, 3}, 24 {{"depctr_va_ssrc"}, 1, 1, 8, 1}, 25 {{"depctr_va_vcc"}, 1, 1, 1, 1}, 26 {{"depctr_vm_vsrc"}, 7, 7, 2, 3}, 27 }; 28 // NOLINTEND 29 30 const int DEP_CTR_SIZE = 31 static_cast<int>(sizeof(DepCtrInfo) / sizeof(CustomOperandVal)); 32 33 } // namespace DepCtr 34 35 namespace SendMsg { 36 37 // Disable lint checking for this block since it makes the table unreadable. 38 // NOLINTBEGIN 39 const CustomOperand<const MCSubtargetInfo &> Msg[] = { 40 {{""}}, 41 {{"MSG_INTERRUPT"}, ID_INTERRUPT}, 42 {{"MSG_GS"}, ID_GS_PreGFX11, isNotGFX11Plus}, 43 {{"MSG_GS_DONE"}, ID_GS_DONE_PreGFX11, isNotGFX11Plus}, 44 {{"MSG_SAVEWAVE"}, ID_SAVEWAVE, isGFX8_GFX9_GFX10}, 45 {{"MSG_STALL_WAVE_GEN"}, ID_STALL_WAVE_GEN, isGFX9Plus}, 46 {{"MSG_HALT_WAVES"}, ID_HALT_WAVES, isGFX9Plus}, 47 {{"MSG_ORDERED_PS_DONE"}, ID_ORDERED_PS_DONE, isGFX9Plus}, 48 {{"MSG_EARLY_PRIM_DEALLOC"}, ID_EARLY_PRIM_DEALLOC, isGFX9_GFX10}, 49 {{"MSG_GS_ALLOC_REQ"}, ID_GS_ALLOC_REQ, isGFX9Plus}, 50 {{"MSG_GET_DOORBELL"}, ID_GET_DOORBELL, isGFX9_GFX10}, 51 {{"MSG_GET_DDID"}, ID_GET_DDID, isGFX10}, 52 {{"MSG_HS_TESSFACTOR"}, ID_HS_TESSFACTOR_GFX11Plus, isGFX11Plus}, 53 {{"MSG_DEALLOC_VGPRS"}, ID_DEALLOC_VGPRS_GFX11Plus, isGFX11Plus}, 54 {{""}}, 55 {{"MSG_SYSMSG"}, ID_SYSMSG}, 56 {{"MSG_RTN_GET_DOORBELL"}, ID_RTN_GET_DOORBELL, isGFX11Plus}, 57 {{"MSG_RTN_GET_DDID"}, ID_RTN_GET_DDID, isGFX11Plus}, 58 {{"MSG_RTN_GET_TMA"}, ID_RTN_GET_TMA, isGFX11Plus}, 59 {{"MSG_RTN_GET_REALTIME"}, ID_RTN_GET_REALTIME, isGFX11Plus}, 60 {{"MSG_RTN_SAVE_WAVE"}, ID_RTN_SAVE_WAVE, isGFX11Plus}, 61 {{"MSG_RTN_GET_TBA"}, ID_RTN_GET_TBA, isGFX11Plus}, 62 }; 63 // NOLINTEND 64 65 const int MSG_SIZE = static_cast<int>( 66 sizeof(Msg) / sizeof(CustomOperand<const MCSubtargetInfo &>)); 67 68 // These two must be in sync with llvm::AMDGPU::SendMsg::Op enum members, see SIDefines.h. 69 const char *const OpSysSymbolic[OP_SYS_LAST_] = { 70 nullptr, 71 "SYSMSG_OP_ECC_ERR_INTERRUPT", 72 "SYSMSG_OP_REG_RD", 73 "SYSMSG_OP_HOST_TRAP_ACK", 74 "SYSMSG_OP_TTRACE_PC" 75 }; 76 77 const char *const OpGsSymbolic[OP_GS_LAST_] = { 78 "GS_OP_NOP", 79 "GS_OP_CUT", 80 "GS_OP_EMIT", 81 "GS_OP_EMIT_CUT" 82 }; 83 84 } // namespace SendMsg 85 86 namespace Hwreg { 87 88 // Disable lint checking for this block since it makes the table unreadable. 89 // NOLINTBEGIN 90 const CustomOperand<const MCSubtargetInfo &> Opr[] = { 91 {{""}}, 92 {{"HW_REG_MODE"}, ID_MODE}, 93 {{"HW_REG_STATUS"}, ID_STATUS}, 94 {{"HW_REG_TRAPSTS"}, ID_TRAPSTS}, 95 {{"HW_REG_HW_ID"}, ID_HW_ID, isNotGFX10Plus}, 96 {{"HW_REG_GPR_ALLOC"}, ID_GPR_ALLOC}, 97 {{"HW_REG_LDS_ALLOC"}, ID_LDS_ALLOC}, 98 {{"HW_REG_IB_STS"}, ID_IB_STS}, 99 {{""}}, 100 {{""}}, 101 {{""}}, 102 {{""}}, 103 {{""}}, 104 {{""}}, 105 {{""}}, 106 {{"HW_REG_SH_MEM_BASES"}, ID_MEM_BASES, isGFX9Plus}, 107 {{"HW_REG_TBA_LO"}, ID_TBA_LO, isGFX9_GFX10}, 108 {{"HW_REG_TBA_HI"}, ID_TBA_HI, isGFX9_GFX10}, 109 {{"HW_REG_TMA_LO"}, ID_TMA_LO, isGFX9_GFX10}, 110 {{"HW_REG_TMA_HI"}, ID_TMA_HI, isGFX9_GFX10}, 111 {{"HW_REG_FLAT_SCR_LO"}, ID_FLAT_SCR_LO, isGFX10Plus}, 112 {{"HW_REG_FLAT_SCR_HI"}, ID_FLAT_SCR_HI, isGFX10Plus}, 113 {{"HW_REG_XNACK_MASK"}, ID_XNACK_MASK, isGFX10Before1030}, 114 {{"HW_REG_HW_ID1"}, ID_HW_ID1, isGFX10Plus}, 115 {{"HW_REG_HW_ID2"}, ID_HW_ID2, isGFX10Plus}, 116 {{"HW_REG_POPS_PACKER"}, ID_POPS_PACKER, isGFX10}, 117 {{""}}, 118 {{""}}, 119 {{""}}, 120 {{"HW_REG_SHADER_CYCLES"}, ID_SHADER_CYCLES, isGFX10_BEncoding}, 121 122 // GFX940 specific registers 123 {{"HW_REG_XCC_ID"}, ID_XCC_ID, isGFX940}, 124 {{"HW_REG_SQ_PERF_SNAPSHOT_DATA"}, ID_SQ_PERF_SNAPSHOT_DATA, isGFX940}, 125 {{"HW_REG_SQ_PERF_SNAPSHOT_DATA1"}, ID_SQ_PERF_SNAPSHOT_DATA1, isGFX940}, 126 {{"HW_REG_SQ_PERF_SNAPSHOT_PC_LO"}, ID_SQ_PERF_SNAPSHOT_PC_LO, isGFX940}, 127 {{"HW_REG_SQ_PERF_SNAPSHOT_PC_HI"}, ID_SQ_PERF_SNAPSHOT_PC_HI, isGFX940}, 128 129 // Aliases 130 {{"HW_REG_HW_ID"}, ID_HW_ID1, isGFX10}, 131 }; 132 // NOLINTEND 133 134 const int OPR_SIZE = static_cast<int>( 135 sizeof(Opr) / sizeof(CustomOperand<const MCSubtargetInfo &>)); 136 137 } // namespace Hwreg 138 139 namespace MTBUFFormat { 140 141 StringLiteral const DfmtSymbolic[] = { 142 "BUF_DATA_FORMAT_INVALID", 143 "BUF_DATA_FORMAT_8", 144 "BUF_DATA_FORMAT_16", 145 "BUF_DATA_FORMAT_8_8", 146 "BUF_DATA_FORMAT_32", 147 "BUF_DATA_FORMAT_16_16", 148 "BUF_DATA_FORMAT_10_11_11", 149 "BUF_DATA_FORMAT_11_11_10", 150 "BUF_DATA_FORMAT_10_10_10_2", 151 "BUF_DATA_FORMAT_2_10_10_10", 152 "BUF_DATA_FORMAT_8_8_8_8", 153 "BUF_DATA_FORMAT_32_32", 154 "BUF_DATA_FORMAT_16_16_16_16", 155 "BUF_DATA_FORMAT_32_32_32", 156 "BUF_DATA_FORMAT_32_32_32_32", 157 "BUF_DATA_FORMAT_RESERVED_15" 158 }; 159 160 StringLiteral const NfmtSymbolicGFX10[] = { 161 "BUF_NUM_FORMAT_UNORM", 162 "BUF_NUM_FORMAT_SNORM", 163 "BUF_NUM_FORMAT_USCALED", 164 "BUF_NUM_FORMAT_SSCALED", 165 "BUF_NUM_FORMAT_UINT", 166 "BUF_NUM_FORMAT_SINT", 167 "", 168 "BUF_NUM_FORMAT_FLOAT" 169 }; 170 171 StringLiteral const NfmtSymbolicSICI[] = { 172 "BUF_NUM_FORMAT_UNORM", 173 "BUF_NUM_FORMAT_SNORM", 174 "BUF_NUM_FORMAT_USCALED", 175 "BUF_NUM_FORMAT_SSCALED", 176 "BUF_NUM_FORMAT_UINT", 177 "BUF_NUM_FORMAT_SINT", 178 "BUF_NUM_FORMAT_SNORM_OGL", 179 "BUF_NUM_FORMAT_FLOAT" 180 }; 181 182 StringLiteral const NfmtSymbolicVI[] = { // VI and GFX9 183 "BUF_NUM_FORMAT_UNORM", 184 "BUF_NUM_FORMAT_SNORM", 185 "BUF_NUM_FORMAT_USCALED", 186 "BUF_NUM_FORMAT_SSCALED", 187 "BUF_NUM_FORMAT_UINT", 188 "BUF_NUM_FORMAT_SINT", 189 "BUF_NUM_FORMAT_RESERVED_6", 190 "BUF_NUM_FORMAT_FLOAT" 191 }; 192 193 StringLiteral const UfmtSymbolicGFX10[] = { 194 "BUF_FMT_INVALID", 195 196 "BUF_FMT_8_UNORM", 197 "BUF_FMT_8_SNORM", 198 "BUF_FMT_8_USCALED", 199 "BUF_FMT_8_SSCALED", 200 "BUF_FMT_8_UINT", 201 "BUF_FMT_8_SINT", 202 203 "BUF_FMT_16_UNORM", 204 "BUF_FMT_16_SNORM", 205 "BUF_FMT_16_USCALED", 206 "BUF_FMT_16_SSCALED", 207 "BUF_FMT_16_UINT", 208 "BUF_FMT_16_SINT", 209 "BUF_FMT_16_FLOAT", 210 211 "BUF_FMT_8_8_UNORM", 212 "BUF_FMT_8_8_SNORM", 213 "BUF_FMT_8_8_USCALED", 214 "BUF_FMT_8_8_SSCALED", 215 "BUF_FMT_8_8_UINT", 216 "BUF_FMT_8_8_SINT", 217 218 "BUF_FMT_32_UINT", 219 "BUF_FMT_32_SINT", 220 "BUF_FMT_32_FLOAT", 221 222 "BUF_FMT_16_16_UNORM", 223 "BUF_FMT_16_16_SNORM", 224 "BUF_FMT_16_16_USCALED", 225 "BUF_FMT_16_16_SSCALED", 226 "BUF_FMT_16_16_UINT", 227 "BUF_FMT_16_16_SINT", 228 "BUF_FMT_16_16_FLOAT", 229 230 "BUF_FMT_10_11_11_UNORM", 231 "BUF_FMT_10_11_11_SNORM", 232 "BUF_FMT_10_11_11_USCALED", 233 "BUF_FMT_10_11_11_SSCALED", 234 "BUF_FMT_10_11_11_UINT", 235 "BUF_FMT_10_11_11_SINT", 236 "BUF_FMT_10_11_11_FLOAT", 237 238 "BUF_FMT_11_11_10_UNORM", 239 "BUF_FMT_11_11_10_SNORM", 240 "BUF_FMT_11_11_10_USCALED", 241 "BUF_FMT_11_11_10_SSCALED", 242 "BUF_FMT_11_11_10_UINT", 243 "BUF_FMT_11_11_10_SINT", 244 "BUF_FMT_11_11_10_FLOAT", 245 246 "BUF_FMT_10_10_10_2_UNORM", 247 "BUF_FMT_10_10_10_2_SNORM", 248 "BUF_FMT_10_10_10_2_USCALED", 249 "BUF_FMT_10_10_10_2_SSCALED", 250 "BUF_FMT_10_10_10_2_UINT", 251 "BUF_FMT_10_10_10_2_SINT", 252 253 "BUF_FMT_2_10_10_10_UNORM", 254 "BUF_FMT_2_10_10_10_SNORM", 255 "BUF_FMT_2_10_10_10_USCALED", 256 "BUF_FMT_2_10_10_10_SSCALED", 257 "BUF_FMT_2_10_10_10_UINT", 258 "BUF_FMT_2_10_10_10_SINT", 259 260 "BUF_FMT_8_8_8_8_UNORM", 261 "BUF_FMT_8_8_8_8_SNORM", 262 "BUF_FMT_8_8_8_8_USCALED", 263 "BUF_FMT_8_8_8_8_SSCALED", 264 "BUF_FMT_8_8_8_8_UINT", 265 "BUF_FMT_8_8_8_8_SINT", 266 267 "BUF_FMT_32_32_UINT", 268 "BUF_FMT_32_32_SINT", 269 "BUF_FMT_32_32_FLOAT", 270 271 "BUF_FMT_16_16_16_16_UNORM", 272 "BUF_FMT_16_16_16_16_SNORM", 273 "BUF_FMT_16_16_16_16_USCALED", 274 "BUF_FMT_16_16_16_16_SSCALED", 275 "BUF_FMT_16_16_16_16_UINT", 276 "BUF_FMT_16_16_16_16_SINT", 277 "BUF_FMT_16_16_16_16_FLOAT", 278 279 "BUF_FMT_32_32_32_UINT", 280 "BUF_FMT_32_32_32_SINT", 281 "BUF_FMT_32_32_32_FLOAT", 282 "BUF_FMT_32_32_32_32_UINT", 283 "BUF_FMT_32_32_32_32_SINT", 284 "BUF_FMT_32_32_32_32_FLOAT" 285 }; 286 287 unsigned const DfmtNfmt2UFmtGFX10[] = { 288 DFMT_INVALID | (NFMT_UNORM << NFMT_SHIFT), 289 290 DFMT_8 | (NFMT_UNORM << NFMT_SHIFT), 291 DFMT_8 | (NFMT_SNORM << NFMT_SHIFT), 292 DFMT_8 | (NFMT_USCALED << NFMT_SHIFT), 293 DFMT_8 | (NFMT_SSCALED << NFMT_SHIFT), 294 DFMT_8 | (NFMT_UINT << NFMT_SHIFT), 295 DFMT_8 | (NFMT_SINT << NFMT_SHIFT), 296 297 DFMT_16 | (NFMT_UNORM << NFMT_SHIFT), 298 DFMT_16 | (NFMT_SNORM << NFMT_SHIFT), 299 DFMT_16 | (NFMT_USCALED << NFMT_SHIFT), 300 DFMT_16 | (NFMT_SSCALED << NFMT_SHIFT), 301 DFMT_16 | (NFMT_UINT << NFMT_SHIFT), 302 DFMT_16 | (NFMT_SINT << NFMT_SHIFT), 303 DFMT_16 | (NFMT_FLOAT << NFMT_SHIFT), 304 305 DFMT_8_8 | (NFMT_UNORM << NFMT_SHIFT), 306 DFMT_8_8 | (NFMT_SNORM << NFMT_SHIFT), 307 DFMT_8_8 | (NFMT_USCALED << NFMT_SHIFT), 308 DFMT_8_8 | (NFMT_SSCALED << NFMT_SHIFT), 309 DFMT_8_8 | (NFMT_UINT << NFMT_SHIFT), 310 DFMT_8_8 | (NFMT_SINT << NFMT_SHIFT), 311 312 DFMT_32 | (NFMT_UINT << NFMT_SHIFT), 313 DFMT_32 | (NFMT_SINT << NFMT_SHIFT), 314 DFMT_32 | (NFMT_FLOAT << NFMT_SHIFT), 315 316 DFMT_16_16 | (NFMT_UNORM << NFMT_SHIFT), 317 DFMT_16_16 | (NFMT_SNORM << NFMT_SHIFT), 318 DFMT_16_16 | (NFMT_USCALED << NFMT_SHIFT), 319 DFMT_16_16 | (NFMT_SSCALED << NFMT_SHIFT), 320 DFMT_16_16 | (NFMT_UINT << NFMT_SHIFT), 321 DFMT_16_16 | (NFMT_SINT << NFMT_SHIFT), 322 DFMT_16_16 | (NFMT_FLOAT << NFMT_SHIFT), 323 324 DFMT_10_11_11 | (NFMT_UNORM << NFMT_SHIFT), 325 DFMT_10_11_11 | (NFMT_SNORM << NFMT_SHIFT), 326 DFMT_10_11_11 | (NFMT_USCALED << NFMT_SHIFT), 327 DFMT_10_11_11 | (NFMT_SSCALED << NFMT_SHIFT), 328 DFMT_10_11_11 | (NFMT_UINT << NFMT_SHIFT), 329 DFMT_10_11_11 | (NFMT_SINT << NFMT_SHIFT), 330 DFMT_10_11_11 | (NFMT_FLOAT << NFMT_SHIFT), 331 332 DFMT_11_11_10 | (NFMT_UNORM << NFMT_SHIFT), 333 DFMT_11_11_10 | (NFMT_SNORM << NFMT_SHIFT), 334 DFMT_11_11_10 | (NFMT_USCALED << NFMT_SHIFT), 335 DFMT_11_11_10 | (NFMT_SSCALED << NFMT_SHIFT), 336 DFMT_11_11_10 | (NFMT_UINT << NFMT_SHIFT), 337 DFMT_11_11_10 | (NFMT_SINT << NFMT_SHIFT), 338 DFMT_11_11_10 | (NFMT_FLOAT << NFMT_SHIFT), 339 340 DFMT_10_10_10_2 | (NFMT_UNORM << NFMT_SHIFT), 341 DFMT_10_10_10_2 | (NFMT_SNORM << NFMT_SHIFT), 342 DFMT_10_10_10_2 | (NFMT_USCALED << NFMT_SHIFT), 343 DFMT_10_10_10_2 | (NFMT_SSCALED << NFMT_SHIFT), 344 DFMT_10_10_10_2 | (NFMT_UINT << NFMT_SHIFT), 345 DFMT_10_10_10_2 | (NFMT_SINT << NFMT_SHIFT), 346 347 DFMT_2_10_10_10 | (NFMT_UNORM << NFMT_SHIFT), 348 DFMT_2_10_10_10 | (NFMT_SNORM << NFMT_SHIFT), 349 DFMT_2_10_10_10 | (NFMT_USCALED << NFMT_SHIFT), 350 DFMT_2_10_10_10 | (NFMT_SSCALED << NFMT_SHIFT), 351 DFMT_2_10_10_10 | (NFMT_UINT << NFMT_SHIFT), 352 DFMT_2_10_10_10 | (NFMT_SINT << NFMT_SHIFT), 353 354 DFMT_8_8_8_8 | (NFMT_UNORM << NFMT_SHIFT), 355 DFMT_8_8_8_8 | (NFMT_SNORM << NFMT_SHIFT), 356 DFMT_8_8_8_8 | (NFMT_USCALED << NFMT_SHIFT), 357 DFMT_8_8_8_8 | (NFMT_SSCALED << NFMT_SHIFT), 358 DFMT_8_8_8_8 | (NFMT_UINT << NFMT_SHIFT), 359 DFMT_8_8_8_8 | (NFMT_SINT << NFMT_SHIFT), 360 361 DFMT_32_32 | (NFMT_UINT << NFMT_SHIFT), 362 DFMT_32_32 | (NFMT_SINT << NFMT_SHIFT), 363 DFMT_32_32 | (NFMT_FLOAT << NFMT_SHIFT), 364 365 DFMT_16_16_16_16 | (NFMT_UNORM << NFMT_SHIFT), 366 DFMT_16_16_16_16 | (NFMT_SNORM << NFMT_SHIFT), 367 DFMT_16_16_16_16 | (NFMT_USCALED << NFMT_SHIFT), 368 DFMT_16_16_16_16 | (NFMT_SSCALED << NFMT_SHIFT), 369 DFMT_16_16_16_16 | (NFMT_UINT << NFMT_SHIFT), 370 DFMT_16_16_16_16 | (NFMT_SINT << NFMT_SHIFT), 371 DFMT_16_16_16_16 | (NFMT_FLOAT << NFMT_SHIFT), 372 373 DFMT_32_32_32 | (NFMT_UINT << NFMT_SHIFT), 374 DFMT_32_32_32 | (NFMT_SINT << NFMT_SHIFT), 375 DFMT_32_32_32 | (NFMT_FLOAT << NFMT_SHIFT), 376 DFMT_32_32_32_32 | (NFMT_UINT << NFMT_SHIFT), 377 DFMT_32_32_32_32 | (NFMT_SINT << NFMT_SHIFT), 378 DFMT_32_32_32_32 | (NFMT_FLOAT << NFMT_SHIFT) 379 }; 380 381 StringLiteral const UfmtSymbolicGFX11[] = { 382 "BUF_FMT_INVALID", 383 384 "BUF_FMT_8_UNORM", 385 "BUF_FMT_8_SNORM", 386 "BUF_FMT_8_USCALED", 387 "BUF_FMT_8_SSCALED", 388 "BUF_FMT_8_UINT", 389 "BUF_FMT_8_SINT", 390 391 "BUF_FMT_16_UNORM", 392 "BUF_FMT_16_SNORM", 393 "BUF_FMT_16_USCALED", 394 "BUF_FMT_16_SSCALED", 395 "BUF_FMT_16_UINT", 396 "BUF_FMT_16_SINT", 397 "BUF_FMT_16_FLOAT", 398 399 "BUF_FMT_8_8_UNORM", 400 "BUF_FMT_8_8_SNORM", 401 "BUF_FMT_8_8_USCALED", 402 "BUF_FMT_8_8_SSCALED", 403 "BUF_FMT_8_8_UINT", 404 "BUF_FMT_8_8_SINT", 405 406 "BUF_FMT_32_UINT", 407 "BUF_FMT_32_SINT", 408 "BUF_FMT_32_FLOAT", 409 410 "BUF_FMT_16_16_UNORM", 411 "BUF_FMT_16_16_SNORM", 412 "BUF_FMT_16_16_USCALED", 413 "BUF_FMT_16_16_SSCALED", 414 "BUF_FMT_16_16_UINT", 415 "BUF_FMT_16_16_SINT", 416 "BUF_FMT_16_16_FLOAT", 417 418 "BUF_FMT_10_11_11_FLOAT", 419 420 "BUF_FMT_11_11_10_FLOAT", 421 422 "BUF_FMT_10_10_10_2_UNORM", 423 "BUF_FMT_10_10_10_2_SNORM", 424 "BUF_FMT_10_10_10_2_UINT", 425 "BUF_FMT_10_10_10_2_SINT", 426 427 "BUF_FMT_2_10_10_10_UNORM", 428 "BUF_FMT_2_10_10_10_SNORM", 429 "BUF_FMT_2_10_10_10_USCALED", 430 "BUF_FMT_2_10_10_10_SSCALED", 431 "BUF_FMT_2_10_10_10_UINT", 432 "BUF_FMT_2_10_10_10_SINT", 433 434 "BUF_FMT_8_8_8_8_UNORM", 435 "BUF_FMT_8_8_8_8_SNORM", 436 "BUF_FMT_8_8_8_8_USCALED", 437 "BUF_FMT_8_8_8_8_SSCALED", 438 "BUF_FMT_8_8_8_8_UINT", 439 "BUF_FMT_8_8_8_8_SINT", 440 441 "BUF_FMT_32_32_UINT", 442 "BUF_FMT_32_32_SINT", 443 "BUF_FMT_32_32_FLOAT", 444 445 "BUF_FMT_16_16_16_16_UNORM", 446 "BUF_FMT_16_16_16_16_SNORM", 447 "BUF_FMT_16_16_16_16_USCALED", 448 "BUF_FMT_16_16_16_16_SSCALED", 449 "BUF_FMT_16_16_16_16_UINT", 450 "BUF_FMT_16_16_16_16_SINT", 451 "BUF_FMT_16_16_16_16_FLOAT", 452 453 "BUF_FMT_32_32_32_UINT", 454 "BUF_FMT_32_32_32_SINT", 455 "BUF_FMT_32_32_32_FLOAT", 456 "BUF_FMT_32_32_32_32_UINT", 457 "BUF_FMT_32_32_32_32_SINT", 458 "BUF_FMT_32_32_32_32_FLOAT" 459 }; 460 461 unsigned const DfmtNfmt2UFmtGFX11[] = { 462 DFMT_INVALID | (NFMT_UNORM << NFMT_SHIFT), 463 464 DFMT_8 | (NFMT_UNORM << NFMT_SHIFT), 465 DFMT_8 | (NFMT_SNORM << NFMT_SHIFT), 466 DFMT_8 | (NFMT_USCALED << NFMT_SHIFT), 467 DFMT_8 | (NFMT_SSCALED << NFMT_SHIFT), 468 DFMT_8 | (NFMT_UINT << NFMT_SHIFT), 469 DFMT_8 | (NFMT_SINT << NFMT_SHIFT), 470 471 DFMT_16 | (NFMT_UNORM << NFMT_SHIFT), 472 DFMT_16 | (NFMT_SNORM << NFMT_SHIFT), 473 DFMT_16 | (NFMT_USCALED << NFMT_SHIFT), 474 DFMT_16 | (NFMT_SSCALED << NFMT_SHIFT), 475 DFMT_16 | (NFMT_UINT << NFMT_SHIFT), 476 DFMT_16 | (NFMT_SINT << NFMT_SHIFT), 477 DFMT_16 | (NFMT_FLOAT << NFMT_SHIFT), 478 479 DFMT_8_8 | (NFMT_UNORM << NFMT_SHIFT), 480 DFMT_8_8 | (NFMT_SNORM << NFMT_SHIFT), 481 DFMT_8_8 | (NFMT_USCALED << NFMT_SHIFT), 482 DFMT_8_8 | (NFMT_SSCALED << NFMT_SHIFT), 483 DFMT_8_8 | (NFMT_UINT << NFMT_SHIFT), 484 DFMT_8_8 | (NFMT_SINT << NFMT_SHIFT), 485 486 DFMT_32 | (NFMT_UINT << NFMT_SHIFT), 487 DFMT_32 | (NFMT_SINT << NFMT_SHIFT), 488 DFMT_32 | (NFMT_FLOAT << NFMT_SHIFT), 489 490 DFMT_16_16 | (NFMT_UNORM << NFMT_SHIFT), 491 DFMT_16_16 | (NFMT_SNORM << NFMT_SHIFT), 492 DFMT_16_16 | (NFMT_USCALED << NFMT_SHIFT), 493 DFMT_16_16 | (NFMT_SSCALED << NFMT_SHIFT), 494 DFMT_16_16 | (NFMT_UINT << NFMT_SHIFT), 495 DFMT_16_16 | (NFMT_SINT << NFMT_SHIFT), 496 DFMT_16_16 | (NFMT_FLOAT << NFMT_SHIFT), 497 498 DFMT_10_11_11 | (NFMT_FLOAT << NFMT_SHIFT), 499 500 DFMT_11_11_10 | (NFMT_FLOAT << NFMT_SHIFT), 501 502 DFMT_10_10_10_2 | (NFMT_UNORM << NFMT_SHIFT), 503 DFMT_10_10_10_2 | (NFMT_SNORM << NFMT_SHIFT), 504 DFMT_10_10_10_2 | (NFMT_UINT << NFMT_SHIFT), 505 DFMT_10_10_10_2 | (NFMT_SINT << NFMT_SHIFT), 506 507 DFMT_2_10_10_10 | (NFMT_UNORM << NFMT_SHIFT), 508 DFMT_2_10_10_10 | (NFMT_SNORM << NFMT_SHIFT), 509 DFMT_2_10_10_10 | (NFMT_USCALED << NFMT_SHIFT), 510 DFMT_2_10_10_10 | (NFMT_SSCALED << NFMT_SHIFT), 511 DFMT_2_10_10_10 | (NFMT_UINT << NFMT_SHIFT), 512 DFMT_2_10_10_10 | (NFMT_SINT << NFMT_SHIFT), 513 514 DFMT_8_8_8_8 | (NFMT_UNORM << NFMT_SHIFT), 515 DFMT_8_8_8_8 | (NFMT_SNORM << NFMT_SHIFT), 516 DFMT_8_8_8_8 | (NFMT_USCALED << NFMT_SHIFT), 517 DFMT_8_8_8_8 | (NFMT_SSCALED << NFMT_SHIFT), 518 DFMT_8_8_8_8 | (NFMT_UINT << NFMT_SHIFT), 519 DFMT_8_8_8_8 | (NFMT_SINT << NFMT_SHIFT), 520 521 DFMT_32_32 | (NFMT_UINT << NFMT_SHIFT), 522 DFMT_32_32 | (NFMT_SINT << NFMT_SHIFT), 523 DFMT_32_32 | (NFMT_FLOAT << NFMT_SHIFT), 524 525 DFMT_16_16_16_16 | (NFMT_UNORM << NFMT_SHIFT), 526 DFMT_16_16_16_16 | (NFMT_SNORM << NFMT_SHIFT), 527 DFMT_16_16_16_16 | (NFMT_USCALED << NFMT_SHIFT), 528 DFMT_16_16_16_16 | (NFMT_SSCALED << NFMT_SHIFT), 529 DFMT_16_16_16_16 | (NFMT_UINT << NFMT_SHIFT), 530 DFMT_16_16_16_16 | (NFMT_SINT << NFMT_SHIFT), 531 DFMT_16_16_16_16 | (NFMT_FLOAT << NFMT_SHIFT), 532 533 DFMT_32_32_32 | (NFMT_UINT << NFMT_SHIFT), 534 DFMT_32_32_32 | (NFMT_SINT << NFMT_SHIFT), 535 DFMT_32_32_32 | (NFMT_FLOAT << NFMT_SHIFT), 536 DFMT_32_32_32_32 | (NFMT_UINT << NFMT_SHIFT), 537 DFMT_32_32_32_32 | (NFMT_SINT << NFMT_SHIFT), 538 DFMT_32_32_32_32 | (NFMT_FLOAT << NFMT_SHIFT) 539 }; 540 541 } // namespace MTBUFFormat 542 543 namespace Swizzle { 544 545 // This must be in sync with llvm::AMDGPU::Swizzle::Id enum members, see SIDefines.h. 546 const char* const IdSymbolic[] = { 547 "QUAD_PERM", 548 "BITMASK_PERM", 549 "SWAP", 550 "REVERSE", 551 "BROADCAST", 552 }; 553 554 } // namespace Swizzle 555 556 namespace VGPRIndexMode { 557 558 // This must be in sync with llvm::AMDGPU::VGPRIndexMode::Id enum members, see SIDefines.h. 559 const char* const IdSymbolic[] = { 560 "SRC0", 561 "SRC1", 562 "SRC2", 563 "DST", 564 }; 565 566 } // namespace VGPRIndexMode 567 568 } // namespace AMDGPU 569 } // namespace llvm 570