Skip to content

Commit

Permalink
make xor enable in SSEonly + fast math
Browse files Browse the repository at this point in the history
  • Loading branch information
recp committed Apr 1, 2024
1 parent d8e933b commit 1d09c41
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions include/cglm/simd/x86.h
Expand Up @@ -55,8 +55,20 @@
#endif

/* Note that `0x80000000` corresponds to `INT_MIN` for a 32-bit int. */
#define GLMM_NEGZEROf ((int)0x80000000) /* 0x80000000 ---> -0.0f */
#define GLMM_POSZEROf ((int)0x00000000) /* 0x00000000 ---> +0.0f */

#if defined(__SSE2__)
# define GLMM_NEGZEROf ((int)0x80000000) /* 0x80000000 ---> -0.0f */
# define GLMM_POSZEROf ((int)0x00000000) /* 0x00000000 ---> +0.0f */
#else
# ifdef CGLM_FAST_MATH
union { int i; float f; } static GLMM_NEGZEROf_TU = { .i = 0x80000000 };
# define GLMM_NEGZEROf GLMM_NEGZEROf_TU.f
# define GLMM_POSZEROf 0.0f
# else
# define GLMM_NEGZEROf -0.0f
# define GLMM_POSZEROf 0.0f
# endif
#endif

#if defined(__SSE2__)
# define GLMM__SIGNMASKf(X, Y, Z, W) \
Expand Down

0 comments on commit 1d09c41

Please sign in to comment.