| 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 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 } else if (mleft.right().Is(24) && m.right().Is(24)) { | 778 } else if (mleft.right().Is(24) && m.right().Is(24)) { |
| 779 Emit(kPPC_ExtendSignWord8, g.DefineAsRegister(node), | 779 Emit(kPPC_ExtendSignWord8, g.DefineAsRegister(node), |
| 780 g.UseRegister(mleft.left().node())); | 780 g.UseRegister(mleft.left().node())); |
| 781 return; | 781 return; |
| 782 } | 782 } |
| 783 } | 783 } |
| 784 VisitRRO(this, kPPC_ShiftRightAlg32, node, kShift32Imm); | 784 VisitRRO(this, kPPC_ShiftRightAlg32, node, kShift32Imm); |
| 785 } | 785 } |
| 786 | 786 |
| 787 #if !V8_TARGET_ARCH_PPC64 | 787 #if !V8_TARGET_ARCH_PPC64 |
| 788 void InstructionSelector::VisitInt32PairAdd(Node* node) { |
| 789 PPCOperandGenerator g(this); |
| 790 |
| 791 // We use UseUniqueRegister here to avoid register sharing with the output |
| 792 // registers. |
| 793 InstructionOperand inputs[] = { |
| 794 g.UseRegister(node->InputAt(0)), g.UseUniqueRegister(node->InputAt(1)), |
| 795 g.UseRegister(node->InputAt(2)), g.UseUniqueRegister(node->InputAt(3))}; |
| 796 |
| 797 InstructionOperand outputs[] = { |
| 798 g.DefineAsRegister(node), |
| 799 g.DefineAsRegister(NodeProperties::FindProjection(node, 1))}; |
| 800 |
| 801 Emit(kPPC_AddPair, 2, outputs, 4, inputs); |
| 802 } |
| 803 |
| 788 void VisitPairShift(InstructionSelector* selector, ArchOpcode opcode, | 804 void VisitPairShift(InstructionSelector* selector, ArchOpcode opcode, |
| 789 Node* node) { | 805 Node* node) { |
| 790 PPCOperandGenerator g(selector); | 806 PPCOperandGenerator g(selector); |
| 791 Int32Matcher m(node->InputAt(2)); | 807 Int32Matcher m(node->InputAt(2)); |
| 792 InstructionOperand shift_operand; | 808 InstructionOperand shift_operand; |
| 793 if (m.HasValue()) { | 809 if (m.HasValue()) { |
| 794 shift_operand = g.UseImmediate(m.node()); | 810 shift_operand = g.UseImmediate(m.node()); |
| 795 } else { | 811 } else { |
| 796 shift_operand = g.UseUniqueRegister(m.node()); | 812 shift_operand = g.UseUniqueRegister(m.node()); |
| 797 } | 813 } |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 891 VisitBinop<Int32BinopMatcher>(this, node, kPPC_Add, kInt16Imm); | 907 VisitBinop<Int32BinopMatcher>(this, node, kPPC_Add, kInt16Imm); |
| 892 } | 908 } |
| 893 | 909 |
| 894 | 910 |
| 895 #if V8_TARGET_ARCH_PPC64 | 911 #if V8_TARGET_ARCH_PPC64 |
| 896 void InstructionSelector::VisitInt64Add(Node* node) { | 912 void InstructionSelector::VisitInt64Add(Node* node) { |
| 897 VisitBinop<Int64BinopMatcher>(this, node, kPPC_Add, kInt16Imm); | 913 VisitBinop<Int64BinopMatcher>(this, node, kPPC_Add, kInt16Imm); |
| 898 } | 914 } |
| 899 #endif | 915 #endif |
| 900 | 916 |
| 901 #if !V8_TARGET_ARCH_PPC64 | |
| 902 void InstructionSelector::VisitInt32PairAdd(Node* node) { UNIMPLEMENTED(); } | |
| 903 #endif | |
| 904 | |
| 905 void InstructionSelector::VisitInt32Sub(Node* node) { | 917 void InstructionSelector::VisitInt32Sub(Node* node) { |
| 906 PPCOperandGenerator g(this); | 918 PPCOperandGenerator g(this); |
| 907 Int32BinopMatcher m(node); | 919 Int32BinopMatcher m(node); |
| 908 if (m.left().Is(0)) { | 920 if (m.left().Is(0)) { |
| 909 Emit(kPPC_Neg, g.DefineAsRegister(node), g.UseRegister(m.right().node())); | 921 Emit(kPPC_Neg, g.DefineAsRegister(node), g.UseRegister(m.right().node())); |
| 910 } else { | 922 } else { |
| 911 VisitBinop<Int32BinopMatcher>(this, node, kPPC_Sub, kInt16Imm_Negate); | 923 VisitBinop<Int32BinopMatcher>(this, node, kPPC_Sub, kInt16Imm_Negate); |
| 912 } | 924 } |
| 913 } | 925 } |
| 914 | 926 |
| (...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1869 MachineOperatorBuilder::kFloat64RoundTruncate | | 1881 MachineOperatorBuilder::kFloat64RoundTruncate | |
| 1870 MachineOperatorBuilder::kFloat64RoundTiesAway | | 1882 MachineOperatorBuilder::kFloat64RoundTiesAway | |
| 1871 MachineOperatorBuilder::kWord32Popcnt | | 1883 MachineOperatorBuilder::kWord32Popcnt | |
| 1872 MachineOperatorBuilder::kWord64Popcnt; | 1884 MachineOperatorBuilder::kWord64Popcnt; |
| 1873 // We omit kWord32ShiftIsSafe as s[rl]w use 0x3f as a mask rather than 0x1f. | 1885 // We omit kWord32ShiftIsSafe as s[rl]w use 0x3f as a mask rather than 0x1f. |
| 1874 } | 1886 } |
| 1875 | 1887 |
| 1876 } // namespace compiler | 1888 } // namespace compiler |
| 1877 } // namespace internal | 1889 } // namespace internal |
| 1878 } // namespace v8 | 1890 } // namespace v8 |
| OLD | NEW |