| 105 | #endif |
| 106 | |
| 107 | static 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 | |
| 141 | void detect_sse41() |
| 142 | { |
no test coverage detected