Reverts 03eaf9b461 due to licensing issues (source/lib is MIT licensed) and replaces with compatible FreeBSD/clang-based solution, patch by pstumpf. Refs #2675

This was SVN commit r15890.
This commit is contained in:
historic_bruno 2014-10-18 20:45:11 +00:00
parent 2a7c3a95f9
commit 6334ee3f8b

View File

@ -49,18 +49,17 @@ namespace x86_x64 {
#if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 150030729
// VC10+ and VC9 SP1: __cpuidex is already available
#elif GCC_VERSION
// Adapted from GPLv2 version of GCC's cpuid.h
# if ARCH_IA32 && defined(__PIC__)
// %ebx may be the PIC register
# if defined(__i386__) && defined(__PIC__)
# define __cpuidex(regsArray, level, index)\
__asm__ ("xchgl\t%%ebx, %1\n\t"\
"cpuid\n\t"\
"xchgl\t%%ebx, %1\n\t"\
__asm__ __volatile__ ("pushl %%ebx\n"\
"cpuid\n"\
"mov %%ebx,%1\n"\
"popl %%ebx"\
: "=a" ((regsArray)[0]), "=r" ((regsArray)[1]), "=c" ((regsArray)[2]), "=d" ((regsArray)[3])\
: "0" (level), "2" (index));
# else
# define __cpuidex(regsArray, level, index)\
__asm__ ("cpuid\n\t"\
__asm__ __volatile__ ("cpuid"\
: "=a" ((regsArray)[0]), "=b" ((regsArray)[1]), "=c" ((regsArray)[2]), "=d" ((regsArray)[3])\
: "0" (level), "2" (index));
# endif