We can't use cpuid.h's __get_cpuid as it does not support subleafs.
| 551 | #if defined(USE_ASM) && (defined(__x86_64__) || defined(__amd64__) || defined(__i386__)) |
| 552 | // We can't use cpuid.h's __get_cpuid as it does not support subleafs. |
| 553 | void inline cpuid(uint32_t leaf, uint32_t subleaf, uint32_t& a, uint32_t& b, uint32_t& c, uint32_t& d) |
| 554 | { |
| 555 | #ifdef __GNUC__ |
| 556 | __cpuid_count(leaf, subleaf, a, b, c, d); |
| 557 | #else |
| 558 | __asm__ ("cpuid" : "=a"(a), "=b"(b), "=c"(c), "=d"(d) : "0"(leaf), "2"(subleaf)); |
| 559 | #endif |
| 560 | } |
| 561 | |
| 562 | /** Check whether the OS has enabled AVX registers. */ |
| 563 | bool AVXEnabled() |