forked from travisdowns/uarch-bench
-
Notifications
You must be signed in to change notification settings - Fork 0
/
isa-support.hpp
79 lines (68 loc) · 1.92 KB
/
isa-support.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
* isa-support.hpp
*
* Functionality to all specification of required ISA features and checking such features. Most of
* the hard work is just delegated to portable-snippets/cpu
*/
#ifndef ISA_SUPPORT_HPP_
#define ISA_SUPPORT_HPP_
#include <vector>
#include <string>
#include <ostream>
#define FEATURES_X(f) \
f(SSE3 ) \
f(PCLMULQDQ ) \
f(VMX ) \
f(SMX ) \
f(EST ) \
f(TM2 ) \
f(SSSE3 ) \
f(FMA ) \
f(CX16 ) \
f(SSE4_1 ) \
f(SSE4_2 ) \
f(MOVBE ) \
f(POPCNT ) \
f(AES ) \
f(AVX ) \
f(RDRND ) \
f(TSC_ADJ ) \
f(SGX ) \
f(BMI1 ) \
f(HLE ) \
f(AVX2 ) \
f(BMI2 ) \
f(ERMS ) \
f(RTM ) \
f(MPX ) \
f(PQE ) \
f(AVX512F ) \
f(AVX512DQ ) \
f(RDSEED ) \
f(ADX ) \
f(AVX512IFMA) \
f(PCOMMIT ) \
f(CLFLUSHOPT) \
f(CLWB ) \
f(INTEL_PT ) \
f(AVX512PF ) \
f(AVX512ER ) \
f(AVX512CD ) \
f(SHA ) \
f(AVX512BW ) \
f(AVX512VL )
#define COMMA(x) x,
/**
* Features a benchmark may require from an x86 CPU.
*/
enum x86Feature {
// the list is the same as the arguments in the FEATURES_X macro above
FEATURES_X(COMMA)
};
/** does the current CPU support all of the given features */
bool supports(std::vector<x86Feature> features);
std::string to_string(x86Feature);
/** return a space-delimited string of all the features in x86Features the current CPU supports */
std::string support_string();
std::ostream& operator<<(std::ostream& os, const x86Feature& f);
#endif /* ISA_SUPPORT_HPP_ */