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:
Gregory Hainaut 2016-07-27 23:25:12 +02:00
parent cc15a9480b
commit 90707f8d4e
2 changed files with 6 additions and 1 deletions

View File

@ -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

View File

@ -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();