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 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
960 // Shared routine for multiple word compare operations. | 960 // Shared routine for multiple word compare operations. |
961 void VisitWordCompare(InstructionSelector* selector, Node* node, | 961 void VisitWordCompare(InstructionSelector* selector, Node* node, |
962 InstructionCode opcode, FlagsContinuation* cont, | 962 InstructionCode opcode, FlagsContinuation* cont, |
963 bool commutative) { | 963 bool commutative) { |
964 Mips64OperandGenerator g(selector); | 964 Mips64OperandGenerator g(selector); |
965 Node* left = node->InputAt(0); | 965 Node* left = node->InputAt(0); |
966 Node* right = node->InputAt(1); | 966 Node* right = node->InputAt(1); |
967 | 967 |
968 // Match immediates on left or right side of comparison. | 968 // Match immediates on left or right side of comparison. |
969 if (g.CanBeImmediate(right, opcode)) { | 969 if (g.CanBeImmediate(right, opcode)) { |
970 VisitCompare(selector, opcode, g.UseRegister(left), g.UseImmediate(right), | 970 switch (cont->condition()) { |
971 cont); | 971 case kSignedLessThan: |
| 972 case kSignedGreaterThanOrEqual: |
| 973 case kUnsignedLessThan: |
| 974 case kUnsignedGreaterThanOrEqual: |
| 975 VisitCompare(selector, opcode, g.UseRegister(left), |
| 976 g.UseImmediate(right), cont); |
| 977 break; |
| 978 default: |
| 979 VisitCompare(selector, opcode, g.UseRegister(left), |
| 980 g.UseRegister(right), cont); |
| 981 } |
972 } else if (g.CanBeImmediate(left, opcode)) { | 982 } else if (g.CanBeImmediate(left, opcode)) { |
973 if (!commutative) cont->Commute(); | 983 if (!commutative) cont->Commute(); |
974 VisitCompare(selector, opcode, g.UseRegister(right), g.UseImmediate(left), | 984 switch (cont->condition()) { |
975 cont); | 985 case kSignedLessThan: |
| 986 case kSignedGreaterThanOrEqual: |
| 987 case kUnsignedLessThan: |
| 988 case kUnsignedGreaterThanOrEqual: |
| 989 VisitCompare(selector, opcode, g.UseRegister(right), |
| 990 g.UseImmediate(left), cont); |
| 991 break; |
| 992 default: |
| 993 VisitCompare(selector, opcode, g.UseRegister(right), |
| 994 g.UseRegister(left), cont); |
| 995 } |
976 } else { | 996 } else { |
977 VisitCompare(selector, opcode, g.UseRegister(left), g.UseRegister(right), | 997 VisitCompare(selector, opcode, g.UseRegister(left), g.UseRegister(right), |
978 cont); | 998 cont); |
979 } | 999 } |
980 } | 1000 } |
981 | 1001 |
982 | 1002 |
983 void VisitWord32Compare(InstructionSelector* selector, Node* node, | 1003 void VisitWord32Compare(InstructionSelector* selector, Node* node, |
984 FlagsContinuation* cont) { | 1004 FlagsContinuation* cont) { |
985 VisitWordCompare(selector, node, kMips64Cmp, cont, false); | 1005 VisitWordCompare(selector, node, kMips64Cmp, cont, false); |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1317 // static | 1337 // static |
1318 MachineOperatorBuilder::Flags | 1338 MachineOperatorBuilder::Flags |
1319 InstructionSelector::SupportedMachineOperatorFlags() { | 1339 InstructionSelector::SupportedMachineOperatorFlags() { |
1320 return MachineOperatorBuilder::kFloat64RoundDown | | 1340 return MachineOperatorBuilder::kFloat64RoundDown | |
1321 MachineOperatorBuilder::kFloat64RoundTruncate; | 1341 MachineOperatorBuilder::kFloat64RoundTruncate; |
1322 } | 1342 } |
1323 | 1343 |
1324 } // namespace compiler | 1344 } // namespace compiler |
1325 } // namespace internal | 1345 } // namespace internal |
1326 } // namespace v8 | 1346 } // namespace v8 |
OLD | NEW |