Implement *MULH
This commit is contained in:
parent
5b6e2add82
commit
bdc1b0f590
1 changed files with 14 additions and 8 deletions
|
@ -1051,18 +1051,24 @@ void EmitIR<IR::Opcode::Mul64>(oaknut::CodeGenerator& code, EmitContext& ctx, IR
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
void EmitIR<IR::Opcode::SignedMultiplyHigh64>(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) {
|
void EmitIR<IR::Opcode::SignedMultiplyHigh64>(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 Xop1 = ctx.reg_alloc.ReadX(args[0]);
|
||||||
ASSERT_FALSE("Unimplemented");
|
auto Xop2 = ctx.reg_alloc.ReadX(args[1]);
|
||||||
|
RegAlloc::Realize(Xresult, Xop1, Xop2);
|
||||||
|
|
||||||
|
code.SMULH(Xresult, Xop1, Xop2);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
void EmitIR<IR::Opcode::UnsignedMultiplyHigh64>(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) {
|
void EmitIR<IR::Opcode::UnsignedMultiplyHigh64>(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 Xop1 = ctx.reg_alloc.ReadX(args[0]);
|
||||||
ASSERT_FALSE("Unimplemented");
|
auto Xop2 = ctx.reg_alloc.ReadX(args[1]);
|
||||||
|
RegAlloc::Realize(Xresult, Xop1, Xop2);
|
||||||
|
|
||||||
|
code.UMULH(Xresult, Xop1, Xop2);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
|
|
Loading…
Reference in a new issue