diff options
| author | gnick79 <gnick79@gmail.com> | 2010-12-18 18:23:22 +0000 |
|---|---|---|
| committer | gnick79 <gnick79@gmail.com> | 2010-12-18 18:23:22 +0000 |
| commit | 522746b2c223f37c45569ee7fd4a226b278cb6d9 (patch) | |
| tree | d38bae2fc9374b6098ed56dd134207c8b635f5f8 /Source/Core/Common/Src/CPUDetect.cpp | |
| parent | 42e40b46c0968affdcd9738a80fb98d6124686da (diff) | |
**Changes**
* More formats recognition for "Clear Screen" step. Improved the ability handling the alpha channel (% color translucency).
* Related to CPUID detecting:
- Added support displaying correct SysInfo for recent multicore Intel CPUs x86-64 with HT/SMT (Core i3/i5/i7 and Xeon) based on Nehalem architecture.
+ minor and passive changes.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6604 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/Common/Src/CPUDetect.cpp')
| -rw-r--r-- | Source/Core/Common/Src/CPUDetect.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/Source/Core/Common/Src/CPUDetect.cpp b/Source/Core/Common/Src/CPUDetect.cpp index 5fcc7062d9..79aad925e7 100644 --- a/Source/Core/Common/Src/CPUDetect.cpp +++ b/Source/Core/Common/Src/CPUDetect.cpp @@ -133,8 +133,8 @@ void CPUInfo::Detect() strcpy(brand_string, cpu_string); // Detect family and other misc stuff. - bool HTT = false; - int logical_cpu_count = 1; + HTT = false; + logical_cpu_count = 1; if (max_std_fn >= 1) { __cpuid(cpu_id, 0x00000001); logical_cpu_count = (cpu_id[1] >> 16) & 0xFF; @@ -171,11 +171,14 @@ void CPUInfo::Detect() __cpuid(cpu_id, 0x80000008); int apic_id_core_id_size = (cpu_id[2] >> 12) & 0xF; if (apic_id_core_id_size == 0) { - // Use what AMD calls the "legacy method" to determine # of cores. + // New mechanism for modern CPUs. + num_cores = logical_cpu_count; if (HTT) { - num_cores = logical_cpu_count; - } else { - num_cores = 1; + __cpuid(cpu_id, 0x00000004); + int cores_x_package = ((cpu_id[0] >> 26) & 0x3F) + 1; + cores_x_package = ((logical_cpu_count % cores_x_package) == 0) ? cores_x_package : 1; + num_cores = (cores_x_package > 1) ? cores_x_package : num_cores; + logical_cpu_count /= cores_x_package; } } else { // Use AMD's new method. @@ -193,10 +196,13 @@ std::string CPUInfo::Summarize() { std::string sum; if (num_cores == 1) - sum = StringFromFormat("%s, %i core, ", cpu_string, num_cores); + sum = StringFromFormat("%s, %i core", cpu_string, num_cores); else - sum = StringFromFormat("%s, %i cores, ", cpu_string, num_cores); - if (bSSE) sum += "SSE"; + { + sum = StringFromFormat("%s, %i cores", cpu_string, num_cores); + if (HTT) sum += StringFromFormat(" (%i logical IDs per physical core)", logical_cpu_count); + } + if (bSSE) sum += ", SSE"; if (bSSE2) sum += ", SSE2"; if (bSSE3) sum += ", SSE3"; if (bSSSE3) sum += ", SSSE3"; |
