Added CLI parameters to overwrite the CPU feature flags. Useful for testing.

This commit is contained in:
LoRd_MuldeR 2011-09-20 00:03:51 +02:00
parent a77ee5c397
commit 1fc851af2b
5 changed files with 18 additions and 8 deletions

View File

@ -2684,17 +2684,17 @@
<context> <context>
<name>QApplication</name> <name>QApplication</name>
<message> <message>
<location filename="../../src/Global.cpp" line="671"/> <location filename="../../src/Global.cpp" line="681"/>
<source>Executable &apos;%1&apos; doesn&apos;t support Windows compatibility mode.</source> <source>Executable &apos;%1&apos; doesn&apos;t support Windows compatibility mode.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/Global.cpp" line="758"/> <location filename="../../src/Global.cpp" line="768"/>
<source>Executable &apos;%1&apos; requires Qt v%2, but found Qt v%3.</source> <source>Executable &apos;%1&apos; requires Qt v%2, but found Qt v%3.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../src/Global.cpp" line="767"/> <location filename="../../src/Global.cpp" line="777"/>
<source>Executable &apos;%1&apos; requires Windows 2000 or later.</source> <source>Executable &apos;%1&apos; requires Windows 2000 or later.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>

View File

@ -30,7 +30,7 @@
#define VER_LAMEXP_MINOR_LO 3 #define VER_LAMEXP_MINOR_LO 3
#define VER_LAMEXP_TYPE Beta #define VER_LAMEXP_TYPE Beta
#define VER_LAMEXP_PATCH 2 #define VER_LAMEXP_PATCH 2
#define VER_LAMEXP_BUILD 690 #define VER_LAMEXP_BUILD 692
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Tools versions // Tools versions

View File

@ -516,7 +516,7 @@ void lamexp_init_console(int argc, char* argv[])
/* /*
* Detect CPU features * Detect CPU features
*/ */
lamexp_cpu_t lamexp_detect_cpu_features(void) lamexp_cpu_t lamexp_detect_cpu_features(int argc, char **argv)
{ {
typedef BOOL (WINAPI *IsWow64ProcessFun)(__in HANDLE hProcess, __out PBOOL Wow64Process); typedef BOOL (WINAPI *IsWow64ProcessFun)(__in HANDLE hProcess, __out PBOOL Wow64Process);
typedef VOID (WINAPI *GetNativeSystemInfoFun)(__out LPSYSTEM_INFO lpSystemInfo); typedef VOID (WINAPI *GetNativeSystemInfoFun)(__out LPSYSTEM_INFO lpSystemInfo);
@ -611,6 +611,16 @@ lamexp_cpu_t lamexp_detect_cpu_features(void)
features.x64 = true; features.x64 = true;
#endif #endif
if(argv)
{
for(int i = 0; i < argc; i++)
{
if(!_stricmp("--force-cpu-no-64bit", argv[i])) features.x64 = false;
if(!_stricmp("--force-cpu-no-sse", argv[i])) features.sse = features.sse2 = features.sse3 = features.ssse3 = false;
if(!_stricmp("--force-cpu-no-intel", argv[i])) features.intel = false;
}
}
return features; return features;
} }

View File

@ -100,7 +100,7 @@ QString lamexp_rand_str(void);
const QString &lamexp_temp_folder2(void); const QString &lamexp_temp_folder2(void);
void lamexp_ipc_read(unsigned int *command, char* message, size_t buffSize); void lamexp_ipc_read(unsigned int *command, char* message, size_t buffSize);
void lamexp_ipc_send(unsigned int command, const char* message); void lamexp_ipc_send(unsigned int command, const char* message);
lamexp_cpu_t lamexp_detect_cpu_features(void); lamexp_cpu_t lamexp_detect_cpu_features(int argc = 0, char **argv = NULL);
bool lamexp_portable_mode(void); bool lamexp_portable_mode(void);
bool lamexp_shutdown_computer(const QString &message, const unsigned long timeout = 30, const bool forceShutdown = true); bool lamexp_shutdown_computer(const QString &message, const unsigned long timeout = 30, const bool forceShutdown = true);

View File

@ -71,8 +71,8 @@ static int lamexp_main(int argc, char* argv[])
} }
//Detect CPU capabilities //Detect CPU capabilities
lamexp_cpu_t cpuFeatures = lamexp_detect_cpu_features(); lamexp_cpu_t cpuFeatures = lamexp_detect_cpu_features(argc, argv);
qDebug(" CPU vendor id : %s (Intel: %d)", cpuFeatures.vendor, (cpuFeatures.intel ? 1 : 0)); qDebug(" CPU vendor id : %s (Intel: %s)", cpuFeatures.vendor, LAMEXP_BOOL(cpuFeatures.intel));
qDebug("CPU brand string : %s", cpuFeatures.brand); qDebug("CPU brand string : %s", cpuFeatures.brand);
qDebug(" CPU signature : Family: %d, Model: %d, Stepping: %d", cpuFeatures.family, cpuFeatures.model, cpuFeatures.stepping); qDebug(" CPU signature : Family: %d, Model: %d, Stepping: %d", cpuFeatures.family, cpuFeatures.model, cpuFeatures.stepping);
qDebug("CPU capabilities : MMX: %s, SSE: %s, SSE2: %s, SSE3: %s, SSSE3: %s, x64: %s", LAMEXP_BOOL(cpuFeatures.mmx), LAMEXP_BOOL(cpuFeatures.sse), LAMEXP_BOOL(cpuFeatures.sse2), LAMEXP_BOOL(cpuFeatures.sse3), LAMEXP_BOOL(cpuFeatures.ssse3), LAMEXP_BOOL(cpuFeatures.x64)); qDebug("CPU capabilities : MMX: %s, SSE: %s, SSE2: %s, SSE3: %s, SSSE3: %s, x64: %s", LAMEXP_BOOL(cpuFeatures.mmx), LAMEXP_BOOL(cpuFeatures.sse), LAMEXP_BOOL(cpuFeatures.sse2), LAMEXP_BOOL(cpuFeatures.sse3), LAMEXP_BOOL(cpuFeatures.ssse3), LAMEXP_BOOL(cpuFeatures.x64));