diff --git a/code/nel/include/nel/misc/vectorf.h b/code/nel/include/nel/misc/vectorf.h new file mode 100644 index 000000000..9443d2717 --- /dev/null +++ b/code/nel/include/nel/misc/vectorf.h @@ -0,0 +1,57 @@ +/* + +Copyright (c) 2010-2014, Jan BOON +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#ifndef NLMISC_VECTORF_H +#define NLMISC_VECTORF_H +#include "types_nl.h" + +// System includes +#ifdef NL_HAS_SSE2 +# include +# include +#endif + +// STL includes + +// NLMISC includes +#include "vectorf_types.h" +#include "vectorf_misc.h" +#include "vectorf_swizzle.h" +#include "vectorf_accessors.h" +#include "vectorf_math.h" +#include "vectorf_operators.h" + +// Project includes + +namespace NLMISC { + +} /* namespace NLMISC */ + +#endif /* #ifndef NLMISC_VECTORF_H */ + +/* end of file */ diff --git a/code/nel/include/nel/misc/vectorf_accessors.h b/code/nel/include/nel/misc/vectorf_accessors.h new file mode 100644 index 000000000..099d7f48b --- /dev/null +++ b/code/nel/include/nel/misc/vectorf_accessors.h @@ -0,0 +1,694 @@ +/* + +Copyright (c) 2010-2014, Jan BOON +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#ifndef NLMISC_VECTORF_ACCESSORS_H +#define NLMISC_VECTORF_ACCESSORS_H +#include "types_nl.h" + +// System includes +#ifdef NL_HAS_SSE2 +# include +# include +#endif + +// STL includes + +// NLMISC includes + +// Project includes + +namespace NLMISC { + +NL_FORCE_INLINE float getX(const CVector1F &v) +{ +#ifdef NL_HAS_SSE2 + return _mm_cvtss_f32(v.mm); +#else + return v.x; +#endif +} + +NL_FORCE_INLINE float getX(const CVector2F &v) +{ +#ifdef NL_HAS_SSE2 + return _mm_cvtss_f32(v.mm); +#else + return v.x; +#endif +} + +NL_FORCE_INLINE float getY(const CVector2F &v) +{ +#ifdef NL_HAS_SSE2 + CVector2F g; + g.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 1, 1, 1)); + return _mm_cvtss_f32(g.mm); +#else + return v.y; +#endif +} + +NL_FORCE_INLINE float getX(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + return _mm_cvtss_f32(v.mm); +#else + return v.x; +#endif +} + +NL_FORCE_INLINE float getY(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F g; + g.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 1, 1, 1)); + return _mm_cvtss_f32(g.mm); +#else + return v.y; +#endif +} + +NL_FORCE_INLINE float getZ(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F g; + g.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 2, 2, 2)); + return _mm_cvtss_f32(g.mm); +#else + return v.z; +#endif +} + +NL_FORCE_INLINE float getX(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + return _mm_cvtss_f32(v.mm); +#else + return v.x; +#endif +} + +NL_FORCE_INLINE float getY(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F g; + g.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 1, 1, 1)); + return _mm_cvtss_f32(g.mm); +#else + return v.y; +#endif +} + +NL_FORCE_INLINE float getZ(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F g; + g.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 2, 2, 2)); + return _mm_cvtss_f32(g.mm); +#else + return v.z; +#endif +} + +NL_FORCE_INLINE float getW(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F g; + g.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 3, 3, 3)); + return _mm_cvtss_f32(g.mm); +#else + return v.w; +#endif +} + +NL_FORCE_INLINE CVector2F setX(const CVector2F &src, const float x) +{ +#ifdef NL_HAS_SSE2 + CVector1F v1x; + v1x.mm = _mm_set_ss(x); + CVector2F result; + result.mm = _mm_move_ss(src.mm, v1x.mm); + return result; +#else + CVector2F result = src; + result.x = x; + return result; +#endif +} + +NL_FORCE_INLINE CVector3F setX(const CVector3F &src, const float x) +{ +#ifdef NL_HAS_SSE2 + CVector1F v1x; + v1x.mm = _mm_set_ss(x); + CVector3F result; + result.mm = _mm_move_ss(src.mm, v1x.mm); + return result; +#else + CVector3F result = src; + result.x = x; + return result; +#endif +} + +NL_FORCE_INLINE CVector4F setX(const CVector4F &src, const float x) +{ +#ifdef NL_HAS_SSE2 + CVector1F v1x; + v1x.mm = _mm_set_ss(x); + CVector4F result; + result.mm = _mm_move_ss(src.mm, v1x.mm); + return result; +#else + CVector4F result = src; + result.x = x; + return result; +#endif +} + + + +NL_FORCE_INLINE CVector2F setY(const CVector2F &src, const float y) +{ +#ifdef NL_HAS_SSE2 + return yx(setX(yx(src), y)); +#else + CVector2F result = src; + result.y = y; + return result; +#endif +} + +NL_FORCE_INLINE CVector3F setY(const CVector3F &src, const float y) +{ +#ifdef NL_HAS_SSE2 + return yxz(setX(yxz(src), y)); +#else + CVector3F result = src; + result.y = y; + return result; +#endif +} + +NL_FORCE_INLINE CVector4F setY(const CVector4F &src, const float y) +{ +#ifdef NL_HAS_SSE2 + return yxzw(setX(yxzw(src), y)); +#else + CVector4F result = src; + result.y = y; + return result; +#endif +} + + + +NL_FORCE_INLINE CVector3F setZ(const CVector3F &src, const float z) +{ +#ifdef NL_HAS_SSE2 + return zyx(setX(zyx(src), z)); +#else + CVector3F result = src; + result.z = z; + return result; +#endif +} + +NL_FORCE_INLINE CVector4F setZ(const CVector4F &src, const float z) +{ +#ifdef NL_HAS_SSE2 + return zyxw(setX(zyxw(src), z)); +#else + CVector4F result = src; + result.z = z; + return result; +#endif +} + + + +NL_FORCE_INLINE CVector4F setW(const CVector4F &src, const float w) +{ +#ifdef NL_HAS_SSE2 + return wyzx(setX(wyzx(src), w)); +#else + CVector4F result = src; + result.w = w; + return result; +#endif +} + + + +NL_FORCE_INLINE CVector2F splat2F(const float v) +{ +#ifdef NL_HAS_SSE2 + CVector2F s; + s.mm = _mm_set_ps1(v); + return s; +#else + CVector2F s; + s.x = v; + s.y = v; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F splat3F(const float v) +{ +#ifdef NL_HAS_SSE2 + CVector3F s; + s.mm = _mm_set_ps1(v); + return s; +#else + CVector3F s; + s.x = v; + s.y = v; + s.z = v; + return s; +#endif +} + + + +NL_FORCE_INLINE CVector1F set1F(const float x) +{ +#ifdef NL_HAS_SSE2 + CVector1F s; + s.mm = _mm_set_ss(x); + return s; +#else + CVector1F s; + s.x = x; + return s; +#endif +} + +NL_FORCE_INLINE CVector2F set2F(const float x, const float y) +{ +#ifdef NL_HAS_SSE2 + CVector2F s; + s.mm = _mm_setr_ps(x, y, 0.0f, 0.0f); + return s; +#else + CVector2F s; + s.x = x; + s.y = y; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F set3F(const CVector1F &x, const CVector1F &y, const CVector1F &z) +{ + // todo: optimize +#ifdef NL_HAS_SSE2 + CVector3F s; + s.mm = _mm_setr_ps(getX(x), getX(y), getX(z), 0.0f); + return s; +#else + CVector3F s; + s.x = getX(x); + s.y = getX(y); + s.z = getX(z); + return s; +#endif +} + +NL_FORCE_INLINE CVector3F set3F(const float x, const float y, const float z) +{ +#ifdef NL_HAS_SSE2 + CVector3F s; + s.mm = _mm_setr_ps(x, y, z, 0.0f); + return s; +#else + CVector3F s; + s.x = x; + s.y = y; + s.z = z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F set4F(const CVector2F &xy) +{ +#ifdef NL_HAS_SSE2 + CVector4F s; + s.mm = xy.mm; // z, w "undefined" + return s; +#else + CVector4F s; + s.x = getX(xy); + s.y = getY(xy); + // s.z = 0.0f; + // s.w = 0.0f; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F set4F(const CVector3F &xyz) +{ +#ifdef NL_HAS_SSE2 + CVector4F s; + s.mm = xyz.mm; // w "undefined" + return s; +#else + CVector4F s; + s.x = getX(xyz); + s.y = getY(xyz); + s.z = getZ(xyz); + // s.w = 0.0f; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F set4F(const CVector3F &xyz, const float w) +{ +#ifdef NL_HAS_SSE2 + CVector4F s; + s.mm = xyz.mm; + s = setW(s, w); + return s; +#else + CVector4F s; + s.x = getX(xyz); + s.y = getY(xyz); + s.z = getZ(xyz); + s.w = w; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F set4F(const float x, const float y, const float z, const float w) +{ +#ifdef NL_HAS_SSE2 + CVector4F s; + s.mm = _mm_setr_ps(x, y, z, w); + return s; +#else + CVector4F s; + s.x = x; + s.y = y; + s.z = z; + s.w = w; + return s; +#endif +} + +NL_FORCE_INLINE CVector1F zero1F() +{ +#ifdef NL_HAS_SSE2 + CVector1F z; + z.mm = _mm_setzero_ps(); + return z; +#else + CVector1F z; + z.x = 0.0f; + return z; +#endif +} + +NL_FORCE_INLINE CVector2F zero2F() +{ +#ifdef NL_HAS_SSE2 + CVector2F z; + z.mm = _mm_setzero_ps(); + return z; +#else + CVector2F z; + z.x = 0.0f; + z.y = 0.0f; + return z; +#endif +} + +NL_FORCE_INLINE CVector3F zero3F() +{ +#ifdef NL_HAS_SSE2 + CVector3F z; + z.mm = _mm_setzero_ps(); + return z; +#else + CVector3F z; + z.x = 0.0f; + z.y = 0.0f; + z.z = 0.0f; + return z; +#endif +} + + +NL_FORCE_INLINE CVector4F zero4F() +{ +#ifdef NL_HAS_SSE2 + CVector4F z; + z.mm = _mm_setzero_ps(); + return z; +#else + CVector4F z; + z.x = 0.0f; + z.y = 0.0f; + z.z = 0.0f; + z.w = 0.0f; + return z; +#endif +} + +NL_FORCE_INLINE CVector4F splat4F(const float v) +{ +#ifdef NL_HAS_SSE2 + CVector4F s; + s.mm = _mm_set_ps1(v); + return s; +#else + CVector4F s; + s.x = v; + s.y = v; + s.z = v; + s.w = v; + return s; +#endif +} + + +NL_FORCE_INLINE CVector4F to4F(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F r; + r.mm = v.mm; + return r; +#else + CVector4F dst; + dst.x = v.x; + dst.y = v.y; + dst.z = v.z; + dst.w = 0.0f; + return dst; +#endif +} + + +NL_FORCE_INLINE CVector3F to3F(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F r; + r.mm = v.mm; + return r; +#else + CVector3F dst; + dst.x = v.x; + dst.y = v.y; + dst.z = v.z; + return dst; +#endif +} + + + +NL_FORCE_INLINE void swapX(CVector1F &left, CVector1F &right) +{ +#ifdef NL_HAS_SSE2 + CVector1F cache = left; + left.mm = _mm_move_ss(left.mm, right.mm); + right.mm = _mm_move_ss(right.mm, cache.mm); +#else + float x = getX(left); + left = set1F(getX(right)); + right = set1F(x); +#endif +} + +NL_FORCE_INLINE void swapX(CVector2F &left, CVector2F &right) +{ +#ifdef NL_HAS_SSE2 + CVector2F cache = left; + left.mm = _mm_move_ss(left.mm, right.mm); + right.mm = _mm_move_ss(right.mm, cache.mm); +#else + float x = getX(left); + left = setX(left, getX(right)); + right = setX(right, x); +#endif +} + +NL_FORCE_INLINE void swapX(CVector3F &left, CVector3F &right) +{ +#ifdef NL_HAS_SSE2 + CVector3F cache = left; + left.mm = _mm_move_ss(left.mm, right.mm); + right.mm = _mm_move_ss(right.mm, cache.mm); +#else + float x = getX(left); + left = setX(left, getX(right)); + right = setX(right, x); +#endif +} + +NL_FORCE_INLINE void swapX(CVector4F &left, CVector4F &right) +{ +#ifdef NL_HAS_SSE2 + CVector4F cache = left; + left.mm = _mm_move_ss(left.mm, right.mm); + right.mm = _mm_move_ss(right.mm, cache.mm); +#else + float x = getX(left); + left = setX(left, getX(right)); + right = setX(right, x); +#endif +} + + +NL_FORCE_INLINE void swapY(CVector2F &left, CVector2F &right) +{ +#ifdef NL_HAS_SSE2 + left = yx(left); + right = yx(right); + CVector2F cache = left; + left.mm = _mm_move_ss(left.mm, right.mm); + right.mm = _mm_move_ss(right.mm, cache.mm); + left = yx(left); + right = yx(right); +#else + float y = getY(left); + left = setY(left, getY(right)); + right = setY(right, y); +#endif +} + +NL_FORCE_INLINE void swapY(CVector3F &left, CVector3F &right) +{ +#ifdef NL_HAS_SSE2 + left = yxz(left); + right = yxz(right); + CVector3F cache = left; + left.mm = _mm_move_ss(left.mm, right.mm); + right.mm = _mm_move_ss(right.mm, cache.mm); + left = yxz(left); + right = yxz(right); +#else + float y = getY(left); + left = setY(left, getY(right)); + right = setY(right, y); +#endif +} + +NL_FORCE_INLINE void swapY(CVector4F &left, CVector4F &right) +{ +#ifdef NL_HAS_SSE2 + left = yxzw(left); + right = yxzw(right); + CVector4F cache = left; + left.mm = _mm_move_ss(left.mm, right.mm); + right.mm = _mm_move_ss(right.mm, cache.mm); + left = yxzw(left); + right = yxzw(right); +#else + float y = getY(left); + left = setY(left, getY(right)); + right = setY(right, y); +#endif +} + + +NL_FORCE_INLINE void swapZ(CVector3F &left, CVector3F &right) +{ +#ifdef NL_HAS_SSE2 + left = zyx(left); + right = zyx(right); + CVector3F cache = left; + left.mm = _mm_move_ss(left.mm, right.mm); + right.mm = _mm_move_ss(right.mm, cache.mm); + left = zyx(left); + right = zyx(right); +#else + float z = getZ(left); + left = setZ(left, getZ(right)); + right = setZ(right, z); +#endif +} + +NL_FORCE_INLINE void swapZ(CVector4F &left, CVector4F &right) +{ +#ifdef NL_HAS_SSE2 + left = zyxw(left); + right = zyxw(right); + CVector4F cache = left; + left.mm = _mm_move_ss(left.mm, right.mm); + right.mm = _mm_move_ss(right.mm, cache.mm); + left = zyxw(left); + right = zyxw(right); +#else + float z = getZ(left); + left = setZ(left, getZ(right)); + right = setZ(right, z); +#endif +} + + +NL_FORCE_INLINE void swapW(CVector4F &left, CVector4F &right) +{ +#ifdef NL_HAS_SSE2 + left = wyzx(left); + right = wyzx(right); + CVector4F cache = left; + left.mm = _mm_move_ss(left.mm, right.mm); + right.mm = _mm_move_ss(right.mm, cache.mm); + left = wyzx(left); + right = wyzx(right); +#else + float w = getW(left); + left = setW(left, getW(right)); + right = setW(right, w); +#endif +} + + +} /* namespace NLMISC */ + +#endif /* #ifndef NLMISC_VECTORF_ACCESSORS_H */ + +/* end of file */ diff --git a/code/nel/include/nel/misc/vectorf_math.h b/code/nel/include/nel/misc/vectorf_math.h new file mode 100644 index 000000000..98077c0cf --- /dev/null +++ b/code/nel/include/nel/misc/vectorf_math.h @@ -0,0 +1,711 @@ +/* + +Copyright (c) 2010-2014, Jan BOON +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#ifndef NLMISC_VECTORF_MATH_H +#define NLMISC_VECTORF_MATH_H +#include "types_nl.h" + +// System includes +#ifdef NL_HAS_SSE2 +# include +# include +#endif +#include + +// STL includes + +// NLMISC includes +#include "types_nl.h" + +// Project includes + +#ifdef min +# undef min +#endif +#ifdef max +# undef max +#endif + +namespace NLMISC { + +NL_FORCE_INLINE CVector1F add(const CVector1F &l, const CVector1F &r) +{ +#ifdef NL_HAS_SSE2 + CVector1F m; + m.mm = _mm_add_ss(l.mm, r.mm); + return m; +#else + CVector1F a; + a.x = l.x + r.x; + return a; +#endif +} + +NL_FORCE_INLINE CVector2F add(const CVector2F &l, const CVector2F &r) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = _mm_add_ps(l.mm, r.mm); + return m; +#else + CVector2F a; + a.x = l.x + r.x; + a.y = l.y + r.y; + return a; +#endif +} + +NL_FORCE_INLINE CVector3F add(const CVector3F &l, const CVector3F &r) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_add_ps(l.mm, r.mm); + return m; +#else + CVector3F a; + a.x = l.x + r.x; + a.y = l.y + r.y; + a.z = l.z + r.z; + return a; +#endif +} + +NL_FORCE_INLINE CVector4F add(const CVector4F &l, const CVector4F &r) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_add_ps(l.mm, r.mm); + return m; +#else + CVector4F a; + a.x = l.x + r.x; + a.y = l.y + r.y; + a.z = l.z + r.z; + a.w = l.w + r.w; + return a; +#endif +} + + + + + +NL_FORCE_INLINE CVector1F sub(const CVector1F &l, const CVector1F &r) +{ +#ifdef NL_HAS_SSE2 + CVector1F m; + m.mm = _mm_sub_ss(l.mm, r.mm); + return m; +#else + CVector1F a; + a.x = l.x - r.x; + return a; +#endif +} + +NL_FORCE_INLINE CVector2F sub(const CVector2F &l, const CVector2F &r) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = _mm_sub_ps(l.mm, r.mm); + return m; +#else + CVector2F a; + a.x = l.x - r.x; + a.y = l.y - r.y; + return a; +#endif +} + +NL_FORCE_INLINE CVector3F sub(const CVector3F &l, const CVector3F &r) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_sub_ps(l.mm, r.mm); + return m; +#else + CVector3F a; + a.x = l.x - r.x; + a.y = l.y - r.y; + a.z = l.z - r.z; + return a; +#endif +} + +NL_FORCE_INLINE CVector4F sub(const CVector4F &l, const CVector4F &r) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_sub_ps(l.mm, r.mm); + return m; +#else + CVector4F a; + a.x = l.x - r.x; + a.y = l.y - r.y; + a.z = l.z - r.z; + a.w = l.w - r.w; + return a; +#endif +} + + + + + +NL_FORCE_INLINE CVector1F mul(const CVector1F &l, const CVector1F &r) +{ +#ifdef NL_HAS_SSE2 + CVector1F m; + m.mm = _mm_mul_ss(l.mm, r.mm); + return m; +#else + CVector1F a; + a.x = l.x * r.x; + return a; +#endif +} + +NL_FORCE_INLINE CVector2F mul(const CVector2F &l, const CVector2F &r) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = _mm_mul_ps(l.mm, r.mm); + return m; +#else + CVector2F a; + a.x = l.x * r.x; + a.y = l.y * r.y; + return a; +#endif +} + +NL_FORCE_INLINE CVector3F mul(const CVector3F &l, const CVector3F &r) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_mul_ps(l.mm, r.mm); + return m; +#else + CVector3F a; + a.x = l.x * r.x; + a.y = l.y * r.y; + a.z = l.z * r.z; + return a; +#endif +} + +NL_FORCE_INLINE CVector4F mul(const CVector4F &l, const CVector4F &r) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_mul_ps(l.mm, r.mm); + return m; +#else + CVector4F a; + a.x = l.x * r.x; + a.y = l.y * r.y; + a.z = l.z * r.z; + a.w = l.w * r.w; + return a; +#endif +} + + + + + +NL_FORCE_INLINE CVector1F div(const CVector1F &l, const CVector1F &r) +{ +#ifdef NL_HAS_SSE2 + CVector1F m; + m.mm = _mm_div_ss(l.mm, r.mm); + return m; +#else + CVector1F a; + a.x = l.x / r.x; + return a; +#endif +} + +NL_FORCE_INLINE CVector2F div(const CVector2F &l, const CVector2F &r) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = _mm_div_ps(l.mm, r.mm); + return m; +#else + CVector2F a; + a.x = l.x / r.x; + a.y = l.y / r.y; + return a; +#endif +} + +NL_FORCE_INLINE CVector3F div(const CVector3F &l, const CVector3F &r) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_div_ps(l.mm, r.mm); + return m; +#else + CVector3F a; + a.x = l.x / r.x; + a.y = l.y / r.y; + a.z = l.z / r.z; + return a; +#endif +} + +NL_FORCE_INLINE CVector4F div(const CVector4F &l, const CVector4F &r) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_div_ps(l.mm, r.mm); + return m; +#else + CVector4F a; + a.x = l.x / r.x; + a.y = l.y / r.y; + a.z = l.z / r.z; + a.w = l.w / r.w; + return a; +#endif +} + + + + + +NL_FORCE_INLINE CVector1F sqrtF(const CVector1F &v) +{ +#if (NL_HAS_SSE2 && NL_HAS_SSE2) + CVector1F s; + s.mm = _mm_sqrt_ss(v.mm); + return s; +#else + CVector1F s; + s.x = sqrtf(v.x); + return s; +#endif +} + +NL_FORCE_INLINE CVector2F sqrtF(const CVector2F &v) +{ +#if (NL_HAS_SSE2 && NL_HAS_SSE2) + CVector2F s; + s.mm = _mm_sqrt_ps(v.mm); + return s; +#else + CVector2F s; + s.x = sqrtf(v.x); + s.y = sqrtf(v.y); + return s; +#endif +} + +NL_FORCE_INLINE CVector3F sqrtF(const CVector3F &v) +{ +#if (NL_HAS_SSE2 && NL_HAS_SSE2) + CVector3F s; + s.mm = _mm_sqrt_ps(v.mm); + return s; +#else + CVector3F s; + s.x = sqrtf(v.x); + s.y = sqrtf(v.y); + s.z = sqrtf(v.z); + return s; +#endif +} + +NL_FORCE_INLINE CVector4F sqrtF(const CVector4F &v) +{ +#if (NL_HAS_SSE2 && NL_HAS_SSE2) + CVector4F s; + s.mm = _mm_sqrt_ps(v.mm); + return s; +#else + CVector4F s; + s.x = sqrtf(v.x); + s.y = sqrtf(v.y); + s.z = sqrtf(v.z); + s.w = sqrtf(v.w); + return s; +#endif +} + + + +NL_FORCE_INLINE CVector1F accumulate(const CVector2F &v) +{ +#ifdef NL_HAS_SSE2 + return add(x(v), y(v)); +#else + CVector1F result; + result.x = v.x + v.y; + return result; +#endif +} + +NL_FORCE_INLINE CVector1F accumulate(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + return add(add(x(v), y(v)), z(v)); +#else + CVector1F result; + result.x = v.x + v.y + v.z; + return result; +#endif +} + +NL_FORCE_INLINE CVector1F accumulate(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + return accumulate(add(xy(v), zw(v))); +#else + CVector1F result; + result.x = v.x + v.y + v.z + v.w; + return result; +#endif +} + + + +NL_FORCE_INLINE CVector3F cross(const CVector3F &l, const CVector3F &r) +{ + return sub(mul(yzx(l), zxy(r)), mul(zxy(l), yzx(r))); +} + + + +NL_FORCE_INLINE CVector1F dot(const CVector2F &l, const CVector2F &r) +{ + CVector2F mult = mul(l, r); + CVector1F result = accumulate(mult); + return result; +} + +NL_FORCE_INLINE CVector1F dot(const CVector3F &l, const CVector3F &r) +{ + CVector3F mult = mul(l, r); + CVector1F result = accumulate(mult); + return result; +} + +NL_FORCE_INLINE CVector2F dotSplat(const CVector2F &l, const CVector2F &r) +{ + return xx(dot(l, r)); +} + +NL_FORCE_INLINE CVector3F dotSplat(const CVector3F &l, const CVector3F &r) +{ + return xxx(dot(l, r)); +} + +NL_FORCE_INLINE CVector1F lengthSq(const CVector2F &v) +{ + return dot(v, v); +} + +NL_FORCE_INLINE CVector1F lengthSq(const CVector3F &v) +{ + return dot(v, v); +} + +NL_FORCE_INLINE CVector2F lengthSqSplat(const CVector2F &v) +{ + return dotSplat(v, v); +} + +NL_FORCE_INLINE CVector3F lengthSqSplat(const CVector3F &v) +{ + return dotSplat(v, v); +} + +NL_FORCE_INLINE CVector1F length(const CVector2F &v) +{ + return sqrtF(lengthSq(v)); +} + +NL_FORCE_INLINE CVector1F length(const CVector3F &v) +{ + return sqrtF(lengthSq(v)); +} + +NL_FORCE_INLINE CVector2F lengthSplat(const CVector2F &v) +{ + return xx(length(v)); +} + +NL_FORCE_INLINE CVector3F lengthSplat(const CVector3F &v) +{ + return xxx(length(v)); +} + + +NL_FORCE_INLINE CVector2F normalize(const CVector2F &v) +{ + return div(v, lengthSplat(v)); +} + +NL_FORCE_INLINE CVector3F normalize(const CVector3F &v) +{ + return div(v, lengthSplat(v)); +} + +NL_FORCE_INLINE CVector1F minF(const CVector1F &l, const CVector1F &r) +{ +#ifdef NL_HAS_SSE2 + CVector1F m; + m.mm = _mm_min_ss(l.mm, r.mm); + return m; +#else + CVector1F m; + m.x = min(l.x, r.x); + return m; +#endif +} + +NL_FORCE_INLINE CVector1F maxF(const CVector1F &l, const CVector1F &r) +{ +#ifdef NL_HAS_SSE2 + CVector1F m; + m.mm = _mm_max_ss(l.mm, r.mm); + return m; +#else + CVector1F m; + m.x = max(l.x, r.x); + return m; +#endif +} + +NL_FORCE_INLINE CVector2F minF(const CVector2F &l, const CVector2F &r) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = _mm_min_ps(l.mm, r.mm); + return m; +#else + CVector2F m; + m.x = min(l.x, r.x); + m.y = min(l.y, r.y); + return m; +#endif +} + +NL_FORCE_INLINE CVector2F maxF(const CVector2F &l, const CVector2F &r) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = _mm_max_ps(l.mm, r.mm); + return m; +#else + CVector2F m; + m.x = max(l.x, r.x); + m.y = max(l.y, r.y); + return m; +#endif +} + +NL_FORCE_INLINE CVector3F minF(const CVector3F &l, const CVector3F &r) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_min_ps(l.mm, r.mm); + return m; +#else + CVector3F m; + m.x = min(l.x, r.x); + m.y = min(l.y, r.y); + m.z = min(l.z, r.z); + return m; +#endif +} + +NL_FORCE_INLINE CVector3F maxF(const CVector3F &l, const CVector3F &r) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_max_ps(l.mm, r.mm); + return m; +#else + CVector3F m; + m.x = max(l.x, r.x); + m.y = max(l.y, r.y); + m.z = max(l.z, r.z); + return m; +#endif +} + + +NL_FORCE_INLINE CVector4F minF(const CVector4F &l, const CVector4F &r) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_min_ps(l.mm, r.mm); + return m; +#else + CVector4F m; + m.x = min(l.x, r.x); + m.y = min(l.y, r.y); + m.z = min(l.z, r.z); + m.w = min(l.w, r.w); + return m; +#endif +} + +NL_FORCE_INLINE CVector4F maxF(const CVector4F &l, const CVector4F &r) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_max_ps(l.mm, r.mm); + return m; +#else + CVector4F m; + m.x = max(l.x, r.x); + m.y = max(l.y, r.y); + m.z = max(l.z, r.z); + m.w = max(l.w, r.w); + return m; +#endif +} + + +NL_FORCE_INLINE CVector3F average(const CVector3F &v0, const CVector3F &v1) +{ + CVector3F divider = splat3F(1.0f / 2.0f); + return mul(add(v0, v1), divider); +} + +NL_FORCE_INLINE CVector3F average(const CVector3F &v0, const CVector3F &v1, const CVector3F &v2) +{ + CVector3F divider = splat3F(1.0f / 3.0f); + return mul(add(add(v0, v1), v2), divider); +} + + +NL_FORCE_INLINE CVector3F average(const CVector3F &v0, const CVector3F &v1, const CVector3F &v2, const CVector3F &v3) +{ + CVector3F divider = splat3F(1.0f / 4.0f); + return mul(add(add(add(v0, v1), v2), v3), divider); +} + + + +NL_FORCE_INLINE CVector4F average(const CVector4F &v0, const CVector4F &v1) +{ + CVector4F divider = splat4F(1.0f / 2.0f); + return mul(add(v0, v1), divider); +} + +NL_FORCE_INLINE CVector4F average(const CVector4F &v0, const CVector4F &v1, const CVector4F &v2) +{ + CVector4F divider = splat4F(1.0f / 3.0f); + return mul(add(add(v0, v1), v2), divider); +} + +NL_FORCE_INLINE CVector4F average(const CVector4F &v0, const CVector4F &v1, const CVector4F &v2, const CVector4F &v3) +{ + CVector4F divider = splat4F(1.0f / 4.0f); + return mul(add(add(add(v0, v1), v2), v3), divider); +} + + + +NL_FORCE_INLINE CVector3F lerp(const CVector3F &l, const CVector3F &r, const CVector3F &a) +{ + CVector3F one = splat3F(1.0f); + CVector3F lmul = mul(l, sub(one, a)); + CVector3F rmul = mul(r, a); + return add(lmul, rmul); +} + +NL_FORCE_INLINE CVector3F lerp(const CVector3F &l, const CVector3F &r, const float a) +{ + CVector3F va = splat3F(a); + return lerp(l, r, va); +} + +NL_FORCE_INLINE CVector4F lerp(const CVector4F &l, const CVector4F &r, const CVector4F &a) +{ + CVector4F one = splat4F(1.0f); + CVector4F lmul = mul(l, sub(one, a)); + CVector4F rmul = mul(r, a); + return add(lmul, rmul); +} + +NL_FORCE_INLINE CVector4F lerp(const CVector4F &l, const CVector4F &r, const float a) +{ + CVector4F va = splat4F(a); + return lerp(l, r, va); +} + + +/* +/// Add all the elements inside one float and splat them +// accumulate() +NL_FORCE_INLINE CVector4F accumulateSplat(const CVector4F &v) +{ +#ifdef NL_HAS_SSE3 + CVector4F result; + result.mm = _mm_hadd_ps(v.mm, v.mm); + result.mm = _mm_hadd_ps(result.mm, result.mm); + return result; +#else + CVector4F result; + result.x = v.x + v.y + v.z + v.w; + result.y = result.x; + result.z = result.x; + result.w = result.x; + return result; +#endif +} +*/ + + +NL_ASSIMILATE_BI_FUNCTION(CVector2F, minF, const CVector2F &) +NL_ASSIMILATE_BI_FUNCTION(CVector2F, maxF, const CVector2F &) + +NL_ASSIMILATE_BI_FUNCTION(CVector3F, minF, const CVector3F &) +NL_ASSIMILATE_BI_FUNCTION(CVector3F, maxF, const CVector3F &) + +NL_ASSIMILATE_BI_FUNCTION(CVector4F, minF, const CVector4F &) +NL_ASSIMILATE_BI_FUNCTION(CVector4F, maxF, const CVector4F &) + + +NL_CLAMP_USING_MIN_MAX(CVector1F, const CVector1F &) +NL_CLAMP_USING_MIN_MAX(CVector2F, const CVector2F &) +NL_CLAMP_USING_MIN_MAX(CVector3F, const CVector3F &) +NL_CLAMP_USING_MIN_MAX(CVector4F, const CVector4F &) + + +} /* namespace NLMISC */ + +#endif /* #ifndef NLMISC_VECTORF_MATH_H */ + +/* end of file */ diff --git a/code/nel/include/nel/misc/vectorf_misc.h b/code/nel/include/nel/misc/vectorf_misc.h new file mode 100644 index 000000000..809da3804 --- /dev/null +++ b/code/nel/include/nel/misc/vectorf_misc.h @@ -0,0 +1,147 @@ +/* + +Copyright (c) 2010-2014, Jan BOON +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#ifndef NLMISC_VECTORF_MISC_H +#define NLMISC_VECTORF_MISC_H +#include "types_nl.h" + +// STL includes + +// NLMISC includes + +// Project includes + + + +#define NL_ASSIMILATE_BI_FUNCTION(__return_type, __function_name, __parameter_type) \ +NL_FORCE_INLINE __return_type __function_name(__parameter_type v0, __parameter_type v1, __parameter_type v2) \ +{ \ + return __function_name(__function_name(v0, v1), v2); \ +} \ + \ +NL_FORCE_INLINE __return_type __function_name(__parameter_type v0, __parameter_type v1, __parameter_type v2, __parameter_type v3) \ +{ \ + return __function_name(__function_name(__function_name(v0, v1), v2), v3); \ +} \ + \ +NL_FORCE_INLINE __return_type __function_name(__parameter_type v0, __parameter_type v1, __parameter_type v2, __parameter_type v3, __parameter_type v4) \ +{ \ + return __function_name(__function_name(__function_name(__function_name(v0, v1), v2), v3), v4); \ +} \ + \ +NL_FORCE_INLINE __return_type __function_name(__parameter_type v0, __parameter_type v1, __parameter_type v2, __parameter_type v3, __parameter_type v4, __parameter_type v5) \ +{ \ + return __function_name(__function_name(__function_name(__function_name(__function_name(v0, v1), v2), v3), v4), v5); \ +} \ + \ +NL_FORCE_INLINE __return_type __function_name(__parameter_type v0, __parameter_type v1, __parameter_type v2, __parameter_type v3, __parameter_type v4, __parameter_type v5, __parameter_type v6) \ +{ \ + return __function_name(__function_name(__function_name(__function_name(__function_name(__function_name(v0, v1), v2), v3), v4), v5), v6); \ +} \ + \ +NL_FORCE_INLINE __return_type __function_name(__parameter_type v0, __parameter_type v1, __parameter_type v2, __parameter_type v3, __parameter_type v4, __parameter_type v5, __parameter_type v6, __parameter_type v7) \ +{ \ + return __function_name(__function_name(__function_name(__function_name(__function_name(__function_name(__function_name(v0, v1), v2), v3), v4), v5), v6), v7); \ +} \ + + + +#define NL_CLAMP_USING_MIN_MAX(__return_type, __parameter_type) \ +NL_FORCE_INLINE __return_type clamp(__parameter_type value, __parameter_type minValue, __parameter_type maxValue) \ +{ \ + return minF(maxF(minValue, value), maxValue); \ +} \ + + + +#define NL_MATH_OPERATORS_USING_FUNCTIONS_ADD_SUB(__return_type, __ref_return_type, __in_parameter_type, __out_parameter_type) \ +\ +NL_FORCE_INLINE __return_type operator+(__in_parameter_type l, __in_parameter_type r) \ +{ \ + return add(l, r); \ +} \ +\ +NL_FORCE_INLINE __ref_return_type operator+=(__out_parameter_type l, __in_parameter_type r) \ +{ \ + l = add(l, r); \ + return l; \ +} \ +\ +NL_FORCE_INLINE __return_type operator-(__in_parameter_type l, __in_parameter_type r) \ +{ \ + return sub(l, r); \ +} \ +\ +NL_FORCE_INLINE __ref_return_type operator-=(__out_parameter_type l, __in_parameter_type r) \ +{ \ + l = sub(l, r); \ + return l; \ +} \ + + + +#define NL_MATH_OPERATORS_USING_FUNCTIONS_MUL_DIV(__return_type, __ref_return_type, __in_parameter_type, __out_parameter_type) \ +\ +NL_FORCE_INLINE __return_type operator*(__in_parameter_type l, __in_parameter_type r) \ +{ \ + return mul(l, r); \ +} \ +\ +NL_FORCE_INLINE __ref_return_type operator*=(__out_parameter_type l, __in_parameter_type r) \ +{ \ + l = mul(l, r); \ + return l; \ +} \ +\ +NL_FORCE_INLINE __return_type operator/(__in_parameter_type l, __in_parameter_type r) \ +{ \ + return div(l, r); \ +} \ +\ +NL_FORCE_INLINE __ref_return_type operator/=(__out_parameter_type l, __in_parameter_type r) \ +{ \ + l = div(l, r); \ + return l; \ +} \ + + + +#define NL_MATH_OPERATORS_USING_FUNCTIONS_ADD_SUB_MUL_DIV(__return_type, __ref_return_type, __in_parameter_type, __out_parameter_type) \ +\ +NL_MATH_OPERATORS_USING_FUNCTIONS_ADD_SUB(__return_type, __ref_return_type, __in_parameter_type, __out_parameter_type) \ +NL_MATH_OPERATORS_USING_FUNCTIONS_MUL_DIV(__return_type, __ref_return_type, __in_parameter_type, __out_parameter_type) \ + + + +namespace NLMISC { + +} /* namespace NLMISC */ + +#endif /* #ifndef NLMISC_VECTORF_MISC_H */ + +/* end of file */ diff --git a/code/nel/include/nel/misc/vectorf_operators.h b/code/nel/include/nel/misc/vectorf_operators.h new file mode 100644 index 000000000..106e722e9 --- /dev/null +++ b/code/nel/include/nel/misc/vectorf_operators.h @@ -0,0 +1,99 @@ +/* + +Copyright (c) 2010-2014, Jan BOON +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#ifndef NLMISC_VECTORF_OPERATORS_H +#define NLMISC_VECTORF_OPERATORS_H +#include "types_nl.h" + +// System includes +#ifdef NL_HAS_SSE2 +# include +# include +#endif + +// STL includes + +// NLMISC includes + +// Project includes + +namespace NLMISC { + + +NL_MATH_OPERATORS_USING_FUNCTIONS_ADD_SUB_MUL_DIV(CVector1F, CVector1F &, const CVector1F &, CVector1F &) +NL_MATH_OPERATORS_USING_FUNCTIONS_ADD_SUB(CVector2F, CVector2F &, const CVector2F &, CVector2F &) +NL_MATH_OPERATORS_USING_FUNCTIONS_ADD_SUB(CVector3F, CVector3F &, const CVector3F &, CVector3F &) +NL_MATH_OPERATORS_USING_FUNCTIONS_ADD_SUB(CVector4F, CVector4F &, const CVector4F &, CVector4F &) + + + +NL_FORCE_INLINE bool operator==(const CVector3F &l, const CVector3F &r) +{ +#ifdef NL_HAS_SSE2 + return (_mm_movemask_ps(_mm_cmpeq_ps(l.mm, r.mm)) & 0x07) == 0x07; +#else + return l.x == r.x && l.y == r.y && l.z == r.z; +#endif +} + +NL_FORCE_INLINE bool operator!=(const CVector3F &l, const CVector3F &r) +{ +#ifdef NL_HAS_SSE2 + return (_mm_movemask_ps(_mm_cmpneq_ps(l.mm, r.mm)) & 0x07) != 0; +#else + return l.x != r.x || l.y != r.y || l.z != r.z; +#endif +} + + + +NL_FORCE_INLINE bool operator==(const CVector4F &l, const CVector4F &r) +{ +#ifdef NL_HAS_SSE2 + return (_mm_movemask_ps(_mm_cmpeq_ps(l.mm, r.mm)) & 0x0F) == 0x0F; +#else + return l.x == r.x && l.y == r.y && l.z == r.z && l.w == r.w; +#endif +} + +NL_FORCE_INLINE bool operator!=(const CVector4F &l, const CVector4F &r) +{ +#ifdef NL_HAS_SSE2 + return (_mm_movemask_ps(_mm_cmpneq_ps(l.mm, r.mm)) & 0x0F) != 0; +#else + return l.x != r.x || l.y != r.y || l.z != r.z || l.w != r.w; +#endif +} + + + +} /* namespace NLMISC */ + +#endif /* #ifndef NLMISC_VECTORF_OPERATORS_H */ + +/* end of file */ diff --git a/code/nel/include/nel/misc/vectorf_swizzle.h b/code/nel/include/nel/misc/vectorf_swizzle.h new file mode 100644 index 000000000..20eb71a10 --- /dev/null +++ b/code/nel/include/nel/misc/vectorf_swizzle.h @@ -0,0 +1,7765 @@ +/* + +Copyright (c) 2010-2014, Jan BOON +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#ifndef NLMISC_VECTORF_SWIZZLE_H +#define NLMISC_VECTORF_SWIZZLE_H +#include "types_nl.h" + +// System includes +#ifdef NL_HAS_SSE2 +# include +# include +#endif + +// STL includes + +// NLMISC includes + +// Project includes + +namespace NLMISC { + +NL_FORCE_INLINE CVector1F x(const CVector1F &v) +{ +#ifdef NL_HAS_SSE2 + CVector1F m; + m.mm = v.mm; + return m; +#else + CVector1F s; + s.x = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector1F x(const CVector2F &v) +{ +#ifdef NL_HAS_SSE2 + CVector1F m; + m.mm = v.mm; + return m; +#else + CVector1F s; + s.x = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector1F x(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector1F m; + m.mm = v.mm; + return m; +#else + CVector1F s; + s.x = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector1F x(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector1F m; + m.mm = v.mm; + return m; +#else + CVector1F s; + s.x = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector2F xx(const CVector1F &v) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 0, 0)); + return m; +#else + CVector2F s; + s.x = v.x; + s.y = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector2F xx(const CVector2F &v) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 0, 0)); + return m; +#else + CVector2F s; + s.x = v.x; + s.y = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector2F xx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 0, 0)); + return m; +#else + CVector2F s; + s.x = v.x; + s.y = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector2F xx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 0, 0)); + return m; +#else + CVector2F s; + s.x = v.x; + s.y = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F xxx(const CVector1F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 0, 0)); + return m; +#else + CVector3F s; + s.x = v.x; + s.y = v.x; + s.z = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F xxx(const CVector2F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 0, 0)); + return m; +#else + CVector3F s; + s.x = v.x; + s.y = v.x; + s.z = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F xxx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 0, 0)); + return m; +#else + CVector3F s; + s.x = v.x; + s.y = v.x; + s.z = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F xxx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 0, 0)); + return m; +#else + CVector3F s; + s.x = v.x; + s.y = v.x; + s.z = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xxxx(const CVector1F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 0, 0, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.x; + s.z = v.x; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xxxx(const CVector2F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 0, 0, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.x; + s.z = v.x; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xxxx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 0, 0, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.x; + s.z = v.x; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xxxx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 0, 0, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.x; + s.z = v.x; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xxxy(const CVector2F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 0, 0, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.x; + s.z = v.x; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xxxy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 0, 0, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.x; + s.z = v.x; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xxxy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 0, 0, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.x; + s.z = v.x; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xxxz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 0, 0, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.x; + s.z = v.x; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xxxz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 0, 0, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.x; + s.z = v.x; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xxxw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 0, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.x; + s.z = v.x; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F xxy(const CVector2F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 0, 0)); + return m; +#else + CVector3F s; + s.x = v.x; + s.y = v.x; + s.z = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F xxy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 0, 0)); + return m; +#else + CVector3F s; + s.x = v.x; + s.y = v.x; + s.z = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F xxy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 0, 0)); + return m; +#else + CVector3F s; + s.x = v.x; + s.y = v.x; + s.z = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xxyx(const CVector2F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 1, 0, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.x; + s.z = v.y; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xxyx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 1, 0, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.x; + s.z = v.y; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xxyx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 1, 0, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.x; + s.z = v.y; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xxyy(const CVector2F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 1, 0, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.x; + s.z = v.y; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xxyy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 1, 0, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.x; + s.z = v.y; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xxyy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 1, 0, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.x; + s.z = v.y; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xxyz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 1, 0, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.x; + s.z = v.y; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xxyz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 1, 0, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.x; + s.z = v.y; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xxyw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 0, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.x; + s.z = v.y; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F xxz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 0, 0)); + return m; +#else + CVector3F s; + s.x = v.x; + s.y = v.x; + s.z = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F xxz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 0, 0)); + return m; +#else + CVector3F s; + s.x = v.x; + s.y = v.x; + s.z = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xxzx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 2, 0, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.x; + s.z = v.z; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xxzx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 2, 0, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.x; + s.z = v.z; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xxzy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 2, 0, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.x; + s.z = v.z; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xxzy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 2, 0, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.x; + s.z = v.z; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xxzz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 2, 0, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.x; + s.z = v.z; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xxzz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 2, 0, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.x; + s.z = v.z; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xxzw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 0, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.x; + s.z = v.z; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F xxw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 3, 0, 0)); + return m; +#else + CVector3F s; + s.x = v.x; + s.y = v.x; + s.z = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xxwx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 3, 0, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.x; + s.z = v.w; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xxwy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 3, 0, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.x; + s.z = v.w; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xxwz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 3, 0, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.x; + s.z = v.w; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xxww(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 3, 0, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.x; + s.z = v.w; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector2F xy(const CVector2F &v) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = v.mm; + return m; +#else + CVector2F s; + s.x = v.x; + s.y = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector2F xy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = v.mm; + return m; +#else + CVector2F s; + s.x = v.x; + s.y = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector2F xy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = v.mm; + return m; +#else + CVector2F s; + s.x = v.x; + s.y = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F xyx(const CVector2F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 1, 0)); + return m; +#else + CVector3F s; + s.x = v.x; + s.y = v.y; + s.z = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F xyx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 1, 0)); + return m; +#else + CVector3F s; + s.x = v.x; + s.y = v.y; + s.z = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F xyx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 1, 0)); + return m; +#else + CVector3F s; + s.x = v.x; + s.y = v.y; + s.z = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xyxx(const CVector2F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 0, 1, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.y; + s.z = v.x; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xyxx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 0, 1, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.y; + s.z = v.x; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xyxx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 0, 1, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.y; + s.z = v.x; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xyxy(const CVector2F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 0, 1, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.y; + s.z = v.x; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xyxy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 0, 1, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.y; + s.z = v.x; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xyxy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 0, 1, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.y; + s.z = v.x; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xyxz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 0, 1, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.y; + s.z = v.x; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xyxz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 0, 1, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.y; + s.z = v.x; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xyxw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 1, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.y; + s.z = v.x; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F xyy(const CVector2F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 1, 0)); + return m; +#else + CVector3F s; + s.x = v.x; + s.y = v.y; + s.z = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F xyy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 1, 0)); + return m; +#else + CVector3F s; + s.x = v.x; + s.y = v.y; + s.z = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F xyy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 1, 0)); + return m; +#else + CVector3F s; + s.x = v.x; + s.y = v.y; + s.z = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xyyx(const CVector2F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 1, 1, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.y; + s.z = v.y; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xyyx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 1, 1, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.y; + s.z = v.y; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xyyx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 1, 1, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.y; + s.z = v.y; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xyyy(const CVector2F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 1, 1, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.y; + s.z = v.y; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xyyy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 1, 1, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.y; + s.z = v.y; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xyyy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 1, 1, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.y; + s.z = v.y; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xyyz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 1, 1, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.y; + s.z = v.y; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xyyz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 1, 1, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.y; + s.z = v.y; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xyyw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 1, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.y; + s.z = v.y; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F xyz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = v.mm; + return m; +#else + CVector3F s; + s.x = v.x; + s.y = v.y; + s.z = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F xyz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = v.mm; + return m; +#else + CVector3F s; + s.x = v.x; + s.y = v.y; + s.z = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xyzx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 2, 1, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.y; + s.z = v.z; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xyzx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 2, 1, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.y; + s.z = v.z; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xyzy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 2, 1, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.y; + s.z = v.z; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xyzy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 2, 1, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.y; + s.z = v.z; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xyzz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 2, 1, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.y; + s.z = v.z; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xyzz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 2, 1, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.y; + s.z = v.z; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xyzw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = v.mm; + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.y; + s.z = v.z; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F xyw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 3, 1, 0)); + return m; +#else + CVector3F s; + s.x = v.x; + s.y = v.y; + s.z = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xywx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 3, 1, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.y; + s.z = v.w; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xywy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 3, 1, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.y; + s.z = v.w; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xywz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 3, 1, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.y; + s.z = v.w; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xyww(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 3, 1, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.y; + s.z = v.w; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector2F xz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 2, 0)); + return m; +#else + CVector2F s; + s.x = v.x; + s.y = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector2F xz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 2, 0)); + return m; +#else + CVector2F s; + s.x = v.x; + s.y = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F xzx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 2, 0)); + return m; +#else + CVector3F s; + s.x = v.x; + s.y = v.z; + s.z = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F xzx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 2, 0)); + return m; +#else + CVector3F s; + s.x = v.x; + s.y = v.z; + s.z = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xzxx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 0, 2, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.z; + s.z = v.x; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xzxx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 0, 2, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.z; + s.z = v.x; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xzxy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 0, 2, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.z; + s.z = v.x; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xzxy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 0, 2, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.z; + s.z = v.x; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xzxz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 0, 2, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.z; + s.z = v.x; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xzxz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 0, 2, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.z; + s.z = v.x; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xzxw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 2, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.z; + s.z = v.x; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F xzy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 2, 0)); + return m; +#else + CVector3F s; + s.x = v.x; + s.y = v.z; + s.z = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F xzy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 2, 0)); + return m; +#else + CVector3F s; + s.x = v.x; + s.y = v.z; + s.z = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xzyx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 1, 2, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.z; + s.z = v.y; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xzyx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 1, 2, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.z; + s.z = v.y; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xzyy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 1, 2, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.z; + s.z = v.y; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xzyy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 1, 2, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.z; + s.z = v.y; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xzyz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 1, 2, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.z; + s.z = v.y; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xzyz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 1, 2, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.z; + s.z = v.y; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xzyw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 2, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.z; + s.z = v.y; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F xzz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 2, 0)); + return m; +#else + CVector3F s; + s.x = v.x; + s.y = v.z; + s.z = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F xzz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 2, 0)); + return m; +#else + CVector3F s; + s.x = v.x; + s.y = v.z; + s.z = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xzzx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 2, 2, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.z; + s.z = v.z; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xzzx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 2, 2, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.z; + s.z = v.z; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xzzy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 2, 2, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.z; + s.z = v.z; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xzzy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 2, 2, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.z; + s.z = v.z; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xzzz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 2, 2, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.z; + s.z = v.z; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xzzz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 2, 2, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.z; + s.z = v.z; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xzzw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 2, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.z; + s.z = v.z; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F xzw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 3, 2, 0)); + return m; +#else + CVector3F s; + s.x = v.x; + s.y = v.z; + s.z = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xzwx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 3, 2, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.z; + s.z = v.w; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xzwy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 3, 2, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.z; + s.z = v.w; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xzwz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 3, 2, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.z; + s.z = v.w; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xzww(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 3, 2, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.z; + s.z = v.w; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector2F xw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 3, 0)); + return m; +#else + CVector2F s; + s.x = v.x; + s.y = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F xwx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 3, 0)); + return m; +#else + CVector3F s; + s.x = v.x; + s.y = v.w; + s.z = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xwxx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 0, 3, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.w; + s.z = v.x; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xwxy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 0, 3, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.w; + s.z = v.x; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xwxz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 0, 3, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.w; + s.z = v.x; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xwxw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 3, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.w; + s.z = v.x; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F xwy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 3, 0)); + return m; +#else + CVector3F s; + s.x = v.x; + s.y = v.w; + s.z = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xwyx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 1, 3, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.w; + s.z = v.y; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xwyy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 1, 3, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.w; + s.z = v.y; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xwyz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 1, 3, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.w; + s.z = v.y; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xwyw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 3, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.w; + s.z = v.y; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F xwz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 3, 0)); + return m; +#else + CVector3F s; + s.x = v.x; + s.y = v.w; + s.z = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xwzx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 2, 3, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.w; + s.z = v.z; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xwzy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 2, 3, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.w; + s.z = v.z; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xwzz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 2, 3, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.w; + s.z = v.z; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xwzw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 3, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.w; + s.z = v.z; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F xww(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 3, 3, 0)); + return m; +#else + CVector3F s; + s.x = v.x; + s.y = v.w; + s.z = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xwwx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 3, 3, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.w; + s.z = v.w; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xwwy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 3, 3, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.w; + s.z = v.w; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xwwz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 3, 3, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.w; + s.z = v.w; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F xwww(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 3, 3, 0)); + return m; +#else + CVector4F s; + s.x = v.x; + s.y = v.w; + s.z = v.w; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector1F y(const CVector2F &v) +{ +#ifdef NL_HAS_SSE2 + CVector1F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 1, 1)); + return m; +#else + CVector1F s; + s.x = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector1F y(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector1F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 1, 1)); + return m; +#else + CVector1F s; + s.x = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector1F y(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector1F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 1, 1)); + return m; +#else + CVector1F s; + s.x = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector2F yx(const CVector2F &v) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 0, 1)); + return m; +#else + CVector2F s; + s.x = v.y; + s.y = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector2F yx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 0, 1)); + return m; +#else + CVector2F s; + s.x = v.y; + s.y = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector2F yx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 0, 1)); + return m; +#else + CVector2F s; + s.x = v.y; + s.y = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F yxx(const CVector2F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 0, 1)); + return m; +#else + CVector3F s; + s.x = v.y; + s.y = v.x; + s.z = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F yxx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 0, 1)); + return m; +#else + CVector3F s; + s.x = v.y; + s.y = v.x; + s.z = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F yxx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 0, 1)); + return m; +#else + CVector3F s; + s.x = v.y; + s.y = v.x; + s.z = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yxxx(const CVector2F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 0, 0, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.x; + s.z = v.x; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yxxx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 0, 0, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.x; + s.z = v.x; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yxxx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 0, 0, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.x; + s.z = v.x; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yxxy(const CVector2F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 0, 0, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.x; + s.z = v.x; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yxxy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 0, 0, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.x; + s.z = v.x; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yxxy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 0, 0, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.x; + s.z = v.x; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yxxz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 0, 0, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.x; + s.z = v.x; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yxxz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 0, 0, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.x; + s.z = v.x; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yxxw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 0, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.x; + s.z = v.x; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F yxy(const CVector2F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 0, 1)); + return m; +#else + CVector3F s; + s.x = v.y; + s.y = v.x; + s.z = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F yxy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 0, 1)); + return m; +#else + CVector3F s; + s.x = v.y; + s.y = v.x; + s.z = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F yxy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 0, 1)); + return m; +#else + CVector3F s; + s.x = v.y; + s.y = v.x; + s.z = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yxyx(const CVector2F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 1, 0, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.x; + s.z = v.y; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yxyx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 1, 0, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.x; + s.z = v.y; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yxyx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 1, 0, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.x; + s.z = v.y; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yxyy(const CVector2F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 1, 0, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.x; + s.z = v.y; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yxyy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 1, 0, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.x; + s.z = v.y; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yxyy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 1, 0, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.x; + s.z = v.y; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yxyz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 1, 0, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.x; + s.z = v.y; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yxyz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 1, 0, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.x; + s.z = v.y; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yxyw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 0, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.x; + s.z = v.y; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F yxz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 0, 1)); + return m; +#else + CVector3F s; + s.x = v.y; + s.y = v.x; + s.z = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F yxz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 0, 1)); + return m; +#else + CVector3F s; + s.x = v.y; + s.y = v.x; + s.z = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yxzx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 2, 0, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.x; + s.z = v.z; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yxzx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 2, 0, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.x; + s.z = v.z; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yxzy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 2, 0, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.x; + s.z = v.z; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yxzy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 2, 0, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.x; + s.z = v.z; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yxzz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 2, 0, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.x; + s.z = v.z; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yxzz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 2, 0, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.x; + s.z = v.z; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yxzw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 0, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.x; + s.z = v.z; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F yxw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 3, 0, 1)); + return m; +#else + CVector3F s; + s.x = v.y; + s.y = v.x; + s.z = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yxwx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 3, 0, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.x; + s.z = v.w; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yxwy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 3, 0, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.x; + s.z = v.w; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yxwz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 3, 0, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.x; + s.z = v.w; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yxww(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 3, 0, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.x; + s.z = v.w; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector2F yy(const CVector2F &v) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 1, 1)); + return m; +#else + CVector2F s; + s.x = v.y; + s.y = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector2F yy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 1, 1)); + return m; +#else + CVector2F s; + s.x = v.y; + s.y = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector2F yy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 1, 1)); + return m; +#else + CVector2F s; + s.x = v.y; + s.y = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F yyx(const CVector2F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 1, 1)); + return m; +#else + CVector3F s; + s.x = v.y; + s.y = v.y; + s.z = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F yyx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 1, 1)); + return m; +#else + CVector3F s; + s.x = v.y; + s.y = v.y; + s.z = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F yyx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 1, 1)); + return m; +#else + CVector3F s; + s.x = v.y; + s.y = v.y; + s.z = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yyxx(const CVector2F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 0, 1, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.y; + s.z = v.x; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yyxx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 0, 1, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.y; + s.z = v.x; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yyxx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 0, 1, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.y; + s.z = v.x; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yyxy(const CVector2F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 0, 1, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.y; + s.z = v.x; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yyxy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 0, 1, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.y; + s.z = v.x; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yyxy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 0, 1, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.y; + s.z = v.x; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yyxz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 0, 1, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.y; + s.z = v.x; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yyxz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 0, 1, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.y; + s.z = v.x; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yyxw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 1, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.y; + s.z = v.x; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F yyy(const CVector2F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 1, 1)); + return m; +#else + CVector3F s; + s.x = v.y; + s.y = v.y; + s.z = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F yyy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 1, 1)); + return m; +#else + CVector3F s; + s.x = v.y; + s.y = v.y; + s.z = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F yyy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 1, 1)); + return m; +#else + CVector3F s; + s.x = v.y; + s.y = v.y; + s.z = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yyyx(const CVector2F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 1, 1, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.y; + s.z = v.y; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yyyx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 1, 1, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.y; + s.z = v.y; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yyyx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 1, 1, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.y; + s.z = v.y; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yyyy(const CVector2F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 1, 1, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.y; + s.z = v.y; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yyyy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 1, 1, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.y; + s.z = v.y; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yyyy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 1, 1, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.y; + s.z = v.y; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yyyz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 1, 1, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.y; + s.z = v.y; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yyyz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 1, 1, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.y; + s.z = v.y; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yyyw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 1, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.y; + s.z = v.y; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F yyz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 1, 1)); + return m; +#else + CVector3F s; + s.x = v.y; + s.y = v.y; + s.z = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F yyz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 1, 1)); + return m; +#else + CVector3F s; + s.x = v.y; + s.y = v.y; + s.z = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yyzx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 2, 1, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.y; + s.z = v.z; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yyzx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 2, 1, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.y; + s.z = v.z; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yyzy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 2, 1, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.y; + s.z = v.z; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yyzy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 2, 1, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.y; + s.z = v.z; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yyzz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 2, 1, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.y; + s.z = v.z; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yyzz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 2, 1, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.y; + s.z = v.z; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yyzw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 1, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.y; + s.z = v.z; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F yyw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 3, 1, 1)); + return m; +#else + CVector3F s; + s.x = v.y; + s.y = v.y; + s.z = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yywx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 3, 1, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.y; + s.z = v.w; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yywy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 3, 1, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.y; + s.z = v.w; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yywz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 3, 1, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.y; + s.z = v.w; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yyww(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 3, 1, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.y; + s.z = v.w; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector2F yz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 2, 1)); + return m; +#else + CVector2F s; + s.x = v.y; + s.y = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector2F yz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 2, 1)); + return m; +#else + CVector2F s; + s.x = v.y; + s.y = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F yzx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 2, 1)); + return m; +#else + CVector3F s; + s.x = v.y; + s.y = v.z; + s.z = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F yzx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 2, 1)); + return m; +#else + CVector3F s; + s.x = v.y; + s.y = v.z; + s.z = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yzxx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 0, 2, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.z; + s.z = v.x; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yzxx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 0, 2, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.z; + s.z = v.x; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yzxy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 0, 2, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.z; + s.z = v.x; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yzxy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 0, 2, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.z; + s.z = v.x; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yzxz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 0, 2, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.z; + s.z = v.x; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yzxz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 0, 2, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.z; + s.z = v.x; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yzxw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 2, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.z; + s.z = v.x; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F yzy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 2, 1)); + return m; +#else + CVector3F s; + s.x = v.y; + s.y = v.z; + s.z = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F yzy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 2, 1)); + return m; +#else + CVector3F s; + s.x = v.y; + s.y = v.z; + s.z = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yzyx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 1, 2, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.z; + s.z = v.y; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yzyx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 1, 2, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.z; + s.z = v.y; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yzyy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 1, 2, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.z; + s.z = v.y; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yzyy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 1, 2, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.z; + s.z = v.y; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yzyz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 1, 2, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.z; + s.z = v.y; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yzyz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 1, 2, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.z; + s.z = v.y; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yzyw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 2, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.z; + s.z = v.y; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F yzz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 2, 1)); + return m; +#else + CVector3F s; + s.x = v.y; + s.y = v.z; + s.z = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F yzz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 2, 1)); + return m; +#else + CVector3F s; + s.x = v.y; + s.y = v.z; + s.z = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yzzx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 2, 2, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.z; + s.z = v.z; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yzzx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 2, 2, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.z; + s.z = v.z; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yzzy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 2, 2, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.z; + s.z = v.z; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yzzy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 2, 2, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.z; + s.z = v.z; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yzzz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 2, 2, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.z; + s.z = v.z; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yzzz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 2, 2, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.z; + s.z = v.z; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yzzw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 2, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.z; + s.z = v.z; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F yzw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 3, 2, 1)); + return m; +#else + CVector3F s; + s.x = v.y; + s.y = v.z; + s.z = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yzwx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 3, 2, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.z; + s.z = v.w; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yzwy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 3, 2, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.z; + s.z = v.w; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yzwz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 3, 2, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.z; + s.z = v.w; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F yzww(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 3, 2, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.z; + s.z = v.w; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector2F yw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 3, 1)); + return m; +#else + CVector2F s; + s.x = v.y; + s.y = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F ywx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 3, 1)); + return m; +#else + CVector3F s; + s.x = v.y; + s.y = v.w; + s.z = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F ywxx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 0, 3, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.w; + s.z = v.x; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F ywxy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 0, 3, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.w; + s.z = v.x; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F ywxz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 0, 3, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.w; + s.z = v.x; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F ywxw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 3, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.w; + s.z = v.x; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F ywy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 3, 1)); + return m; +#else + CVector3F s; + s.x = v.y; + s.y = v.w; + s.z = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F ywyx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 1, 3, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.w; + s.z = v.y; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F ywyy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 1, 3, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.w; + s.z = v.y; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F ywyz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 1, 3, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.w; + s.z = v.y; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F ywyw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 3, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.w; + s.z = v.y; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F ywz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 3, 1)); + return m; +#else + CVector3F s; + s.x = v.y; + s.y = v.w; + s.z = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F ywzx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 2, 3, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.w; + s.z = v.z; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F ywzy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 2, 3, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.w; + s.z = v.z; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F ywzz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 2, 3, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.w; + s.z = v.z; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F ywzw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 3, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.w; + s.z = v.z; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F yww(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 3, 3, 1)); + return m; +#else + CVector3F s; + s.x = v.y; + s.y = v.w; + s.z = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F ywwx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 3, 3, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.w; + s.z = v.w; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F ywwy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 3, 3, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.w; + s.z = v.w; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F ywwz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 3, 3, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.w; + s.z = v.w; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F ywww(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 3, 3, 1)); + return m; +#else + CVector4F s; + s.x = v.y; + s.y = v.w; + s.z = v.w; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector1F z(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector1F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 1, 2)); + return m; +#else + CVector1F s; + s.x = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector1F z(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector1F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 1, 2)); + return m; +#else + CVector1F s; + s.x = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector2F zx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 0, 2)); + return m; +#else + CVector2F s; + s.x = v.z; + s.y = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector2F zx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 0, 2)); + return m; +#else + CVector2F s; + s.x = v.z; + s.y = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F zxx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 0, 2)); + return m; +#else + CVector3F s; + s.x = v.z; + s.y = v.x; + s.z = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F zxx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 0, 2)); + return m; +#else + CVector3F s; + s.x = v.z; + s.y = v.x; + s.z = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zxxx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 0, 0, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.x; + s.z = v.x; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zxxx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 0, 0, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.x; + s.z = v.x; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zxxy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 0, 0, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.x; + s.z = v.x; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zxxy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 0, 0, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.x; + s.z = v.x; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zxxz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 0, 0, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.x; + s.z = v.x; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zxxz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 0, 0, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.x; + s.z = v.x; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zxxw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 0, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.x; + s.z = v.x; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F zxy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 0, 2)); + return m; +#else + CVector3F s; + s.x = v.z; + s.y = v.x; + s.z = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F zxy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 0, 2)); + return m; +#else + CVector3F s; + s.x = v.z; + s.y = v.x; + s.z = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zxyx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 1, 0, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.x; + s.z = v.y; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zxyx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 1, 0, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.x; + s.z = v.y; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zxyy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 1, 0, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.x; + s.z = v.y; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zxyy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 1, 0, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.x; + s.z = v.y; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zxyz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 1, 0, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.x; + s.z = v.y; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zxyz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 1, 0, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.x; + s.z = v.y; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zxyw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 0, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.x; + s.z = v.y; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F zxz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 0, 2)); + return m; +#else + CVector3F s; + s.x = v.z; + s.y = v.x; + s.z = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F zxz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 0, 2)); + return m; +#else + CVector3F s; + s.x = v.z; + s.y = v.x; + s.z = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zxzx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 2, 0, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.x; + s.z = v.z; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zxzx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 2, 0, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.x; + s.z = v.z; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zxzy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 2, 0, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.x; + s.z = v.z; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zxzy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 2, 0, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.x; + s.z = v.z; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zxzz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 2, 0, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.x; + s.z = v.z; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zxzz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 2, 0, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.x; + s.z = v.z; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zxzw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 0, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.x; + s.z = v.z; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F zxw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 3, 0, 2)); + return m; +#else + CVector3F s; + s.x = v.z; + s.y = v.x; + s.z = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zxwx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 3, 0, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.x; + s.z = v.w; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zxwy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 3, 0, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.x; + s.z = v.w; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zxwz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 3, 0, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.x; + s.z = v.w; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zxww(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 3, 0, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.x; + s.z = v.w; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector2F zy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 1, 2)); + return m; +#else + CVector2F s; + s.x = v.z; + s.y = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector2F zy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 1, 2)); + return m; +#else + CVector2F s; + s.x = v.z; + s.y = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F zyx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 1, 2)); + return m; +#else + CVector3F s; + s.x = v.z; + s.y = v.y; + s.z = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F zyx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 1, 2)); + return m; +#else + CVector3F s; + s.x = v.z; + s.y = v.y; + s.z = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zyxx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 0, 1, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.y; + s.z = v.x; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zyxx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 0, 1, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.y; + s.z = v.x; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zyxy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 0, 1, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.y; + s.z = v.x; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zyxy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 0, 1, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.y; + s.z = v.x; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zyxz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 0, 1, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.y; + s.z = v.x; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zyxz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 0, 1, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.y; + s.z = v.x; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zyxw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 1, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.y; + s.z = v.x; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F zyy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 1, 2)); + return m; +#else + CVector3F s; + s.x = v.z; + s.y = v.y; + s.z = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F zyy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 1, 2)); + return m; +#else + CVector3F s; + s.x = v.z; + s.y = v.y; + s.z = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zyyx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 1, 1, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.y; + s.z = v.y; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zyyx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 1, 1, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.y; + s.z = v.y; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zyyy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 1, 1, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.y; + s.z = v.y; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zyyy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 1, 1, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.y; + s.z = v.y; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zyyz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 1, 1, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.y; + s.z = v.y; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zyyz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 1, 1, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.y; + s.z = v.y; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zyyw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 1, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.y; + s.z = v.y; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F zyz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 1, 2)); + return m; +#else + CVector3F s; + s.x = v.z; + s.y = v.y; + s.z = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F zyz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 1, 2)); + return m; +#else + CVector3F s; + s.x = v.z; + s.y = v.y; + s.z = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zyzx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 2, 1, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.y; + s.z = v.z; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zyzx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 2, 1, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.y; + s.z = v.z; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zyzy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 2, 1, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.y; + s.z = v.z; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zyzy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 2, 1, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.y; + s.z = v.z; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zyzz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 2, 1, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.y; + s.z = v.z; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zyzz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 2, 1, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.y; + s.z = v.z; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zyzw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 1, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.y; + s.z = v.z; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F zyw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 3, 1, 2)); + return m; +#else + CVector3F s; + s.x = v.z; + s.y = v.y; + s.z = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zywx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 3, 1, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.y; + s.z = v.w; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zywy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 3, 1, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.y; + s.z = v.w; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zywz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 3, 1, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.y; + s.z = v.w; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zyww(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 3, 1, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.y; + s.z = v.w; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector2F zz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 2, 2)); + return m; +#else + CVector2F s; + s.x = v.z; + s.y = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector2F zz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 2, 2)); + return m; +#else + CVector2F s; + s.x = v.z; + s.y = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F zzx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 2, 2)); + return m; +#else + CVector3F s; + s.x = v.z; + s.y = v.z; + s.z = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F zzx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 2, 2)); + return m; +#else + CVector3F s; + s.x = v.z; + s.y = v.z; + s.z = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zzxx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 0, 2, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.z; + s.z = v.x; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zzxx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 0, 2, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.z; + s.z = v.x; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zzxy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 0, 2, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.z; + s.z = v.x; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zzxy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 0, 2, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.z; + s.z = v.x; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zzxz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 0, 2, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.z; + s.z = v.x; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zzxz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 0, 2, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.z; + s.z = v.x; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zzxw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 2, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.z; + s.z = v.x; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F zzy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 2, 2)); + return m; +#else + CVector3F s; + s.x = v.z; + s.y = v.z; + s.z = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F zzy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 2, 2)); + return m; +#else + CVector3F s; + s.x = v.z; + s.y = v.z; + s.z = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zzyx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 1, 2, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.z; + s.z = v.y; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zzyx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 1, 2, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.z; + s.z = v.y; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zzyy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 1, 2, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.z; + s.z = v.y; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zzyy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 1, 2, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.z; + s.z = v.y; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zzyz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 1, 2, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.z; + s.z = v.y; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zzyz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 1, 2, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.z; + s.z = v.y; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zzyw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 2, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.z; + s.z = v.y; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F zzz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 2, 2)); + return m; +#else + CVector3F s; + s.x = v.z; + s.y = v.z; + s.z = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F zzz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 2, 2)); + return m; +#else + CVector3F s; + s.x = v.z; + s.y = v.z; + s.z = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zzzx(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 2, 2, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.z; + s.z = v.z; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zzzx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 2, 2, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.z; + s.z = v.z; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zzzy(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 2, 2, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.z; + s.z = v.z; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zzzy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 2, 2, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.z; + s.z = v.z; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zzzz(const CVector3F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 2, 2, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.z; + s.z = v.z; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zzzz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 2, 2, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.z; + s.z = v.z; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zzzw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 2, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.z; + s.z = v.z; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F zzw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 3, 2, 2)); + return m; +#else + CVector3F s; + s.x = v.z; + s.y = v.z; + s.z = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zzwx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 3, 2, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.z; + s.z = v.w; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zzwy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 3, 2, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.z; + s.z = v.w; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zzwz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 3, 2, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.z; + s.z = v.w; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zzww(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 3, 2, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.z; + s.z = v.w; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector2F zw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 3, 2)); + return m; +#else + CVector2F s; + s.x = v.z; + s.y = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F zwx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 3, 2)); + return m; +#else + CVector3F s; + s.x = v.z; + s.y = v.w; + s.z = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zwxx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 0, 3, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.w; + s.z = v.x; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zwxy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 0, 3, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.w; + s.z = v.x; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zwxz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 0, 3, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.w; + s.z = v.x; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zwxw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 3, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.w; + s.z = v.x; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F zwy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 3, 2)); + return m; +#else + CVector3F s; + s.x = v.z; + s.y = v.w; + s.z = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zwyx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 1, 3, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.w; + s.z = v.y; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zwyy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 1, 3, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.w; + s.z = v.y; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zwyz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 1, 3, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.w; + s.z = v.y; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zwyw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 3, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.w; + s.z = v.y; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F zwz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 3, 2)); + return m; +#else + CVector3F s; + s.x = v.z; + s.y = v.w; + s.z = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zwzx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 2, 3, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.w; + s.z = v.z; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zwzy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 2, 3, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.w; + s.z = v.z; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zwzz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 2, 3, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.w; + s.z = v.z; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zwzw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 3, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.w; + s.z = v.z; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F zww(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 3, 3, 2)); + return m; +#else + CVector3F s; + s.x = v.z; + s.y = v.w; + s.z = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zwwx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 3, 3, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.w; + s.z = v.w; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zwwy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 3, 3, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.w; + s.z = v.w; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zwwz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 3, 3, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.w; + s.z = v.w; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F zwww(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 3, 3, 2)); + return m; +#else + CVector4F s; + s.x = v.z; + s.y = v.w; + s.z = v.w; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector1F w(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector1F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 1, 3)); + return m; +#else + CVector1F s; + s.x = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector2F wx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 0, 3)); + return m; +#else + CVector2F s; + s.x = v.w; + s.y = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F wxx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 0, 3)); + return m; +#else + CVector3F s; + s.x = v.w; + s.y = v.x; + s.z = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wxxx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 0, 0, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.x; + s.z = v.x; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wxxy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 0, 0, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.x; + s.z = v.x; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wxxz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 0, 0, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.x; + s.z = v.x; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wxxw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 0, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.x; + s.z = v.x; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F wxy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 0, 3)); + return m; +#else + CVector3F s; + s.x = v.w; + s.y = v.x; + s.z = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wxyx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 1, 0, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.x; + s.z = v.y; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wxyy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 1, 0, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.x; + s.z = v.y; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wxyz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 1, 0, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.x; + s.z = v.y; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wxyw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 0, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.x; + s.z = v.y; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F wxz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 0, 3)); + return m; +#else + CVector3F s; + s.x = v.w; + s.y = v.x; + s.z = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wxzx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 2, 0, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.x; + s.z = v.z; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wxzy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 2, 0, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.x; + s.z = v.z; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wxzz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 2, 0, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.x; + s.z = v.z; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wxzw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 0, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.x; + s.z = v.z; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F wxw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 3, 0, 3)); + return m; +#else + CVector3F s; + s.x = v.w; + s.y = v.x; + s.z = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wxwx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 3, 0, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.x; + s.z = v.w; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wxwy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 3, 0, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.x; + s.z = v.w; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wxwz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 3, 0, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.x; + s.z = v.w; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wxww(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 3, 0, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.x; + s.z = v.w; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector2F wy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 1, 3)); + return m; +#else + CVector2F s; + s.x = v.w; + s.y = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F wyx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 1, 3)); + return m; +#else + CVector3F s; + s.x = v.w; + s.y = v.y; + s.z = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wyxx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 0, 1, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.y; + s.z = v.x; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wyxy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 0, 1, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.y; + s.z = v.x; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wyxz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 0, 1, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.y; + s.z = v.x; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wyxw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 1, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.y; + s.z = v.x; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F wyy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 1, 3)); + return m; +#else + CVector3F s; + s.x = v.w; + s.y = v.y; + s.z = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wyyx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 1, 1, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.y; + s.z = v.y; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wyyy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 1, 1, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.y; + s.z = v.y; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wyyz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 1, 1, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.y; + s.z = v.y; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wyyw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 1, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.y; + s.z = v.y; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F wyz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 1, 3)); + return m; +#else + CVector3F s; + s.x = v.w; + s.y = v.y; + s.z = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wyzx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 2, 1, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.y; + s.z = v.z; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wyzy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 2, 1, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.y; + s.z = v.z; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wyzz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 2, 1, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.y; + s.z = v.z; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wyzw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 1, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.y; + s.z = v.z; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F wyw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 3, 1, 3)); + return m; +#else + CVector3F s; + s.x = v.w; + s.y = v.y; + s.z = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wywx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 3, 1, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.y; + s.z = v.w; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wywy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 3, 1, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.y; + s.z = v.w; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wywz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 3, 1, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.y; + s.z = v.w; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wyww(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 3, 1, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.y; + s.z = v.w; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector2F wz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 2, 3)); + return m; +#else + CVector2F s; + s.x = v.w; + s.y = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F wzx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 2, 3)); + return m; +#else + CVector3F s; + s.x = v.w; + s.y = v.z; + s.z = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wzxx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 0, 2, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.z; + s.z = v.x; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wzxy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 0, 2, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.z; + s.z = v.x; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wzxz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 0, 2, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.z; + s.z = v.x; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wzxw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 2, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.z; + s.z = v.x; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F wzy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 2, 3)); + return m; +#else + CVector3F s; + s.x = v.w; + s.y = v.z; + s.z = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wzyx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 1, 2, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.z; + s.z = v.y; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wzyy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 1, 2, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.z; + s.z = v.y; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wzyz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 1, 2, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.z; + s.z = v.y; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wzyw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 2, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.z; + s.z = v.y; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F wzz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 2, 3)); + return m; +#else + CVector3F s; + s.x = v.w; + s.y = v.z; + s.z = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wzzx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 2, 2, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.z; + s.z = v.z; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wzzy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 2, 2, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.z; + s.z = v.z; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wzzz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 2, 2, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.z; + s.z = v.z; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wzzw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 2, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.z; + s.z = v.z; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F wzw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 3, 2, 3)); + return m; +#else + CVector3F s; + s.x = v.w; + s.y = v.z; + s.z = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wzwx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 3, 2, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.z; + s.z = v.w; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wzwy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 3, 2, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.z; + s.z = v.w; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wzwz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 3, 2, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.z; + s.z = v.w; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wzww(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 3, 2, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.z; + s.z = v.w; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector2F ww(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector2F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 3, 3)); + return m; +#else + CVector2F s; + s.x = v.w; + s.y = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F wwx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 3, 3)); + return m; +#else + CVector3F s; + s.x = v.w; + s.y = v.w; + s.z = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wwxx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 0, 3, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.w; + s.z = v.x; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wwxy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 0, 3, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.w; + s.z = v.x; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wwxz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 0, 3, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.w; + s.z = v.x; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wwxw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 0, 3, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.w; + s.z = v.x; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F wwy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 3, 3)); + return m; +#else + CVector3F s; + s.x = v.w; + s.y = v.w; + s.z = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wwyx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 1, 3, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.w; + s.z = v.y; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wwyy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 1, 3, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.w; + s.z = v.y; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wwyz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 1, 3, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.w; + s.z = v.y; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wwyw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 1, 3, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.w; + s.z = v.y; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F wwz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 3, 3)); + return m; +#else + CVector3F s; + s.x = v.w; + s.y = v.w; + s.z = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wwzx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 2, 3, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.w; + s.z = v.z; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wwzy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 2, 3, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.w; + s.z = v.z; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wwzz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 2, 3, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.w; + s.z = v.z; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wwzw(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 2, 3, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.w; + s.z = v.z; + s.w = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector3F www(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector3F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 3, 3, 3)); + return m; +#else + CVector3F s; + s.x = v.w; + s.y = v.w; + s.z = v.w; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wwwx(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(0, 3, 3, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.w; + s.z = v.w; + s.w = v.x; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wwwy(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(1, 3, 3, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.w; + s.z = v.w; + s.w = v.y; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wwwz(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(2, 3, 3, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.w; + s.z = v.w; + s.w = v.z; + return s; +#endif +} + +NL_FORCE_INLINE CVector4F wwww(const CVector4F &v) +{ +#ifdef NL_HAS_SSE2 + CVector4F m; + m.mm = _mm_shuffle_ps(v.mm, v.mm, _MM_SHUFFLE(3, 3, 3, 3)); + return m; +#else + CVector4F s; + s.x = v.w; + s.y = v.w; + s.z = v.w; + s.w = v.w; + return s; +#endif +} + +} /* namespace NLMISC */ + +#endif /* #ifndef NLMISC_VECTORF_SWIZZLE_H */ + +/* end of file */ diff --git a/code/nel/include/nel/misc/vectorf_types.h b/code/nel/include/nel/misc/vectorf_types.h new file mode 100644 index 000000000..6eb1b9c2c --- /dev/null +++ b/code/nel/include/nel/misc/vectorf_types.h @@ -0,0 +1,75 @@ +/* + +Copyright (c) 2010-2014, Jan BOON +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +#ifndef NLMISC_VECTORF_TYPES_H +#define NLMISC_VECTORF_TYPES_H +#include "types_nl.h" + +// System includes +#ifdef NL_HAS_SSE2 +# include +# include +#endif + +// STL includes + +// NLMISC includes + +// Project includes + +namespace NLMISC { + +#ifdef NL_HAS_SSE2 +typedef NL_ALIGN_SSE2 struct { __m128 mm; } CVector1F; // 12 of 16 bytes wasted +#else +typedef struct { float x; } CVector1F; +#endif + +#ifdef NL_HAS_SSE2 +typedef NL_ALIGN_SSE2 struct { __m128 mm; } CVector2F; // 8 of 16 bytes wasted +#else +typedef struct { float x, y; } CVector2F; +#endif + +#ifdef NL_HAS_SSE2 +typedef NL_ALIGN_SSE2 struct { __m128 mm; } CVector3F; // 4 of 16 bytes wasted +#else +typedef struct { float x, y, z; } CVector3F; +#endif + +#ifdef NL_HAS_SSE2 +typedef NL_ALIGN_SSE2 struct { __m128 mm; } CVector4F; +#else +typedef struct { float x, y, z, w; } CVector4F; +#endif + +} /* namespace NLMISC */ + +#endif /* #ifndef NLMISC_VECTORF_TYPES_H */ + +/* end of file */