fixup
This commit is contained in:
parent
a3fc95204b
commit
59ccccdc26
1 changed files with 14 additions and 2 deletions
|
@ -24,6 +24,7 @@ static void EmitCoprocessorException() {
|
|||
}
|
||||
|
||||
static void CallCoprocCallback(oaknut::CodeGenerator& code, EmitContext& ctx, A32::Coprocessor::Callback callback, IR::Inst* inst = nullptr, std::optional<Argument::copyable_reference> arg0 = {}, std::optional<Argument::copyable_reference> arg1 = {}) {
|
||||
if (inst) {
|
||||
const auto Xresult = ctx.reg_alloc.PrepareForCallReg(inst, {}, arg0, arg1);
|
||||
|
||||
if (callback.user_arg) {
|
||||
|
@ -33,6 +34,17 @@ static void CallCoprocCallback(oaknut::CodeGenerator& code, EmitContext& ctx, A3
|
|||
code.MOV(Xscratch0, reinterpret_cast<u64>(callback.function));
|
||||
code.BLR(Xscratch0);
|
||||
code.MOV(Xresult, X0);
|
||||
return;
|
||||
}
|
||||
|
||||
ctx.reg_alloc.PrepareForCall({}, arg0, arg1);
|
||||
|
||||
if (callback.user_arg) {
|
||||
code.MOV(X0, reinterpret_cast<u64>(*callback.user_arg));
|
||||
}
|
||||
|
||||
code.MOV(Xscratch0, reinterpret_cast<u64>(callback.function));
|
||||
code.BLR(Xscratch0);
|
||||
}
|
||||
|
||||
template<>
|
||||
|
|
Loading…
Reference in a new issue