OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 #ifndef VM_CPU_ARM64_H_ |
| 6 #define VM_CPU_ARM64_H_ |
| 7 |
| 8 #include "vm/allocation.h" |
| 9 #include "vm/simulator.h" |
| 10 |
| 11 namespace dart { |
| 12 |
| 13 // TargetCPUFeatures gives CPU features for the architecture that we are |
| 14 // generating code for. HostCPUFeatures gives the CPU features for the |
| 15 // architecture that we are actually running on. When the architectures |
| 16 // are the same, TargetCPUFeatures will query HostCPUFeatures. When they are |
| 17 // different (i.e. we are running in a simulator), HostCPUFeatures will |
| 18 // additionally mock the options needed for the target architecture so that |
| 19 // they may be altered for testing. |
| 20 |
| 21 class HostCPUFeatures: public AllStatic { |
| 22 public: |
| 23 static void InitOnce(); |
| 24 static void Cleanup(); |
| 25 static const char* hardware() { |
| 26 DEBUG_ASSERT(initialized_); |
| 27 return hardware_; |
| 28 } |
| 29 |
| 30 private: |
| 31 static const char* hardware_; |
| 32 #if defined(DEBUG) |
| 33 static bool initialized_; |
| 34 #endif |
| 35 }; |
| 36 |
| 37 class TargetCPUFeatures : public AllStatic { |
| 38 public: |
| 39 static void InitOnce() { |
| 40 HostCPUFeatures::InitOnce(); |
| 41 } |
| 42 static void Cleanup() { |
| 43 HostCPUFeatures::Cleanup(); |
| 44 } |
| 45 static const char* hardware() { |
| 46 return HostCPUFeatures::hardware(); |
| 47 } |
| 48 static bool double_truncate_round_supported() { |
| 49 return false; |
| 50 } |
| 51 }; |
| 52 |
| 53 } // namespace dart |
| 54 |
| 55 #endif // VM_CPU_ARM64_H_ |
OLD | NEW |