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

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

Issue 212703002: Consistently use a separate Lithium instruction for flooring division. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added TODOs 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 | « no previous file | src/arm/lithium-arm.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(DoubleBits) \ 92 V(DoubleBits) \
93 V(DoubleToI) \ 93 V(DoubleToI) \
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 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 DECLARE_CONCRETE_INSTRUCTION(DivByConstI, "div-by-const-i") 707 DECLARE_CONCRETE_INSTRUCTION(DivByConstI, "div-by-const-i")
707 DECLARE_HYDROGEN_ACCESSOR(Div) 708 DECLARE_HYDROGEN_ACCESSOR(Div)
708 709
709 private: 710 private:
710 int32_t divisor_; 711 int32_t divisor_;
711 }; 712 };
712 713
713 714
714 class LDivI V8_FINAL : public LTemplateInstruction<1, 2, 1> { 715 class LDivI V8_FINAL : public LTemplateInstruction<1, 2, 1> {
715 public: 716 public:
716 LDivI(LOperand* left, LOperand* right, LOperand* temp) { 717 LDivI(LOperand* dividend, LOperand* divisor, LOperand* temp) {
717 inputs_[0] = left; 718 inputs_[0] = dividend;
718 inputs_[1] = right; 719 inputs_[1] = divisor;
719 temps_[0] = temp; 720 temps_[0] = temp;
720 } 721 }
721 722
722 LOperand* left() { return inputs_[0]; } 723 LOperand* dividend() { return inputs_[0]; }
723 LOperand* right() { return inputs_[1]; } 724 LOperand* divisor() { return inputs_[1]; }
724 LOperand* temp() { return temps_[0]; } 725 LOperand* temp() { return temps_[0]; }
725 726
726 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i") 727 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i")
727 DECLARE_HYDROGEN_ACCESSOR(BinaryOperation) 728 DECLARE_HYDROGEN_ACCESSOR(BinaryOperation)
728 }; 729 };
729 730
730 731
731 class LFlooringDivByPowerOf2I V8_FINAL : public LTemplateInstruction<1, 1, 0> { 732 class LFlooringDivByPowerOf2I V8_FINAL : public LTemplateInstruction<1, 1, 0> {
732 public: 733 public:
733 LFlooringDivByPowerOf2I(LOperand* dividend, int32_t divisor) { 734 LFlooringDivByPowerOf2I(LOperand* dividend, int32_t divisor) {
(...skipping 26 matching lines...) Expand all
760 LOperand* temp() { return temps_[0]; } 761 LOperand* temp() { return temps_[0]; }
761 762
762 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByConstI, "flooring-div-by-const-i") 763 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByConstI, "flooring-div-by-const-i")
763 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) 764 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
764 765
765 private: 766 private:
766 int32_t divisor_; 767 int32_t divisor_;
767 }; 768 };
768 769
769 770
771 class LFlooringDivI V8_FINAL : public LTemplateInstruction<1, 2, 1> {
772 public:
773 LFlooringDivI(LOperand* dividend, LOperand* divisor, LOperand* temp) {
774 inputs_[0] = dividend;
775 inputs_[1] = divisor;
776 temps_[0] = temp;
777 }
778
779 LOperand* dividend() { return inputs_[0]; }
780 LOperand* divisor() { return inputs_[1]; }
781 LOperand* temp() { return temps_[0]; }
782
783 DECLARE_CONCRETE_INSTRUCTION(FlooringDivI, "flooring-div-i")
784 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
785 };
786
787
770 class LMulI V8_FINAL : public LTemplateInstruction<1, 2, 0> { 788 class LMulI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
771 public: 789 public:
772 LMulI(LOperand* left, LOperand* right) { 790 LMulI(LOperand* left, LOperand* right) {
773 inputs_[0] = left; 791 inputs_[0] = left;
774 inputs_[1] = right; 792 inputs_[1] = right;
775 } 793 }
776 794
777 LOperand* left() { return inputs_[0]; } 795 LOperand* left() { return inputs_[0]; }
778 LOperand* right() { return inputs_[1]; } 796 LOperand* right() { return inputs_[1]; }
779 797
(...skipping 1935 matching lines...) Expand 10 before | Expand all | Expand 10 after
2715 LInstruction* DoMathFloor(HUnaryMathOperation* instr); 2733 LInstruction* DoMathFloor(HUnaryMathOperation* instr);
2716 LInstruction* DoMathRound(HUnaryMathOperation* instr); 2734 LInstruction* DoMathRound(HUnaryMathOperation* instr);
2717 LInstruction* DoMathAbs(HUnaryMathOperation* instr); 2735 LInstruction* DoMathAbs(HUnaryMathOperation* instr);
2718 LInstruction* DoMathLog(HUnaryMathOperation* instr); 2736 LInstruction* DoMathLog(HUnaryMathOperation* instr);
2719 LInstruction* DoMathExp(HUnaryMathOperation* instr); 2737 LInstruction* DoMathExp(HUnaryMathOperation* instr);
2720 LInstruction* DoMathSqrt(HUnaryMathOperation* instr); 2738 LInstruction* DoMathSqrt(HUnaryMathOperation* instr);
2721 LInstruction* DoMathPowHalf(HUnaryMathOperation* instr); 2739 LInstruction* DoMathPowHalf(HUnaryMathOperation* instr);
2722 LInstruction* DoMathClz32(HUnaryMathOperation* instr); 2740 LInstruction* DoMathClz32(HUnaryMathOperation* instr);
2723 LInstruction* DoDivByPowerOf2I(HDiv* instr); 2741 LInstruction* DoDivByPowerOf2I(HDiv* instr);
2724 LInstruction* DoDivByConstI(HDiv* instr); 2742 LInstruction* DoDivByConstI(HDiv* instr);
2725 LInstruction* DoDivI(HBinaryOperation* instr); 2743 LInstruction* DoDivI(HDiv* instr);
2726 LInstruction* DoModByPowerOf2I(HMod* instr); 2744 LInstruction* DoModByPowerOf2I(HMod* instr);
2727 LInstruction* DoModByConstI(HMod* instr); 2745 LInstruction* DoModByConstI(HMod* instr);
2728 LInstruction* DoModI(HMod* instr); 2746 LInstruction* DoModI(HMod* instr);
2729 LInstruction* DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr); 2747 LInstruction* DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr);
2730 LInstruction* DoFlooringDivByConstI(HMathFloorOfDiv* instr); 2748 LInstruction* DoFlooringDivByConstI(HMathFloorOfDiv* instr);
2749 LInstruction* DoFlooringDivI(HMathFloorOfDiv* instr);
2731 2750
2732 private: 2751 private:
2733 enum Status { 2752 enum Status {
2734 UNUSED, 2753 UNUSED,
2735 BUILDING, 2754 BUILDING,
2736 DONE, 2755 DONE,
2737 ABORTED 2756 ABORTED
2738 }; 2757 };
2739 2758
2740 LPlatformChunk* chunk() const { return chunk_; } 2759 LPlatformChunk* chunk() const { return chunk_; }
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
2841 2860
2842 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2861 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2843 }; 2862 };
2844 2863
2845 #undef DECLARE_HYDROGEN_ACCESSOR 2864 #undef DECLARE_HYDROGEN_ACCESSOR
2846 #undef DECLARE_CONCRETE_INSTRUCTION 2865 #undef DECLARE_CONCRETE_INSTRUCTION
2847 2866
2848 } } // namespace v8::internal 2867 } } // namespace v8::internal
2849 2868
2850 #endif // V8_ARM_LITHIUM_ARM_H_ 2869 #endif // V8_ARM_LITHIUM_ARM_H_
OLDNEW
« no previous file with comments | « no previous file | src/arm/lithium-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698