emit_arm64_packed: Implement PackedAddU8

This commit is contained in:
Merry 2022-07-26 08:07:50 +01:00 committed by merry
parent 8f1f1c8f0b
commit 619adce84f

View file

@ -20,10 +20,22 @@ using namespace oaknut::util;
template<> template<>
void EmitIR<IR::Opcode::PackedAddU8>(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) { void EmitIR<IR::Opcode::PackedAddU8>(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) {
(void)code; const auto ge_inst = inst->GetAssociatedPseudoOperation(IR::Opcode::GetGEFromOp);
(void)ctx;
(void)inst; auto args = ctx.reg_alloc.GetArgumentInfo(inst);
ASSERT_FALSE("Unimplemented"); auto Vresult = ctx.reg_alloc.WriteD(inst);
auto Va = ctx.reg_alloc.ReadD(args[0]);
auto Vb = ctx.reg_alloc.ReadD(args[1]);
RegAlloc::Realize(Vresult, Va, Vb);
code.ADD(Vresult->B8(), Va->B8(), Vb->B8());
if (ge_inst) {
auto Vge = ctx.reg_alloc.WriteD(ge_inst);
RegAlloc::Realize(Vge);
code.CMHI(Vge->B8(), Va->B8(), Vresult->B8());
}
} }
template<> template<>