Add TestBit

This commit is contained in:
Liam 2022-11-13 14:38:04 -05:00
parent e6949a86a2
commit 92ef9a7276

View file

@ -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<>