Debian Codegraph @

Source/Core/Common/CPUDetect.h

raw symbols SCIP
1 // Copyright 2008 Dolphin Emulator Project
2 // SPDX-License-Identifier: GPL-2.0-or-later
3
4 // Detect the CPU, so we'll know which optimizations to use
5 #pragma once
6
7 #include <string>
8
9 enum class CPUVendor
10 {
11 Intel,
12 AMD,
13 ARM,
14 Other,
15 };
16
17 struct CPUInfo
18 {
19 CPUVendor vendor = CPUVendor::Other;
20
21 std::string cpu_id;
22 std::string model_name;
23
24 bool HTT = false;
25 int num_cores = 0;
26
27 bool bSSE3 = false;
28 bool bSSSE3 = false;
29 bool bSSE4_1 = false;
30 bool bSSE4_2 = false;
31 bool bLZCNT = false;
32 bool bAVX = false;
33 bool bBMI1 = false;
34 bool bBMI2 = false;
35 // PDEP and PEXT are ridiculously slow on AMD Zen1, Zen1+ and Zen2 (Family 17h)
36 bool bBMI2FastParallelBitOps = false;
37 bool bFMA = false;
38 bool bFMA4 = false;
39 bool bAES = false;
40 bool bMOVBE = false;
41 // This flag indicates that the hardware supports some mode
42 // in which denormal inputs _and_ outputs are automatically set to (signed) zero.
43 bool bFlushToZero = false;
44 bool bAtom = false;
45 bool bCRC32 = false;
46 bool bSHA1 = false;
47 bool bSHA2 = false;
48
49 // ARMv8 specific
50 bool bAFP = false; // Alternate floating-point behavior
51
52 // Call Detect()
53 explicit CPUInfo();
54
55 // The returned string consists of "<model_name>,<cpu_id>,<flag...>"
56 // Where:
57 // model_name and cpud_id may be zero-length
58 // model_name is human-readable marketing name
59 // cpu_id is ':'-delimited string of id info
60 // flags are optionally included if the related feature is supported and reporting its enablement
61 // seems useful to report
62 std::string Summarize();
63
64 private:
65 void Detect();
66 };
67
68 extern CPUInfo cpu_info;