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

Side by Side Diff: base/cpu.cc

Issue 9836125: Fix base::CPU detection. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move drift test Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | base/cpu_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/cpu.h" 5 #include "base/cpu.h"
6 6
7 #include <string.h>
8
9 #include "build/build_config.h"
10
7 #if defined(ARCH_CPU_X86_FAMILY) 11 #if defined(ARCH_CPU_X86_FAMILY)
8 #if defined(_MSC_VER) 12 #if defined(_MSC_VER)
9 #include <intrin.h> 13 #include <intrin.h>
10 #endif 14 #endif
11 #endif 15 #endif
12 16
13 #include <string.h>
14
15 namespace base { 17 namespace base {
16 18
17 CPU::CPU() 19 CPU::CPU()
18 : type_(0), 20 : type_(0),
19 family_(0), 21 family_(0),
20 model_(0), 22 model_(0),
21 stepping_(0), 23 stepping_(0),
22 ext_model_(0), 24 ext_model_(0),
23 ext_family_(0), 25 ext_family_(0),
24 has_mmx_(false), 26 has_mmx_(false),
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 has_sse2_ = (cpu_info[3] & 0x04000000) != 0; 116 has_sse2_ = (cpu_info[3] & 0x04000000) != 0;
115 has_sse3_ = (cpu_info[2] & 0x00000001) != 0; 117 has_sse3_ = (cpu_info[2] & 0x00000001) != 0;
116 has_ssse3_ = (cpu_info[2] & 0x00000200) != 0; 118 has_ssse3_ = (cpu_info[2] & 0x00000200) != 0;
117 has_sse41_ = (cpu_info[2] & 0x00080000) != 0; 119 has_sse41_ = (cpu_info[2] & 0x00080000) != 0;
118 has_sse42_ = (cpu_info[2] & 0x00100000) != 0; 120 has_sse42_ = (cpu_info[2] & 0x00100000) != 0;
119 } 121 }
120 #endif 122 #endif
121 } 123 }
122 124
123 } // namespace base 125 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/cpu_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698