Add TestBit
This commit is contained in:
parent
e6949a86a2
commit
92ef9a7276
1 changed files with 8 additions and 4 deletions
|
@ -189,10 +189,14 @@ void EmitIR<IR::Opcode::IsZero64>(oaknut::CodeGenerator& code, EmitContext& ctx,
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
void EmitIR<IR::Opcode::TestBit>(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) {
|
void EmitIR<IR::Opcode::TestBit>(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) {
|
||||||
(void)code;
|
auto args = ctx.reg_alloc.GetArgumentInfo(inst);
|
||||||
(void)ctx;
|
auto Xresult = ctx.reg_alloc.WriteX(inst);
|
||||||
(void)inst;
|
auto Xoperand = ctx.reg_alloc.ReadX(args[0]);
|
||||||
ASSERT_FALSE("Unimplemented");
|
RegAlloc::Realize(Xresult, Xoperand);
|
||||||
|
ASSERT(args[1].IsImmediate());
|
||||||
|
ASSERT(args[1].GetImmediateU8() < 64);
|
||||||
|
|
||||||
|
code.UBFX(Xresult, Xoperand, args[1].GetImmediateU8(), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
|
|
Loading…
Reference in a new issue