Index: intern/cycles/util/util_system.cpp =================================================================== --- intern/cycles/util/util_system.cpp (revision 36380) +++ intern/cycles/util/util_system.cpp (working copy) @@ -45,7 +45,7 @@ #elif defined(__APPLE__) size_t len = sizeof(count); int mib[2] = { CTL_HW, HW_NCPU }; - + sysctl(mib, 2, &count, &len, NULL, 0); #else count = (uint)sysconf(_SC_NPROCESSORS_ONLN); @@ -60,7 +60,24 @@ #ifndef _WIN32 static void __cpuid(int data[4], int selector) { - asm("cpuid" : "=a" (data[0]), "=b" (data[1]), "=c" (data[2]), "=d" (data[3]) : "a"(selector)); + uint32_t eax; // output: eax + uint32_t ebx; // output: ebx + uint32_t ecx; // output: ecx + uint32_t edx; // output: edx + + asm( + "pushl %%ebx\n\t" + "cpuid \n\t" + "movl %%ebx, %1\n\t" + "popl %%ebx\n\t" + : "=a" (eax), "=r" (ebx), "=c" (ecx), "=d" (edx) + : "a"(selector) + : "cc"); + + data[0] = eax; + data[1] = ebx; + data[2] = ecx; + data[3] = edx; } #endif