diff --git a/lib/hkStubs/Havok/Common/Base/Math/Vector/hkVector4f.inl b/lib/hkStubs/Havok/Common/Base/Math/Vector/hkVector4f.inl index 07a7aefb..f4bbe66e 100644 --- a/lib/hkStubs/Havok/Common/Base/Math/Vector/hkVector4f.inl +++ b/lib/hkStubs/Havok/Common/Base/Math/Vector/hkVector4f.inl @@ -22,10 +22,13 @@ inline hkVector4f& hkVector4f::operator=(hkVector4fParameter other) { } inline void hkVector4f::set(hkFloat32 x, hkFloat32 y, hkFloat32 z, hkFloat32 w) { - v[0] = x; - v[1] = y; - v[2] = z; - v[3] = w; +#ifdef HK_VECTOR4F_AARCH64_NEON + // Annoyingly, v = {x, y, z, w} and vcombine_f32({x, y}, {z, w} lead to different codegen. + // It is unclear why Havok decided to split the load in two parts. + v = vcombine_f32(float32x2_t{x, y}, float32x2_t{z, w}); +#else + v = {x, y, z, w}; +#endif } inline void hkVector4f::setAll(hkReal x) {