| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 #include "vm/globals.h" | 5 #include "vm/globals.h" |
| 6 | 6 |
| 7 #if defined(TARGET_ARCH_X64) | 7 #if defined(TARGET_ARCH_X64) |
| 8 | 8 |
| 9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
| 10 | 10 |
| 11 #include "vm/assembler.h" | |
| 12 #include "vm/constants_x64.h" | 11 #include "vm/constants_x64.h" |
| 13 #include "vm/cpuinfo.h" | |
| 14 #include "vm/heap.h" | 12 #include "vm/heap.h" |
| 15 #include "vm/isolate.h" | 13 #include "vm/isolate.h" |
| 16 #include "vm/object.h" | 14 #include "vm/object.h" |
| 17 | 15 |
| 18 namespace dart { | 16 namespace dart { |
| 19 | 17 |
| 20 DEFINE_FLAG(bool, use_sse41, true, "Use SSE 4.1 if available"); | |
| 21 | |
| 22 | |
| 23 void CPU::FlushICache(uword start, uword size) { | 18 void CPU::FlushICache(uword start, uword size) { |
| 24 // Nothing to be done here. | 19 // Nothing to be done here. |
| 25 } | 20 } |
| 26 | 21 |
| 27 | 22 |
| 28 const char* CPU::Id() { | 23 const char* CPU::Id() { |
| 29 return "x64"; | 24 return "x64"; |
| 30 } | 25 } |
| 31 | 26 |
| 32 | |
| 33 bool HostCPUFeatures::sse2_supported_ = true; | |
| 34 bool HostCPUFeatures::sse4_1_supported_ = false; | |
| 35 char* HostCPUFeatures::hardware_ = NULL; | |
| 36 #ifdef DEBUG | |
| 37 bool HostCPUFeatures::initialized_ = false; | |
| 38 #endif | |
| 39 | |
| 40 | |
| 41 #define __ assembler. | |
| 42 void HostCPUFeatures::InitOnce() { | |
| 43 CpuInfo::InitOnce(); | |
| 44 hardware_ = CpuInfo::GetCpuModel(); | |
| 45 sse4_1_supported_ = | |
| 46 CpuInfo::FieldContainsById(CpuInfo::kCpuInfoFeatures, "sse4_1") || | |
| 47 CpuInfo::FieldContainsById(CpuInfo::kCpuInfoFeatures, "sse4.1"); | |
| 48 | |
| 49 #ifdef DEBUG | |
| 50 initialized_ = true; | |
| 51 #endif | |
| 52 } | |
| 53 #undef __ | |
| 54 | |
| 55 } // namespace dart | 27 } // namespace dart |
| 56 | 28 |
| 57 #endif // defined TARGET_ARCH_X64 | 29 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |