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 char *const IdSymbolic[ID_GAPS_LAST_];
35 extern const char *const OpSysSymbolic[OP_SYS_LAST_];
36 extern const char *const OpGsSymbolic[OP_GS_LAST_];
37 
38 } // namespace SendMsg
39 
40 namespace Hwreg { // Symbolic names for the hwreg(...) syntax.
41 
42 extern const CustomOperand<const MCSubtargetInfo &> Opr[];
43 extern const int OPR_SIZE;
44 
45 } // namespace Hwreg
46 
47 namespace MTBUFFormat {
48 
49 extern StringLiteral const DfmtSymbolic[];
50 extern StringLiteral const NfmtSymbolicGFX10[];
51 extern StringLiteral const NfmtSymbolicSICI[];
52 extern StringLiteral const NfmtSymbolicVI[];
53 extern StringLiteral const UfmtSymbolic[];
54 extern unsigned const DfmtNfmt2UFmt[];
55 
56 } // namespace MTBUFFormat
57 
58 namespace Swizzle { // Symbolic names for the swizzle(...) syntax.
59 
60 extern const char* const IdSymbolic[];
61 
62 } // namespace Swizzle
63 
64 namespace VGPRIndexMode { // Symbolic names for the gpr_idx(...) syntax.
65 
66 extern const char* const IdSymbolic[];
67 
68 } // namespace VGPRIndexMode
69 
70 } // namespace AMDGPU
71 } // namespace llvm
72 
73 #endif
74