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) {
|
||||
auto args = ctx.reg_alloc.GetArgumentInfo(inst);
|
||||
|
||||
auto Wbit = ctx.reg_alloc.ReadW(args[0]);
|
||||
RegAlloc::Realize(Wbit);
|
||||
|
||||
code.STRB(Wbit, SP, offsetof(StackLayout, check_bit));
|
||||
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]);
|
||||
RegAlloc::Realize(Wbit);
|
||||
code.STRB(Wbit, SP, offsetof(StackLayout, check_bit));
|
||||
}
|
||||
}
|
||||
|
||||
template<>
|
||||
|
|
Loading…
Reference in a new issue