From 6142db864714572ebab318b71b09f5403352c6b1 Mon Sep 17 00:00:00 2001 From: Yang Liu Date: Mon, 19 Feb 2024 14:00:52 +0800 Subject: backend/rv64: Implement GetCFlagFromNZCV --- src/dynarmic/backend/riscv64/emit_riscv64.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/dynarmic/backend/riscv64/emit_riscv64.cpp b/src/dynarmic/backend/riscv64/emit_riscv64.cpp index 32a5506b..f9302821 100644 --- a/src/dynarmic/backend/riscv64/emit_riscv64.cpp +++ b/src/dynarmic/backend/riscv64/emit_riscv64.cpp @@ -93,8 +93,15 @@ void EmitIR(biscuit::Assembler&, EmitContext&, IR::I } template<> -void EmitIR(biscuit::Assembler&, EmitContext&, IR::Inst*) { - UNIMPLEMENTED(); +void EmitIR(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<> -- cgit v1.2.3