diff options
| author | 2014-04-08 19:25:03 -0400 | |
|---|---|---|
| committer | 2014-04-08 19:25:03 -0400 | |
| commit | 63e46abdb8764bc97e91bae862c8d461e61b1965 (patch) | |
| tree | e73f4aa25d7b4015a265e7bbfb6004dab7561027 /src/common/cpu_detect.h | |
| parent | fixed some license headers that I missed (diff) | |
| download | yuzu-63e46abdb8764bc97e91bae862c8d461e61b1965.tar.gz yuzu-63e46abdb8764bc97e91bae862c8d461e61b1965.tar.xz yuzu-63e46abdb8764bc97e91bae862c8d461e61b1965.zip | |
got rid of 'src' folders in each sub-project
Diffstat (limited to 'src/common/cpu_detect.h')
| -rw-r--r-- | src/common/cpu_detect.h | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/src/common/cpu_detect.h b/src/common/cpu_detect.h new file mode 100644 index 000000000..e93cf333a --- /dev/null +++ b/src/common/cpu_detect.h | |||
| @@ -0,0 +1,81 @@ | |||
| 1 | // Copyright 2013 Dolphin Emulator Project | ||
| 2 | // Licensed under GPLv2 | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | |||
| 6 | // Detect the cpu, so we'll know which optimizations to use | ||
| 7 | #ifndef _CPUDETECT_H_ | ||
| 8 | #define _CPUDETECT_H_ | ||
| 9 | |||
| 10 | #include <string> | ||
| 11 | |||
| 12 | enum CPUVendor | ||
| 13 | { | ||
| 14 | VENDOR_INTEL = 0, | ||
| 15 | VENDOR_AMD = 1, | ||
| 16 | VENDOR_ARM = 2, | ||
| 17 | VENDOR_OTHER = 3, | ||
| 18 | }; | ||
| 19 | |||
| 20 | struct CPUInfo | ||
| 21 | { | ||
| 22 | CPUVendor vendor; | ||
| 23 | |||
| 24 | char cpu_string[0x21]; | ||
| 25 | char brand_string[0x41]; | ||
| 26 | bool OS64bit; | ||
| 27 | bool CPU64bit; | ||
| 28 | bool Mode64bit; | ||
| 29 | |||
| 30 | bool HTT; | ||
| 31 | int num_cores; | ||
| 32 | int logical_cpu_count; | ||
| 33 | |||
| 34 | bool bSSE; | ||
| 35 | bool bSSE2; | ||
| 36 | bool bSSE3; | ||
| 37 | bool bSSSE3; | ||
| 38 | bool bPOPCNT; | ||
| 39 | bool bSSE4_1; | ||
| 40 | bool bSSE4_2; | ||
| 41 | bool bLZCNT; | ||
| 42 | bool bSSE4A; | ||
| 43 | bool bAVX; | ||
| 44 | bool bAES; | ||
| 45 | bool bLAHFSAHF64; | ||
| 46 | bool bLongMode; | ||
| 47 | |||
| 48 | // ARM specific CPUInfo | ||
| 49 | bool bSwp; | ||
| 50 | bool bHalf; | ||
| 51 | bool bThumb; | ||
| 52 | bool bFastMult; | ||
| 53 | bool bVFP; | ||
| 54 | bool bEDSP; | ||
| 55 | bool bThumbEE; | ||
| 56 | bool bNEON; | ||
| 57 | bool bVFPv3; | ||
| 58 | bool bTLS; | ||
| 59 | bool bVFPv4; | ||
| 60 | bool bIDIVa; | ||
| 61 | bool bIDIVt; | ||
| 62 | bool bArmV7; // enable MOVT, MOVW etc | ||
| 63 | |||
| 64 | // ARMv8 specific | ||
| 65 | bool bFP; | ||
| 66 | bool bASIMD; | ||
| 67 | |||
| 68 | // Call Detect() | ||
| 69 | explicit CPUInfo(); | ||
| 70 | |||
| 71 | // Turn the cpu info into a string we can show | ||
| 72 | std::string Summarize(); | ||
| 73 | |||
| 74 | private: | ||
| 75 | // Detects the various cpu features | ||
| 76 | void Detect(); | ||
| 77 | }; | ||
| 78 | |||
| 79 | extern CPUInfo cpu_info; | ||
| 80 | |||
| 81 | #endif // _CPUDETECT_H_ | ||