GCC/clang cpuid intrinsic instead of inline asm
This commit is contained in:
parent
7e1dcb8129
commit
e5e82457d2
1 changed files with 4 additions and 7 deletions
|
@ -22,6 +22,8 @@
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
#include <intrin.h>
|
#include <intrin.h>
|
||||||
|
#else
|
||||||
|
#include <cpuid.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "ispc_texcomp.h"
|
#include "ispc_texcomp.h"
|
||||||
|
@ -54,13 +56,8 @@ void ISPCInit()
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
unsigned int eax = 0x80000001;
|
unsigned int eax, ebx, ecx, edx;
|
||||||
unsigned int ebx = 0;
|
__get_cpuid(0x80000001, &eax, &ebx, &ecx, &edx);
|
||||||
unsigned int ecx = 0;
|
|
||||||
unsigned int edx = 0;
|
|
||||||
asm volatile("cpuid"
|
|
||||||
: "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx)
|
|
||||||
: "a"(eax));
|
|
||||||
isAmd = (ecx & (1 << 6)) != 0;
|
isAmd = (ecx & (1 << 6)) != 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue