Fix partially reverted code for cpuid function with -fPIC, which isn't actually used in 64 bit builds anyway

CQTexperiment
Chris Moeller 2015-01-16 20:56:08 -08:00
parent 040efbcc15
commit ead4f8053b
1 changed files with 16 additions and 0 deletions

View File

@ -753,12 +753,28 @@ static void it_filter_sse(DUMB_CLICK_REMOVER *cr, IT_FILTER_STATE *state, sample
static inline void
__cpuid(int *data, int selector)
{
#if defined(__PIC__) && defined(__i386__)
asm("xchgl %%ebx, %%esi; cpuid; xchgl %%ebx, %%esi"
: "=a" (data[0]),
"=S" (data[1]),
"=c" (data[2]),
"=d" (data[3])
: "0" (selector));
#elif defined(__PIC__) && defined(__amd64__)
asm("xchg{q} {%%}rbx, %q1; cpuid; xchg{q} {%%}rbx, %q1"
: "=a" (data[0]),
"=&r" (data[1]),
"=c" (data[2]),
"=d" (data[3])
: "0" (selector));
#else
asm("cpuid"
: "=a" (data[0]),
"=b" (data[1]),
"=c" (data[2]),
"=d" (data[3])
: "a"(selector));
#endif
}
#else
#define __cpuid(a,b) memset((a), 0, sizeof(int) * 4)