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 #include "vm/globals.h" // Needed here to get TARGET_ARCH_DBC. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_DBC. |
6 #if defined(TARGET_ARCH_DBC) | 6 #if defined(TARGET_ARCH_DBC) |
7 | 7 |
8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
9 | 9 |
10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 16 matching lines...) Expand all Loading... | |
27 | 27 |
28 DECLARE_FLAG(bool, emit_edge_counters); | 28 DECLARE_FLAG(bool, emit_edge_counters); |
29 DECLARE_FLAG(int, optimization_counter_threshold); | 29 DECLARE_FLAG(int, optimization_counter_threshold); |
30 | 30 |
31 // List of instructions that are still unimplemented by DBC backend. | 31 // List of instructions that are still unimplemented by DBC backend. |
32 #define FOR_EACH_UNIMPLEMENTED_INSTRUCTION(M) \ | 32 #define FOR_EACH_UNIMPLEMENTED_INSTRUCTION(M) \ |
33 M(LoadCodeUnits) \ | 33 M(LoadCodeUnits) \ |
34 M(BinaryInt32Op) \ | 34 M(BinaryInt32Op) \ |
35 M(Int32ToDouble) \ | 35 M(Int32ToDouble) \ |
36 M(DoubleToInteger) \ | 36 M(DoubleToInteger) \ |
37 M(DoubleToDouble) \ | |
38 M(DoubleToFloat) \ | |
39 M(FloatToDouble) \ | |
40 M(BoxInt64) \ | 37 M(BoxInt64) \ |
41 M(MergedMath) \ | 38 M(MergedMath) \ |
42 M(GuardFieldClass) \ | 39 M(GuardFieldClass) \ |
43 M(GuardFieldLength) \ | 40 M(GuardFieldLength) \ |
44 M(IfThenElse) \ | 41 M(IfThenElse) \ |
45 M(ExtractNthOutput) \ | 42 M(ExtractNthOutput) \ |
46 M(BinaryUint32Op) \ | 43 M(BinaryUint32Op) \ |
47 M(ShiftUint32Op) \ | 44 M(ShiftUint32Op) \ |
48 M(UnaryUint32Op) \ | 45 M(UnaryUint32Op) \ |
49 M(UnboxedIntConverter) \ | 46 M(UnboxedIntConverter) \ |
(...skipping 1540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1590 __ DSqrt(result, value); | 1587 __ DSqrt(result, value); |
1591 } else if (kind() == MathUnaryInstr::kDoubleSquare) { | 1588 } else if (kind() == MathUnaryInstr::kDoubleSquare) { |
1592 __ DMul(result, value, value); | 1589 __ DMul(result, value, value); |
1593 } else { | 1590 } else { |
1594 Unsupported(compiler); | 1591 Unsupported(compiler); |
1595 UNREACHABLE(); | 1592 UNREACHABLE(); |
1596 } | 1593 } |
1597 } | 1594 } |
1598 | 1595 |
1599 | 1596 |
1597 EMIT_NATIVE_CODE(DoubleToDouble, 1, Location::RequiresRegister()) { | |
1598 const Register in = locs()->in(0).reg(); | |
1599 const Register result = locs()->out(0).reg(); | |
1600 switch (recognized_kind()) { | |
1601 case MethodRecognizer::kDoubleTruncate: | |
1602 __ DTruncate(result, in); | |
1603 break; | |
1604 case MethodRecognizer::kDoubleFloor: | |
1605 __ DFloor(result, in); | |
1606 break; | |
1607 case MethodRecognizer::kDoubleCeil: | |
1608 __ DCeil(result, in); | |
1609 break; | |
1610 default: | |
1611 UNREACHABLE(); | |
1612 } | |
1613 } | |
1614 | |
1615 | |
1616 EMIT_NATIVE_CODE(DoubleToFloat, 1, Location::RequiresRegister()) { | |
Florian Schneider
2016/09/15 02:02:26
This won't be tested until you have support for op
zra
2016/09/15 15:09:31
Done.
| |
1617 const Register in = locs()->in(0).reg(); | |
1618 const Register result = locs()->out(0).reg(); | |
1619 __ DoubleToFloat(result, in); | |
1620 } | |
1621 | |
1622 | |
1623 EMIT_NATIVE_CODE(FloatToDouble, 1, Location::RequiresRegister()) { | |
Florian Schneider
2016/09/15 02:02:26
Same comment as above.
zra
2016/09/15 15:09:30
Done.
| |
1624 const Register in = locs()->in(0).reg(); | |
1625 const Register result = locs()->out(0).reg(); | |
1626 __ FloatToDouble(result, in); | |
1627 } | |
1628 | |
1629 | |
1600 EMIT_NATIVE_CODE(InvokeMathCFunction, | 1630 EMIT_NATIVE_CODE(InvokeMathCFunction, |
1601 InputCount(), Location::RequiresRegister()) { | 1631 InputCount(), Location::RequiresRegister()) { |
1602 const Register left = locs()->in(0).reg(); | 1632 const Register left = locs()->in(0).reg(); |
1603 const Register result = locs()->out(0).reg(); | 1633 const Register result = locs()->out(0).reg(); |
1604 if (recognized_kind() == MethodRecognizer::kMathDoublePow) { | 1634 if (recognized_kind() == MethodRecognizer::kMathDoublePow) { |
1605 const Register right = locs()->in(1).reg(); | 1635 const Register right = locs()->in(1).reg(); |
1606 __ DPow(result, left, right); | 1636 __ DPow(result, left, right); |
1607 } else if (recognized_kind() == MethodRecognizer::kDoubleMod) { | 1637 } else if (recognized_kind() == MethodRecognizer::kDoubleMod) { |
1608 const Register right = locs()->in(1).reg(); | 1638 const Register right = locs()->in(1).reg(); |
1609 __ DMod(result, left, right); | 1639 __ DMod(result, left, right); |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1809 __ IfULe(length, index); | 1839 __ IfULe(length, index); |
1810 compiler->EmitDeopt(deopt_id(), | 1840 compiler->EmitDeopt(deopt_id(), |
1811 ICData::kDeoptCheckArrayBound, | 1841 ICData::kDeoptCheckArrayBound, |
1812 (generalized_ ? ICData::kGeneralized : 0) | | 1842 (generalized_ ? ICData::kGeneralized : 0) | |
1813 (licm_hoisted_ ? ICData::kHoisted : 0)); | 1843 (licm_hoisted_ ? ICData::kHoisted : 0)); |
1814 } | 1844 } |
1815 | 1845 |
1816 } // namespace dart | 1846 } // namespace dart |
1817 | 1847 |
1818 #endif // defined TARGET_ARCH_DBC | 1848 #endif // defined TARGET_ARCH_DBC |
OLD | NEW |