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

Side by Side Diff: src/base/cpu.cc

Issue 809003002: x86: enable check of Atom (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « src/base/cpu.h ('k') | src/flag-definitions.h » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project 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 "src/base/cpu.h" 5 #include "src/base/cpu.h"
6 6
7 #if V8_LIBC_MSVCRT 7 #if V8_LIBC_MSVCRT
8 #include <intrin.h> // __cpuid() 8 #include <intrin.h> // __cpuid()
9 #endif 9 #endif
10 #if V8_OS_LINUX 10 #if V8_OS_LINUX
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 has_fpu_(false), 304 has_fpu_(false),
305 has_cmov_(false), 305 has_cmov_(false),
306 has_sahf_(false), 306 has_sahf_(false),
307 has_mmx_(false), 307 has_mmx_(false),
308 has_sse_(false), 308 has_sse_(false),
309 has_sse2_(false), 309 has_sse2_(false),
310 has_sse3_(false), 310 has_sse3_(false),
311 has_ssse3_(false), 311 has_ssse3_(false),
312 has_sse41_(false), 312 has_sse41_(false),
313 has_sse42_(false), 313 has_sse42_(false),
314 is_atom_(false),
314 has_avx_(false), 315 has_avx_(false),
315 has_fma3_(false), 316 has_fma3_(false),
316 has_idiva_(false), 317 has_idiva_(false),
317 has_neon_(false), 318 has_neon_(false),
318 has_thumb2_(false), 319 has_thumb2_(false),
319 has_vfp_(false), 320 has_vfp_(false),
320 has_vfp3_(false), 321 has_vfp3_(false),
321 has_vfp3_d32_(false), 322 has_vfp3_d32_(false),
322 is_fp64_mode_(false) { 323 is_fp64_mode_(false) {
323 memcpy(vendor_, "Unknown", 8); 324 memcpy(vendor_, "Unknown", 8);
(...skipping 30 matching lines...) Expand all
354 has_cmov_ = (cpu_info[3] & 0x00008000) != 0; 355 has_cmov_ = (cpu_info[3] & 0x00008000) != 0;
355 has_mmx_ = (cpu_info[3] & 0x00800000) != 0; 356 has_mmx_ = (cpu_info[3] & 0x00800000) != 0;
356 has_sse_ = (cpu_info[3] & 0x02000000) != 0; 357 has_sse_ = (cpu_info[3] & 0x02000000) != 0;
357 has_sse2_ = (cpu_info[3] & 0x04000000) != 0; 358 has_sse2_ = (cpu_info[3] & 0x04000000) != 0;
358 has_sse3_ = (cpu_info[2] & 0x00000001) != 0; 359 has_sse3_ = (cpu_info[2] & 0x00000001) != 0;
359 has_ssse3_ = (cpu_info[2] & 0x00000200) != 0; 360 has_ssse3_ = (cpu_info[2] & 0x00000200) != 0;
360 has_sse41_ = (cpu_info[2] & 0x00080000) != 0; 361 has_sse41_ = (cpu_info[2] & 0x00080000) != 0;
361 has_sse42_ = (cpu_info[2] & 0x00100000) != 0; 362 has_sse42_ = (cpu_info[2] & 0x00100000) != 0;
362 has_avx_ = (cpu_info[2] & 0x10000000) != 0; 363 has_avx_ = (cpu_info[2] & 0x10000000) != 0;
363 if (has_avx_) has_fma3_ = (cpu_info[2] & 0x00001000) != 0; 364 if (has_avx_) has_fma3_ = (cpu_info[2] & 0x00001000) != 0;
365
366 if (family_ == 0x6) {
367 switch (model_) {
368 case 0x1c: // SLT
369 case 0x26:
370 case 0x36:
371 case 0x27:
372 case 0x35:
373 case 0x37: // SLM
374 case 0x4a:
375 case 0x4d:
376 is_atom_ = true;
377 }
378 }
364 } 379 }
365 380
366 #if V8_HOST_ARCH_IA32 381 #if V8_HOST_ARCH_IA32
367 // SAHF is always available in compat/legacy mode, 382 // SAHF is always available in compat/legacy mode,
368 has_sahf_ = true; 383 has_sahf_ = true;
369 #else 384 #else
370 // Query extended IDs. 385 // Query extended IDs.
371 __cpuid(cpu_info, 0x80000000); 386 __cpuid(cpu_info, 0x80000000);
372 unsigned num_ext_ids = cpu_info[0]; 387 unsigned num_ext_ids = cpu_info[0];
373 388
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 if (end == part) { 571 if (end == part) {
557 part_ = 0; 572 part_ = 0;
558 } 573 }
559 delete[] part; 574 delete[] part;
560 } 575 }
561 576
562 #endif 577 #endif
563 } 578 }
564 579
565 } } // namespace v8::base 580 } } // namespace v8::base
OLDNEW
« no previous file with comments | « src/base/cpu.h ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698