From a4b8778be9835fa01331335a35fc96108dbbfaa8 Mon Sep 17 00:00:00 2001 From: Recep Aslantas Date: Fri, 21 Apr 2023 22:42:04 +0300 Subject: [PATCH] fixes for "simd, sse: use 0x80000000 insteaf of -0.f to fix fastmath on msvc" --- include/cglm/simd/sse2/mat4.h | 2 +- include/cglm/simd/x86.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/cglm/simd/sse2/mat4.h b/include/cglm/simd/sse2/mat4.h index 571682a..05e7efe 100644 --- a/include/cglm/simd/sse2/mat4.h +++ b/include/cglm/simd/sse2/mat4.h @@ -153,7 +153,7 @@ glm_mat4_det_sse2(mat4 mat) { _mm_shuffle_ps(x0, x1, _MM_SHUFFLE(2, 2, 3, 1)), x2); - x2 = _mm_xor_ps(x2, glmm_float32x4_SIGNMASK_PNPN); + x2 = _mm_xor_ps(x2, glmm_float32x4_SIGNMASK_NPNP); return glmm_hadd(_mm_mul_ps(x2, r0)); } diff --git a/include/cglm/simd/x86.h b/include/cglm/simd/x86.h index 58dc0fd..77c289e 100644 --- a/include/cglm/simd/x86.h +++ b/include/cglm/simd/x86.h @@ -64,8 +64,8 @@ #define glmm_float32x4_SIGNMASK_NPNP GLMM__SIGNMASKf(GLMM_NEGZEROf, 0, GLMM_NEGZEROf, 0) #define glmm_float32x4_SIGNMASK_NPPN GLMM__SIGNMASKf(GLMM_NEGZEROf, 0, 0, GLMM_NEGZEROf) -#define glmm_float32x4_SIGNMASK_NEG _mm_set1_ps(GLMM_NEGZEROf) -#define glmm_float32x8_SIGNMASK_NEG _mm256_castsi256_ps(_mm256_set1_epi32(GLMM_NEGZEROf)); +#define glmm_float32x4_SIGNMASK_NEG _mm_castsi128_ps(_mm_set1_epi32(0x80000000)) /* _mm_set1_ps(-0.0f) */ +#define glmm_float32x8_SIGNMASK_NEG _mm256_castsi256_ps(_mm256_set1_epi32(GLMM_NEGZEROf)) static inline __m128