0
Commit Graph

12 Commits

Author SHA1 Message Date
Takuto Ikuta
fb5e120796 base: remove usage of _MSC_VER
Bug: 1053958
Change-Id: I4df58a6bc6d8b839239c7d56a7a7db1e54fcfd42
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2089433
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747241}
2020-03-05 13:31:51 +00:00
Gabriel Marin
8fdd777b01 base::CPU: compute CPU family and model based on Intel and AMD manuals
Update how CPU family and model are computed for x86 architectures, using
the specifications in the Intel and AMD manuals.

In particular, the old code didn't take into account the extended family
when computing the display family. This computed an incorrect family for
AMD devices, because the common Intel microarchitectures have extended
family 0.

Also compute an extended model only for families where it is defined.

Moved the computation to a separate function, so it can be tested.

The family is used only in three places in the Chromium code base.
The use in chrome/browser/metrics/perf/cpu_identity.cc is what motivated
this change. The other two uses are used in logging.

BUG=b:128528055

Change-Id: I04de6c6cf22e0637246f89cfe0d1538bba194696
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1758824
Reviewed-by: Gabriel Marin <gmx@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Gabriel Marin <gmx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#687903}
2019-08-17 00:28:09 +00:00
Jan Wilken Dörrie
f61e74cf6d [base] Replace Contains{Key,Value} with Contains in //base
This change replaces usages of base::ContainsKey and base::ContainsValue
with base::Contains in //base.

Bug: 970209
Change-Id: I7457bcfadd8501159d0a44a32b30e45cf4af7aca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1646778
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Cr-Commit-Position: refs/heads/master@{#667046}
2019-06-07 08:20:02 +00:00
Lei Zhang
49c4b2a05a base::CPU::cpu_brand() should not contain NULs.
BUG=249713

Change-Id: Ic167b497acc2308c0f8222800367e13e3926c0af
Reviewed-on: https://chromium-review.googlesource.com/741547
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Primiano Tucci <primiano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#513918}
2017-11-03 21:34:23 +00:00
ilevy
b7d2f408e8 Add popcnt support for pnacl
Detect popcount from cpuid and add feature flag in
pnacl.

BUG=660673

Review-Url: https://codereview.chromium.org/2458333002
Cr-Commit-Position: refs/heads/master@{#428632}
2016-10-30 20:49:25 +00:00
fbarchard
20028e6808 Enable CPU.RunExtendedInstructions test for win64 with clangcl
clangcl supports Visual C (Intel) syntax for inline assembly for 64 bit,
as well as 32 bit.  Enable the existing instruction set test when built
with clangcl.

R=brucedawson@chromium.org
BUG=chromium:168866

Review URL: https://codereview.chromium.org/1385093002

Cr-Commit-Position: refs/heads/master@{#352629}
2015-10-06 17:27:19 +00:00
fbarchard
0ce41ae082 Add AVX2 detection.
Update unittest to test avx and avx2, including for win64 with clangcl.
Add AVX2 to uma for histograms.

BUG=chromium:537916,chromium:168866

Review URL: https://codereview.chromium.org/1380943002

Cr-Commit-Position: refs/heads/master@{#351949}
2015-10-02 03:24:29 +00:00
jschuh@chromium.org
728269addc Make all base targets build on Win64
BUG=166496
BUG=167187

Review URL: https://chromiumcodereview.appspot.com/11825006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175916 0039d316-1c4b-4281-b951-d872f2087c98
2013-01-09 23:18:29 +00:00
jbauman@chromium.org
d1811bc49d Fix base::CPU detection.
ARCH_CPU_X86_FAMILY was never being defined, causing base::CPU::Initialize to be a no-op.


BUG=
TEST=


Review URL: http://codereview.chromium.org/9836125

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130046 0039d316-1c4b-4281-b951-d872f2087c98
2012-03-31 07:08:53 +00:00
hbono@chromium.org
28947cb670 Prevent compiling cpu_unittest on i386 (Take 2).
This change prevents compiling cpu_unittest on 32-bit GCC since some builders does not compile with SSE support.

TBR=jiesun
BUG=none
TEST=fix build.
Review URL: http://codereview.chromium.org/6581032

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75872 0039d316-1c4b-4281-b951-d872f2087c98
2011-02-24 10:50:25 +00:00
hbono@chromium.org
0e3ef25395 Prevent compiling cpu_unittest on i386.
This change prevents compiling cpu_unittest on 32-bit GCC since some builders does not compile with SSE support.

TBR=jiesun
BUG=none
TEST=fix build.
Review URL: http://codereview.chromium.org/6578017

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75871 0039d316-1c4b-4281-b951-d872f2087c98
2011-02-24 10:48:12 +00:00
hbono@chromium.org
14cd2e6a7d Add a unittest for the CPU class.
This change just adds a unit test "CPU.RunExtendedInstructions" to base_unittests, which runs extended instructions for each CPU member function.

BUG=none
TEST=CPU.RunExtendedInstructions
Review URL: http://codereview.chromium.org/6548003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75861 0039d316-1c4b-4281-b951-d872f2087c98
2011-02-24 09:20:16 +00:00