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

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: addressing feedback 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
« no previous file with comments | « base/cpu.h ('k') | chrome/browser/chrome_browser_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/cpu.cc
diff --git a/base/cpu.cc b/base/cpu.cc
index cf4f2f1e496346c7ceea9dfcbe46d36f8cc4e48e..d6976bab33b316aed50e3a133edf1a7e8a060a97 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,15 @@ void CPU::Initialize() {
#endif
}
+CPU::IntelMicroArchitecture CPU::GetIntelMicroArchitecture() const {
+ if (has_avx()) return AVX;
+ if (has_sse42()) return SSE42;
+ if (has_sse41()) return SSE41;
+ if (has_ssse3()) return SSSE3;
+ if (has_sse3()) return SSE3;
+ if (has_sse2()) return SSE2;
+ if (has_sse()) return SSE;
+ return PENTIUM;
+}
+
} // namespace base
« no previous file with comments | « base/cpu.h ('k') | chrome/browser/chrome_browser_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698