|
|
@@ -64,25 +64,6 @@ inline void SetFPUState(unsigned control)
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
-// CPUID inline assembly from http://softpixel.com/~cwright/programming/simd/cpuid.php
|
|
|
-inline void PerformCPUID(unsigned& func, unsigned& a, unsigned& b, unsigned& c, unsigned& d)
|
|
|
-{
|
|
|
- #ifdef _MSC_VER
|
|
|
- __asm
|
|
|
- {
|
|
|
- mov eax, func
|
|
|
- cpuid
|
|
|
- mov a, eax
|
|
|
- mov b, ebx
|
|
|
- mov c, ecx
|
|
|
- mov d, edx
|
|
|
- }
|
|
|
- #else
|
|
|
- __asm__ __volatile__ ("cpuid":
|
|
|
- "=a" (a), "=b" (b), "=c" (c), "=d" (d) : "a" (func));
|
|
|
- #endif
|
|
|
-}
|
|
|
-
|
|
|
#include "DebugNew.h"
|
|
|
|
|
|
#ifdef WIN32
|
|
|
@@ -155,11 +136,6 @@ void PrintLine(const char* str)
|
|
|
printf("%s\n", str);
|
|
|
}
|
|
|
|
|
|
-Mutex& GetStaticMutex()
|
|
|
-{
|
|
|
- return staticMutex;
|
|
|
-}
|
|
|
-
|
|
|
const Vector<String>& ParseArguments(const char* cmdLine)
|
|
|
{
|
|
|
arguments.Clear();
|
|
|
@@ -285,12 +261,33 @@ unsigned GetNumCPUCores()
|
|
|
#endif
|
|
|
|
|
|
// If CPU uses hyperthreading, report only half of the cores, as using the "extra" cores for worker threads
|
|
|
- // seems to result in unstable frame rates and extra time spent synchronizing
|
|
|
+ // seems to result in extra time spent synchronizing
|
|
|
unsigned func = 1;
|
|
|
unsigned a, b, c, d;
|
|
|
- PerformCPUID(func, a, b, c, d);
|
|
|
+
|
|
|
+ // CPUID inline assembly from http://softpixel.com/~cwright/programming/simd/cpuid.php
|
|
|
+ #ifdef _MSC_VER
|
|
|
+ __asm
|
|
|
+ {
|
|
|
+ mov eax, func
|
|
|
+ cpuid
|
|
|
+ mov a, eax
|
|
|
+ mov b, ebx
|
|
|
+ mov c, ecx
|
|
|
+ mov d, edx
|
|
|
+ }
|
|
|
+ #else
|
|
|
+ __asm__ __volatile__ ("cpuid":
|
|
|
+ "=a" (a), "=b" (b), "=c" (c), "=d" (d) : "a" (func));
|
|
|
+ #endif
|
|
|
+
|
|
|
if (d & 0x10000000)
|
|
|
numCores >>= 1;
|
|
|
|
|
|
return numCores;
|
|
|
}
|
|
|
+
|
|
|
+Mutex& GetStaticMutex()
|
|
|
+{
|
|
|
+ return staticMutex;
|
|
|
+}
|