Cycles: two 32 bit fixes with help from IRC user Agiofws.

This commit is contained in:
2011-05-05 13:51:33 +00:00
parent b25346a48c
commit c18c6056ff
2 changed files with 32 additions and 21 deletions

View File

@@ -60,7 +60,18 @@ int system_cpu_thread_count()
#ifndef _WIN32
static void __cpuid(int data[4], int selector)
{
#ifdef __x86_64__
asm("cpuid" : "=a" (data[0]), "=b" (data[1]), "=c" (data[2]), "=d" (data[3]) : "a"(selector));
#else
#ifdef __i386__
asm("pushl %%ebx \n\t"
"cpuid \n\t"
"movl %%ebx, %1 \n\t"
"popl %%ebx \n\t" : "=a" (data[0]), "=r" (data[1]), "=c" (data[2]), "=d" (data[3]) : "a"(selector));
#else
data[0] = data[1] = data[2] = data[3] = 0;
#endif
#endif
}
#endif