From b87f406cfaa066c29ec0b563cf3b3c9f26ca3328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Wed, 2 Feb 2022 11:02:28 +0100 Subject: [PATCH] Havok: Add hkSimdFloat32 load/store --- .../Common/Base/Math/Vector/hkSimdFloat32.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/hkStubs/Havok/Common/Base/Math/Vector/hkSimdFloat32.h b/lib/hkStubs/Havok/Common/Base/Math/Vector/hkSimdFloat32.h index 0c3a08ca..cb327973 100644 --- a/lib/hkStubs/Havok/Common/Base/Math/Vector/hkSimdFloat32.h +++ b/lib/hkStubs/Havok/Common/Base/Math/Vector/hkSimdFloat32.h @@ -99,6 +99,8 @@ public: HK_FORCE_INLINE hkVector4fComparison notEqualZero() const; HK_FORCE_INLINE m128 toQuad() const; + HK_FORCE_INLINE void load(const float* out); + HK_FORCE_INLINE void store(float* out) const; Storage m_real; @@ -390,3 +392,19 @@ inline m128 hkSimdFloat32::toQuad() const { return m_real; #endif } + +inline void hkSimdFloat32::load(const float* out) { +#ifdef HK_SIMD_FLOAT32_AARCH64_NEON + m_real = vld1_dup_f32(out); +#else + *this = *out; +#endif +} + +inline void hkSimdFloat32::store(float* out) const { +#ifdef HK_SIMD_FLOAT32_AARCH64_NEON + vst1_lane_f32(out, m_real, 0); +#else + *out = val(); +#endif +}