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

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

Issue 189963005: Revert "Handle non-power-of-2 divisors in division-like operations", "A64 tweaks for division-like … (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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/ia32/lithium-codegen-ia32.cc ('k') | src/ia32/lithium-ia32.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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 V(ConstantD) \ 80 V(ConstantD) \
81 V(ConstantE) \ 81 V(ConstantE) \
82 V(ConstantI) \ 82 V(ConstantI) \
83 V(ConstantS) \ 83 V(ConstantS) \
84 V(ConstantT) \ 84 V(ConstantT) \
85 V(Context) \ 85 V(Context) \
86 V(DateField) \ 86 V(DateField) \
87 V(DebugBreak) \ 87 V(DebugBreak) \
88 V(DeclareGlobals) \ 88 V(DeclareGlobals) \
89 V(Deoptimize) \ 89 V(Deoptimize) \
90 V(DivByConstI) \
91 V(DivByPowerOf2I) \ 90 V(DivByPowerOf2I) \
92 V(DivI) \ 91 V(DivI) \
93 V(DoubleToI) \ 92 V(DoubleToI) \
94 V(DoubleToSmi) \ 93 V(DoubleToSmi) \
95 V(Drop) \ 94 V(Drop) \
96 V(Dummy) \ 95 V(Dummy) \
97 V(DummyUse) \ 96 V(DummyUse) \
98 V(FlooringDivByConstI) \ 97 V(FlooringDivByConstI) \
99 V(FlooringDivByPowerOf2I) \ 98 V(FlooringDivByPowerOf2I) \
100 V(ForInCacheArray) \ 99 V(ForInCacheArray) \
(...skipping 30 matching lines...) Expand all
131 V(MapEnumLength) \ 130 V(MapEnumLength) \
132 V(MathAbs) \ 131 V(MathAbs) \
133 V(MathClz32) \ 132 V(MathClz32) \
134 V(MathExp) \ 133 V(MathExp) \
135 V(MathFloor) \ 134 V(MathFloor) \
136 V(MathLog) \ 135 V(MathLog) \
137 V(MathMinMax) \ 136 V(MathMinMax) \
138 V(MathPowHalf) \ 137 V(MathPowHalf) \
139 V(MathRound) \ 138 V(MathRound) \
140 V(MathSqrt) \ 139 V(MathSqrt) \
141 V(ModByConstI) \
142 V(ModByPowerOf2I) \ 140 V(ModByPowerOf2I) \
143 V(ModI) \ 141 V(ModI) \
144 V(MulI) \ 142 V(MulI) \
145 V(NumberTagD) \ 143 V(NumberTagD) \
146 V(NumberTagI) \ 144 V(NumberTagI) \
147 V(NumberTagU) \ 145 V(NumberTagU) \
148 V(NumberUntagD) \ 146 V(NumberUntagD) \
149 V(OsrEntry) \ 147 V(OsrEntry) \
150 V(Parameter) \ 148 V(Parameter) \
151 V(Power) \ 149 V(Power) \
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 int32_t divisor() const { return divisor_; } 648 int32_t divisor() const { return divisor_; }
651 649
652 DECLARE_CONCRETE_INSTRUCTION(ModByPowerOf2I, "mod-by-power-of-2-i") 650 DECLARE_CONCRETE_INSTRUCTION(ModByPowerOf2I, "mod-by-power-of-2-i")
653 DECLARE_HYDROGEN_ACCESSOR(Mod) 651 DECLARE_HYDROGEN_ACCESSOR(Mod)
654 652
655 private: 653 private:
656 int32_t divisor_; 654 int32_t divisor_;
657 }; 655 };
658 656
659 657
660 class LModByConstI V8_FINAL : public LTemplateInstruction<1, 1, 2> {
661 public:
662 LModByConstI(LOperand* dividend,
663 int32_t divisor,
664 LOperand* temp1,
665 LOperand* temp2) {
666 inputs_[0] = dividend;
667 divisor_ = divisor;
668 temps_[0] = temp1;
669 temps_[1] = temp2;
670 }
671
672 LOperand* dividend() { return inputs_[0]; }
673 int32_t divisor() const { return divisor_; }
674 LOperand* temp1() { return temps_[0]; }
675 LOperand* temp2() { return temps_[1]; }
676
677 DECLARE_CONCRETE_INSTRUCTION(ModByConstI, "mod-by-const-i")
678 DECLARE_HYDROGEN_ACCESSOR(Mod)
679
680 private:
681 int32_t divisor_;
682 };
683
684
685 class LModI V8_FINAL : public LTemplateInstruction<1, 2, 1> { 658 class LModI V8_FINAL : public LTemplateInstruction<1, 2, 1> {
686 public: 659 public:
687 LModI(LOperand* left, LOperand* right, LOperand* temp) { 660 LModI(LOperand* left, LOperand* right, LOperand* temp) {
688 inputs_[0] = left; 661 inputs_[0] = left;
689 inputs_[1] = right; 662 inputs_[1] = right;
690 temps_[0] = temp; 663 temps_[0] = temp;
691 } 664 }
692 665
693 LOperand* left() { return inputs_[0]; } 666 LOperand* left() { return inputs_[0]; }
694 LOperand* right() { return inputs_[1]; } 667 LOperand* right() { return inputs_[1]; }
(...skipping 15 matching lines...) Expand all
710 int32_t divisor() const { return divisor_; } 683 int32_t divisor() const { return divisor_; }
711 684
712 DECLARE_CONCRETE_INSTRUCTION(DivByPowerOf2I, "div-by-power-of-2-i") 685 DECLARE_CONCRETE_INSTRUCTION(DivByPowerOf2I, "div-by-power-of-2-i")
713 DECLARE_HYDROGEN_ACCESSOR(Div) 686 DECLARE_HYDROGEN_ACCESSOR(Div)
714 687
715 private: 688 private:
716 int32_t divisor_; 689 int32_t divisor_;
717 }; 690 };
718 691
719 692
720 class LDivByConstI V8_FINAL : public LTemplateInstruction<1, 1, 2> {
721 public:
722 LDivByConstI(LOperand* dividend,
723 int32_t divisor,
724 LOperand* temp1,
725 LOperand* temp2) {
726 inputs_[0] = dividend;
727 divisor_ = divisor;
728 temps_[0] = temp1;
729 temps_[1] = temp2;
730 }
731
732 LOperand* dividend() { return inputs_[0]; }
733 int32_t divisor() const { return divisor_; }
734 LOperand* temp1() { return temps_[0]; }
735 LOperand* temp2() { return temps_[1]; }
736
737 DECLARE_CONCRETE_INSTRUCTION(DivByConstI, "div-by-const-i")
738 DECLARE_HYDROGEN_ACCESSOR(Div)
739
740 private:
741 int32_t divisor_;
742 };
743
744
745 class LDivI V8_FINAL : public LTemplateInstruction<1, 2, 1> { 693 class LDivI V8_FINAL : public LTemplateInstruction<1, 2, 1> {
746 public: 694 public:
747 LDivI(LOperand* left, LOperand* right, LOperand* temp) { 695 LDivI(LOperand* left, LOperand* right, LOperand* temp) {
748 inputs_[0] = left; 696 inputs_[0] = left;
749 inputs_[1] = right; 697 inputs_[1] = right;
750 temps_[0] = temp; 698 temps_[0] = temp;
751 } 699 }
752 700
753 LOperand* left() { return inputs_[0]; } 701 LOperand* left() { return inputs_[0]; }
754 LOperand* right() { return inputs_[1]; } 702 LOperand* right() { return inputs_[1]; }
(...skipping 18 matching lines...) Expand all
773 721
774 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByPowerOf2I, 722 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByPowerOf2I,
775 "flooring-div-by-power-of-2-i") 723 "flooring-div-by-power-of-2-i")
776 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) 724 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
777 725
778 private: 726 private:
779 int32_t divisor_; 727 int32_t divisor_;
780 }; 728 };
781 729
782 730
783 class LFlooringDivByConstI V8_FINAL : public LTemplateInstruction<1, 1, 2> { 731 class LFlooringDivByConstI V8_FINAL : public LTemplateInstruction<1, 1, 1> {
784 public: 732 public:
785 LFlooringDivByConstI(LOperand* dividend, 733 LFlooringDivByConstI(LOperand* dividend, int32_t divisor, LOperand* temp) {
786 int32_t divisor,
787 LOperand* temp1,
788 LOperand* temp2) {
789 inputs_[0] = dividend; 734 inputs_[0] = dividend;
790 divisor_ = divisor; 735 divisor_ = divisor;
791 temps_[0] = temp1; 736 temps_[0] = temp;
792 temps_[1] = temp2;
793 } 737 }
794 738
795 LOperand* dividend() { return inputs_[0]; } 739 LOperand* dividend() { return inputs_[0]; }
796 int32_t divisor() const { return divisor_; } 740 int32_t divisor() const { return divisor_; }
797 LOperand* temp1() { return temps_[0]; } 741 LOperand* temp() { return temps_[0]; }
798 LOperand* temp2() { return temps_[1]; }
799 742
800 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByConstI, "flooring-div-by-const-i") 743 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByConstI, "flooring-div-by-const-i")
801 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) 744 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
802 745
803 private: 746 private:
804 int32_t divisor_; 747 int32_t divisor_;
805 }; 748 };
806 749
807 750
808 class LMulI V8_FINAL : public LTemplateInstruction<1, 2, 1> { 751 class LMulI V8_FINAL : public LTemplateInstruction<1, 2, 1> {
(...skipping 1932 matching lines...) Expand 10 before | Expand all | Expand 10 after
2741 2684
2742 LInstruction* DoMathFloor(HUnaryMathOperation* instr); 2685 LInstruction* DoMathFloor(HUnaryMathOperation* instr);
2743 LInstruction* DoMathRound(HUnaryMathOperation* instr); 2686 LInstruction* DoMathRound(HUnaryMathOperation* instr);
2744 LInstruction* DoMathAbs(HUnaryMathOperation* instr); 2687 LInstruction* DoMathAbs(HUnaryMathOperation* instr);
2745 LInstruction* DoMathLog(HUnaryMathOperation* instr); 2688 LInstruction* DoMathLog(HUnaryMathOperation* instr);
2746 LInstruction* DoMathExp(HUnaryMathOperation* instr); 2689 LInstruction* DoMathExp(HUnaryMathOperation* instr);
2747 LInstruction* DoMathSqrt(HUnaryMathOperation* instr); 2690 LInstruction* DoMathSqrt(HUnaryMathOperation* instr);
2748 LInstruction* DoMathPowHalf(HUnaryMathOperation* instr); 2691 LInstruction* DoMathPowHalf(HUnaryMathOperation* instr);
2749 LInstruction* DoMathClz32(HUnaryMathOperation* instr); 2692 LInstruction* DoMathClz32(HUnaryMathOperation* instr);
2750 LInstruction* DoDivByPowerOf2I(HDiv* instr); 2693 LInstruction* DoDivByPowerOf2I(HDiv* instr);
2751 LInstruction* DoDivByConstI(HDiv* instr);
2752 LInstruction* DoDivI(HBinaryOperation* instr); 2694 LInstruction* DoDivI(HBinaryOperation* instr);
2753 LInstruction* DoModByPowerOf2I(HMod* instr); 2695 LInstruction* DoModByPowerOf2I(HMod* instr);
2754 LInstruction* DoModByConstI(HMod* instr);
2755 LInstruction* DoModI(HMod* instr); 2696 LInstruction* DoModI(HMod* instr);
2756 LInstruction* DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr); 2697 LInstruction* DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr);
2757 LInstruction* DoFlooringDivByConstI(HMathFloorOfDiv* instr); 2698 LInstruction* DoFlooringDivByConstI(HMathFloorOfDiv* instr);
2758 2699
2759 private: 2700 private:
2760 enum Status { 2701 enum Status {
2761 UNUSED, 2702 UNUSED,
2762 BUILDING, 2703 BUILDING,
2763 DONE, 2704 DONE,
2764 ABORTED 2705 ABORTED
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
2884 2825
2885 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2826 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2886 }; 2827 };
2887 2828
2888 #undef DECLARE_HYDROGEN_ACCESSOR 2829 #undef DECLARE_HYDROGEN_ACCESSOR
2889 #undef DECLARE_CONCRETE_INSTRUCTION 2830 #undef DECLARE_CONCRETE_INSTRUCTION
2890 2831
2891 } } // namespace v8::internal 2832 } } // namespace v8::internal
2892 2833
2893 #endif // V8_IA32_LITHIUM_IA32_H_ 2834 #endif // V8_IA32_LITHIUM_IA32_H_
OLDNEW
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698