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

Side by Side Diff: src/x64/lithium-x64.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 | « src/x64/lithium-codegen-x64.cc ('k') | src/x64/lithium-x64.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(DummyUse) \ 96 V(DummyUse) \
97 V(Dummy) \ 97 V(Dummy) \
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 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 DECLARE_CONCRETE_INSTRUCTION(DivByConstI, "div-by-const-i") 726 DECLARE_CONCRETE_INSTRUCTION(DivByConstI, "div-by-const-i")
726 DECLARE_HYDROGEN_ACCESSOR(Div) 727 DECLARE_HYDROGEN_ACCESSOR(Div)
727 728
728 private: 729 private:
729 int32_t divisor_; 730 int32_t divisor_;
730 }; 731 };
731 732
732 733
733 class LDivI V8_FINAL : public LTemplateInstruction<1, 2, 1> { 734 class LDivI V8_FINAL : public LTemplateInstruction<1, 2, 1> {
734 public: 735 public:
735 LDivI(LOperand* left, LOperand* right, LOperand* temp) { 736 LDivI(LOperand* dividend, LOperand* divisor, LOperand* temp) {
736 inputs_[0] = left; 737 inputs_[0] = dividend;
737 inputs_[1] = right; 738 inputs_[1] = divisor;
738 temps_[0] = temp; 739 temps_[0] = temp;
739 } 740 }
740 741
741 LOperand* left() { return inputs_[0]; } 742 LOperand* dividend() { return inputs_[0]; }
742 LOperand* right() { return inputs_[1]; } 743 LOperand* divisor() { return inputs_[1]; }
743 LOperand* temp() { return temps_[0]; } 744 LOperand* temp() { return temps_[0]; }
744 745
745 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i") 746 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i")
746 DECLARE_HYDROGEN_ACCESSOR(BinaryOperation) 747 DECLARE_HYDROGEN_ACCESSOR(BinaryOperation)
747 }; 748 };
748 749
749 750
750 class LFlooringDivByPowerOf2I V8_FINAL : public LTemplateInstruction<1, 1, 0> { 751 class LFlooringDivByPowerOf2I V8_FINAL : public LTemplateInstruction<1, 1, 0> {
751 public: 752 public:
752 LFlooringDivByPowerOf2I(LOperand* dividend, int32_t divisor) { 753 LFlooringDivByPowerOf2I(LOperand* dividend, int32_t divisor) {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
787 LOperand* temp3() { return temps_[2]; } 788 LOperand* temp3() { return temps_[2]; }
788 789
789 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByConstI, "flooring-div-by-const-i") 790 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByConstI, "flooring-div-by-const-i")
790 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) 791 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
791 792
792 private: 793 private:
793 int32_t divisor_; 794 int32_t divisor_;
794 }; 795 };
795 796
796 797
798 class LFlooringDivI V8_FINAL : public LTemplateInstruction<1, 2, 1> {
799 public:
800 LFlooringDivI(LOperand* dividend, LOperand* divisor, LOperand* temp) {
801 inputs_[0] = dividend;
802 inputs_[1] = divisor;
803 temps_[0] = temp;
804 }
805
806 LOperand* dividend() { return inputs_[0]; }
807 LOperand* divisor() { return inputs_[1]; }
808 LOperand* temp() { return temps_[0]; }
809
810 DECLARE_CONCRETE_INSTRUCTION(FlooringDivI, "flooring-div-i")
811 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
812 };
813
814
797 class LMulI V8_FINAL : public LTemplateInstruction<1, 2, 0> { 815 class LMulI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
798 public: 816 public:
799 LMulI(LOperand* left, LOperand* right) { 817 LMulI(LOperand* left, LOperand* right) {
800 inputs_[0] = left; 818 inputs_[0] = left;
801 inputs_[1] = right; 819 inputs_[1] = right;
802 } 820 }
803 821
804 LOperand* left() { return inputs_[0]; } 822 LOperand* left() { return inputs_[0]; }
805 LOperand* right() { return inputs_[1]; } 823 LOperand* right() { return inputs_[1]; }
806 824
(...skipping 1867 matching lines...) Expand 10 before | Expand all | Expand 10 after
2674 LInstruction* DoMathFloor(HUnaryMathOperation* instr); 2692 LInstruction* DoMathFloor(HUnaryMathOperation* instr);
2675 LInstruction* DoMathRound(HUnaryMathOperation* instr); 2693 LInstruction* DoMathRound(HUnaryMathOperation* instr);
2676 LInstruction* DoMathAbs(HUnaryMathOperation* instr); 2694 LInstruction* DoMathAbs(HUnaryMathOperation* instr);
2677 LInstruction* DoMathLog(HUnaryMathOperation* instr); 2695 LInstruction* DoMathLog(HUnaryMathOperation* instr);
2678 LInstruction* DoMathExp(HUnaryMathOperation* instr); 2696 LInstruction* DoMathExp(HUnaryMathOperation* instr);
2679 LInstruction* DoMathSqrt(HUnaryMathOperation* instr); 2697 LInstruction* DoMathSqrt(HUnaryMathOperation* instr);
2680 LInstruction* DoMathPowHalf(HUnaryMathOperation* instr); 2698 LInstruction* DoMathPowHalf(HUnaryMathOperation* instr);
2681 LInstruction* DoMathClz32(HUnaryMathOperation* instr); 2699 LInstruction* DoMathClz32(HUnaryMathOperation* instr);
2682 LInstruction* DoDivByPowerOf2I(HDiv* instr); 2700 LInstruction* DoDivByPowerOf2I(HDiv* instr);
2683 LInstruction* DoDivByConstI(HDiv* instr); 2701 LInstruction* DoDivByConstI(HDiv* instr);
2684 LInstruction* DoDivI(HBinaryOperation* instr); 2702 LInstruction* DoDivI(HDiv* instr);
2685 LInstruction* DoModByPowerOf2I(HMod* instr); 2703 LInstruction* DoModByPowerOf2I(HMod* instr);
2686 LInstruction* DoModByConstI(HMod* instr); 2704 LInstruction* DoModByConstI(HMod* instr);
2687 LInstruction* DoModI(HMod* instr); 2705 LInstruction* DoModI(HMod* instr);
2688 LInstruction* DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr); 2706 LInstruction* DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr);
2689 LInstruction* DoFlooringDivByConstI(HMathFloorOfDiv* instr); 2707 LInstruction* DoFlooringDivByConstI(HMathFloorOfDiv* instr);
2708 LInstruction* DoFlooringDivI(HMathFloorOfDiv* instr);
2690 2709
2691 private: 2710 private:
2692 enum Status { 2711 enum Status {
2693 UNUSED, 2712 UNUSED,
2694 BUILDING, 2713 BUILDING,
2695 DONE, 2714 DONE,
2696 ABORTED 2715 ABORTED
2697 }; 2716 };
2698 2717
2699 LPlatformChunk* chunk() const { return chunk_; } 2718 LPlatformChunk* chunk() const { return chunk_; }
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
2808 2827
2809 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2828 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2810 }; 2829 };
2811 2830
2812 #undef DECLARE_HYDROGEN_ACCESSOR 2831 #undef DECLARE_HYDROGEN_ACCESSOR
2813 #undef DECLARE_CONCRETE_INSTRUCTION 2832 #undef DECLARE_CONCRETE_INSTRUCTION
2814 2833
2815 } } // namespace v8::int 2834 } } // namespace v8::int
2816 2835
2817 #endif // V8_X64_LITHIUM_X64_H_ 2836 #endif // V8_X64_LITHIUM_X64_H_
OLDNEW
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | src/x64/lithium-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698