Windows: NEON detection and intrinsic includes on Visual Studio

Visual Studio doesn't define __ARM_ARCH nor _ARM_NEON, but _M_ARM and _M_ARM64,
so SDL_HasNEON() was bypassed.

PF_ARM_NEON_INSTRUCTIONS_AVAILABLE doesn't see to be defined (but still works
 when defined as 19).
This commit is contained in:
Sylvain Becker 2018-12-04 16:50:31 +01:00
parent feadefd971
commit ee4db39e2d
2 changed files with 28 additions and 7 deletions

View file

@ -54,8 +54,22 @@
#if defined(HAVE_ALTIVEC_H) && defined(__ALTIVEC__) && !defined(__APPLE_ALTIVEC__) && defined(SDL_ENABLE_ALTIVEC_H)
#include <altivec.h>
#endif
#if defined(__ARM_NEON) && !defined(SDL_DISABLE_ARM_NEON_H)
#include <arm_neon.h>
#if !defined(SDL_DISABLE_ARM_NEON_H)
# if defined(__ARM_NEON)
# include <arm_neon.h>
# elif defined(__WINDOWS__) || defined(__WINRT__)
/* Visual Studio doesn't define __ARM_ARCH, but _M_ARM (if set, always 7), and _M_ARM64 (if set, always 1).
# if defined(_M_ARM)
# include <armintr.h>
# include <arm_neon.h>
# endif
# if defined (_M_ARM64)
# include <armintr.h>
# include <arm_neon.h>
# endif
/* Set __ARM_NEON so that it can be used elsewhere, at compile time */
# define __ARM_NEON 1
# endif
#endif
#if defined(__3dNOW__) && !defined(SDL_DISABLE_MM3DNOW_H)
#include <mm3dnow.h>