From 379ff50dcc7ccf977379aee68fa9d10f69065d23 Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Sun, 9 Aug 2026 18:31:49 +0800 Subject: [MC] Implement RV64GC assembly emission --- backend/lib/AsmPrinter/TargetMCInstLowering.cpp | 49 +++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 backend/lib/AsmPrinter/TargetMCInstLowering.cpp (limited to 'backend/lib/AsmPrinter/TargetMCInstLowering.cpp') diff --git a/backend/lib/AsmPrinter/TargetMCInstLowering.cpp b/backend/lib/AsmPrinter/TargetMCInstLowering.cpp new file mode 100644 index 0000000..c171034 --- /dev/null +++ b/backend/lib/AsmPrinter/TargetMCInstLowering.cpp @@ -0,0 +1,49 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "rcc/CodeGen/TargetMCInstLowering.h" + +namespace rcc { + +Expected TargetMCInstLowering::emitTerminalInstruction(const MachineInstr &, + MachineMCContext &, + mc::MCStreamer &) const { + return makeUnexpected(ErrorCode::Unsupported, + "target does not support this terminal emission instruction"); +} + +Expected TargetMCInstLowering::emitFileHeader(MachineMCContext &, mc::MCStreamer &) const { + return {}; +} + +Expected TargetMCInstLowering::emitFileTrailer(MachineMCContext &, mc::MCStreamer &) const { + return {}; +} + +Expected TargetMCInstLowering::emitGenericConstant(const GenericConstantData &, std::uint64_t, + MachineMCContext &, + mc::MCStreamer &) const { + return makeUnexpected(ErrorCode::Unsupported, + "target does not support assembly emission for generic constants"); +} + +Expected TargetMCInstLowering::emitGlobalInitializer(const GlobalInitializer &, + MachineMCContext &, + mc::MCStreamer &) const { + return makeUnexpected(ErrorCode::Unsupported, + "target does not support assembly emission for global initializers"); +} + +Expected TargetMCInstLowering::emitTargetConstant(const TargetConstant &, MachineMCContext &, + mc::MCStreamer &) const { + return makeUnexpected(ErrorCode::Unsupported, + "target does not support assembly emission for this target constant"); +} + +Expected TargetMCInstLowering::emitTargetJumpTable(const MachineFunction &, + const MachineJumpTableEntry &, + MachineMCContext &, + mc::MCStreamer &) const { + return makeUnexpected(ErrorCode::Unsupported, "target does not support this jump-table encoding"); +} + +} // namespace rcc -- cgit v1.2.3