Havok: Fix hkVector4f::setReciprocal

This commit is contained in:
Léo Lam 2022-03-29 16:03:47 +02:00
parent f86b6dde65
commit 0a19a4b057
No known key found for this signature in database
GPG Key ID: 0DF30F9081000741
1 changed files with 4 additions and 1 deletions

View File

@ -134,7 +134,10 @@ inline void hkVector4f::setSub(hkVector4fParameter a, hkSimdFloat32Parameter b)
inline void hkVector4f::setReciprocal(hkVector4fParameter a) {
#ifdef HK_VECTOR4F_AARCH64_NEON
v = vrecpeq_f32(a.v);
auto result = vrecpeq_f32(a.v);
result *= vrecpsq_f32(a.v, result);
result *= vrecpsq_f32(a.v, result);
v = result;
#else
for (int i = 0; i < 4; ++i)
v[i] = 1.0f / a[i];