From b014efe1834c205bb30166983240868202acfb33 Mon Sep 17 00:00:00 2001 From: Lixuanwang Date: Wed, 20 Aug 2025 02:46:15 +0800 Subject: [PATCH] =?UTF-8?q?[backend-O1-1]=E5=9C=A8=E5=90=8E=E7=AB=AF?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0kAnd=E5=92=8CkOr=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/RISCv64/RISCv64ISel.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/backend/RISCv64/RISCv64ISel.cpp b/src/backend/RISCv64/RISCv64ISel.cpp index fb9cbd6..0d1a201 100644 --- a/src/backend/RISCv64/RISCv64ISel.cpp +++ b/src/backend/RISCv64/RISCv64ISel.cpp @@ -673,6 +673,22 @@ void RISCv64ISel::selectNode(DAGNode* node) { CurMBB->addInstruction(std::move(xori)); break; } + case BinaryInst::kAnd: { + auto instr = std::make_unique(RVOpcodes::AND); + instr->addOperand(std::make_unique(dest_vreg)); + instr->addOperand(std::make_unique(lhs_vreg)); + instr->addOperand(std::make_unique(rhs_vreg)); + CurMBB->addInstruction(std::move(instr)); + break; + } + case BinaryInst::kOr: { + auto instr = std::make_unique(RVOpcodes::OR); + instr->addOperand(std::make_unique(dest_vreg)); + instr->addOperand(std::make_unique(lhs_vreg)); + instr->addOperand(std::make_unique(rhs_vreg)); + CurMBB->addInstruction(std::move(instr)); + break; + } default: throw std::runtime_error("Unsupported binary instruction in ISel"); }