Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Side by Side Diff: src/mips/lithium-mips.h

Issue 220403009: MIPS: Consistently use a separate Lithium instruction for flooring division. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | src/mips/lithium-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 V(DivByPowerOf2I) \ 90 V(DivByPowerOf2I) \
91 V(DivI) \ 91 V(DivI) \
92 V(DoubleToI) \ 92 V(DoubleToI) \
93 V(DoubleBits) \ 93 V(DoubleBits) \
94 V(DoubleToSmi) \ 94 V(DoubleToSmi) \
95 V(Drop) \ 95 V(Drop) \
96 V(Dummy) \ 96 V(Dummy) \
97 V(DummyUse) \ 97 V(DummyUse) \
98 V(FlooringDivByConstI) \ 98 V(FlooringDivByConstI) \
99 V(FlooringDivByPowerOf2I) \ 99 V(FlooringDivByPowerOf2I) \
100 V(FlooringDivI) \
100 V(ForInCacheArray) \ 101 V(ForInCacheArray) \
101 V(ForInPrepareMap) \ 102 V(ForInPrepareMap) \
102 V(FunctionLiteral) \ 103 V(FunctionLiteral) \
103 V(GetCachedArrayIndex) \ 104 V(GetCachedArrayIndex) \
104 V(Goto) \ 105 V(Goto) \
105 V(HasCachedArrayIndexAndBranch) \ 106 V(HasCachedArrayIndexAndBranch) \
106 V(HasInstanceTypeAndBranch) \ 107 V(HasInstanceTypeAndBranch) \
107 V(InnerAllocatedObject) \ 108 V(InnerAllocatedObject) \
108 V(InstanceOf) \ 109 V(InstanceOf) \
109 V(InstanceOfKnownGlobal) \ 110 V(InstanceOfKnownGlobal) \
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 DECLARE_CONCRETE_INSTRUCTION(DivByConstI, "div-by-const-i") 703 DECLARE_CONCRETE_INSTRUCTION(DivByConstI, "div-by-const-i")
703 DECLARE_HYDROGEN_ACCESSOR(Div) 704 DECLARE_HYDROGEN_ACCESSOR(Div)
704 705
705 private: 706 private:
706 int32_t divisor_; 707 int32_t divisor_;
707 }; 708 };
708 709
709 710
710 class LDivI V8_FINAL : public LTemplateInstruction<1, 2, 0> { 711 class LDivI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
711 public: 712 public:
712 LDivI(LOperand* left, LOperand* right) { 713 LDivI(LOperand* dividend, LOperand* divisor) {
713 inputs_[0] = left; 714 inputs_[0] = dividend;
714 inputs_[1] = right; 715 inputs_[1] = divisor;
715 } 716 }
716 717
717 LOperand* left() { return inputs_[0]; } 718 LOperand* dividend() { return inputs_[0]; }
718 LOperand* right() { return inputs_[1]; } 719 LOperand* divisor() { return inputs_[1]; }
719 720
720 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i") 721 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i")
721 DECLARE_HYDROGEN_ACCESSOR(BinaryOperation) 722 DECLARE_HYDROGEN_ACCESSOR(BinaryOperation)
722 }; 723 };
723 724
724 725
725 class LFlooringDivByPowerOf2I V8_FINAL : public LTemplateInstruction<1, 1, 0> { 726 class LFlooringDivByPowerOf2I V8_FINAL : public LTemplateInstruction<1, 1, 0> {
726 public: 727 public:
727 LFlooringDivByPowerOf2I(LOperand* dividend, int32_t divisor) { 728 LFlooringDivByPowerOf2I(LOperand* dividend, int32_t divisor) {
728 inputs_[0] = dividend; 729 inputs_[0] = dividend;
(...skipping 25 matching lines...) Expand all
754 LOperand* temp() { return temps_[0]; } 755 LOperand* temp() { return temps_[0]; }
755 756
756 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByConstI, "flooring-div-by-const-i") 757 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByConstI, "flooring-div-by-const-i")
757 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) 758 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
758 759
759 private: 760 private:
760 int32_t divisor_; 761 int32_t divisor_;
761 }; 762 };
762 763
763 764
765 class LFlooringDivI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
766 public:
767 LFlooringDivI(LOperand* dividend, LOperand* divisor) {
768 inputs_[0] = dividend;
769 inputs_[1] = divisor;
770 }
771
772 LOperand* dividend() { return inputs_[0]; }
773 LOperand* divisor() { return inputs_[1]; }
774
775 DECLARE_CONCRETE_INSTRUCTION(FlooringDivI, "flooring-div-i")
776 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
777 };
778
779
764 class LMulI V8_FINAL : public LTemplateInstruction<1, 2, 0> { 780 class LMulI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
765 public: 781 public:
766 LMulI(LOperand* left, LOperand* right) { 782 LMulI(LOperand* left, LOperand* right) {
767 inputs_[0] = left; 783 inputs_[0] = left;
768 inputs_[1] = right; 784 inputs_[1] = right;
769 } 785 }
770 786
771 LOperand* left() { return inputs_[0]; } 787 LOperand* left() { return inputs_[0]; }
772 LOperand* right() { return inputs_[1]; } 788 LOperand* right() { return inputs_[1]; }
773 789
(...skipping 1898 matching lines...) Expand 10 before | Expand all | Expand 10 after
2672 LInstruction* DoMathFloor(HUnaryMathOperation* instr); 2688 LInstruction* DoMathFloor(HUnaryMathOperation* instr);
2673 LInstruction* DoMathRound(HUnaryMathOperation* instr); 2689 LInstruction* DoMathRound(HUnaryMathOperation* instr);
2674 LInstruction* DoMathAbs(HUnaryMathOperation* instr); 2690 LInstruction* DoMathAbs(HUnaryMathOperation* instr);
2675 LInstruction* DoMathLog(HUnaryMathOperation* instr); 2691 LInstruction* DoMathLog(HUnaryMathOperation* instr);
2676 LInstruction* DoMathExp(HUnaryMathOperation* instr); 2692 LInstruction* DoMathExp(HUnaryMathOperation* instr);
2677 LInstruction* DoMathSqrt(HUnaryMathOperation* instr); 2693 LInstruction* DoMathSqrt(HUnaryMathOperation* instr);
2678 LInstruction* DoMathPowHalf(HUnaryMathOperation* instr); 2694 LInstruction* DoMathPowHalf(HUnaryMathOperation* instr);
2679 LInstruction* DoMathClz32(HUnaryMathOperation* instr); 2695 LInstruction* DoMathClz32(HUnaryMathOperation* instr);
2680 LInstruction* DoDivByPowerOf2I(HDiv* instr); 2696 LInstruction* DoDivByPowerOf2I(HDiv* instr);
2681 LInstruction* DoDivByConstI(HDiv* instr); 2697 LInstruction* DoDivByConstI(HDiv* instr);
2682 LInstruction* DoDivI(HBinaryOperation* instr); 2698 LInstruction* DoDivI(HDiv* instr);
2683 LInstruction* DoModByPowerOf2I(HMod* instr); 2699 LInstruction* DoModByPowerOf2I(HMod* instr);
2684 LInstruction* DoModByConstI(HMod* instr); 2700 LInstruction* DoModByConstI(HMod* instr);
2685 LInstruction* DoModI(HMod* instr); 2701 LInstruction* DoModI(HMod* instr);
2686 LInstruction* DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr); 2702 LInstruction* DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr);
2687 LInstruction* DoFlooringDivByConstI(HMathFloorOfDiv* instr); 2703 LInstruction* DoFlooringDivByConstI(HMathFloorOfDiv* instr);
2704 LInstruction* DoFlooringDivI(HMathFloorOfDiv* instr);
2688 2705
2689 private: 2706 private:
2690 enum Status { 2707 enum Status {
2691 UNUSED, 2708 UNUSED,
2692 BUILDING, 2709 BUILDING,
2693 DONE, 2710 DONE,
2694 ABORTED 2711 ABORTED
2695 }; 2712 };
2696 2713
2697 LPlatformChunk* chunk() const { return chunk_; } 2714 LPlatformChunk* chunk() const { return chunk_; }
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
2799 2816
2800 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2817 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2801 }; 2818 };
2802 2819
2803 #undef DECLARE_HYDROGEN_ACCESSOR 2820 #undef DECLARE_HYDROGEN_ACCESSOR
2804 #undef DECLARE_CONCRETE_INSTRUCTION 2821 #undef DECLARE_CONCRETE_INSTRUCTION
2805 2822
2806 } } // namespace v8::internal 2823 } } // namespace v8::internal
2807 2824
2808 #endif // V8_MIPS_LITHIUM_MIPS_H_ 2825 #endif // V8_MIPS_LITHIUM_MIPS_H_
OLDNEW
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | src/mips/lithium-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698