summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorLéo Lam <leo@innovatetechnologi.es>2017-09-21 22:09:54 +0200
committerLéo Lam <leo@innovatetechnologi.es>2017-09-24 20:48:28 +0200
commit017bfcda2be6683af57bedc972e6da2d37534784 (patch)
tree0a29ee0386f0d4d70cb78164dd72c3515aa28191 /Source/Core
parent7c01127ac6b37728be435a82ae6d7a2939cf81c7 (diff)
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.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/DSP/DSPHWInterface.cpp2
-rw-r--r--Source/Core/Core/DSP/DSPHWInterface.h2
-rw-r--r--Source/Core/Core/DSP/Jit/DSPJitUtil.cpp2
3 files changed, 3 insertions, 3 deletions
diff --git a/Source/Core/Core/DSP/DSPHWInterface.cpp b/Source/Core/Core/DSP/DSPHWInterface.cpp
index c965233a8e..0e773b8b4b 100644
--- a/Source/Core/Core/DSP/DSPHWInterface.cpp
+++ b/Source/Core/Core/DSP/DSPHWInterface.cpp
@@ -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);
diff --git a/Source/Core/Core/DSP/DSPHWInterface.h b/Source/Core/Core/DSP/DSPHWInterface.h
index 329851fb9a..8c68e1c834 100644
--- a/Source/Core/Core/DSP/DSPHWInterface.h
+++ b/Source/Core/Core/DSP/DSPHWInterface.h
@@ -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
diff --git a/Source/Core/Core/DSP/Jit/DSPJitUtil.cpp b/Source/Core/Core/DSP/Jit/DSPJitUtil.cpp
index 842362c1fb..476637badb 100644
--- a/Source/Core/Core/DSP/Jit/DSPJitUtil.cpp
+++ b/Source/Core/Core/DSP/Jit/DSPJitUtil.cpp
@@ -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();