mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 11:36:13 +00:00
Cb fix
This commit is contained in:
parent
ed55011ede
commit
8cde1c18c4
2 changed files with 26 additions and 8 deletions
|
@ -288,7 +288,7 @@ public:
|
|||
const XmmLink& XmmGet(s8 reg, s8 target = -1) // get xmm register with specific SPU reg
|
||||
{
|
||||
assert(reg >= 0);
|
||||
XmmLink* res = nullptr;
|
||||
const XmmLink* res = nullptr;
|
||||
if (reg == target)
|
||||
{
|
||||
for (u32 i = 0; i < 16; i++)
|
||||
|
@ -311,7 +311,7 @@ public:
|
|||
}
|
||||
if (!res)
|
||||
{
|
||||
res = &(XmmLink&)XmmAlloc(target);
|
||||
res = &XmmAlloc(target);
|
||||
/*if (target != res->reg)
|
||||
{
|
||||
c.movdqa(*res->data, cpu_xmm(GPR[reg]));
|
||||
|
@ -327,7 +327,7 @@ public:
|
|||
c.movdqa(*res->data, cpu_xmm(GPR[reg]));
|
||||
}
|
||||
}
|
||||
res->reg = -1; // ???
|
||||
const_cast<XmmLink*>(res)->reg = -1; // ???
|
||||
LOG4_OPCODE("* cached GPR[%d] not found", reg);
|
||||
}
|
||||
return *res;
|
||||
|
@ -335,9 +335,9 @@ public:
|
|||
|
||||
const XmmLink& XmmCopy(const XmmLink& from, s8 pref = -1) // XmmAlloc + mov
|
||||
{
|
||||
XmmLink* res = &(XmmLink&)XmmAlloc(pref);
|
||||
const XmmLink* res = &XmmAlloc(pref);
|
||||
c.movdqa(*res->data, *from.data);
|
||||
res->reg = -1; // ???
|
||||
const_cast<XmmLink*>(res)->reg = -1; // ???
|
||||
LOG4_OPCODE("*");
|
||||
return *res;
|
||||
}
|
||||
|
|
|
@ -21,15 +21,33 @@ namespace vm
|
|||
}
|
||||
};
|
||||
|
||||
template<typename AT, typename RT, typename... T>
|
||||
RT _ptr_base<RT(*)(T...), 1, AT>::operator ()(T... args) const
|
||||
template<typename RT>
|
||||
struct _func_res
|
||||
{
|
||||
static_assert(!std::is_floating_point<RT>::value, "TODO: Unsupported callback result type (floating point)");
|
||||
static_assert(!std::is_same<RT, u128>::value, "TODO: Unsupported callback result type (vector)");
|
||||
|
||||
static_assert(sizeof(RT) <= 8, "Invalid callback result type");
|
||||
static_assert(!std::is_pointer<RT>::value, "Invalid callback result type (pointer)");
|
||||
static_assert(!std::is_reference<RT>::value, "Invalid callback result type (reference)");
|
||||
|
||||
return (RT)GetCurrentPPUThread().FastCall(vm::read32(m_addr), vm::read32(m_addr + 4), _func_arg<T>::get_value(args)...);
|
||||
__forceinline static RT get_value(const u64 res)
|
||||
{
|
||||
return (RT&)res;
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct _func_res<void>
|
||||
{
|
||||
__forceinline static void get_value(const u64 res)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
template<typename AT, typename RT, typename... T>
|
||||
RT _ptr_base<RT(*)(T...), 1, AT>::operator ()(T... args) const
|
||||
{
|
||||
return _func_res<RT>::get_value(GetCurrentPPUThread().FastCall(vm::read32(m_addr), vm::read32(m_addr + 4), _func_arg<T>::get_value(args)...));
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue