backend/rv64: Implement GetCFlagFromNZCV

This commit is contained in:
Yang Liu 2024-02-19 14:00:52 +08:00 committed by Merry
parent 483dcba9b6
commit 6142db8647

View file

@ -93,8 +93,15 @@ void EmitIR<IR::Opcode::GetLowerFromOp>(biscuit::Assembler&, EmitContext&, IR::I
}
template<>
void EmitIR<IR::Opcode::GetCFlagFromNZCV>(biscuit::Assembler&, EmitContext&, IR::Inst*) {
UNIMPLEMENTED();
void EmitIR<IR::Opcode::GetCFlagFromNZCV>(biscuit::Assembler& as, EmitContext& ctx, IR::Inst* inst) {
auto args = ctx.reg_alloc.GetArgumentInfo(inst);
auto Xc = ctx.reg_alloc.WriteX(inst);
auto Xnzcv = ctx.reg_alloc.ReadX(args[0]);
RegAlloc::Realize(Xc, Xnzcv);
as.LUI(Xscratch0, 0x20000);
as.AND(Xc, Xnzcv, Xscratch0);
}
template<>