SDL_cpuinfo.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #ifndef _SDL_cpuinfo_h
  2. #define _SDL_cpuinfo_h
  3. #include "SDL_stdinc.h"
  4. #if defined(_MSC_VER) && (_MSC_VER >= 1500)
  5. #include <intrin.h>
  6. #ifndef _WIN64
  7. #define __MMX__
  8. #define __3dNOW__
  9. #endif
  10. #define __SSE__
  11. #define __SSE2__
  12. #elif defined(__MINGW64_VERSION_MAJOR)
  13. #include <intrin.h>
  14. #else
  15. #ifdef __ALTIVEC__
  16. #if HAVE_ALTIVEC_H && !defined(__APPLE_ALTIVEC__)
  17. #include <altivec.h>
  18. #undef pixel
  19. #endif
  20. #endif
  21. #ifdef __MMX__
  22. #include <mmintrin.h>
  23. #endif
  24. #ifdef __3dNOW__
  25. #include <mm3dnow.h>
  26. #endif
  27. #ifdef __SSE__
  28. #include <xmmintrin.h>
  29. #endif
  30. #ifdef __SSE2__
  31. #include <emmintrin.h>
  32. #endif
  33. #endif
  34. #include "begin_code.h"
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif
  38. #define SDL_CACHELINE_SIZE 128
  39. typedef int SDLCALL tSDL_GetCPUCount(void);
  40. typedef int SDLCALL tSDL_GetCPUCacheLineSize(void);
  41. typedef SDL_bool SDLCALL tSDL_HasRDTSC(void);
  42. typedef SDL_bool SDLCALL tSDL_HasAltiVec(void);
  43. typedef SDL_bool SDLCALL tSDL_HasMMX(void);
  44. typedef SDL_bool SDLCALL tSDL_Has3DNow(void);
  45. typedef SDL_bool SDLCALL tSDL_HasSSE(void);
  46. typedef SDL_bool SDLCALL tSDL_HasSSE2(void);
  47. typedef SDL_bool SDLCALL tSDL_HasSSE3(void);
  48. typedef SDL_bool SDLCALL tSDL_HasSSE41(void);
  49. typedef SDL_bool SDLCALL tSDL_HasSSE42(void);
  50. extern tSDL_GetCPUCount *SDL_GetCPUCount;
  51. extern tSDL_GetCPUCacheLineSize *SDL_GetCPUCacheLineSize;
  52. extern tSDL_HasRDTSC *SDL_HasRDTSC;
  53. extern tSDL_HasAltiVec *SDL_HasAltiVec;
  54. extern tSDL_HasMMX *SDL_HasMMX;
  55. extern tSDL_Has3DNow *SDL_Has3DNow;
  56. extern tSDL_HasSSE *SDL_HasSSE;
  57. extern tSDL_HasSSE2 *SDL_HasSSE2;
  58. extern tSDL_HasSSE3 *SDL_HasSSE3;
  59. extern tSDL_HasSSE41 *SDL_HasSSE41;
  60. extern tSDL_HasSSE42 *SDL_HasSSE42;
  61. #ifdef __cplusplus
  62. }
  63. #endif
  64. #include "close_code.h"
  65. #endif