emit_arm64_packed: Implement PackedSubU16
This commit is contained in:
parent
fb6ac45259
commit
1810bd6547
1 changed files with 17 additions and 4 deletions
|
@ -157,10 +157,23 @@ void EmitIR<IR::Opcode::PackedAddS16>(oaknut::CodeGenerator& code, EmitContext&
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
void EmitIR<IR::Opcode::PackedSubU16>(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) {
|
void EmitIR<IR::Opcode::PackedSubU16>(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.SUB(Vresult->H4(), Va->H4(), Vb->H4());
|
||||||
|
|
||||||
|
if (ge_inst) {
|
||||||
|
auto Vge = ctx.reg_alloc.WriteD(ge_inst);
|
||||||
|
RegAlloc::Realize(Vge);
|
||||||
|
|
||||||
|
code.UHSUB(Vge->H4(), Va->H4(), Vb->H4());
|
||||||
|
code.CMGE(Vge->H4(), Vge->H4(), 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
|
|
Loading…
Reference in a new issue