@@ -37,21 +37,6 @@ enum class InstructionKind {
37
37
// @TODO: Add more instructions as needed
38
38
};
39
39
40
- static llvm::StringRef toString (InstructionKind name) {
41
- switch (name) {
42
- case InstructionKind::DPAS:
43
- return " dpas" ;
44
- }
45
- llvm_unreachable (" Unknown InstructionKind" );
46
- }
47
-
48
- static std::optional<InstructionKind>
49
- parseInstructionKind (llvm::StringRef str) {
50
- if (str.equals_insensitive (" dpas" ))
51
- return InstructionKind::DPAS;
52
- return std::nullopt ;
53
- }
54
-
55
40
// A struct to represent basic information about an instruction.
56
41
// The primary purpose of the Instruction struct is to provide a generic way to
57
42
// represent information about an instruction and to use this information to
@@ -65,6 +50,20 @@ struct Instruction {
65
50
// Get methods
66
51
InstructionKind getInstructionKind () { return instKind; }
67
52
InstructionScope getScope () { return scope; }
53
+ static llvm::StringRef toString (InstructionKind instKind) {
54
+ switch (instKind) {
55
+ case InstructionKind::DPAS:
56
+ return " dpas" ;
57
+ }
58
+ llvm_unreachable (" Unknown InstructionKind" );
59
+ }
60
+
61
+ static std::optional<InstructionKind>
62
+ parseInstructionKind (llvm::StringRef str) {
63
+ if (str.equals_insensitive (" dpas" ))
64
+ return InstructionKind::DPAS;
65
+ return std::nullopt ;
66
+ }
68
67
69
68
protected:
70
69
InstructionKind instKind; // Specific InstructionKind (e.g., DPAS)
@@ -168,7 +167,7 @@ struct uArch {
168
167
llvm::SmallVector<StringRef, 8 > getSupportedInstructionNames () const {
169
168
llvm::SmallVector<StringRef, 8 > instructionNames;
170
169
for (const auto &inst : instructions) {
171
- instructionNames.push_back (toString (inst.first ));
170
+ instructionNames.push_back (Instruction:: toString (inst.first ));
172
171
}
173
172
return instructionNames;
174
173
}
0 commit comments