Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-05-05 17:51:33 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-05-05 17:51:33 +0400
commitc18c6056ffb733fe670860bb6e2809f79834b9a3 (patch)
treef2a01c57a83eca781202720e701dae37cea6ad2a /intern/cycles/util
parentb25346a48cd616c6ea6b36719e2dc07b24792b92 (diff)
Cycles: two 32 bit fixes with help from IRC user Agiofws.
Diffstat (limited to 'intern/cycles/util')
-rw-r--r--intern/cycles/util/util_system.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/intern/cycles/util/util_system.cpp b/intern/cycles/util/util_system.cpp
index fae575873e0..ac3089aa7ad 100644
--- a/intern/cycles/util/util_system.cpp
+++ b/intern/cycles/util/util_system.cpp
@@ -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