emit_arm64_a32: Implement A32SetCpsrNZCVRaw, A32SetCpsrNZCVQ
This commit is contained in:
parent
11b665c027
commit
33b3376fb1
1 changed files with 14 additions and 8 deletions
|
@ -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<>
|
||||||
|
|
Loading…
Reference in a new issue