Skip to content

Commit

Permalink
simd, msvc: ensure required definitions are exist on msvc
Browse files Browse the repository at this point in the history
  • Loading branch information
recp committed Apr 7, 2024
1 parent 4f00ce0 commit 62c0448
Showing 1 changed file with 26 additions and 9 deletions.
35 changes: 26 additions & 9 deletions include/cglm/simd/intrin.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
# ifndef __SSE__
# define __SSE__
# endif

# ifndef __SSE2__
# define __SSE2__
# endif
# elif _M_IX86_FP == 1
# ifndef __SSE__
# define __SSE__
Expand All @@ -26,6 +28,29 @@
# endif
#endif

#ifdef __AVX__
# include <immintrin.h>
# define CGLM_AVX_FP 1
# ifndef __SSE2__
# define __SSE2__
# endif
# ifndef __SSE3__
# define __SSE3__
# endif
# ifndef __SSE4__
# define __SSE4__
# endif
# ifndef __SSE4_1__
# define __SSE4_1__
# endif
# ifndef __SSE4_2__
# define __SSE4_2__
# endif
# ifndef CGLM_SIMD_x86
# define CGLM_SIMD_x86
# endif
#endif

#if defined(__SSE__)
# include <xmmintrin.h>
# define CGLM_SSE_FP 1
Expand Down Expand Up @@ -63,14 +88,6 @@
# endif
#endif

#ifdef __AVX__
# include <immintrin.h>
# define CGLM_AVX_FP 1
# ifndef CGLM_SIMD_x86
# define CGLM_SIMD_x86
# endif
#endif

/* ARM Neon */
#if defined(_WIN32) && defined(_MSC_VER)
/* TODO: non-ARM stuff already inported, will this be better option */
Expand Down

0 comments on commit 62c0448

Please sign in to comment.