include/SDL_cpuinfo.h
changeset 5389 24903690f48a
parent 5263 e1122f31fec5
child 5390 fefd4f7b5214
     1.1 --- a/include/SDL_cpuinfo.h	Mon Feb 21 23:45:48 2011 -0800
     1.2 +++ b/include/SDL_cpuinfo.h	Tue Feb 22 21:44:36 2011 -0800
     1.3 @@ -31,6 +31,34 @@
     1.4  
     1.5  #include "SDL_stdinc.h"
     1.6  
     1.7 +/* Need to do this here because intrin.h has C++ code in it */
     1.8 +/* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */
     1.9 +#if defined(_MSC_VER) && (_MSC_VER >= 1500) && !defined(_WIN32_WCE)
    1.10 +#include <intrin.h>
    1.11 +#define __MMX__
    1.12 +#define __3dNOW__
    1.13 +#define __SSE__
    1.14 +#define __SSE2__
    1.15 +#elif defined(__MINGW64_VERSION_MAJOR)
    1.16 +#include <intrin.h>
    1.17 +#else
    1.18 +#ifdef __MMX__
    1.19 +#include <mmintrin.h>
    1.20 +#endif
    1.21 +#ifdef __3dNOW__
    1.22 +#include <mm3dnow.h>
    1.23 +#endif
    1.24 +#ifdef __SSE__
    1.25 +#include <xmmintrin.h>
    1.26 +#endif
    1.27 +#ifdef __SSE2__
    1.28 +#include <emmintrin.h>
    1.29 +#endif
    1.30 +#ifdef HAVE_ALTIVEC_H
    1.31 +#include <altivec.h>
    1.32 +#endif
    1.33 +#endif
    1.34 +
    1.35  #include "begin_code.h"
    1.36  /* Set up for C function definitions, even when using C++ */
    1.37  #ifdef __cplusplus
    1.38 @@ -65,11 +93,21 @@
    1.39  extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void);
    1.40  
    1.41  /**
    1.42 + *  This function returns true if the CPU has AltiVec features.
    1.43 + */
    1.44 +extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void);
    1.45 +
    1.46 +/**
    1.47   *  This function returns true if the CPU has MMX features.
    1.48   */
    1.49  extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void);
    1.50  
    1.51  /**
    1.52 + *  This function returns true if the CPU has 3DNow! features.
    1.53 + */
    1.54 +extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void);
    1.55 +
    1.56 +/**
    1.57   *  This function returns true if the CPU has SSE features.
    1.58   */
    1.59  extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void);