From dc3515592e47ff28712045727c8811ace330125a Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sat, 14 Jun 2014 01:59:45 +0200 Subject: [PATCH] SSE2: Adjust accessor --HG-- branch : sse2 --- code/nel/include/nel/misc/vectorf_accessors.h | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/code/nel/include/nel/misc/vectorf_accessors.h b/code/nel/include/nel/misc/vectorf_accessors.h index b150bed8e..a82b1d17e 100644 --- a/code/nel/include/nel/misc/vectorf_accessors.h +++ b/code/nel/include/nel/misc/vectorf_accessors.h @@ -688,23 +688,9 @@ NL_FORCE_INLINE void swapW(CVector4F &left, CVector4F &right) } -NL_FORCE_INLINE CVector toVector(const CVector3F &v) +NL_FORCE_INLINE const CVector &toVector(const CVector3F &v) { -#ifdef NL_HAS_SSE2 - union { __m128 mm; float arr[4]; } temp; - temp.mm = v.mm; - CVector res; - res.x = temp.arr[0]; - res.y = temp.arr[1]; - res.z = temp.arr[2]; - return res; -#else - CVector res; - res.x = v.x; - res.y = v.y; - res.z = v.z; - return res; -#endif + return reinterpret_cast(v); } NL_FORCE_INLINE CVector3F set3F(const CVector &v)