| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_CPU_ARM_H_ | 5 #ifndef VM_CPU_ARM_H_ |
| 6 #define VM_CPU_ARM_H_ | 6 #define VM_CPU_ARM_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/simulator.h" | 9 #include "vm/simulator.h" |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 return integer_division_supported_; | 38 return integer_division_supported_; |
| 39 } | 39 } |
| 40 static bool vfp_supported() { | 40 static bool vfp_supported() { |
| 41 DEBUG_ASSERT(initialized_); | 41 DEBUG_ASSERT(initialized_); |
| 42 return vfp_supported_; | 42 return vfp_supported_; |
| 43 } | 43 } |
| 44 static bool neon_supported() { | 44 static bool neon_supported() { |
| 45 DEBUG_ASSERT(initialized_); | 45 DEBUG_ASSERT(initialized_); |
| 46 return neon_supported_; | 46 return neon_supported_; |
| 47 } | 47 } |
| 48 static bool hardfp_supported() { |
| 49 DEBUG_ASSERT(initialized_); |
| 50 return hardfp_supported_; |
| 51 } |
| 48 static ARMVersion arm_version() { | 52 static ARMVersion arm_version() { |
| 49 DEBUG_ASSERT(initialized_); | 53 DEBUG_ASSERT(initialized_); |
| 50 return arm_version_; | 54 return arm_version_; |
| 51 } | 55 } |
| 52 | 56 |
| 53 #if !defined(HOST_ARCH_ARM) | 57 #if !defined(HOST_ARCH_ARM) |
| 54 static void set_integer_division_supported(bool supported) { | 58 static void set_integer_division_supported(bool supported) { |
| 55 DEBUG_ASSERT(initialized_); | 59 DEBUG_ASSERT(initialized_); |
| 56 integer_division_supported_ = supported; | 60 integer_division_supported_ = supported; |
| 57 } | 61 } |
| 58 static void set_vfp_supported(bool supported) { | 62 static void set_vfp_supported(bool supported) { |
| 59 DEBUG_ASSERT(initialized_); | 63 DEBUG_ASSERT(initialized_); |
| 60 vfp_supported_ = supported; | 64 vfp_supported_ = supported; |
| 61 } | 65 } |
| 62 static void set_neon_supported(bool supported) { | 66 static void set_neon_supported(bool supported) { |
| 63 DEBUG_ASSERT(initialized_); | 67 DEBUG_ASSERT(initialized_); |
| 64 neon_supported_ = supported; | 68 neon_supported_ = supported; |
| 65 } | 69 } |
| 66 static void set_arm_version(ARMVersion version) { | 70 static void set_arm_version(ARMVersion version) { |
| 67 DEBUG_ASSERT(initialized_); | 71 DEBUG_ASSERT(initialized_); |
| 68 arm_version_ = version; | 72 arm_version_ = version; |
| 69 } | 73 } |
| 70 #endif // !defined(HOST_ARCH_ARM) | 74 #endif // !defined(HOST_ARCH_ARM) |
| 71 | 75 |
| 72 private: | 76 private: |
| 73 static const char* hardware_; | 77 static const char* hardware_; |
| 74 static bool integer_division_supported_; | 78 static bool integer_division_supported_; |
| 75 static bool vfp_supported_; | 79 static bool vfp_supported_; |
| 76 static bool neon_supported_; | 80 static bool neon_supported_; |
| 81 static bool hardfp_supported_; |
| 77 static ARMVersion arm_version_; | 82 static ARMVersion arm_version_; |
| 78 #if defined(DEBUG) | 83 #if defined(DEBUG) |
| 79 static bool initialized_; | 84 static bool initialized_; |
| 80 #endif | 85 #endif |
| 81 }; | 86 }; |
| 82 | 87 |
| 83 class TargetCPUFeatures : public AllStatic { | 88 class TargetCPUFeatures : public AllStatic { |
| 84 public: | 89 public: |
| 85 static void InitOnce() { | 90 static void InitOnce() { |
| 86 HostCPUFeatures::InitOnce(); | 91 HostCPUFeatures::InitOnce(); |
| 87 } | 92 } |
| 88 static void Cleanup() { | 93 static void Cleanup() { |
| 89 HostCPUFeatures::Cleanup(); | 94 HostCPUFeatures::Cleanup(); |
| 90 } | 95 } |
| 91 static bool double_truncate_round_supported() { | 96 static bool double_truncate_round_supported() { |
| 92 return false; | 97 return false; |
| 93 } | 98 } |
| 94 static bool integer_division_supported() { | 99 static bool integer_division_supported() { |
| 95 return HostCPUFeatures::integer_division_supported(); | 100 return HostCPUFeatures::integer_division_supported(); |
| 96 } | 101 } |
| 97 static bool vfp_supported() { | 102 static bool vfp_supported() { |
| 98 return HostCPUFeatures::vfp_supported(); | 103 return HostCPUFeatures::vfp_supported(); |
| 99 } | 104 } |
| 100 static bool neon_supported() { | 105 static bool neon_supported() { |
| 101 return HostCPUFeatures::neon_supported(); | 106 return HostCPUFeatures::neon_supported(); |
| 102 } | 107 } |
| 108 static bool hardfp_supported() { |
| 109 return HostCPUFeatures::hardfp_supported(); |
| 110 } |
| 103 static const char* hardware() { | 111 static const char* hardware() { |
| 104 return HostCPUFeatures::hardware(); | 112 return HostCPUFeatures::hardware(); |
| 105 } | 113 } |
| 106 static ARMVersion arm_version() { | 114 static ARMVersion arm_version() { |
| 107 return HostCPUFeatures::arm_version(); | 115 return HostCPUFeatures::arm_version(); |
| 108 } | 116 } |
| 109 }; | 117 }; |
| 110 | 118 |
| 111 } // namespace dart | 119 } // namespace dart |
| 112 | 120 |
| 113 #endif // VM_CPU_ARM_H_ | 121 #endif // VM_CPU_ARM_H_ |
| OLD | NEW |