diff options
| author | 2015-07-21 19:49:33 -0400 | |
|---|---|---|
| committer | 2015-08-15 17:33:44 -0400 | |
| commit | 4d517922856791decfed475cdd536aedcaa25c30 (patch) | |
| tree | e6ac9daf302ea079411052bb0e78428fb71f1440 /src/common/cpu_detect.h | |
| parent | Shader: Define a common interface for running vertex shader programs. (diff) | |
| download | yuzu-4d517922856791decfed475cdd536aedcaa25c30.tar.gz yuzu-4d517922856791decfed475cdd536aedcaa25c30.tar.xz yuzu-4d517922856791decfed475cdd536aedcaa25c30.zip | |
Common: Ported over Dolphin's code for x86 CPU capability detection.
Diffstat (limited to 'src/common/cpu_detect.h')
| -rw-r--r-- | src/common/cpu_detect.h | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/src/common/cpu_detect.h b/src/common/cpu_detect.h index b585f9608..19a2c25d6 100644 --- a/src/common/cpu_detect.h +++ b/src/common/cpu_detect.h | |||
| @@ -3,11 +3,13 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | // Detect the cpu, so we'll know which optimizations to use | 6 | // Detect the CPU, so we'll know which optimizations to use |
| 7 | #pragma once | 7 | #pragma once |
| 8 | 8 | ||
| 9 | #include <string> | 9 | #include <string> |
| 10 | 10 | ||
| 11 | namespace Common { | ||
| 12 | |||
| 11 | enum CPUVendor | 13 | enum CPUVendor |
| 12 | { | 14 | { |
| 13 | VENDOR_INTEL = 0, | 15 | VENDOR_INTEL = 0, |
| @@ -40,29 +42,28 @@ struct CPUInfo | |||
| 40 | bool bLZCNT; | 42 | bool bLZCNT; |
| 41 | bool bSSE4A; | 43 | bool bSSE4A; |
| 42 | bool bAVX; | 44 | bool bAVX; |
| 45 | bool bAVX2; | ||
| 46 | bool bBMI1; | ||
| 47 | bool bBMI2; | ||
| 48 | bool bFMA; | ||
| 49 | bool bFMA4; | ||
| 43 | bool bAES; | 50 | bool bAES; |
| 51 | // FXSAVE/FXRSTOR | ||
| 52 | bool bFXSR; | ||
| 53 | bool bMOVBE; | ||
| 54 | // This flag indicates that the hardware supports some mode | ||
| 55 | // in which denormal inputs _and_ outputs are automatically set to (signed) zero. | ||
| 56 | bool bFlushToZero; | ||
| 44 | bool bLAHFSAHF64; | 57 | bool bLAHFSAHF64; |
| 45 | bool bLongMode; | 58 | bool bLongMode; |
| 46 | 59 | bool bAtom; | |
| 47 | // ARM specific CPUInfo | ||
| 48 | bool bSwp; | ||
| 49 | bool bHalf; | ||
| 50 | bool bThumb; | ||
| 51 | bool bFastMult; | ||
| 52 | bool bVFP; | ||
| 53 | bool bEDSP; | ||
| 54 | bool bThumbEE; | ||
| 55 | bool bNEON; | ||
| 56 | bool bVFPv3; | ||
| 57 | bool bTLS; | ||
| 58 | bool bVFPv4; | ||
| 59 | bool bIDIVa; | ||
| 60 | bool bIDIVt; | ||
| 61 | bool bArmV7; // enable MOVT, MOVW etc | ||
| 62 | 60 | ||
| 63 | // ARMv8 specific | 61 | // ARMv8 specific |
| 64 | bool bFP; | 62 | bool bFP; |
| 65 | bool bASIMD; | 63 | bool bASIMD; |
| 64 | bool bCRC32; | ||
| 65 | bool bSHA1; | ||
| 66 | bool bSHA2; | ||
| 66 | 67 | ||
| 67 | // Call Detect() | 68 | // Call Detect() |
| 68 | explicit CPUInfo(); | 69 | explicit CPUInfo(); |
| @@ -76,3 +77,5 @@ private: | |||
| 76 | }; | 77 | }; |
| 77 | 78 | ||
| 78 | extern CPUInfo cpu_info; | 79 | extern CPUInfo cpu_info; |
| 80 | |||
| 81 | } // namespace Common | ||