Skip to content
Permalink
Browse files

Fix bug inadvertently introduced in a1c4c4e

  • Loading branch information
sneves committed Feb 13, 2020
1 parent 207915a commit 421a21abd8a8be9fc7be4eb9c62b7004dc9ec93c
Showing with 6 additions and 4 deletions.
  1. +6 −4 c/blake3_dispatch.c
@@ -95,8 +95,7 @@ static uint64_t xgetbv() {
static void cpuid(uint32_t out[4], uint32_t id) {
#if defined(_MSC_VER)
__cpuid((int *)out, id);
#else
#if defined(__i386__) || defined(_M_IX86)
#elif defined(__i386__) || defined(_M_IX86)
__asm__ __volatile__("movl %%ebx, %1\n"
"cpuid\n"
"xchgl %1, %%ebx\n"
@@ -107,18 +106,21 @@ static void cpuid(uint32_t out[4], uint32_t id) {
: "=a"(out[0]), "=b"(out[1]), "=c"(out[2]), "=d"(out[3])
: "a"(id));
#endif
#endif
}

static void cpuidex(uint32_t out[4], uint32_t id, uint32_t sid) {
#if defined(_MSC_VER)
__cpuidex((int *)out, id, sid);
#else
#elif defined(__i386__) || defined(_M_IX86)
__asm__ __volatile__("movl %%ebx, %1\n"
"cpuid\n"
"xchgl %1, %%ebx\n"
: "=a"(out[0]), "=r"(out[1]), "=c"(out[2]), "=d"(out[3])
: "a"(id), "c"(sid));
#else
__asm__ __volatile__("cpuid\n"
: "=a"(out[0]), "=b"(out[1]), "=c"(out[2]), "=d"(out[3])
: "a"(id), "c"(sid));
#endif
}

0 comments on commit 421a21a

Please sign in to comment.
You can’t perform that action at this time.