| 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/base/bits.h" | 6 #include "src/base/bits.h" |
| 7 #include "src/compiler/instruction-selector-impl.h" | 7 #include "src/compiler/instruction-selector-impl.h" |
| 8 #include "src/compiler/node-matchers.h" | 8 #include "src/compiler/node-matchers.h" |
| 9 #include "src/compiler/node-properties.h" | 9 #include "src/compiler/node-properties.h" |
| 10 | 10 |
| (...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 954 // Shared routine for multiple word compare operations. | 954 // Shared routine for multiple word compare operations. |
| 955 void VisitWordCompare(InstructionSelector* selector, Node* node, | 955 void VisitWordCompare(InstructionSelector* selector, Node* node, |
| 956 InstructionCode opcode, FlagsContinuation* cont, | 956 InstructionCode opcode, FlagsContinuation* cont, |
| 957 bool commutative) { | 957 bool commutative) { |
| 958 Mips64OperandGenerator g(selector); | 958 Mips64OperandGenerator g(selector); |
| 959 Node* left = node->InputAt(0); | 959 Node* left = node->InputAt(0); |
| 960 Node* right = node->InputAt(1); | 960 Node* right = node->InputAt(1); |
| 961 | 961 |
| 962 // Match immediates on left or right side of comparison. | 962 // Match immediates on left or right side of comparison. |
| 963 if (g.CanBeImmediate(right, opcode)) { | 963 if (g.CanBeImmediate(right, opcode)) { |
| 964 VisitCompare(selector, opcode, g.UseRegister(left), g.UseImmediate(right), | 964 switch (cont->condition()) { |
| 965 cont); | 965 case kSignedLessThan: |
| 966 case kSignedGreaterThanOrEqual: |
| 967 case kUnsignedLessThan: |
| 968 case kUnsignedGreaterThanOrEqual: |
| 969 VisitCompare(selector, opcode, g.UseRegister(left), |
| 970 g.UseImmediate(right), cont); |
| 971 break; |
| 972 default: |
| 973 VisitCompare(selector, opcode, g.UseRegister(left), |
| 974 g.UseRegister(right), cont); |
| 975 } |
| 966 } else if (g.CanBeImmediate(left, opcode)) { | 976 } else if (g.CanBeImmediate(left, opcode)) { |
| 967 if (!commutative) cont->Commute(); | 977 if (!commutative) cont->Commute(); |
| 968 VisitCompare(selector, opcode, g.UseRegister(right), g.UseImmediate(left), | 978 switch (cont->condition()) { |
| 969 cont); | 979 case kSignedLessThan: |
| 980 case kSignedGreaterThanOrEqual: |
| 981 case kUnsignedLessThan: |
| 982 case kUnsignedGreaterThanOrEqual: |
| 983 VisitCompare(selector, opcode, g.UseRegister(right), |
| 984 g.UseImmediate(left), cont); |
| 985 break; |
| 986 default: |
| 987 VisitCompare(selector, opcode, g.UseRegister(right), |
| 988 g.UseRegister(left), cont); |
| 989 } |
| 970 } else { | 990 } else { |
| 971 VisitCompare(selector, opcode, g.UseRegister(left), g.UseRegister(right), | 991 VisitCompare(selector, opcode, g.UseRegister(left), g.UseRegister(right), |
| 972 cont); | 992 cont); |
| 973 } | 993 } |
| 974 } | 994 } |
| 975 | 995 |
| 976 | 996 |
| 977 void VisitWord32Compare(InstructionSelector* selector, Node* node, | 997 void VisitWord32Compare(InstructionSelector* selector, Node* node, |
| 978 FlagsContinuation* cont) { | 998 FlagsContinuation* cont) { |
| 979 VisitWordCompare(selector, node, kMips64Cmp, cont, false); | 999 VisitWordCompare(selector, node, kMips64Cmp, cont, false); |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1311 // static | 1331 // static |
| 1312 MachineOperatorBuilder::Flags | 1332 MachineOperatorBuilder::Flags |
| 1313 InstructionSelector::SupportedMachineOperatorFlags() { | 1333 InstructionSelector::SupportedMachineOperatorFlags() { |
| 1314 return MachineOperatorBuilder::kFloat64RoundDown | | 1334 return MachineOperatorBuilder::kFloat64RoundDown | |
| 1315 MachineOperatorBuilder::kFloat64RoundTruncate; | 1335 MachineOperatorBuilder::kFloat64RoundTruncate; |
| 1316 } | 1336 } |
| 1317 | 1337 |
| 1318 } // namespace compiler | 1338 } // namespace compiler |
| 1319 } // namespace internal | 1339 } // namespace internal |
| 1320 } // namespace v8 | 1340 } // namespace v8 |
| OLD | NEW |