[Aarch64] fix for glm::length

master
Amaury Le Leyzour ago%!(EXTRA string=5 years)
parent 9da0c80e26
commit 16a650ea65
  1. 6
      glm/detail/func_geometric_simd.inl

@ -105,7 +105,7 @@ namespace detail
{ {
GLM_FUNC_QUALIFIER static float call(vec<4, float, Q> const& v) GLM_FUNC_QUALIFIER static float call(vec<4, float, Q> const& v)
{ {
return compute_dot<vec<4, float, Q>, float, true>::call(v, v); return sqrt(compute_dot<vec<4, float, Q>, float, true>::call(v, v));
} }
}; };
@ -126,9 +126,7 @@ namespace detail
{ {
#if GLM_ARCH & GLM_ARCH_ARMV8_BIT #if GLM_ARCH & GLM_ARCH_ARMV8_BIT
float32x4_t v = vmulq_f32(x.data, y.data); float32x4_t v = vmulq_f32(x.data, y.data);
v = vpaddq_f32(v, v); return vaddvq_f32(v);
v = vpaddq_f32(v, v);
return vgetq_lane_f32(v, 0);
#else // Armv7a with Neon #else // Armv7a with Neon
float32x4_t p = vmulq_f32(x.data, y.data); float32x4_t p = vmulq_f32(x.data, y.data);
float32x2_t v = vpadd_f32(vget_low_f32(p), vget_high_f32(p)); float32x2_t v = vpadd_f32(vget_low_f32(p), vget_high_f32(p));

Loading…
Cancel
Save