OLD | NEW |
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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 has_fpu_(false), | 308 has_fpu_(false), |
309 has_cmov_(false), | 309 has_cmov_(false), |
310 has_sahf_(false), | 310 has_sahf_(false), |
311 has_mmx_(false), | 311 has_mmx_(false), |
312 has_sse_(false), | 312 has_sse_(false), |
313 has_sse2_(false), | 313 has_sse2_(false), |
314 has_sse3_(false), | 314 has_sse3_(false), |
315 has_ssse3_(false), | 315 has_ssse3_(false), |
316 has_sse41_(false), | 316 has_sse41_(false), |
317 has_sse42_(false), | 317 has_sse42_(false), |
| 318 is_atom_(false), |
318 has_avx_(false), | 319 has_avx_(false), |
319 has_fma3_(false), | 320 has_fma3_(false), |
320 has_idiva_(false), | 321 has_idiva_(false), |
321 has_neon_(false), | 322 has_neon_(false), |
322 has_thumb2_(false), | 323 has_thumb2_(false), |
323 has_vfp_(false), | 324 has_vfp_(false), |
324 has_vfp3_(false), | 325 has_vfp3_(false), |
325 has_vfp3_d32_(false), | 326 has_vfp3_d32_(false), |
326 is_fp64_mode_(false) { | 327 is_fp64_mode_(false) { |
327 memcpy(vendor_, "Unknown", 8); | 328 memcpy(vendor_, "Unknown", 8); |
(...skipping 30 matching lines...) Expand all Loading... |
358 has_cmov_ = (cpu_info[3] & 0x00008000) != 0; | 359 has_cmov_ = (cpu_info[3] & 0x00008000) != 0; |
359 has_mmx_ = (cpu_info[3] & 0x00800000) != 0; | 360 has_mmx_ = (cpu_info[3] & 0x00800000) != 0; |
360 has_sse_ = (cpu_info[3] & 0x02000000) != 0; | 361 has_sse_ = (cpu_info[3] & 0x02000000) != 0; |
361 has_sse2_ = (cpu_info[3] & 0x04000000) != 0; | 362 has_sse2_ = (cpu_info[3] & 0x04000000) != 0; |
362 has_sse3_ = (cpu_info[2] & 0x00000001) != 0; | 363 has_sse3_ = (cpu_info[2] & 0x00000001) != 0; |
363 has_ssse3_ = (cpu_info[2] & 0x00000200) != 0; | 364 has_ssse3_ = (cpu_info[2] & 0x00000200) != 0; |
364 has_sse41_ = (cpu_info[2] & 0x00080000) != 0; | 365 has_sse41_ = (cpu_info[2] & 0x00080000) != 0; |
365 has_sse42_ = (cpu_info[2] & 0x00100000) != 0; | 366 has_sse42_ = (cpu_info[2] & 0x00100000) != 0; |
366 has_avx_ = (cpu_info[2] & 0x10000000) != 0; | 367 has_avx_ = (cpu_info[2] & 0x10000000) != 0; |
367 if (has_avx_) has_fma3_ = (cpu_info[2] & 0x00001000) != 0; | 368 if (has_avx_) has_fma3_ = (cpu_info[2] & 0x00001000) != 0; |
| 369 |
| 370 if (family_ == 0x6) { |
| 371 switch (model_) { |
| 372 case 0x1c: // SLT |
| 373 case 0x26: |
| 374 case 0x36: |
| 375 case 0x27: |
| 376 case 0x35: |
| 377 case 0x37: // SLM |
| 378 case 0x4a: |
| 379 case 0x4d: |
| 380 is_atom_ = true; |
| 381 } |
| 382 } |
368 } | 383 } |
369 | 384 |
370 #if V8_HOST_ARCH_IA32 | 385 #if V8_HOST_ARCH_IA32 |
371 // SAHF is always available in compat/legacy mode, | 386 // SAHF is always available in compat/legacy mode, |
372 has_sahf_ = true; | 387 has_sahf_ = true; |
373 #else | 388 #else |
374 // Query extended IDs. | 389 // Query extended IDs. |
375 __cpuid(cpu_info, 0x80000000); | 390 __cpuid(cpu_info, 0x80000000); |
376 unsigned num_ext_ids = cpu_info[0]; | 391 unsigned num_ext_ids = cpu_info[0]; |
377 | 392 |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 part_ = PPC_PA6T; | 642 part_ = PPC_PA6T; |
628 } | 643 } |
629 } | 644 } |
630 | 645 |
631 #endif // V8_OS_LINUX | 646 #endif // V8_OS_LINUX |
632 #endif // !USE_SIMULATOR | 647 #endif // !USE_SIMULATOR |
633 #endif // V8_HOST_ARCH_PPC | 648 #endif // V8_HOST_ARCH_PPC |
634 } | 649 } |
635 | 650 |
636 } } // namespace v8::base | 651 } } // namespace v8::base |
OLD | NEW |