Finally finish with MinGW building (linking still has some issues shush)

This commit is contained in:
wuggy 2026-04-18 01:02:51 -07:00
commit 854f39b4ab
32 changed files with 104 additions and 19 deletions

View file

@ -13,7 +13,15 @@
#include <intrin.h>
static void cpuid (uint32_t abcd[4]) { __cpuid ((int*)abcd, 1); }
static void cpuid7(uint32_t abcd[4]) { __cpuidex((int*)abcd, 7, 0); }
static uint64_t xgetbv(uint32_t xcr) { return _xgetbv(xcr); }
static uint64_t xgetbv(uint32_t xcr) {
#if defined(__MINGW32__)
uint32_t eax, edx;
__asm__ __volatile__ ("xgetbv" : "=a"(eax), "=d"(edx) : "c"(xcr));
return (uint64_t)(edx) << 32 | eax;
#else
return _xgetbv(xcr);
#endif
}
#else
#include <cpuid.h>
#if !defined(__cpuid_count) // Old Mac Clang doesn't have this defined.