1 //===-- AMDGPUAsmUtils.h - AsmParser/InstPrinter common ---------*- C++ -*-===// 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 9 #ifndef LLVM_LIB_TARGET_AMDGPU_UTILS_AMDGPUASMUTILS_H 10 #define LLVM_LIB_TARGET_AMDGPU_UTILS_AMDGPUASMUTILS_H 11 12 #include "SIDefines.h" 13 14 #include "llvm/ADT/StringRef.h" 15 16 namespace llvm { 17 18 class StringLiteral; 19 class MCSubtargetInfo; 20 21 namespace AMDGPU { 22 23 const int OPR_ID_UNKNOWN = -1; 24 const int OPR_ID_UNSUPPORTED = -2; 25 26 template <class T> struct CustomOperand { 27 StringLiteral Name; 28 int Encoding = 0; 29 bool (*Cond)(T Context) = nullptr; 30 }; 31 32 namespace SendMsg { // Symbolic names for the sendmsg(...) syntax. 33 34 extern const CustomOperand<const MCSubtargetInfo &> Msg[]; 35 extern const int MSG_SIZE; 36 37 extern const char *const OpSysSymbolic[OP_SYS_LAST_]; 38 extern const char *const OpGsSymbolic[OP_GS_LAST_]; 39 40 } // namespace SendMsg 41 42 namespace Hwreg { // Symbolic names for the hwreg(...) syntax. 43 44 extern const CustomOperand<const MCSubtargetInfo &> Opr[]; 45 extern const int OPR_SIZE; 46 47 } // namespace Hwreg 48 49 namespace MTBUFFormat { 50 51 extern StringLiteral const DfmtSymbolic[]; 52 extern StringLiteral const NfmtSymbolicGFX10[]; 53 extern StringLiteral const NfmtSymbolicSICI[]; 54 extern StringLiteral const NfmtSymbolicVI[]; 55 extern StringLiteral const UfmtSymbolic[]; 56 extern unsigned const DfmtNfmt2UFmt[]; 57 58 } // namespace MTBUFFormat 59 60 namespace Swizzle { // Symbolic names for the swizzle(...) syntax. 61 62 extern const char* const IdSymbolic[]; 63 64 } // namespace Swizzle 65 66 namespace VGPRIndexMode { // Symbolic names for the gpr_idx(...) syntax. 67 68 extern const char* const IdSymbolic[]; 69 70 } // namespace VGPRIndexMode 71 72 } // namespace AMDGPU 73 } // namespace llvm 74 75 #endif 76