summaryrefslogtreecommitdiff
path: root/src/common/cpu_detect.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/cpu_detect.h')
-rw-r--r--src/common/cpu_detect.h81
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
12enum CPUVendor
13{
14 VENDOR_INTEL = 0,
15 VENDOR_AMD = 1,
16 VENDOR_ARM = 2,
17 VENDOR_OTHER = 3,
18};
19
20struct 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
74private:
75 // Detects the various cpu features
76 void Detect();
77};
78
79extern CPUInfo cpu_info;
80
81#endif // _CPUDETECT_H_