Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2804)

Unified Diff: base/cpu.cc

Issue 12049058: Adds AVX detection to CPU and records a histogram of Intel uArch Support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed refactoring and renaming recommendataions Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698