Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RTG] Add InstructionOpInterface #7979

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions include/circt/Dialect/RTG/IR/RTGISAAssemblyInterfaces.td
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,30 @@ def RegisterOpInterface : OpInterface<"RegisterOpInterface"> {
];
}

def InstructionOpInterface : OpInterface<"InstructionOpInterface"> {
let description = [{
This interface should be implemented by operations that represent
ISA instructions.
}];
let cppNamespace = "::circt::rtg";

let methods = [
StaticInterfaceMethod<[{
Emits a binary representation of the instruction compatible with the
ISA specification.
}],
"void", "printInstructionBinary",
(ins "llvm::raw_ostream &":$os,
"llvm::ArrayRef<mlir::Attribute>":$operands)>,
StaticInterfaceMethod<[{
Emits the ISA assembly representation of the instruction to the provided
stream. The format should be the one understood by common assembler
tools.
}],
"void", "printInstructionAssembly",
(ins "llvm::raw_ostream &":$os,
"llvm::ArrayRef<mlir::Attribute>":$operands)>,
];
}

#endif // CIRCT_DIALECT_RTG_IR_RTGISAASSEMBLYINTERFACES_TD
Loading