| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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_DBC_H_ | 5 #ifndef VM_CPU_DBC_H_ |
| 6 #define VM_CPU_DBC_H_ | 6 #define VM_CPU_DBC_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 class HostCPUFeatures: public AllStatic { | 13 class HostCPUFeatures: public AllStatic { |
| 14 public: | 14 public: |
| 15 static const char* hardware() { return "simdbc"; } | 15 static void InitOnce(); |
| 16 static void Cleanup(); |
| 17 |
| 18 static const char* hardware() { |
| 19 DEBUG_ASSERT(initialized_); |
| 20 return hardware_; |
| 21 } |
| 22 |
| 23 private: |
| 24 static const char* hardware_; |
| 25 #if defined(DEBUG) |
| 26 static bool initialized_; |
| 27 #endif |
| 16 }; | 28 }; |
| 17 | 29 |
| 18 class TargetCPUFeatures : public AllStatic { | 30 class TargetCPUFeatures : public AllStatic { |
| 19 public: | 31 public: |
| 20 static void InitOnce() {} | 32 static void InitOnce() { |
| 21 static void Cleanup() {} | 33 HostCPUFeatures::InitOnce(); |
| 34 } |
| 35 static void Cleanup() { |
| 36 HostCPUFeatures::Cleanup(); |
| 37 } |
| 38 |
| 39 static const char* hardware() { |
| 40 return CPU::Id(); |
| 41 } |
| 22 | 42 |
| 23 static bool double_truncate_round_supported() { | 43 static bool double_truncate_round_supported() { |
| 24 return true; | 44 return true; |
| 25 } | 45 } |
| 26 }; | 46 }; |
| 27 | 47 |
| 28 } // namespace dart | 48 } // namespace dart |
| 29 | 49 |
| 30 #endif // VM_CPU_DBC_H_ | 50 #endif // VM_CPU_DBC_H_ |
| OLD | NEW |