1.1 --- a/src/cpu/x86/vm/vm_version_x86_64.hpp Tue Oct 14 06:58:58 2008 -0700 1.2 +++ b/src/cpu/x86/vm/vm_version_x86_64.hpp Tue Oct 14 15:10:26 2008 -0700 1.3 @@ -68,9 +68,9 @@ 1.4 cmpxchg16: 1, 1.5 : 4, 1.6 dca : 1, 1.7 - : 4, 1.8 - popcnt : 1, 1.9 - : 8; 1.10 + sse4_1 : 1, 1.11 + sse4_2 : 1, 1.12 + : 11; 1.13 } bits; 1.14 }; 1.15 1.16 @@ -177,8 +177,9 @@ 1.17 CPU_SSE2 = (1 << 7), 1.18 CPU_SSE3 = (1 << 8), 1.19 CPU_SSSE3= (1 << 9), 1.20 - CPU_SSE4 = (1 <<10), 1.21 - CPU_SSE4A= (1 <<11) 1.22 + CPU_SSE4A= (1 <<10), 1.23 + CPU_SSE4_1 = (1 << 11), 1.24 + CPU_SSE4_2 = (1 << 12) 1.25 } cpuFeatureFlags; 1.26 1.27 // cpuid information block. All info derived from executing cpuid with 1.28 @@ -240,22 +241,14 @@ 1.29 static CpuidInfo _cpuid_info; 1.30 1.31 // Extractors and predicates 1.32 - static bool is_extended_cpu_family() { 1.33 - const uint32_t Extended_Cpu_Family = 0xf; 1.34 - return _cpuid_info.std_cpuid1_eax.bits.family == Extended_Cpu_Family; 1.35 - } 1.36 static uint32_t extended_cpu_family() { 1.37 uint32_t result = _cpuid_info.std_cpuid1_eax.bits.family; 1.38 - if (is_extended_cpu_family()) { 1.39 - result += _cpuid_info.std_cpuid1_eax.bits.ext_family; 1.40 - } 1.41 + result += _cpuid_info.std_cpuid1_eax.bits.ext_family; 1.42 return result; 1.43 } 1.44 static uint32_t extended_cpu_model() { 1.45 uint32_t result = _cpuid_info.std_cpuid1_eax.bits.model; 1.46 - if (is_extended_cpu_family()) { 1.47 - result |= _cpuid_info.std_cpuid1_eax.bits.ext_model << 4; 1.48 - } 1.49 + result |= _cpuid_info.std_cpuid1_eax.bits.ext_model << 4; 1.50 return result; 1.51 } 1.52 static uint32_t cpu_stepping() { 1.53 @@ -293,6 +286,10 @@ 1.54 result |= CPU_SSSE3; 1.55 if (is_amd() && _cpuid_info.ext_cpuid1_ecx.bits.sse4a != 0) 1.56 result |= CPU_SSE4A; 1.57 + if (_cpuid_info.std_cpuid1_ecx.bits.sse4_1 != 0) 1.58 + result |= CPU_SSE4_1; 1.59 + if (_cpuid_info.std_cpuid1_ecx.bits.sse4_2 != 0) 1.60 + result |= CPU_SSE4_2; 1.61 return result; 1.62 } 1.63 1.64 @@ -380,7 +377,8 @@ 1.65 static bool supports_sse2() { return (_cpuFeatures & CPU_SSE2) != 0; } 1.66 static bool supports_sse3() { return (_cpuFeatures & CPU_SSE3) != 0; } 1.67 static bool supports_ssse3() { return (_cpuFeatures & CPU_SSSE3)!= 0; } 1.68 - static bool supports_sse4() { return (_cpuFeatures & CPU_SSE4) != 0; } 1.69 + static bool supports_sse4_1() { return (_cpuFeatures & CPU_SSE4_1) != 0; } 1.70 + static bool supports_sse4_2() { return (_cpuFeatures & CPU_SSE4_2) != 0; } 1.71 // 1.72 // AMD features 1.73 //