mirror of https://github.com/PCSX2/pcsx2.git
gsdx: avoid aliasing issue
Extend GSVector to support float move Initial code likely used integer move for performance reason. However due to the nan correction, register is now in float domain.
This commit is contained in:
parent
cc15a9480b
commit
90707f8d4e
|
@ -530,7 +530,7 @@ void GSState::GIFPackedRegHandlerSTQ(const GIFPackedReg* RESTRICT r)
|
|||
// Suikoden 4 creates some nan for Q. Let's avoid undefined behavior (See GIFRegHandlerRGBAQ)
|
||||
q = GSVector4i::cast(GSVector4::cast(q).replace_nan(GSVector4::m_max));
|
||||
|
||||
*(int*)&m_q = GSVector4i::store(q);
|
||||
GSVector4::store(&m_q, GSVector4::cast(q));
|
||||
|
||||
ASSERT(!std::isnan(m_v.ST.S)); // See GIFRegHandlerRGBAQ
|
||||
ASSERT(!std::isnan(m_v.ST.T)); // See GIFRegHandlerRGBAQ
|
||||
|
|
|
@ -3100,6 +3100,11 @@ GSVector.h:2973:15: error: shadows template parm 'int i'
|
|||
else _mm_storeu_ps((float*)p, v.m);
|
||||
}
|
||||
|
||||
__forceinline static void store(float* p, const GSVector4& v)
|
||||
{
|
||||
_mm_store_ss(p, v.m);
|
||||
}
|
||||
|
||||
__forceinline static void expand(const GSVector4i& v, GSVector4& a, GSVector4& b, GSVector4& c, GSVector4& d)
|
||||
{
|
||||
GSVector4i mask = GSVector4i::x000000ff();
|
||||
|
|
Loading…
Reference in New Issue