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