emit_arm64_a32: Implement A32SetCpsrNZCVRaw, A32SetCpsrNZCVQ

This commit is contained in:
Merry 2022-07-30 19:10:35 +01:00 committed by merry
parent 11b665c027
commit 33b3376fb1

View file

@ -274,18 +274,24 @@ void EmitIR<IR::Opcode::A32SetCpsrNZCV>(oaknut::CodeGenerator& code, EmitContext
template<> template<>
void EmitIR<IR::Opcode::A32SetCpsrNZCVRaw>(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) { void EmitIR<IR::Opcode::A32SetCpsrNZCVRaw>(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) {
(void)code; auto args = ctx.reg_alloc.GetArgumentInfo(inst);
(void)ctx; auto Wnzcv = ctx.reg_alloc.ReadW(args[0]);
(void)inst; RegAlloc::Realize(Wnzcv);
ASSERT_FALSE("Unimplemented");
code.STR(Wnzcv, Xstate, offsetof(A32JitState, cpsr_nzcv));
} }
template<> template<>
void EmitIR<IR::Opcode::A32SetCpsrNZCVQ>(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) { void EmitIR<IR::Opcode::A32SetCpsrNZCVQ>(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) {
(void)code; auto args = ctx.reg_alloc.GetArgumentInfo(inst);
(void)ctx; auto Wnzcv = ctx.reg_alloc.ReadW(args[0]);
(void)inst; RegAlloc::Realize(Wnzcv);
ASSERT_FALSE("Unimplemented");
static_assert(offsetof(A32JitState, cpsr_nzcv) + sizeof(u32) == offsetof(A32JitState, cpsr_q));
code.AND(Wscratch0, Wnzcv, 0xf000'0000);
code.AND(Wscratch1, Wnzcv, 0x0800'0000);
code.STP(Wscratch0, Wscratch1, Xstate, offsetof(A32JitState, cpsr_nzcv));
} }
template<> template<>