SDL
2.0
|
Go to the source code of this file.
Macros | |
#define | CPU_HAS_RDTSC 0x00000001 |
#define | CPU_HAS_ALTIVEC 0x00000002 |
#define | CPU_HAS_MMX 0x00000004 |
#define | CPU_HAS_3DNOW 0x00000008 |
#define | CPU_HAS_SSE 0x00000010 |
#define | CPU_HAS_SSE2 0x00000020 |
#define | CPU_HAS_SSE3 0x00000040 |
#define | CPU_HAS_SSE41 0x00000100 |
#define | CPU_HAS_SSE42 0x00000200 |
#define | CPU_HAS_AVX 0x00000400 |
#define | CPU_HAS_AVX2 0x00000800 |
#define | cpuid(func, a, b, c, d) a = b = c = d = 0 |
Functions | |
static int | CPU_haveCPUID (void) |
static int | CPU_getCPUIDFeatures (void) |
static SDL_bool | CPU_OSSavesYMM (void) |
static int | CPU_haveRDTSC (void) |
static int | CPU_haveAltiVec (void) |
static int | CPU_haveMMX (void) |
static int | CPU_have3DNow (void) |
static int | CPU_haveSSE (void) |
static int | CPU_haveSSE2 (void) |
static int | CPU_haveSSE3 (void) |
static int | CPU_haveSSE41 (void) |
static int | CPU_haveSSE42 (void) |
static int | CPU_haveAVX (void) |
static int | CPU_haveAVX2 (void) |
int | SDL_GetCPUCount (void) |
static const char * | SDL_GetCPUType (void) |
int | SDL_GetCPUCacheLineSize (void) |
static Uint32 | SDL_GetCPUFeatures (void) |
SDL_bool | SDL_HasRDTSC (void) |
SDL_bool | SDL_HasAltiVec (void) |
SDL_bool | SDL_HasMMX (void) |
SDL_bool | SDL_Has3DNow (void) |
SDL_bool | SDL_HasSSE (void) |
SDL_bool | SDL_HasSSE2 (void) |
SDL_bool | SDL_HasSSE3 (void) |
SDL_bool | SDL_HasSSE41 (void) |
SDL_bool | SDL_HasSSE42 (void) |
SDL_bool | SDL_HasAVX (void) |
SDL_bool | SDL_HasAVX2 (void) |
int | SDL_GetSystemRAM (void) |
Variables | |
static int | SDL_CPUCount = 0 |
static Uint32 | SDL_CPUFeatures = 0xFFFFFFFF |
static int | SDL_SystemRAM = 0 |
#define CPU_HAS_3DNOW 0x00000008 |
Definition at line 56 of file SDL_cpuinfo.c.
Referenced by SDL_GetCPUFeatures(), and SDL_Has3DNow().
#define CPU_HAS_ALTIVEC 0x00000002 |
Definition at line 54 of file SDL_cpuinfo.c.
Referenced by SDL_GetCPUFeatures(), and SDL_HasAltiVec().
#define CPU_HAS_AVX 0x00000400 |
Definition at line 62 of file SDL_cpuinfo.c.
Referenced by SDL_GetCPUFeatures(), and SDL_HasAVX().
#define CPU_HAS_AVX2 0x00000800 |
Definition at line 63 of file SDL_cpuinfo.c.
Referenced by SDL_GetCPUFeatures(), and SDL_HasAVX2().
#define CPU_HAS_MMX 0x00000004 |
Definition at line 55 of file SDL_cpuinfo.c.
Referenced by SDL_GetCPUFeatures(), and SDL_HasMMX().
#define CPU_HAS_RDTSC 0x00000001 |
Definition at line 53 of file SDL_cpuinfo.c.
Referenced by SDL_GetCPUFeatures(), and SDL_HasRDTSC().
#define CPU_HAS_SSE 0x00000010 |
Definition at line 57 of file SDL_cpuinfo.c.
Referenced by SDL_GetCPUFeatures(), and SDL_HasSSE().
#define CPU_HAS_SSE2 0x00000020 |
Definition at line 58 of file SDL_cpuinfo.c.
Referenced by SDL_GetCPUFeatures(), and SDL_HasSSE2().
#define CPU_HAS_SSE3 0x00000040 |
Definition at line 59 of file SDL_cpuinfo.c.
Referenced by SDL_GetCPUFeatures(), and SDL_HasSSE3().
#define CPU_HAS_SSE41 0x00000100 |
Definition at line 60 of file SDL_cpuinfo.c.
Referenced by SDL_GetCPUFeatures(), and SDL_HasSSE41().
#define CPU_HAS_SSE42 0x00000200 |
Definition at line 61 of file SDL_cpuinfo.c.
Referenced by SDL_GetCPUFeatures(), and SDL_HasSSE42().
Definition at line 214 of file SDL_cpuinfo.c.
Referenced by CPU_getCPUIDFeatures(), CPU_have3DNow(), CPU_haveAVX(), CPU_haveAVX2(), CPU_haveSSE3(), CPU_haveSSE41(), CPU_haveSSE42(), CPU_OSSavesYMM(), SDL_GetCPUCacheLineSize(), and SDL_GetCPUType().
|
static |
Definition at line 219 of file SDL_cpuinfo.c.
Referenced by CPU_haveMMX(), CPU_haveRDTSC(), CPU_haveSSE(), and CPU_haveSSE2().
|
static |
Definition at line 312 of file SDL_cpuinfo.c.
References CPU_haveCPUID(), cpuid, and d.
Referenced by SDL_GetCPUFeatures().
|
static |
Definition at line 274 of file SDL_cpuinfo.c.
Referenced by SDL_GetCPUFeatures().
|
static |
Definition at line 390 of file SDL_cpuinfo.c.
References CPU_haveCPUID(), CPU_OSSavesYMM(), cpuid, and d.
Referenced by SDL_GetCPUFeatures().
|
static |
Definition at line 405 of file SDL_cpuinfo.c.
References CPU_haveCPUID(), CPU_OSSavesYMM(), cpuid, and d.
Referenced by SDL_GetCPUFeatures().
|
static |
Definition at line 78 of file SDL_cpuinfo.c.
Referenced by CPU_have3DNow(), CPU_haveAVX(), CPU_haveAVX2(), CPU_haveMMX(), CPU_haveRDTSC(), CPU_haveSSE(), CPU_haveSSE2(), CPU_haveSSE3(), CPU_haveSSE41(), CPU_haveSSE42(), and SDL_GetCPUType().
|
static |
Definition at line 303 of file SDL_cpuinfo.c.
References CPU_getCPUIDFeatures(), and CPU_haveCPUID().
Referenced by SDL_GetCPUFeatures().
|
static |
Definition at line 265 of file SDL_cpuinfo.c.
References CPU_getCPUIDFeatures(), and CPU_haveCPUID().
Referenced by SDL_GetCPUFeatures().
|
static |
Definition at line 327 of file SDL_cpuinfo.c.
References CPU_getCPUIDFeatures(), and CPU_haveCPUID().
Referenced by SDL_GetCPUFeatures().
|
static |
Definition at line 336 of file SDL_cpuinfo.c.
References CPU_getCPUIDFeatures(), and CPU_haveCPUID().
Referenced by SDL_GetCPUFeatures().
|
static |
Definition at line 345 of file SDL_cpuinfo.c.
References CPU_haveCPUID(), cpuid, and d.
Referenced by SDL_GetCPUFeatures().
|
static |
Definition at line 360 of file SDL_cpuinfo.c.
References CPU_haveCPUID(), cpuid, and d.
Referenced by SDL_GetCPUFeatures().
|
static |
Definition at line 375 of file SDL_cpuinfo.c.
References CPU_haveCPUID(), cpuid, and d.
Referenced by SDL_GetCPUFeatures().
Definition at line 233 of file SDL_cpuinfo.c.
References cpuid, d, SDL_FALSE, and SDL_TRUE.
Referenced by CPU_haveAVX(), and CPU_haveAVX2().
int SDL_GetCPUCacheLineSize | ( | void | ) |
This function returns the L1 cache line size of the CPU
This is useful for determining multi-threaded structure padding or SIMD prefetch sizes.
Definition at line 564 of file SDL_cpuinfo.c.
References cpuid, d, SDL_CACHELINE_SIZE, SDL_GetCPUType(), SDL_strcmp, and void.
Referenced by SDL_GetSystemRAM().
int SDL_GetCPUCount | ( | void | ) |
This function returns the number of CPU cores available.
Definition at line 422 of file SDL_cpuinfo.c.
References NULL, and SDL_CPUCount.
Referenced by SDL_GetSystemRAM().
Definition at line 584 of file SDL_cpuinfo.c.
References CPU_HAS_3DNOW, CPU_HAS_ALTIVEC, CPU_HAS_AVX, CPU_HAS_AVX2, CPU_HAS_MMX, CPU_HAS_RDTSC, CPU_HAS_SSE, CPU_HAS_SSE2, CPU_HAS_SSE3, CPU_HAS_SSE41, CPU_HAS_SSE42, CPU_have3DNow(), CPU_haveAltiVec(), CPU_haveAVX(), CPU_haveAVX2(), CPU_haveMMX(), CPU_haveRDTSC(), CPU_haveSSE(), CPU_haveSSE2(), CPU_haveSSE3(), CPU_haveSSE41(), CPU_haveSSE42(), and SDL_CPUFeatures.
Referenced by SDL_Has3DNow(), SDL_HasAltiVec(), SDL_HasAVX(), SDL_HasAVX2(), SDL_HasMMX(), SDL_HasRDTSC(), SDL_HasSSE(), SDL_HasSSE2(), SDL_HasSSE3(), SDL_HasSSE41(), and SDL_HasSSE42().
|
static |
Definition at line 455 of file SDL_cpuinfo.c.
References CPU_haveCPUID(), cpuid, d, i, SDL_strlcpy, and void.
Referenced by SDL_GetCPUCacheLineSize(), and SDL_GetSystemRAM().
int SDL_GetSystemRAM | ( | void | ) |
This function returns the amount of RAM configured in the system, in MB.
Definition at line 727 of file SDL_cpuinfo.c.
References main, NULL, SDL_GetCPUCacheLineSize(), SDL_GetCPUCount(), SDL_GetCPUType(), SDL_Has3DNow(), SDL_HasAltiVec(), SDL_HasAVX(), SDL_HasAVX2(), SDL_HasMMX(), SDL_HasRDTSC(), SDL_HasSSE(), SDL_HasSSE2(), SDL_HasSSE3(), SDL_HasSSE41(), SDL_HasSSE42(), and SDL_SystemRAM.
This function returns true if the CPU has 3DNow! features.
Definition at line 653 of file SDL_cpuinfo.c.
References CPU_HAS_3DNOW, SDL_FALSE, SDL_GetCPUFeatures(), and SDL_TRUE.
Referenced by SDL_GetSystemRAM().
This function returns true if the CPU has AltiVec features.
Definition at line 635 of file SDL_cpuinfo.c.
References CPU_HAS_ALTIVEC, SDL_FALSE, SDL_GetCPUFeatures(), and SDL_TRUE.
Referenced by SDL_GetSystemRAM().
This function returns true if the CPU has AVX features.
Definition at line 707 of file SDL_cpuinfo.c.
References CPU_HAS_AVX, SDL_FALSE, SDL_GetCPUFeatures(), and SDL_TRUE.
Referenced by SDL_GetSystemRAM().
This function returns true if the CPU has AVX2 features.
Definition at line 716 of file SDL_cpuinfo.c.
References CPU_HAS_AVX2, SDL_FALSE, SDL_GetCPUFeatures(), and SDL_TRUE.
Referenced by SDL_GetSystemRAM().
This function returns true if the CPU has MMX features.
Definition at line 644 of file SDL_cpuinfo.c.
References CPU_HAS_MMX, SDL_FALSE, SDL_GetCPUFeatures(), and SDL_TRUE.
Referenced by SDL_GetSystemRAM().
This function returns true if the CPU has the RDTSC instruction.
Definition at line 626 of file SDL_cpuinfo.c.
References CPU_HAS_RDTSC, SDL_FALSE, SDL_GetCPUFeatures(), and SDL_TRUE.
Referenced by SDL_GetSystemRAM().
This function returns true if the CPU has SSE features.
Definition at line 662 of file SDL_cpuinfo.c.
References CPU_HAS_SSE, SDL_FALSE, SDL_GetCPUFeatures(), and SDL_TRUE.
Referenced by SDL_GetSystemRAM().
This function returns true if the CPU has SSE2 features.
Definition at line 671 of file SDL_cpuinfo.c.
References CPU_HAS_SSE2, SDL_FALSE, SDL_GetCPUFeatures(), and SDL_TRUE.
Referenced by SDL_GetSystemRAM().
This function returns true if the CPU has SSE3 features.
Definition at line 680 of file SDL_cpuinfo.c.
References CPU_HAS_SSE3, SDL_FALSE, SDL_GetCPUFeatures(), and SDL_TRUE.
Referenced by SDL_GetSystemRAM().
This function returns true if the CPU has SSE4.1 features.
Definition at line 689 of file SDL_cpuinfo.c.
References CPU_HAS_SSE41, SDL_FALSE, SDL_GetCPUFeatures(), and SDL_TRUE.
Referenced by SDL_GetSystemRAM().
This function returns true if the CPU has SSE4.2 features.
Definition at line 698 of file SDL_cpuinfo.c.
References CPU_HAS_SSE42, SDL_FALSE, SDL_GetCPUFeatures(), and SDL_TRUE.
Referenced by SDL_GetSystemRAM().
|
static |
Definition at line 419 of file SDL_cpuinfo.c.
Referenced by SDL_GetCPUCount().
|
static |
Definition at line 581 of file SDL_cpuinfo.c.
Referenced by SDL_GetCPUFeatures().
|
static |
Definition at line 724 of file SDL_cpuinfo.c.
Referenced by SDL_GetSystemRAM().