arm: use glmm_div where possible to fix ARMv7 <-> ARM64

This commit is contained in:
Recep Aslantas
2025-01-24 22:20:57 +03:00
parent 441f2657ab
commit 8ca1f19aa2

View File

@@ -527,11 +527,7 @@ CGLM_INLINE
void void
glm_vec4_divs(vec4 v, float s, vec4 dest) { glm_vec4_divs(vec4 v, float s, vec4 dest) {
#if defined(__wasm__) && defined(__wasm_simd128__) #if defined(__wasm__) && defined(__wasm_simd128__)
glmm_store(dest, wasm_f32x4_div(glmm_load(v), wasm_f32x4_splat(s))); #if defined(CGLM_SIMD)
#elif defined( __SSE__ ) || defined( __SSE2__ )
glmm_store(dest, _mm_div_ps(glmm_load(v), _mm_set1_ps(s)));
#elif defined(CGLM_NEON_FP)
vst1q_f32(dest, vdivq_f32(vld1q_f32(v), vdupq_n_f32(s)));
#else #else
glm_vec4_scale(v, 1.0f / s, dest); glm_vec4_scale(v, 1.0f / s, dest);
#endif #endif
@@ -926,7 +922,7 @@ glm_vec4_normalize_to(vec4 v, vec4 dest) {
return; return;
} }
glmm_store(dest, wasm_f32x4_div(x0, wasm_f32x4_sqrt(xdot))); glmm_store(dest, glmm_div(x0, wasm_f32x4_sqrt(xdot)));
#elif defined( __SSE__ ) || defined( __SSE2__ ) #elif defined( __SSE__ ) || defined( __SSE2__ )
__m128 xdot, x0; __m128 xdot, x0;
float dot; float dot;
@@ -940,7 +936,7 @@ glm_vec4_normalize_to(vec4 v, vec4 dest) {
return; return;
} }
glmm_store(dest, _mm_div_ps(x0, _mm_sqrt_ps(xdot))); glmm_store(dest, glmm_div(x0, _mm_sqrt_ps(xdot)));
#else #else
float norm; float norm;