Fix to use armv7 compatible function for glm_vec4_distance

Before it used armv8 only function thus it leads to build failed for
Android with target of armv7 i.e. armeabi-v7a. This fixed that issue.
This commit is contained in:
Wasin Thonkaew
2019-04-19 01:47:50 +08:00
parent 81a74ba225
commit 8f2f2c5572

View File

@@ -697,11 +697,7 @@ glm_vec4_distance(vec4 a, vec4 b) {
return _mm_cvtss_f32(_mm_sqrt_ss(_mm_add_ss(x0,
glmm_shuff1(x0, 0, 1, 0, 1))));
#elif defined(CGLM_NEON_FP)
float32x4_t v0;
float32_t r;
v0 = vsubq_f32(vld1q_f32(a), vld1q_f32(b));
r = vaddvq_f32(vmulq_f32(v0, v0));
return sqrtf(r);
return glmm_norm(vsubq_f32(glmm_load(a), glmm_load(b)));
#else
return sqrtf(glm_pow2(b[0] - a[0])
+ glm_pow2(b[1] - a[1])