| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/base/adapters.h" | 5 #include "src/base/adapters.h" |
| 6 #include "src/compiler/instruction-selector-impl.h" | 6 #include "src/compiler/instruction-selector-impl.h" |
| 7 #include "src/compiler/node-matchers.h" | 7 #include "src/compiler/node-matchers.h" |
| 8 #include "src/compiler/node-properties.h" | 8 #include "src/compiler/node-properties.h" |
| 9 #include "src/ppc/frames-ppc.h" | 9 #include "src/ppc/frames-ppc.h" |
| 10 | 10 |
| (...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 834 } else { | 834 } else { |
| 835 // The high word of the result is not used, so we emit the standard 32 bit | 835 // The high word of the result is not used, so we emit the standard 32 bit |
| 836 // instruction. | 836 // instruction. |
| 837 selector->Emit(opcode2, g.DefineSameAsFirst(node), | 837 selector->Emit(opcode2, g.DefineSameAsFirst(node), |
| 838 g.UseRegister(node->InputAt(0)), | 838 g.UseRegister(node->InputAt(0)), |
| 839 g.UseRegister(node->InputAt(2))); | 839 g.UseRegister(node->InputAt(2))); |
| 840 } | 840 } |
| 841 } | 841 } |
| 842 | 842 |
| 843 void InstructionSelector::VisitInt32PairAdd(Node* node) { | 843 void InstructionSelector::VisitInt32PairAdd(Node* node) { |
| 844 VisitPairBinop(this, kPPC_AddPair, kPPC_Add, node); | 844 VisitPairBinop(this, kPPC_AddPair, kPPC_Add32, node); |
| 845 } | 845 } |
| 846 | 846 |
| 847 void InstructionSelector::VisitInt32PairSub(Node* node) { | 847 void InstructionSelector::VisitInt32PairSub(Node* node) { |
| 848 VisitPairBinop(this, kPPC_SubPair, kPPC_Sub, node); | 848 VisitPairBinop(this, kPPC_SubPair, kPPC_Sub, node); |
| 849 } | 849 } |
| 850 | 850 |
| 851 void InstructionSelector::VisitInt32PairMul(Node* node) { | 851 void InstructionSelector::VisitInt32PairMul(Node* node) { |
| 852 PPCOperandGenerator g(this); | 852 PPCOperandGenerator g(this); |
| 853 Node* projection1 = NodeProperties::FindProjection(node, 1); | 853 Node* projection1 = NodeProperties::FindProjection(node, 1); |
| 854 if (projection1) { | 854 if (projection1) { |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1011 | 1011 |
| 1012 #if V8_TARGET_ARCH_PPC64 | 1012 #if V8_TARGET_ARCH_PPC64 |
| 1013 void InstructionSelector::VisitWord64ReverseBits(Node* node) { UNREACHABLE(); } | 1013 void InstructionSelector::VisitWord64ReverseBits(Node* node) { UNREACHABLE(); } |
| 1014 #endif | 1014 #endif |
| 1015 | 1015 |
| 1016 void InstructionSelector::VisitWord64ReverseBytes(Node* node) { UNREACHABLE(); } | 1016 void InstructionSelector::VisitWord64ReverseBytes(Node* node) { UNREACHABLE(); } |
| 1017 | 1017 |
| 1018 void InstructionSelector::VisitWord32ReverseBytes(Node* node) { UNREACHABLE(); } | 1018 void InstructionSelector::VisitWord32ReverseBytes(Node* node) { UNREACHABLE(); } |
| 1019 | 1019 |
| 1020 void InstructionSelector::VisitInt32Add(Node* node) { | 1020 void InstructionSelector::VisitInt32Add(Node* node) { |
| 1021 VisitBinop<Int32BinopMatcher>(this, node, kPPC_Add, kInt16Imm); | 1021 VisitBinop<Int32BinopMatcher>(this, node, kPPC_Add32, kInt16Imm); |
| 1022 } | 1022 } |
| 1023 | 1023 |
| 1024 | 1024 |
| 1025 #if V8_TARGET_ARCH_PPC64 | 1025 #if V8_TARGET_ARCH_PPC64 |
| 1026 void InstructionSelector::VisitInt64Add(Node* node) { | 1026 void InstructionSelector::VisitInt64Add(Node* node) { |
| 1027 VisitBinop<Int64BinopMatcher>(this, node, kPPC_Add, kInt16Imm); | 1027 VisitBinop<Int64BinopMatcher>(this, node, kPPC_Add64, kInt16Imm); |
| 1028 } | 1028 } |
| 1029 #endif | 1029 #endif |
| 1030 | 1030 |
| 1031 void InstructionSelector::VisitInt32Sub(Node* node) { | 1031 void InstructionSelector::VisitInt32Sub(Node* node) { |
| 1032 PPCOperandGenerator g(this); | 1032 PPCOperandGenerator g(this); |
| 1033 Int32BinopMatcher m(node); | 1033 Int32BinopMatcher m(node); |
| 1034 if (m.left().Is(0)) { | 1034 if (m.left().Is(0)) { |
| 1035 Emit(kPPC_Neg, g.DefineAsRegister(node), g.UseRegister(m.right().node())); | 1035 Emit(kPPC_Neg, g.DefineAsRegister(node), g.UseRegister(m.right().node())); |
| 1036 } else { | 1036 } else { |
| 1037 VisitBinop<Int32BinopMatcher>(this, node, kPPC_Sub, kInt16Imm_Negate); | 1037 VisitBinop<Int32BinopMatcher>(this, node, kPPC_Sub, kInt16Imm_Negate); |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1479 FlagsContinuation cont; | 1479 FlagsContinuation cont; |
| 1480 VisitBinop<Int32BinopMatcher>(this, node, kPPC_SubWithOverflow32, | 1480 VisitBinop<Int32BinopMatcher>(this, node, kPPC_SubWithOverflow32, |
| 1481 kInt16Imm_Negate, &cont); | 1481 kInt16Imm_Negate, &cont); |
| 1482 } | 1482 } |
| 1483 | 1483 |
| 1484 | 1484 |
| 1485 #if V8_TARGET_ARCH_PPC64 | 1485 #if V8_TARGET_ARCH_PPC64 |
| 1486 void InstructionSelector::VisitInt64AddWithOverflow(Node* node) { | 1486 void InstructionSelector::VisitInt64AddWithOverflow(Node* node) { |
| 1487 if (Node* ovf = NodeProperties::FindProjection(node, 1)) { | 1487 if (Node* ovf = NodeProperties::FindProjection(node, 1)) { |
| 1488 FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf); | 1488 FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf); |
| 1489 return VisitBinop<Int64BinopMatcher>(this, node, kPPC_Add, kInt16Imm, | 1489 return VisitBinop<Int64BinopMatcher>(this, node, kPPC_Add64, kInt16Imm, |
| 1490 &cont); | 1490 &cont); |
| 1491 } | 1491 } |
| 1492 FlagsContinuation cont; | 1492 FlagsContinuation cont; |
| 1493 VisitBinop<Int64BinopMatcher>(this, node, kPPC_Add, kInt16Imm, &cont); | 1493 VisitBinop<Int64BinopMatcher>(this, node, kPPC_Add64, kInt16Imm, &cont); |
| 1494 } | 1494 } |
| 1495 | 1495 |
| 1496 | 1496 |
| 1497 void InstructionSelector::VisitInt64SubWithOverflow(Node* node) { | 1497 void InstructionSelector::VisitInt64SubWithOverflow(Node* node) { |
| 1498 if (Node* ovf = NodeProperties::FindProjection(node, 1)) { | 1498 if (Node* ovf = NodeProperties::FindProjection(node, 1)) { |
| 1499 FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf); | 1499 FlagsContinuation cont = FlagsContinuation::ForSet(kOverflow, ovf); |
| 1500 return VisitBinop<Int64BinopMatcher>(this, node, kPPC_Sub, kInt16Imm_Negate, | 1500 return VisitBinop<Int64BinopMatcher>(this, node, kPPC_Sub, kInt16Imm_Negate, |
| 1501 &cont); | 1501 &cont); |
| 1502 } | 1502 } |
| 1503 FlagsContinuation cont; | 1503 FlagsContinuation cont; |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1691 cont->OverwriteAndNegateIfEqual(kOverflow); | 1691 cont->OverwriteAndNegateIfEqual(kOverflow); |
| 1692 return VisitBinop<Int32BinopMatcher>(selector, node, | 1692 return VisitBinop<Int32BinopMatcher>(selector, node, |
| 1693 kPPC_SubWithOverflow32, | 1693 kPPC_SubWithOverflow32, |
| 1694 kInt16Imm_Negate, cont); | 1694 kInt16Imm_Negate, cont); |
| 1695 case IrOpcode::kInt32MulWithOverflow: | 1695 case IrOpcode::kInt32MulWithOverflow: |
| 1696 cont->OverwriteAndNegateIfEqual(kNotEqual); | 1696 cont->OverwriteAndNegateIfEqual(kNotEqual); |
| 1697 return EmitInt32MulWithOverflow(selector, node, cont); | 1697 return EmitInt32MulWithOverflow(selector, node, cont); |
| 1698 #if V8_TARGET_ARCH_PPC64 | 1698 #if V8_TARGET_ARCH_PPC64 |
| 1699 case IrOpcode::kInt64AddWithOverflow: | 1699 case IrOpcode::kInt64AddWithOverflow: |
| 1700 cont->OverwriteAndNegateIfEqual(kOverflow); | 1700 cont->OverwriteAndNegateIfEqual(kOverflow); |
| 1701 return VisitBinop<Int64BinopMatcher>(selector, node, kPPC_Add, | 1701 return VisitBinop<Int64BinopMatcher>(selector, node, kPPC_Add64, |
| 1702 kInt16Imm, cont); | 1702 kInt16Imm, cont); |
| 1703 case IrOpcode::kInt64SubWithOverflow: | 1703 case IrOpcode::kInt64SubWithOverflow: |
| 1704 cont->OverwriteAndNegateIfEqual(kOverflow); | 1704 cont->OverwriteAndNegateIfEqual(kOverflow); |
| 1705 return VisitBinop<Int64BinopMatcher>(selector, node, kPPC_Sub, | 1705 return VisitBinop<Int64BinopMatcher>(selector, node, kPPC_Sub, |
| 1706 kInt16Imm_Negate, cont); | 1706 kInt16Imm_Negate, cont); |
| 1707 #endif | 1707 #endif |
| 1708 default: | 1708 default: |
| 1709 break; | 1709 break; |
| 1710 } | 1710 } |
| 1711 } | 1711 } |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2098 // static | 2098 // static |
| 2099 MachineOperatorBuilder::AlignmentRequirements | 2099 MachineOperatorBuilder::AlignmentRequirements |
| 2100 InstructionSelector::AlignmentRequirements() { | 2100 InstructionSelector::AlignmentRequirements() { |
| 2101 return MachineOperatorBuilder::AlignmentRequirements:: | 2101 return MachineOperatorBuilder::AlignmentRequirements:: |
| 2102 FullUnalignedAccessSupport(); | 2102 FullUnalignedAccessSupport(); |
| 2103 } | 2103 } |
| 2104 | 2104 |
| 2105 } // namespace compiler | 2105 } // namespace compiler |
| 2106 } // namespace internal | 2106 } // namespace internal |
| 2107 } // namespace v8 | 2107 } // namespace v8 |
| OLD | NEW |