diff options
| author | sschirm <[email protected]> | 2017-02-27 16:40:12 +0100 |
|---|---|---|
| committer | sschirm <[email protected]> | 2017-03-01 18:04:26 +0100 |
| commit | 7840347c32755e94a807f978f1cbb558717ac8cf (patch) | |
| tree | 295cd3ca93a45f8fcc43cf3cbf3887c0e0c5526b /PxShared/src/foundation/include/unix/sse2/PsUnixSse2InlineAoS.h | |
| parent | Pre-release comments marking end of beta. (diff) | |
| download | physx-3.4-7840347c32755e94a807f978f1cbb558717ac8cf.tar.xz physx-3.4-7840347c32755e94a807f978f1cbb558717ac8cf.zip | |
PhysX 3.4, APEX 1.4 final release @21757769v3.4.0-rc-2
Diffstat (limited to 'PxShared/src/foundation/include/unix/sse2/PsUnixSse2InlineAoS.h')
| -rw-r--r-- | PxShared/src/foundation/include/unix/sse2/PsUnixSse2InlineAoS.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/PxShared/src/foundation/include/unix/sse2/PsUnixSse2InlineAoS.h b/PxShared/src/foundation/include/unix/sse2/PsUnixSse2InlineAoS.h index 6986b4ca..03555381 100644 --- a/PxShared/src/foundation/include/unix/sse2/PsUnixSse2InlineAoS.h +++ b/PxShared/src/foundation/include/unix/sse2/PsUnixSse2InlineAoS.h @@ -165,9 +165,15 @@ PX_FORCE_INLINE PxU32 FiniteTestEq(const Vec4V a, const Vec4V b) _mm_comieq_ss(_mm_shuffle_ps(a1, a1, _MM_SHUFFLE(3, 3, 3, 3)), _mm_shuffle_ps(b1, b1, _MM_SHUFFLE(3, 3, 3, 3)))); } +#if !PX_EMSCRIPTEN const PX_ALIGN(16, PxF32 gMaskXYZ[4]) = { physx::PxUnionCast<PxF32>(0xffffffff), physx::PxUnionCast<PxF32>(0xffffffff), physx::PxUnionCast<PxF32>(0xffffffff), 0 }; } +#else +// emscripten doesn't like the PxUnionCast data structure +// the following is what windows and xbox does -- using these for emscripten +const PX_ALIGN(16, PxU32 gMaskXYZ[4]) = { 0xffffffff, 0xffffffff, 0xffffffff, 0 }; } +#endif namespace _VecMathTests { @@ -341,7 +347,11 @@ PX_FORCE_INLINE BoolV BLoad(const bool f) PX_FORCE_INLINE Vec3V V3LoadA(const PxVec3& f) { ASSERT_ISALIGNED16(const_cast<PxVec3*>(&f)); +#if !PX_EMSCRIPTEN return _mm_and_ps(reinterpret_cast<const Vec3V&>(f), V4LoadA(internalUnitSSE2Simd::gMaskXYZ)); +#else + return _mm_and_ps((Vec3V&)f, (VecI32V&)internalUnitSSE2Simd::gMaskXYZ); +#endif } PX_FORCE_INLINE Vec3V V3LoadU(const PxVec3& f) @@ -358,7 +368,11 @@ PX_FORCE_INLINE Vec3V V3LoadUnsafeA(const PxVec3& f) PX_FORCE_INLINE Vec3V V3LoadA(const PxF32* const f) { ASSERT_ISALIGNED16(const_cast<PxF32*>(f)); +#if !PX_EMSCRIPTEN return _mm_and_ps(V4LoadA(f), V4LoadA(internalUnitSSE2Simd::gMaskXYZ)); +#else + return _mm_and_ps((Vec3V&)*f, (VecI32V&)internalUnitSSE2Simd::gMaskXYZ); +#endif } PX_FORCE_INLINE Vec3V V3LoadU(const PxF32* const i) @@ -1767,7 +1781,11 @@ PX_FORCE_INLINE Vec4V V4SetZ(const Vec4V v, const FloatV f) PX_FORCE_INLINE Vec4V V4ClearW(const Vec4V v) { +#if !PX_EMSCRIPTEN return _mm_and_ps(v, V4LoadA(internalUnitSSE2Simd::gMaskXYZ)); +#else + return _mm_and_ps(v, (VecI32V&)internalUnitSSE2Simd::gMaskXYZ); +#endif } PX_FORCE_INLINE Vec4V V4PermYXWZ(const Vec4V a) |