Skip to content

Commit f52477c

Browse files
authored
[RTG] Add InstructionOpInterface (#7979)
1 parent db847ef commit f52477c

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

include/circt/Dialect/RTG/IR/RTGISAAssemblyInterfaces.td

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,30 @@ def RegisterOpInterface : OpInterface<"RegisterOpInterface"> {
5555
];
5656
}
5757

58+
def InstructionOpInterface : OpInterface<"InstructionOpInterface"> {
59+
let description = [{
60+
This interface should be implemented by operations that represent
61+
ISA instructions.
62+
}];
63+
let cppNamespace = "::circt::rtg";
64+
65+
let methods = [
66+
StaticInterfaceMethod<[{
67+
Emits a binary representation of the instruction compatible with the
68+
ISA specification.
69+
}],
70+
"void", "printInstructionBinary",
71+
(ins "llvm::raw_ostream &":$os,
72+
"llvm::ArrayRef<mlir::Attribute>":$operands)>,
73+
StaticInterfaceMethod<[{
74+
Emits the ISA assembly representation of the instruction to the provided
75+
stream. The format should be the one understood by common assembler
76+
tools.
77+
}],
78+
"void", "printInstructionAssembly",
79+
(ins "llvm::raw_ostream &":$os,
80+
"llvm::ArrayRef<mlir::Attribute>":$operands)>,
81+
];
82+
}
83+
5884
#endif // CIRCT_DIALECT_RTG_IR_RTGISAASSEMBLYINTERFACES_TD

0 commit comments

Comments
 (0)