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

Unified Diff: base/cpu.cc

Issue 2458333002: Add popcnt support for pnacl (Closed)
Patch Set: fix initializer Created 4 years, 2 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') | base/cpu_unittest.cc » ('j') | base/cpu_unittest.cc » ('J')
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 de4a001f7f71210b0924688154431de45ee69b5f..af9c23da1a1ee2ceee74e48b729935032338472a 100644
--- a/base/cpu.cc
+++ b/base/cpu.cc
@@ -43,6 +43,7 @@ CPU::CPU()
has_ssse3_(false),
has_sse41_(false),
has_sse42_(false),
+ has_popcnt_(false),
has_avx_(false),
has_avx2_(false),
has_aesni_(false),
@@ -177,6 +178,8 @@ 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_popcnt_ = (cpu_info[2] & 0x00800000) != 0;
+
// AVX instructions will generate an illegal instruction exception unless
// a) they are supported by the CPU,
// b) XSAVE is supported by the CPU and
« no previous file with comments | « base/cpu.h ('k') | base/cpu_unittest.cc » ('j') | base/cpu_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698