DSP: Fix gdsp_ifx_write to take a u16 value

And change the JIT to clear the upper 16 bits when calling the write
function to work around bugs in some compilers like clang.
This commit is contained in:
Léo Lam 2017-09-21 22:09:54 +02:00
parent 7c01127ac6
commit 017bfcda2b
3 changed files with 3 additions and 3 deletions

View File

@ -98,7 +98,7 @@ u16 gdsp_mbox_read_l(Mailbox mbx)
return (u16)value;
}
void gdsp_ifx_write(u32 addr, u32 val)
void gdsp_ifx_write(u32 addr, u16 val)
{
g_dsp_cap->LogIFXWrite(addr, val);

View File

@ -22,6 +22,6 @@ u16 gdsp_mbox_read_h(Mailbox mbx);
u16 gdsp_mbox_read_l(Mailbox mbx);
void gdsp_ifx_init();
void gdsp_ifx_write(u32 addr, u32 val);
void gdsp_ifx_write(u32 addr, u16 val);
u16 gdsp_ifx_read(u16 addr);
} // namespace DSP

View File

@ -530,9 +530,9 @@ void DSPEmitter::dmem_write(X64Reg value)
FixupBranch end = J(true);
// else if (saddr == 0xf)
SetJumpTarget(ifx);
// Does it mean gdsp_ifx_write needs u32 rather than u16?
DSPJitRegCache c(m_gpr);
X64Reg abisafereg = m_gpr.MakeABICallSafe(value);
MOVZX(32, 16, abisafereg, R(abisafereg));
m_gpr.PushRegs();
ABI_CallFunctionRR(gdsp_ifx_write, EAX, abisafereg);
m_gpr.PopRegs();