From a7845ffc44cb91c24027f99d9a7b4901f84f5d71 Mon Sep 17 00:00:00 2001 From: Recep Aslantas Date: Sun, 7 Apr 2024 00:54:29 +0300 Subject: [PATCH] msvc, simd: fix simd headers for _M_ARM64EC --- include/cglm/simd/intrin.h | 11 +++++------ include/cglm/simd/neon/mat4.h | 2 +- include/cglm/types.h | 1 + 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/cglm/simd/intrin.h b/include/cglm/simd/intrin.h index 9dade91..9b3da2f 100644 --- a/include/cglm/simd/intrin.h +++ b/include/cglm/simd/intrin.h @@ -8,21 +8,20 @@ #ifndef cglm_intrin_h #define cglm_intrin_h -#if defined( _MSC_VER ) +#if defined(_MSC_VER) && !defined(_M_ARM64EC) # if (defined(_M_AMD64) || defined(_M_X64)) || _M_IX86_FP == 2 # ifndef __SSE__ # define __SSE__ # endif -# ifndef __SSE2__ -# define __SSE2__ -# endif + # elif _M_IX86_FP == 1 # ifndef __SSE__ # define __SSE__ # endif -#endif +# endif /* do not use alignment for older visual studio versions */ -# if _MSC_VER < 1913 /* Visual Studio 2017 version 15.6 */ +/* also ARM32 also causes similar error, disable it for now on ARM32 too */ +# if _MSC_VER < 1913 || _M_ARM /* Visual Studio 2017 version 15.6 */ # define CGLM_ALL_UNALIGNED # endif #endif diff --git a/include/cglm/simd/neon/mat4.h b/include/cglm/simd/neon/mat4.h index a15f1b2..92442e3 100644 --- a/include/cglm/simd/neon/mat4.h +++ b/include/cglm/simd/neon/mat4.h @@ -326,7 +326,7 @@ glm_mat4_inv_neon(mat4 mat, mat4 dest) { float32x4_t s1 = glmm_float32x4_SIGNMASK_PNPN, s2; #if !CGLM_ARM64 - float32x2_t l0, l1; + float32x2_t l0, l1; #endif s2 = vrev64q_f32(s1); diff --git a/include/cglm/types.h b/include/cglm/types.h index ce460b7..26e6467 100644 --- a/include/cglm/types.h +++ b/include/cglm/types.h @@ -14,6 +14,7 @@ #if defined(_MSC_VER) /* do not use alignment for older visual studio versions */ +/* also ARM32 also causes similar error, disable it for now on ARM32 too */ # if _MSC_VER < 1913 || _M_ARM /* Visual Studio 2017 version 15.6 */ # define CGLM_ALL_UNALIGNED # define CGLM_ALIGN(X) /* no alignment */