From df7fa97a76044b3ad2844a7cbab953469ad36ed1 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 12 Aug 2024 11:53:36 +0100 Subject: [PATCH] Add AVX detection All supported compilers define `__AVX__` when building with the AVX instruction set enabled. --- include/graphene-config.h.meson | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/graphene-config.h.meson b/include/graphene-config.h.meson index 1600830..cba1741 100644 --- a/include/graphene-config.h.meson +++ b/include/graphene-config.h.meson @@ -57,6 +57,7 @@ extern "C" { # if defined(GRAPHENE_USE_SSE) # include # include +# # if defined(_M_IX86_FP) # if _M_IX86_FP >= 2 # define GRAPHENE_USE_SSE4_1 @@ -66,9 +67,18 @@ extern "C" { # elif defined(_MSC_VER) # define GRAPHENE_USE_SSE4_1 # endif +# +# if defined(__AVX__) +# #define GRAPHENE_USE_AVX +# endif +# # if defined(GRAPHENE_USE_SSE4_1) # include # endif +# +# if defined(GRAPHENE_USE_AVX) +# include +# endif typedef __m128 graphene_simd4f_t; # elif defined(GRAPHENE_USE_ARM_NEON) # if defined (_MSC_VER) && (_MSC_VER < 1920) && defined (_M_ARM64)