"platforms/opencl/tests/TestOpenCLQTBIntegrator.cpp" did not exist on "0b662b4991e37286331dd4b5755d53f2b79fd1dd"
Commit 3bbbeb8e authored by peastman's avatar peastman
Browse files

cpuid() works correctly on both 32 and 64 bit OSes

parent a8ff237c
...@@ -95,6 +95,16 @@ static int getNumProcessors() { ...@@ -95,6 +95,16 @@ static int getNumProcessors() {
#define cpuid __cpuid #define cpuid __cpuid
#else #else
static void cpuid(int cpuInfo[4], int infoType){ static void cpuid(int cpuInfo[4], int infoType){
#ifdef __LP64__
__asm__ __volatile__ (
"cpuid":
"=a" (cpuInfo[0]),
"=b" (cpuInfo[1]),
"=c" (cpuInfo[2]),
"=d" (cpuInfo[3]) :
"a" (infoType)
);
#else
__asm__ __volatile__ ( __asm__ __volatile__ (
"pushl %%ebx\n" "pushl %%ebx\n"
"cpuid\n" "cpuid\n"
...@@ -106,6 +116,7 @@ static void cpuid(int cpuInfo[4], int infoType){ ...@@ -106,6 +116,7 @@ static void cpuid(int cpuInfo[4], int infoType){
"=d" (cpuInfo[3]) : "=d" (cpuInfo[3]) :
"a" (infoType) "a" (infoType)
); );
#endif
} }
#endif #endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment