Havok: Fix matching issue in hkVector4f::set

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.
This commit is contained in:
Léo Lam 2022-01-16 02:30:55 +01:00
parent 9ee731c40c
commit afabdf7132
No known key found for this signature in database
GPG Key ID: 0DF30F9081000741
1 changed files with 7 additions and 4 deletions

View File

@ -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) {