|
SDL
2.0
|
Include dependency graph for SDL_cpuinfo.c: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 | CPU_HAS_NEON 0x00001000 |
| #define | CPU_HAS_ARM_SIMD 0x00002000 |
| #define | cpuid(func, a, b, c, d) a = b = c = d = 0 |
Variables | |
| static int | SDL_CPUCount = 0 |
| static Uint32 | SDL_CPUFeatures = 0xFFFFFFFF |
| static int | SDL_SystemRAM = 0 |
| #define CPU_HAS_3DNOW 0x00000008 |
Definition at line 71 of file SDL_cpuinfo.c.
Referenced by SDL_GetCPUFeatures(), and SDL_Has3DNow().
| #define CPU_HAS_ALTIVEC 0x00000002 |
Definition at line 69 of file SDL_cpuinfo.c.
Referenced by SDL_GetCPUFeatures(), and SDL_HasAltiVec().
| #define CPU_HAS_ARM_SIMD 0x00002000 |
Definition at line 80 of file SDL_cpuinfo.c.
Referenced by SDL_GetCPUFeatures(), and SDL_HasARMSIMD().
| #define CPU_HAS_AVX 0x00000400 |
Definition at line 77 of file SDL_cpuinfo.c.
Referenced by SDL_GetCPUFeatures(), and SDL_HasAVX().
| #define CPU_HAS_AVX2 0x00000800 |
Definition at line 78 of file SDL_cpuinfo.c.
Referenced by SDL_GetCPUFeatures(), and SDL_HasAVX2().
| #define CPU_HAS_MMX 0x00000004 |
Definition at line 70 of file SDL_cpuinfo.c.
Referenced by SDL_GetCPUFeatures(), and SDL_HasMMX().
| #define CPU_HAS_NEON 0x00001000 |
Definition at line 79 of file SDL_cpuinfo.c.
Referenced by SDL_GetCPUFeatures(), and SDL_HasNEON().
| #define CPU_HAS_RDTSC 0x00000001 |
Definition at line 68 of file SDL_cpuinfo.c.
Referenced by SDL_GetCPUFeatures(), and SDL_HasRDTSC().
| #define CPU_HAS_SSE 0x00000010 |
Definition at line 72 of file SDL_cpuinfo.c.
Referenced by SDL_GetCPUFeatures(), and SDL_HasSSE().
| #define CPU_HAS_SSE2 0x00000020 |
Definition at line 73 of file SDL_cpuinfo.c.
Referenced by SDL_GetCPUFeatures(), and SDL_HasSSE2().
| #define CPU_HAS_SSE3 0x00000040 |
Definition at line 74 of file SDL_cpuinfo.c.
Referenced by SDL_GetCPUFeatures(), and SDL_HasSSE3().
| #define CPU_HAS_SSE41 0x00000100 |
Definition at line 75 of file SDL_cpuinfo.c.
Referenced by SDL_GetCPUFeatures(), and SDL_HasSSE41().
| #define CPU_HAS_SSE42 0x00000200 |
Definition at line 76 of file SDL_cpuinfo.c.
Referenced by SDL_GetCPUFeatures(), and SDL_HasSSE42().
Definition at line 231 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 236 of file SDL_cpuinfo.c.
Referenced by CPU_haveMMX(), CPU_haveRDTSC(), CPU_haveSSE(), and CPU_haveSSE2().
|
static |
Definition at line 441 of file SDL_cpuinfo.c.
References CPU_haveCPUID(), cpuid, and d.
Referenced by SDL_GetCPUFeatures().
|
static |
Definition at line 291 of file SDL_cpuinfo.c.
References CPU_haveARMSIMD(), NULL, and void.
Referenced by SDL_GetCPUFeatures().
Definition at line 354 of file SDL_cpuinfo.c.
Referenced by CPU_haveAltiVec(), and SDL_GetCPUFeatures().
|
static |
Definition at line 519 of file SDL_cpuinfo.c.
References CPU_haveCPUID(), CPU_OSSavesYMM(), cpuid, and d.
Referenced by SDL_GetCPUFeatures().
|
static |
Definition at line 534 of file SDL_cpuinfo.c.
References CPU_haveCPUID(), CPU_OSSavesYMM(), cpuid, and d.
Referenced by SDL_GetCPUFeatures().
|
static |
Definition at line 95 of file SDL_cpuinfo.c.
References done, mov, and pop.
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 432 of file SDL_cpuinfo.c.
References CPU_getCPUIDFeatures(), and CPU_haveCPUID().
Referenced by SDL_GetCPUFeatures().
|
static |
|
static |
Definition at line 282 of file SDL_cpuinfo.c.
References CPU_getCPUIDFeatures(), and CPU_haveCPUID().
Referenced by SDL_GetCPUFeatures().
|
static |
Definition at line 456 of file SDL_cpuinfo.c.
References CPU_getCPUIDFeatures(), and CPU_haveCPUID().
Referenced by SDL_GetCPUFeatures().
|
static |
Definition at line 465 of file SDL_cpuinfo.c.
References CPU_getCPUIDFeatures(), and CPU_haveCPUID().
Referenced by SDL_GetCPUFeatures().
|
static |
Definition at line 474 of file SDL_cpuinfo.c.
References CPU_haveCPUID(), cpuid, and d.
Referenced by SDL_GetCPUFeatures().
|
static |
Definition at line 489 of file SDL_cpuinfo.c.
References CPU_haveCPUID(), cpuid, and d.
Referenced by SDL_GetCPUFeatures().
|
static |
Definition at line 504 of file SDL_cpuinfo.c.
References CPU_haveCPUID(), cpuid, and d.
Referenced by SDL_GetCPUFeatures().
Definition at line 250 of file SDL_cpuinfo.c.
References cpuid, d, mov, 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 693 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 551 of file SDL_cpuinfo.c.
References NULL, and SDL_CPUCount.
Referenced by SDL_GetSystemRAM().
Definition at line 713 of file SDL_cpuinfo.c.
References CPU_HAS_3DNOW, CPU_HAS_ALTIVEC, CPU_HAS_ARM_SIMD, CPU_HAS_AVX, CPU_HAS_AVX2, CPU_HAS_MMX, CPU_HAS_NEON, CPU_HAS_RDTSC, CPU_HAS_SSE, CPU_HAS_SSE2, CPU_HAS_SSE3, CPU_HAS_SSE41, CPU_HAS_SSE42, CPU_have3DNow(), CPU_haveAltiVec(), CPU_haveARMSIMD(), CPU_haveAVX(), CPU_haveAVX2(), CPU_haveMMX(), CPU_haveNEON(), CPU_haveRDTSC(), CPU_haveSSE(), CPU_haveSSE2(), CPU_haveSSE3(), CPU_haveSSE41(), CPU_haveSSE42(), and SDL_CPUFeatures.
Referenced by SDL_Has3DNow(), SDL_HasAltiVec(), SDL_HasARMSIMD(), SDL_HasAVX(), SDL_HasAVX2(), SDL_HasMMX(), SDL_HasNEON(), SDL_HasRDTSC(), SDL_HasSSE(), SDL_HasSSE2(), SDL_HasSSE3(), SDL_HasSSE41(), and SDL_HasSSE42().
|
static |
Definition at line 584 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 880 of file SDL_cpuinfo.c.
References main, NULL, SDL_GetCPUCacheLineSize(), SDL_GetCPUCount(), SDL_GetCPUType(), SDL_Has3DNow(), SDL_HasAltiVec(), SDL_HasARMSIMD(), SDL_HasAVX(), SDL_HasAVX2(), SDL_HasMMX(), SDL_HasNEON(), 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 788 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 770 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 ARM SIMD (ARMv6) features.
Definition at line 860 of file SDL_cpuinfo.c.
References CPU_HAS_ARM_SIMD, SDL_FALSE, SDL_GetCPUFeatures(), and SDL_TRUE.
Referenced by SDL_CalculateBlitA(), SDL_FillRect(), and SDL_GetSystemRAM().
This function returns true if the CPU has AVX features.
Definition at line 842 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 851 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 779 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 NEON (ARM SIMD) features.
Definition at line 869 of file SDL_cpuinfo.c.
References CPU_HAS_NEON, SDL_FALSE, SDL_GetCPUFeatures(), and SDL_TRUE.
Referenced by SDL_CalculateBlitA(), SDL_FillRect(), and SDL_GetSystemRAM().
This function returns true if the CPU has the RDTSC instruction.
Definition at line 761 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 797 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 806 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 815 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 824 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 833 of file SDL_cpuinfo.c.
References CPU_HAS_SSE42, SDL_FALSE, SDL_GetCPUFeatures(), and SDL_TRUE.
Referenced by SDL_GetSystemRAM().
|
static |
Definition at line 548 of file SDL_cpuinfo.c.
Referenced by SDL_GetCPUCount().
|
static |
Definition at line 710 of file SDL_cpuinfo.c.
Referenced by SDL_GetCPUFeatures().
|
static |
Definition at line 877 of file SDL_cpuinfo.c.
Referenced by SDL_GetSystemRAM().