OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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" // Needed here to get TARGET_ARCH_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
7 | 7 |
8 #include "vm/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
9 | 9 |
10 #include "vm/ast_printer.h" | 10 #include "vm/ast_printer.h" |
11 #include "vm/compiler.h" | 11 #include "vm/compiler.h" |
12 #include "vm/cpu.h" | 12 #include "vm/cpu.h" |
13 #include "vm/dart_entry.h" | 13 #include "vm/dart_entry.h" |
14 #include "vm/deopt_instructions.h" | 14 #include "vm/deopt_instructions.h" |
15 #include "vm/il_printer.h" | 15 #include "vm/il_printer.h" |
16 #include "vm/locations.h" | 16 #include "vm/locations.h" |
17 #include "vm/object_store.h" | 17 #include "vm/object_store.h" |
18 #include "vm/parser.h" | 18 #include "vm/parser.h" |
19 #include "vm/stack_frame.h" | 19 #include "vm/stack_frame.h" |
20 #include "vm/stub_code.h" | 20 #include "vm/stub_code.h" |
21 #include "vm/symbols.h" | 21 #include "vm/symbols.h" |
22 | 22 |
23 namespace dart { | 23 namespace dart { |
24 | 24 |
25 DEFINE_FLAG(bool, trap_on_deoptimization, false, "Trap on deoptimization."); | 25 DEFINE_FLAG(bool, trap_on_deoptimization, false, "Trap on deoptimization."); |
26 DEFINE_FLAG(bool, unbox_mints, true, "Optimize 64-bit integer arithmetic."); | 26 DEFINE_FLAG(bool, unbox_mints, true, "Optimize 64-bit integer arithmetic."); |
| 27 DEFINE_FLAG(bool, unbox_doubles, true, "Optimize double arithmetic."); |
27 DECLARE_FLAG(int, optimization_counter_threshold); | 28 DECLARE_FLAG(int, optimization_counter_threshold); |
28 DECLARE_FLAG(int, reoptimization_counter_threshold); | 29 DECLARE_FLAG(int, reoptimization_counter_threshold); |
29 DECLARE_FLAG(bool, enable_type_checks); | 30 DECLARE_FLAG(bool, enable_type_checks); |
30 DECLARE_FLAG(bool, eliminate_type_checks); | 31 DECLARE_FLAG(bool, eliminate_type_checks); |
31 DECLARE_FLAG(bool, enable_simd_inline); | 32 DECLARE_FLAG(bool, enable_simd_inline); |
32 | 33 |
33 | 34 |
34 FlowGraphCompiler::~FlowGraphCompiler() { | 35 FlowGraphCompiler::~FlowGraphCompiler() { |
35 // BlockInfos are zone-allocated, so their destructors are not called. | 36 // BlockInfos are zone-allocated, so their destructors are not called. |
36 // Verify the labels explicitly here. | 37 // Verify the labels explicitly here. |
37 for (int i = 0; i < block_info_.length(); ++i) { | 38 for (int i = 0; i < block_info_.length(); ++i) { |
38 ASSERT(!block_info_[i]->jump_label()->IsLinked()); | 39 ASSERT(!block_info_[i]->jump_label()->IsLinked()); |
39 } | 40 } |
40 } | 41 } |
41 | 42 |
42 | 43 |
| 44 bool FlowGraphCompiler::SupportsUnboxedDoubles() { |
| 45 return TargetCPUFeatures::vfp_supported() && FLAG_unbox_doubles; |
| 46 } |
| 47 |
| 48 |
43 bool FlowGraphCompiler::SupportsUnboxedMints() { | 49 bool FlowGraphCompiler::SupportsUnboxedMints() { |
44 return TargetCPUFeatures::neon_supported() && FLAG_unbox_mints; | 50 return TargetCPUFeatures::neon_supported() && FLAG_unbox_mints; |
45 } | 51 } |
46 | 52 |
47 | 53 |
48 bool FlowGraphCompiler::SupportsUnboxedSimd128() { | 54 bool FlowGraphCompiler::SupportsUnboxedSimd128() { |
49 return TargetCPUFeatures::neon_supported() && FLAG_enable_simd_inline; | 55 return TargetCPUFeatures::neon_supported() && FLAG_enable_simd_inline; |
50 } | 56 } |
51 | 57 |
52 | 58 |
(...skipping 1536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1589 __ LoadFromOffset(kWord, destination.reg(), FP, source_offset); | 1595 __ LoadFromOffset(kWord, destination.reg(), FP, source_offset); |
1590 } else { | 1596 } else { |
1591 ASSERT(destination.IsStackSlot()); | 1597 ASSERT(destination.IsStackSlot()); |
1592 const intptr_t source_offset = source.ToStackSlotOffset(); | 1598 const intptr_t source_offset = source.ToStackSlotOffset(); |
1593 const intptr_t dest_offset = destination.ToStackSlotOffset(); | 1599 const intptr_t dest_offset = destination.ToStackSlotOffset(); |
1594 __ LoadFromOffset(kWord, TMP, FP, source_offset); | 1600 __ LoadFromOffset(kWord, TMP, FP, source_offset); |
1595 __ StoreToOffset(kWord, TMP, FP, dest_offset); | 1601 __ StoreToOffset(kWord, TMP, FP, dest_offset); |
1596 } | 1602 } |
1597 } else if (source.IsFpuRegister()) { | 1603 } else if (source.IsFpuRegister()) { |
1598 if (destination.IsFpuRegister()) { | 1604 if (destination.IsFpuRegister()) { |
1599 __ vmovq(destination.fpu_reg(), source.fpu_reg()); | 1605 if (TargetCPUFeatures::neon_supported()) { |
| 1606 __ vmovq(destination.fpu_reg(), source.fpu_reg()); |
| 1607 } else { |
| 1608 // If we're not inlining simd values, then only the even numbered D |
| 1609 // register will have anything in them. |
| 1610 __ vmovd(EvenDRegisterOf(destination.fpu_reg()), |
| 1611 EvenDRegisterOf(source.fpu_reg())); |
| 1612 } |
1600 } else { | 1613 } else { |
1601 if (destination.IsDoubleStackSlot()) { | 1614 if (destination.IsDoubleStackSlot()) { |
1602 const intptr_t dest_offset = destination.ToStackSlotOffset(); | 1615 const intptr_t dest_offset = destination.ToStackSlotOffset(); |
1603 DRegister src = EvenDRegisterOf(source.fpu_reg()); | 1616 DRegister src = EvenDRegisterOf(source.fpu_reg()); |
1604 __ StoreDToOffset(src, FP, dest_offset); | 1617 __ StoreDToOffset(src, FP, dest_offset); |
1605 } else { | 1618 } else { |
1606 ASSERT(destination.IsQuadStackSlot()); | 1619 ASSERT(destination.IsQuadStackSlot()); |
1607 const intptr_t dest_offset = destination.ToStackSlotOffset(); | 1620 const intptr_t dest_offset = destination.ToStackSlotOffset(); |
1608 const DRegister dsrc0 = EvenDRegisterOf(source.fpu_reg()); | 1621 const DRegister dsrc0 = EvenDRegisterOf(source.fpu_reg()); |
1609 __ StoreMultipleDToOffset(dsrc0, 2, FP, dest_offset); | 1622 __ StoreMultipleDToOffset(dsrc0, 2, FP, dest_offset); |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1804 DRegister dreg = EvenDRegisterOf(reg); | 1817 DRegister dreg = EvenDRegisterOf(reg); |
1805 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); | 1818 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); |
1806 } | 1819 } |
1807 | 1820 |
1808 | 1821 |
1809 #undef __ | 1822 #undef __ |
1810 | 1823 |
1811 } // namespace dart | 1824 } // namespace dart |
1812 | 1825 |
1813 #endif // defined TARGET_ARCH_ARM | 1826 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |