[backend-O1-1]在后端添加kAnd和kOr的支持
This commit is contained in:
@@ -673,6 +673,22 @@ void RISCv64ISel::selectNode(DAGNode* node) {
|
|||||||
CurMBB->addInstruction(std::move(xori));
|
CurMBB->addInstruction(std::move(xori));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case BinaryInst::kAnd: {
|
||||||
|
auto instr = std::make_unique<MachineInstr>(RVOpcodes::AND);
|
||||||
|
instr->addOperand(std::make_unique<RegOperand>(dest_vreg));
|
||||||
|
instr->addOperand(std::make_unique<RegOperand>(lhs_vreg));
|
||||||
|
instr->addOperand(std::make_unique<RegOperand>(rhs_vreg));
|
||||||
|
CurMBB->addInstruction(std::move(instr));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case BinaryInst::kOr: {
|
||||||
|
auto instr = std::make_unique<MachineInstr>(RVOpcodes::OR);
|
||||||
|
instr->addOperand(std::make_unique<RegOperand>(dest_vreg));
|
||||||
|
instr->addOperand(std::make_unique<RegOperand>(lhs_vreg));
|
||||||
|
instr->addOperand(std::make_unique<RegOperand>(rhs_vreg));
|
||||||
|
CurMBB->addInstruction(std::move(instr));
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
throw std::runtime_error("Unsupported binary instruction in ISel");
|
throw std::runtime_error("Unsupported binary instruction in ISel");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user