OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 LDivI(LOperand* left, LOperand* right, LOperand* temp) { | 647 LDivI(LOperand* left, LOperand* right, LOperand* temp) { |
648 inputs_[0] = left; | 648 inputs_[0] = left; |
649 inputs_[1] = right; | 649 inputs_[1] = right; |
650 temps_[0] = temp; | 650 temps_[0] = temp; |
651 } | 651 } |
652 | 652 |
653 LOperand* left() { return inputs_[0]; } | 653 LOperand* left() { return inputs_[0]; } |
654 LOperand* right() { return inputs_[1]; } | 654 LOperand* right() { return inputs_[1]; } |
655 LOperand* temp() { return temps_[0]; } | 655 LOperand* temp() { return temps_[0]; } |
656 | 656 |
| 657 bool is_flooring() { return hydrogen_value()->IsMathFloorOfDiv(); } |
| 658 |
657 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i") | 659 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i") |
658 DECLARE_HYDROGEN_ACCESSOR(Div) | 660 DECLARE_HYDROGEN_ACCESSOR(Div) |
659 }; | 661 }; |
660 | 662 |
661 | 663 |
662 class LMathFloorOfDiv V8_FINAL : public LTemplateInstruction<1, 2, 1> { | 664 class LMathFloorOfDiv V8_FINAL : public LTemplateInstruction<1, 2, 1> { |
663 public: | 665 public: |
664 LMathFloorOfDiv(LOperand* left, | 666 LMathFloorOfDiv(LOperand* left, |
665 LOperand* right, | 667 LOperand* right, |
666 LOperand* temp = NULL) { | 668 LOperand* temp = NULL) { |
(...skipping 2021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2688 // Declare methods that deal with the individual node types. | 2690 // Declare methods that deal with the individual node types. |
2689 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); | 2691 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); |
2690 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) | 2692 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) |
2691 #undef DECLARE_DO | 2693 #undef DECLARE_DO |
2692 | 2694 |
2693 LInstruction* DoMultiplyAdd(HMul* mul, HValue* addend); | 2695 LInstruction* DoMultiplyAdd(HMul* mul, HValue* addend); |
2694 LInstruction* DoMultiplySub(HValue* minuend, HMul* mul); | 2696 LInstruction* DoMultiplySub(HValue* minuend, HMul* mul); |
2695 LInstruction* DoRSub(HSub* instr); | 2697 LInstruction* DoRSub(HSub* instr); |
2696 | 2698 |
2697 static bool HasMagicNumberForDivisor(int32_t divisor); | 2699 static bool HasMagicNumberForDivisor(int32_t divisor); |
2698 static HValue* SimplifiedDivisorForMathFloorOfDiv(HValue* val); | |
2699 | 2700 |
2700 LInstruction* DoMathFloor(HUnaryMathOperation* instr); | 2701 LInstruction* DoMathFloor(HUnaryMathOperation* instr); |
2701 LInstruction* DoMathRound(HUnaryMathOperation* instr); | 2702 LInstruction* DoMathRound(HUnaryMathOperation* instr); |
2702 LInstruction* DoMathAbs(HUnaryMathOperation* instr); | 2703 LInstruction* DoMathAbs(HUnaryMathOperation* instr); |
2703 LInstruction* DoMathLog(HUnaryMathOperation* instr); | 2704 LInstruction* DoMathLog(HUnaryMathOperation* instr); |
2704 LInstruction* DoMathExp(HUnaryMathOperation* instr); | 2705 LInstruction* DoMathExp(HUnaryMathOperation* instr); |
2705 LInstruction* DoMathSqrt(HUnaryMathOperation* instr); | 2706 LInstruction* DoMathSqrt(HUnaryMathOperation* instr); |
2706 LInstruction* DoMathPowHalf(HUnaryMathOperation* instr); | 2707 LInstruction* DoMathPowHalf(HUnaryMathOperation* instr); |
2707 | 2708 |
2708 private: | 2709 private: |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2820 | 2821 |
2821 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2822 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2822 }; | 2823 }; |
2823 | 2824 |
2824 #undef DECLARE_HYDROGEN_ACCESSOR | 2825 #undef DECLARE_HYDROGEN_ACCESSOR |
2825 #undef DECLARE_CONCRETE_INSTRUCTION | 2826 #undef DECLARE_CONCRETE_INSTRUCTION |
2826 | 2827 |
2827 } } // namespace v8::internal | 2828 } } // namespace v8::internal |
2828 | 2829 |
2829 #endif // V8_ARM_LITHIUM_ARM_H_ | 2830 #endif // V8_ARM_LITHIUM_ARM_H_ |
OLD | NEW |