MCPcopy Create free account
hub / github.com/defold/defold / get_cpuinfo

Function get_cpuinfo

engine/dlib/src/basis/encoder/basisu_kernels_sse.cpp:107–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105#endif
106
107static void get_cpuinfo(cpu_info &info)
108{
109 int regs[4];
110
111#ifdef _MSC_VER
112 __cpuid(regs, 0);
113#else
114 do_cpuid(0, 0, (uint32_t *)regs);
115#endif
116
117 const uint32_t max_eax = regs[0];
118
119 if (max_eax >= 1U)
120 {
121#ifdef _MSC_VER
122 __cpuid(regs, 1);
123#else
124 do_cpuid(1, 0, (uint32_t*)regs);
125#endif
126 extract_x86_flags(info, regs[2], regs[3]);
127 }
128
129 if (max_eax >= 7U)
130 {
131#ifdef _MSC_VER
132 __cpuidex(regs, 7, 0);
133#else
134 do_cpuid(7, 0, (uint32_t*)regs);
135#endif
136
137 extract_x86_extended_flags(info, regs[1]);
138 }
139}
140
141void detect_sse41()
142{

Callers 1

detect_sse41Function · 0.85

Calls 3

do_cpuidFunction · 0.85
extract_x86_flagsFunction · 0.85

Tested by

no test coverage detected