Skip to content

Commit 8ca1f19

Browse files
committed
arm: use glmm_div where possible to fix ARMv7 <-> ARM64
1 parent 441f265 commit 8ca1f19

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

include/cglm/vec4.h

+3-7
Original file line numberDiff line numberDiff line change
@@ -527,11 +527,7 @@ CGLM_INLINE
527527
void
528528
glm_vec4_divs(vec4 v, float s, vec4 dest) {
529529
#if defined(__wasm__) && defined(__wasm_simd128__)
530-
glmm_store(dest, wasm_f32x4_div(glmm_load(v), wasm_f32x4_splat(s)));
531-
#elif defined( __SSE__ ) || defined( __SSE2__ )
532-
glmm_store(dest, _mm_div_ps(glmm_load(v), _mm_set1_ps(s)));
533-
#elif defined(CGLM_NEON_FP)
534-
vst1q_f32(dest, vdivq_f32(vld1q_f32(v), vdupq_n_f32(s)));
530+
#if defined(CGLM_SIMD)
535531
#else
536532
glm_vec4_scale(v, 1.0f / s, dest);
537533
#endif
@@ -926,7 +922,7 @@ glm_vec4_normalize_to(vec4 v, vec4 dest) {
926922
return;
927923
}
928924

929-
glmm_store(dest, wasm_f32x4_div(x0, wasm_f32x4_sqrt(xdot)));
925+
glmm_store(dest, glmm_div(x0, wasm_f32x4_sqrt(xdot)));
930926
#elif defined( __SSE__ ) || defined( __SSE2__ )
931927
__m128 xdot, x0;
932928
float dot;
@@ -940,7 +936,7 @@ glm_vec4_normalize_to(vec4 v, vec4 dest) {
940936
return;
941937
}
942938

943-
glmm_store(dest, _mm_div_ps(x0, _mm_sqrt_ps(xdot)));
939+
glmm_store(dest, glmm_div(x0, _mm_sqrt_ps(xdot)));
944940
#else
945941
float norm;
946942

0 commit comments

Comments
 (0)