From 62c0448e25ee03dccf3dfa2c0fc61f157410678e Mon Sep 17 00:00:00 2001 From: Recep Aslantas Date: Sun, 7 Apr 2024 22:48:11 +0300 Subject: [PATCH] simd, msvc: ensure required definitions are exist on msvc --- include/cglm/simd/intrin.h | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/include/cglm/simd/intrin.h b/include/cglm/simd/intrin.h index 9b3da2f4..c477f34a 100644 --- a/include/cglm/simd/intrin.h +++ b/include/cglm/simd/intrin.h @@ -13,7 +13,9 @@ # ifndef __SSE__ # define __SSE__ # endif - +# ifndef __SSE2__ +# define __SSE2__ +# endif # elif _M_IX86_FP == 1 # ifndef __SSE__ # define __SSE__ @@ -26,6 +28,29 @@ # endif #endif +#ifdef __AVX__ +# include +# 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 # define CGLM_SSE_FP 1 @@ -63,14 +88,6 @@ # endif #endif -#ifdef __AVX__ -# include -# 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 */