mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-14 23:38:14 +00:00
cmake: Detect AVX + allow build system to disable Intel intrinsics
This commit is contained in:

committed by
Anonymous Maarten

parent
683411e96f
commit
4681240241
@@ -185,6 +185,46 @@
|
||||
|
||||
#include <SDL3/SDL.h>
|
||||
#include <SDL3/SDL_intrin.h>
|
||||
|
||||
|
||||
#ifdef __ARM_NEON
|
||||
#define HAVE_NEON_INTRINSICS 1
|
||||
#endif
|
||||
|
||||
#if defined(__MMX__) && !defined(SDL_DISABLE_MMX)
|
||||
#define HAVE_MMX_INTRINSICS 1
|
||||
#endif
|
||||
|
||||
#if defined(__SSE__) && !defined(SDL_DISABLE_SSE)
|
||||
#define HAVE_SSE_INTRINSICS 1
|
||||
#endif
|
||||
|
||||
#if defined(__SSE2__) && !defined(SDL_DISABLE_SSE2)
|
||||
#define HAVE_SSE2_INTRINSICS 1
|
||||
#endif
|
||||
|
||||
#if defined(__SSE3__) && !defined(SDL_DISABLE_SSE3)
|
||||
#define HAVE_SSE3_INTRINSICS 1
|
||||
#endif
|
||||
|
||||
#if defined(__AVX__) && !defined(SDL_DISABLE_AVX)
|
||||
#define HAVE_AVX_INTRINSICS 1
|
||||
#endif
|
||||
|
||||
#if defined __clang__
|
||||
#if (!__has_attribute(target))
|
||||
#undef HAVE_AVX_INTRINSICS
|
||||
#endif
|
||||
#if (defined(_MSC_VER) || defined(__SCE__)) && !defined(__AVX__)
|
||||
#undef HAVE_AVX_INTRINSICS
|
||||
#endif
|
||||
#elif defined __GNUC__
|
||||
#if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 9)
|
||||
#undef HAVE_AVX_INTRINSICS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#define SDL_MAIN_NOIMPL /* don't drag in header-only implementation of SDL_main */
|
||||
#include <SDL3/SDL_main.h>
|
||||
|
||||
|
Reference in New Issue
Block a user