Chromium Code Reviews| Index: base/cpu.cc |
| diff --git a/base/cpu.cc b/base/cpu.cc |
| index cf4f2f1e496346c7ceea9dfcbe46d36f8cc4e48e..0f95c2006208581536a1c3b6d6c27060249a105c 100644 |
| --- a/base/cpu.cc |
| +++ b/base/cpu.cc |
| @@ -117,6 +117,7 @@ void CPU::Initialize() { |
| has_ssse3_ = (cpu_info[2] & 0x00000200) != 0; |
| has_sse41_ = (cpu_info[2] & 0x00080000) != 0; |
| has_sse42_ = (cpu_info[2] & 0x00100000) != 0; |
| + has_avx_ = (cpu_info[2] & 0x10000000) != 0; |
| } |
| // Get the brand string of the cpu. |
| @@ -137,4 +138,16 @@ void CPU::Initialize() { |
| #endif |
| } |
| +CPU::IntelMicroArchitecture CPU::getIntelMicroArchitecture() const { |
| + IntelMicroArchitecture arch = Pentium; |
|
brettw
2013/01/31 20:08:43
This seems weird. It looks like if the processor s
|
| + if (has_sse()) arch = SSE; |
| + if (has_sse2()) arch = SSE2; |
| + if (has_sse3()) arch = SSE3; |
| + if (has_ssse3()) arch = SSSE3; |
| + if (has_sse41()) arch = SSE41; |
| + if (has_sse42()) arch = SSE42; |
| + if (has_avx()) arch = AVX; |
| + return arch; |
| +} |
| + |
| } // namespace base |