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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 ext_family_ = (cpu_info[0] >> 20) & 0xff; | 352 ext_family_ = (cpu_info[0] >> 20) & 0xff; |
353 has_fpu_ = (cpu_info[3] & 0x00000001) != 0; | 353 has_fpu_ = (cpu_info[3] & 0x00000001) != 0; |
354 has_cmov_ = (cpu_info[3] & 0x00008000) != 0; | 354 has_cmov_ = (cpu_info[3] & 0x00008000) != 0; |
355 has_mmx_ = (cpu_info[3] & 0x00800000) != 0; | 355 has_mmx_ = (cpu_info[3] & 0x00800000) != 0; |
356 has_sse_ = (cpu_info[3] & 0x02000000) != 0; | 356 has_sse_ = (cpu_info[3] & 0x02000000) != 0; |
357 has_sse2_ = (cpu_info[3] & 0x04000000) != 0; | 357 has_sse2_ = (cpu_info[3] & 0x04000000) != 0; |
358 has_sse3_ = (cpu_info[2] & 0x00000001) != 0; | 358 has_sse3_ = (cpu_info[2] & 0x00000001) != 0; |
359 has_ssse3_ = (cpu_info[2] & 0x00000200) != 0; | 359 has_ssse3_ = (cpu_info[2] & 0x00000200) != 0; |
360 has_sse41_ = (cpu_info[2] & 0x00080000) != 0; | 360 has_sse41_ = (cpu_info[2] & 0x00080000) != 0; |
361 has_sse42_ = (cpu_info[2] & 0x00100000) != 0; | 361 has_sse42_ = (cpu_info[2] & 0x00100000) != 0; |
362 has_avx_ = (cpu_info[2] & 0x18000000) != 0; | 362 has_avx_ = (cpu_info[2] & 0x10000000) != 0; |
363 if (has_avx_) has_fma3_ = (cpu_info[2] & 0x00001000) != 0; | 363 if (has_avx_) has_fma3_ = (cpu_info[2] & 0x00001000) != 0; |
364 } | 364 } |
365 | 365 |
366 #if V8_HOST_ARCH_IA32 | 366 #if V8_HOST_ARCH_IA32 |
367 // SAHF is always available in compat/legacy mode, | 367 // SAHF is always available in compat/legacy mode, |
368 has_sahf_ = true; | 368 has_sahf_ = true; |
369 #else | 369 #else |
370 // Query extended IDs. | 370 // Query extended IDs. |
371 __cpuid(cpu_info, 0x80000000); | 371 __cpuid(cpu_info, 0x80000000); |
372 unsigned num_ext_ids = cpu_info[0]; | 372 unsigned num_ext_ids = cpu_info[0]; |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 if (end == part) { | 556 if (end == part) { |
557 part_ = 0; | 557 part_ = 0; |
558 } | 558 } |
559 delete[] part; | 559 delete[] part; |
560 } | 560 } |
561 | 561 |
562 #endif | 562 #endif |
563 } | 563 } |
564 | 564 |
565 } } // namespace v8::base | 565 } } // namespace v8::base |
OLD | NEW |