| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #ifndef V8_MIPS_CONSTANTS_H_ | 5 #ifndef V8_MIPS_CONSTANTS_H_ |
| 6 #define V8_MIPS_CONSTANTS_H_ | 6 #define V8_MIPS_CONSTANTS_H_ |
| 7 #include "src/globals.h" | 7 #include "src/globals.h" |
| 8 // UNIMPLEMENTED_ macro for MIPS. | 8 // UNIMPLEMENTED_ macro for MIPS. |
| 9 #ifdef DEBUG | 9 #ifdef DEBUG |
| 10 #define UNIMPLEMENTED_MIPS() \ | 10 #define UNIMPLEMENTED_MIPS() \ |
| (...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 }; | 553 }; |
| 554 | 554 |
| 555 | 555 |
| 556 // ----- Emulated conditions. | 556 // ----- Emulated conditions. |
| 557 // On MIPS we use this enum to abstract from conditionnal branch instructions. | 557 // On MIPS we use this enum to abstract from conditionnal branch instructions. |
| 558 // The 'U' prefix is used to specify unsigned comparisons. | 558 // The 'U' prefix is used to specify unsigned comparisons. |
| 559 // Oppposite conditions must be paired as odd/even numbers | 559 // Oppposite conditions must be paired as odd/even numbers |
| 560 // because 'NegateCondition' function flips LSB to negate condition. | 560 // because 'NegateCondition' function flips LSB to negate condition. |
| 561 enum Condition { | 561 enum Condition { |
| 562 // Any value < 0 is considered no_condition. | 562 // Any value < 0 is considered no_condition. |
| 563 kNoCondition = -1, | 563 kNoCondition = -1, |
| 564 | 564 overflow = 0, |
| 565 overflow = 0, | 565 no_overflow = 1, |
| 566 no_overflow = 1, | 566 Uless = 2, |
| 567 Uless = 2, | 567 Ugreater_equal = 3, |
| 568 Ugreater_equal= 3, | 568 equal = 4, |
| 569 equal = 4, | 569 not_equal = 5, |
| 570 not_equal = 5, | 570 Uless_equal = 6, |
| 571 Uless_equal = 6, | 571 Ugreater = 7, |
| 572 Ugreater = 7, | 572 negative = 8, |
| 573 negative = 8, | 573 positive = 9, |
| 574 positive = 9, | 574 parity_even = 10, |
| 575 parity_even = 10, | 575 parity_odd = 11, |
| 576 parity_odd = 11, | 576 less = 12, |
| 577 less = 12, | |
| 578 greater_equal = 13, | 577 greater_equal = 13, |
| 579 less_equal = 14, | 578 less_equal = 14, |
| 580 greater = 15, | 579 greater = 15, |
| 581 ueq = 16, // Unordered or Equal. | 580 ueq = 16, // Unordered or Equal. |
| 582 nue = 17, // Not (Unordered or Equal). | 581 nue = 17, // Not (Unordered or Equal). |
| 583 | 582 cc_always = 18, |
| 584 cc_always = 18, | |
| 585 | 583 |
| 586 // Aliases. | 584 // Aliases. |
| 587 carry = Uless, | 585 carry = Uless, |
| 588 not_carry = Ugreater_equal, | 586 not_carry = Ugreater_equal, |
| 589 zero = equal, | 587 zero = equal, |
| 590 eq = equal, | 588 eq = equal, |
| 591 not_zero = not_equal, | 589 not_zero = not_equal, |
| 592 ne = not_equal, | 590 ne = not_equal, |
| 593 nz = not_equal, | 591 nz = not_equal, |
| 594 sign = negative, | 592 sign = negative, |
| 595 not_sign = positive, | 593 not_sign = positive, |
| 596 mi = negative, | 594 mi = negative, |
| 597 pl = positive, | 595 pl = positive, |
| 598 hi = Ugreater, | 596 hi = Ugreater, |
| 599 ls = Uless_equal, | 597 ls = Uless_equal, |
| 600 ge = greater_equal, | 598 ge = greater_equal, |
| 601 lt = less, | 599 lt = less, |
| 602 gt = greater, | 600 gt = greater, |
| 603 le = less_equal, | 601 le = less_equal, |
| 604 hs = Ugreater_equal, | 602 hs = Ugreater_equal, |
| 605 lo = Uless, | 603 lo = Uless, |
| 606 al = cc_always, | 604 al = cc_always, |
| 607 | 605 cc_default = kNoCondition |
| 608 cc_default = kNoCondition | |
| 609 }; | 606 }; |
| 610 | 607 |
| 611 | 608 |
| 612 // Returns the equivalent of !cc. | 609 // Returns the equivalent of !cc. |
| 613 // Negation of the default kNoCondition (-1) results in a non-default | 610 // Negation of the default kNoCondition (-1) results in a non-default |
| 614 // no_condition value (-2). As long as tests for no_condition check | 611 // no_condition value (-2). As long as tests for no_condition check |
| 615 // for condition < 0, this will work as expected. | 612 // for condition < 0, this will work as expected. |
| 616 inline Condition NegateCondition(Condition cc) { | 613 inline Condition NegateCondition(Condition cc) { |
| 617 DCHECK(cc != cc_always); | 614 DCHECK(cc != cc_always); |
| 618 return static_cast<Condition>(cc ^ 1); | 615 return static_cast<Condition>(cc ^ 1); |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 930 // JS argument slots size. | 927 // JS argument slots size. |
| 931 const int kJSArgsSlotsSize = 0 * Instruction::kInstrSize; | 928 const int kJSArgsSlotsSize = 0 * Instruction::kInstrSize; |
| 932 // Assembly builtins argument slots size. | 929 // Assembly builtins argument slots size. |
| 933 const int kBArgsSlotsSize = 0 * Instruction::kInstrSize; | 930 const int kBArgsSlotsSize = 0 * Instruction::kInstrSize; |
| 934 | 931 |
| 935 const int kBranchReturnOffset = 2 * Instruction::kInstrSize; | 932 const int kBranchReturnOffset = 2 * Instruction::kInstrSize; |
| 936 | 933 |
| 937 } } // namespace v8::internal | 934 } } // namespace v8::internal |
| 938 | 935 |
| 939 #endif // #ifndef V8_MIPS_CONSTANTS_H_ | 936 #endif // #ifndef V8_MIPS_CONSTANTS_H_ |
| OLD | NEW |