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/cpu.h" | 5 #include "src/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_POSIX | 10 #if V8_OS_POSIX |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 has_vfp3_ = (hwcaps & (HWCAP_VFPv3 | HWCAP_VFPv3D16 | HWCAP_VFPv4)) != 0; | 388 has_vfp3_ = (hwcaps & (HWCAP_VFPv3 | HWCAP_VFPv3D16 | HWCAP_VFPv4)) != 0; |
389 has_vfp3_d32_ = (has_vfp3_ && ((hwcaps & HWCAP_VFPv3D16) == 0 || | 389 has_vfp3_d32_ = (has_vfp3_ && ((hwcaps & HWCAP_VFPv3D16) == 0 || |
390 (hwcaps & HWCAP_VFPD32) != 0)); | 390 (hwcaps & HWCAP_VFPD32) != 0)); |
391 } else { | 391 } else { |
392 // Try to fallback to "Features" CPUInfo field. | 392 // Try to fallback to "Features" CPUInfo field. |
393 char* features = cpu_info.ExtractField("Features"); | 393 char* features = cpu_info.ExtractField("Features"); |
394 has_idiva_ = HasListItem(features, "idiva"); | 394 has_idiva_ = HasListItem(features, "idiva"); |
395 has_neon_ = HasListItem(features, "neon"); | 395 has_neon_ = HasListItem(features, "neon"); |
396 has_thumbee_ = HasListItem(features, "thumbee"); | 396 has_thumbee_ = HasListItem(features, "thumbee"); |
397 has_vfp_ = HasListItem(features, "vfp"); | 397 has_vfp_ = HasListItem(features, "vfp"); |
398 if (HasListItem(features, "vfpv3")) { | 398 if (HasListItem(features, "vfpv3d16")) { |
| 399 has_vfp3_ = true; |
| 400 } else if (HasListItem(features, "vfpv3")) { |
399 has_vfp3_ = true; | 401 has_vfp3_ = true; |
400 has_vfp3_d32_ = true; | 402 has_vfp3_d32_ = true; |
401 } else if (HasListItem(features, "vfpv3d16")) { | |
402 has_vfp3_ = true; | |
403 } | 403 } |
404 delete[] features; | 404 delete[] features; |
405 } | 405 } |
406 | 406 |
407 // Some old kernels will report vfp not vfpv3. Here we make an attempt | 407 // Some old kernels will report vfp not vfpv3. Here we make an attempt |
408 // to detect vfpv3 by checking for vfp *and* neon, since neon is only | 408 // to detect vfpv3 by checking for vfp *and* neon, since neon is only |
409 // available on architectures with vfpv3. Checking neon on its own is | 409 // available on architectures with vfpv3. Checking neon on its own is |
410 // not enough as it is possible to have neon without vfp. | 410 // not enough as it is possible to have neon without vfp. |
411 if (has_vfp_ && has_neon_) { | 411 if (has_vfp_ && has_neon_) { |
412 has_vfp3_ = true; | 412 has_vfp3_ = true; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 if (end == part) { | 490 if (end == part) { |
491 part_ = 0; | 491 part_ = 0; |
492 } | 492 } |
493 delete[] part; | 493 delete[] part; |
494 } | 494 } |
495 | 495 |
496 #endif | 496 #endif |
497 } | 497 } |
498 | 498 |
499 } } // namespace v8::internal | 499 } } // namespace v8::internal |
OLD | NEW |