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