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/compiler/common-operator.h" | 5 #include "src/compiler/common-operator.h" |
6 #include "src/compiler/graph.h" | 6 #include "src/compiler/graph.h" |
7 #include "src/compiler/instruction.h" | 7 #include "src/compiler/instruction.h" |
8 #include "src/compiler/schedule.h" | 8 #include "src/compiler/schedule.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
11 namespace internal { | 11 namespace internal { |
12 namespace compiler { | 12 namespace compiler { |
13 | 13 |
| 14 |
| 15 FlagsCondition CommuteFlagsCondition(FlagsCondition condition) { |
| 16 switch (condition) { |
| 17 case kSignedLessThan: |
| 18 return kSignedGreaterThan; |
| 19 case kSignedGreaterThanOrEqual: |
| 20 return kSignedLessThanOrEqual; |
| 21 case kSignedLessThanOrEqual: |
| 22 return kSignedGreaterThanOrEqual; |
| 23 case kSignedGreaterThan: |
| 24 return kSignedLessThan; |
| 25 case kUnsignedLessThan: |
| 26 return kUnsignedGreaterThan; |
| 27 case kUnsignedGreaterThanOrEqual: |
| 28 return kUnsignedLessThanOrEqual; |
| 29 case kUnsignedLessThanOrEqual: |
| 30 return kUnsignedGreaterThanOrEqual; |
| 31 case kUnsignedGreaterThan: |
| 32 return kUnsignedLessThan; |
| 33 case kFloatLessThanOrUnordered: |
| 34 return kFloatGreaterThanOrUnordered; |
| 35 case kFloatGreaterThanOrEqual: |
| 36 return kFloatLessThanOrEqual; |
| 37 case kFloatLessThanOrEqual: |
| 38 return kFloatGreaterThanOrEqual; |
| 39 case kFloatGreaterThanOrUnordered: |
| 40 return kFloatLessThanOrUnordered; |
| 41 case kFloatLessThan: |
| 42 return kFloatGreaterThan; |
| 43 case kFloatGreaterThanOrEqualOrUnordered: |
| 44 return kFloatLessThanOrEqualOrUnordered; |
| 45 case kFloatLessThanOrEqualOrUnordered: |
| 46 return kFloatGreaterThanOrEqualOrUnordered; |
| 47 case kFloatGreaterThan: |
| 48 return kFloatLessThan; |
| 49 case kEqual: |
| 50 case kNotEqual: |
| 51 case kOverflow: |
| 52 case kNotOverflow: |
| 53 case kUnorderedEqual: |
| 54 case kUnorderedNotEqual: |
| 55 return condition; |
| 56 } |
| 57 UNREACHABLE(); |
| 58 return condition; |
| 59 } |
| 60 |
| 61 |
14 std::ostream& operator<<(std::ostream& os, | 62 std::ostream& operator<<(std::ostream& os, |
15 const PrintableInstructionOperand& printable) { | 63 const PrintableInstructionOperand& printable) { |
16 const InstructionOperand& op = printable.op_; | 64 const InstructionOperand& op = printable.op_; |
17 const RegisterConfiguration* conf = printable.register_configuration_; | 65 const RegisterConfiguration* conf = printable.register_configuration_; |
18 switch (op.kind()) { | 66 switch (op.kind()) { |
19 case InstructionOperand::UNALLOCATED: { | 67 case InstructionOperand::UNALLOCATED: { |
20 const UnallocatedOperand* unalloc = UnallocatedOperand::cast(&op); | 68 const UnallocatedOperand* unalloc = UnallocatedOperand::cast(&op); |
21 os << "v" << unalloc->virtual_register(); | 69 os << "v" << unalloc->virtual_register(); |
22 if (unalloc->basic_policy() == UnallocatedOperand::FIXED_SLOT) { | 70 if (unalloc->basic_policy() == UnallocatedOperand::FIXED_SLOT) { |
23 return os << "(=" << unalloc->fixed_slot_index() << "S)"; | 71 return os << "(=" << unalloc->fixed_slot_index() << "S)"; |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 case kSignedGreaterThan: | 341 case kSignedGreaterThan: |
294 return os << "signed greater than"; | 342 return os << "signed greater than"; |
295 case kUnsignedLessThan: | 343 case kUnsignedLessThan: |
296 return os << "unsigned less than"; | 344 return os << "unsigned less than"; |
297 case kUnsignedGreaterThanOrEqual: | 345 case kUnsignedGreaterThanOrEqual: |
298 return os << "unsigned greater than or equal"; | 346 return os << "unsigned greater than or equal"; |
299 case kUnsignedLessThanOrEqual: | 347 case kUnsignedLessThanOrEqual: |
300 return os << "unsigned less than or equal"; | 348 return os << "unsigned less than or equal"; |
301 case kUnsignedGreaterThan: | 349 case kUnsignedGreaterThan: |
302 return os << "unsigned greater than"; | 350 return os << "unsigned greater than"; |
| 351 case kFloatLessThanOrUnordered: |
| 352 return os << "less than or unordered (FP)"; |
| 353 case kFloatGreaterThanOrEqual: |
| 354 return os << "greater than or equal (FP)"; |
| 355 case kFloatLessThanOrEqual: |
| 356 return os << "less than or equal (FP)"; |
| 357 case kFloatGreaterThanOrUnordered: |
| 358 return os << "greater than or unordered (FP)"; |
| 359 case kFloatLessThan: |
| 360 return os << "less than (FP)"; |
| 361 case kFloatGreaterThanOrEqualOrUnordered: |
| 362 return os << "greater than, equal or unordered (FP)"; |
| 363 case kFloatLessThanOrEqualOrUnordered: |
| 364 return os << "less than, equal or unordered (FP)"; |
| 365 case kFloatGreaterThan: |
| 366 return os << "greater than (FP)"; |
303 case kUnorderedEqual: | 367 case kUnorderedEqual: |
304 return os << "unordered equal"; | 368 return os << "unordered equal"; |
305 case kUnorderedNotEqual: | 369 case kUnorderedNotEqual: |
306 return os << "unordered not equal"; | 370 return os << "unordered not equal"; |
307 case kOverflow: | 371 case kOverflow: |
308 return os << "overflow"; | 372 return os << "overflow"; |
309 case kNotOverflow: | 373 case kNotOverflow: |
310 return os << "not overflow"; | 374 return os << "not overflow"; |
311 } | 375 } |
312 UNREACHABLE(); | 376 UNREACHABLE(); |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 os << " B" << succ.ToInt(); | 873 os << " B" << succ.ToInt(); |
810 } | 874 } |
811 os << "\n"; | 875 os << "\n"; |
812 } | 876 } |
813 return os; | 877 return os; |
814 } | 878 } |
815 | 879 |
816 } // namespace compiler | 880 } // namespace compiler |
817 } // namespace internal | 881 } // namespace internal |
818 } // namespace v8 | 882 } // namespace v8 |
OLD | NEW |