17{
20 printf(
"vendor %s\n", cpu.
has(Cpu::tINTEL) ?
"intel" :
"amd");
21 static const struct {
25 { Cpu::tMMX, "mmx" },
26 { Cpu::tMMX2, "mmx2" },
27 { Cpu::tCMOV, "cmov" },
28 { Cpu::tSSE, "sse" },
29 { Cpu::tSSE2, "sse2" },
30 { Cpu::tSSE3, "sse3" },
31 { Cpu::tSSSE3, "ssse3" },
32 { Cpu::tSSE41, "sse41" },
33 { Cpu::tSSE42, "sse42" },
34 { Cpu::tPOPCNT, "popcnt" },
35 { Cpu::t3DN, "3dn" },
36 { Cpu::tE3DN, "e3dn" },
37 { Cpu::tSSE4a, "sse4a" },
38 { Cpu::tSSE5, "sse5" },
39 { Cpu::tAESNI, "aesni" },
40 { Cpu::tRDTSCP, "rdtscp" },
41 { Cpu::tOSXSAVE, "osxsave(xgetvb)" },
42 { Cpu::tPCLMULQDQ, "pclmulqdq" },
43 { Cpu::tAVX, "avx" },
44 { Cpu::tFMA, "fma" },
45 { Cpu::tAVX2, "avx2" },
46 { Cpu::tBMI1, "bmi1" },
47 { Cpu::tBMI2, "bmi2" },
48 { Cpu::tLZCNT, "lzcnt" },
49 { Cpu::tPREFETCHW, "prefetchw" },
50 { Cpu::tENHANCED_REP, "enh_rep" },
51 { Cpu::tRDRAND, "rdrand" },
52 { Cpu::tADX, "adx" },
53 { Cpu::tRDSEED, "rdseed" },
54 { Cpu::tSMAP, "smap" },
55 { Cpu::tHLE, "hle" },
56 { Cpu::tRTM, "rtm" },
57 { Cpu::tMPX, "mpx" },
58 { Cpu::tSHA, "sha" },
59 { Cpu::tPREFETCHWT1, "prefetchwt1" },
60 { Cpu::tF16C, "f16c" },
61 { Cpu::tMOVBE, "movbe" },
62 { Cpu::tAVX512F, "avx512f" },
63 { Cpu::tAVX512DQ, "avx512dq" },
64 { Cpu::tAVX512IFMA, "avx512_ifma" },
65 { Cpu::tAVX512PF, "avx512pf" },
66 { Cpu::tAVX512ER, "avx512er" },
67 { Cpu::tAVX512CD, "avx512cd" },
68 { Cpu::tAVX512BW, "avx512bw" },
69 { Cpu::tAVX512VL, "avx512vl" },
70 { Cpu::tAVX512VBMI, "avx512_vbmi" },
71 { Cpu::tAVX512_4VNNIW, "avx512_4vnniw" },
72 { Cpu::tAVX512_4FMAPS, "avx512_4fmaps" },
73
74 { Cpu::tAVX512_VBMI2, "avx512_vbmi2" },
75 { Cpu::tGFNI, "gfni" },
76 { Cpu::tVAES, "vaes" },
77 { Cpu::tVPCLMULQDQ, "vpclmulqdq" },
78 { Cpu::tAVX512_VNNI, "avx512_vnni" },
79 { Cpu::tAVX512_BITALG, "avx512_bitalg" },
80 { Cpu::tAVX512_VPOPCNTDQ, "avx512_vpopcntdq" },
81 };
84 }
86 if (cpu.
has(Cpu::tPOPCNT)) {
87 const int n = 0x12345678;
91 puts("popcnt ok");
92 } else {
93 printf(
"popcnt ng %d %d\n",
r, ok);
94 }
95 }
96
97
98
99
100
101
102
103
104
105
109 }
110}
const uint8 * getCode() const
unsigned int getDataCacheLevels() const
bool has(Type type) const
unsigned int getCoresSharingDataCache(unsigned int i) const
unsigned int getDataCacheSize(unsigned int i) const
LOGGING_API void printf(Category category, const char *format,...)