emit_arm64_a32: A32SetCheckBit: Handle immediate
This commit is contained in:
parent
49589168c9
commit
65a7d9be8d
1 changed files with 12 additions and 4 deletions
|
@ -127,10 +127,18 @@ template<>
|
||||||
void EmitIR<IR::Opcode::A32SetCheckBit>(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) {
|
void EmitIR<IR::Opcode::A32SetCheckBit>(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) {
|
||||||
auto args = ctx.reg_alloc.GetArgumentInfo(inst);
|
auto args = ctx.reg_alloc.GetArgumentInfo(inst);
|
||||||
|
|
||||||
|
if (args[0].IsImmediate()) {
|
||||||
|
if (args[0].GetImmediateU1()) {
|
||||||
|
code.MOV(Wscratch0, 1);
|
||||||
|
code.STRB(Wscratch0, SP, offsetof(StackLayout, check_bit));
|
||||||
|
} else {
|
||||||
|
code.STRB(WZR, SP, offsetof(StackLayout, check_bit));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
auto Wbit = ctx.reg_alloc.ReadW(args[0]);
|
auto Wbit = ctx.reg_alloc.ReadW(args[0]);
|
||||||
RegAlloc::Realize(Wbit);
|
RegAlloc::Realize(Wbit);
|
||||||
|
|
||||||
code.STRB(Wbit, SP, offsetof(StackLayout, check_bit));
|
code.STRB(Wbit, SP, offsetof(StackLayout, check_bit));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
|
|
Loading…
Reference in a new issue