diff options
author | jiesun@chromium.org <jiesun@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-16 18:51:58 +0000 |
---|---|---|
committer | jiesun@chromium.org <jiesun@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-16 18:51:58 +0000 |
commit | 7e6d42b93f1f776ba59bca772c759c1e0f846b56 (patch) | |
tree | c970f2fbeccaf49482ee052b73825bd7957e48df /base/cpu.h | |
parent | e22ba3c851ea7c30cec68905cf10a39db846d1ba (diff) | |
download | chromium_src-7e6d42b93f1f776ba59bca772c759c1e0f846b56.zip chromium_src-7e6d42b93f1f776ba59bca772c759c1e0f846b56.tar.gz chromium_src-7e6d42b93f1f776ba59bca772c759c1e0f846b56.tar.bz2 |
detect cpu feature for all x64 and x86 platforms (no longer windows only).
BUG=None
TEST=trybot
Review URL: http://codereview.chromium.org/6526005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75150 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/cpu.h')
-rw-r--r-- | base/cpu.h | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2006-2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -6,6 +6,8 @@ #define BASE_CPU_H_ #pragma once +#include "build/build_config.h" + #include <string> namespace base { @@ -24,6 +26,13 @@ class CPU { int type() const { return type_; } int extended_model() const { return ext_model_; } int extended_family() const { return ext_family_; } + int has_mmx() const { return has_mmx_; } + int has_sse() const { return has_sse_; } + int has_sse2() const { return has_sse2_; } + int has_sse3() const { return has_sse3_; } + int has_ssse3() const { return has_ssse3_; } + int has_sse41() const { return has_sse41_; } + int has_sse42() const { return has_sse42_; } private: // Query the processor for CPUID information. @@ -35,6 +44,13 @@ class CPU { int stepping_; // processor revision number int ext_model_; int ext_family_; + bool has_mmx_; + bool has_sse_; + bool has_sse2_; + bool has_sse3_; + bool has_ssse3_; + bool has_sse41_; + bool has_sse42_; std::string cpu_vendor_; }; |