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

Side by Side Diff: src/x64/lithium-x64.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/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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 V(ConstantD) \ 78 V(ConstantD) \
79 V(ConstantE) \ 79 V(ConstantE) \
80 V(ConstantI) \ 80 V(ConstantI) \
81 V(ConstantS) \ 81 V(ConstantS) \
82 V(ConstantT) \ 82 V(ConstantT) \
83 V(Context) \ 83 V(Context) \
84 V(DateField) \ 84 V(DateField) \
85 V(DebugBreak) \ 85 V(DebugBreak) \
86 V(DeclareGlobals) \ 86 V(DeclareGlobals) \
87 V(Deoptimize) \ 87 V(Deoptimize) \
88 V(DivByConstI) \
89 V(DivByPowerOf2I) \ 88 V(DivByPowerOf2I) \
90 V(DivI) \ 89 V(DivI) \
91 V(DoubleToI) \ 90 V(DoubleToI) \
92 V(DoubleToSmi) \ 91 V(DoubleToSmi) \
93 V(Drop) \ 92 V(Drop) \
94 V(DummyUse) \ 93 V(DummyUse) \
95 V(Dummy) \ 94 V(Dummy) \
96 V(FlooringDivByConstI) \ 95 V(FlooringDivByConstI) \
97 V(FlooringDivByPowerOf2I) \ 96 V(FlooringDivByPowerOf2I) \
98 V(ForInCacheArray) \ 97 V(ForInCacheArray) \
(...skipping 30 matching lines...) Expand all
129 V(MapEnumLength) \ 128 V(MapEnumLength) \
130 V(MathAbs) \ 129 V(MathAbs) \
131 V(MathClz32) \ 130 V(MathClz32) \
132 V(MathExp) \ 131 V(MathExp) \
133 V(MathFloor) \ 132 V(MathFloor) \
134 V(MathLog) \ 133 V(MathLog) \
135 V(MathMinMax) \ 134 V(MathMinMax) \
136 V(MathPowHalf) \ 135 V(MathPowHalf) \
137 V(MathRound) \ 136 V(MathRound) \
138 V(MathSqrt) \ 137 V(MathSqrt) \
139 V(ModByConstI) \
140 V(ModByPowerOf2I) \ 138 V(ModByPowerOf2I) \
141 V(ModI) \ 139 V(ModI) \
142 V(MulI) \ 140 V(MulI) \
143 V(NumberTagD) \ 141 V(NumberTagD) \
144 V(NumberTagI) \ 142 V(NumberTagI) \
145 V(NumberTagU) \ 143 V(NumberTagU) \
146 V(NumberUntagD) \ 144 V(NumberUntagD) \
147 V(OsrEntry) \ 145 V(OsrEntry) \
148 V(Parameter) \ 146 V(Parameter) \
149 V(Power) \ 147 V(Power) \
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 int32_t divisor() const { return divisor_; } 629 int32_t divisor() const { return divisor_; }
632 630
633 DECLARE_CONCRETE_INSTRUCTION(ModByPowerOf2I, "mod-by-power-of-2-i") 631 DECLARE_CONCRETE_INSTRUCTION(ModByPowerOf2I, "mod-by-power-of-2-i")
634 DECLARE_HYDROGEN_ACCESSOR(Mod) 632 DECLARE_HYDROGEN_ACCESSOR(Mod)
635 633
636 private: 634 private:
637 int32_t divisor_; 635 int32_t divisor_;
638 }; 636 };
639 637
640 638
641 class LModByConstI V8_FINAL : public LTemplateInstruction<1, 1, 2> {
642 public:
643 LModByConstI(LOperand* dividend,
644 int32_t divisor,
645 LOperand* temp1,
646 LOperand* temp2) {
647 inputs_[0] = dividend;
648 divisor_ = divisor;
649 temps_[0] = temp1;
650 temps_[1] = temp2;
651 }
652
653 LOperand* dividend() { return inputs_[0]; }
654 int32_t divisor() const { return divisor_; }
655 LOperand* temp1() { return temps_[0]; }
656 LOperand* temp2() { return temps_[1]; }
657
658 DECLARE_CONCRETE_INSTRUCTION(ModByConstI, "mod-by-const-i")
659 DECLARE_HYDROGEN_ACCESSOR(Mod)
660
661 private:
662 int32_t divisor_;
663 };
664
665
666 class LModI V8_FINAL : public LTemplateInstruction<1, 2, 1> { 639 class LModI V8_FINAL : public LTemplateInstruction<1, 2, 1> {
667 public: 640 public:
668 LModI(LOperand* left, LOperand* right, LOperand* temp) { 641 LModI(LOperand* left, LOperand* right, LOperand* temp) {
669 inputs_[0] = left; 642 inputs_[0] = left;
670 inputs_[1] = right; 643 inputs_[1] = right;
671 temps_[0] = temp; 644 temps_[0] = temp;
672 } 645 }
673 646
674 LOperand* left() { return inputs_[0]; } 647 LOperand* left() { return inputs_[0]; }
675 LOperand* right() { return inputs_[1]; } 648 LOperand* right() { return inputs_[1]; }
(...skipping 15 matching lines...) Expand all
691 int32_t divisor() const { return divisor_; } 664 int32_t divisor() const { return divisor_; }
692 665
693 DECLARE_CONCRETE_INSTRUCTION(DivByPowerOf2I, "div-by-power-of-2-i") 666 DECLARE_CONCRETE_INSTRUCTION(DivByPowerOf2I, "div-by-power-of-2-i")
694 DECLARE_HYDROGEN_ACCESSOR(Div) 667 DECLARE_HYDROGEN_ACCESSOR(Div)
695 668
696 private: 669 private:
697 int32_t divisor_; 670 int32_t divisor_;
698 }; 671 };
699 672
700 673
701 class LDivByConstI V8_FINAL : public LTemplateInstruction<1, 1, 2> {
702 public:
703 LDivByConstI(LOperand* dividend,
704 int32_t divisor,
705 LOperand* temp1,
706 LOperand* temp2) {
707 inputs_[0] = dividend;
708 divisor_ = divisor;
709 temps_[0] = temp1;
710 temps_[1] = temp2;
711 }
712
713 LOperand* dividend() { return inputs_[0]; }
714 int32_t divisor() const { return divisor_; }
715 LOperand* temp1() { return temps_[0]; }
716 LOperand* temp2() { return temps_[1]; }
717
718 DECLARE_CONCRETE_INSTRUCTION(DivByConstI, "div-by-const-i")
719 DECLARE_HYDROGEN_ACCESSOR(Div)
720
721 private:
722 int32_t divisor_;
723 };
724
725
726 class LDivI V8_FINAL : public LTemplateInstruction<1, 2, 1> { 674 class LDivI V8_FINAL : public LTemplateInstruction<1, 2, 1> {
727 public: 675 public:
728 LDivI(LOperand* left, LOperand* right, LOperand* temp) { 676 LDivI(LOperand* left, LOperand* right, LOperand* temp) {
729 inputs_[0] = left; 677 inputs_[0] = left;
730 inputs_[1] = right; 678 inputs_[1] = right;
731 temps_[0] = temp; 679 temps_[0] = temp;
732 } 680 }
733 681
734 LOperand* left() { return inputs_[0]; } 682 LOperand* left() { return inputs_[0]; }
735 LOperand* right() { return inputs_[1]; } 683 LOperand* right() { return inputs_[1]; }
(...skipping 18 matching lines...) Expand all
754 702
755 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByPowerOf2I, 703 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByPowerOf2I,
756 "flooring-div-by-power-of-2-i") 704 "flooring-div-by-power-of-2-i")
757 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) 705 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
758 706
759 private: 707 private:
760 int32_t divisor_; 708 int32_t divisor_;
761 }; 709 };
762 710
763 711
764 class LFlooringDivByConstI V8_FINAL : public LTemplateInstruction<1, 1, 2> { 712 class LFlooringDivByConstI V8_FINAL : public LTemplateInstruction<1, 1, 1> {
765 public: 713 public:
766 LFlooringDivByConstI(LOperand* dividend, 714 LFlooringDivByConstI(LOperand* dividend, int32_t divisor, LOperand* temp) {
767 int32_t divisor,
768 LOperand* temp1,
769 LOperand* temp2) {
770 inputs_[0] = dividend; 715 inputs_[0] = dividend;
771 divisor_ = divisor; 716 divisor_ = divisor;
772 temps_[0] = temp1; 717 temps_[0] = temp;
773 temps_[1] = temp2;
774 } 718 }
775 719
776 LOperand* dividend() { return inputs_[0]; } 720 LOperand* dividend() { return inputs_[0]; }
777 int32_t divisor() const { return divisor_; } 721 int32_t divisor() const { return divisor_; }
778 LOperand* temp1() { return temps_[0]; } 722 LOperand* temp() { return temps_[0]; }
779 LOperand* temp2() { return temps_[0]; }
780 723
781 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByConstI, "flooring-div-by-const-i") 724 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByConstI, "flooring-div-by-const-i")
782 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) 725 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
783 726
784 private: 727 private:
785 int32_t divisor_; 728 int32_t divisor_;
786 }; 729 };
787 730
788 731
789 class LMulI V8_FINAL : public LTemplateInstruction<1, 2, 0> { 732 class LMulI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
(...skipping 1865 matching lines...) Expand 10 before | Expand all | Expand 10 after
2655 2598
2656 LInstruction* DoMathFloor(HUnaryMathOperation* instr); 2599 LInstruction* DoMathFloor(HUnaryMathOperation* instr);
2657 LInstruction* DoMathRound(HUnaryMathOperation* instr); 2600 LInstruction* DoMathRound(HUnaryMathOperation* instr);
2658 LInstruction* DoMathAbs(HUnaryMathOperation* instr); 2601 LInstruction* DoMathAbs(HUnaryMathOperation* instr);
2659 LInstruction* DoMathLog(HUnaryMathOperation* instr); 2602 LInstruction* DoMathLog(HUnaryMathOperation* instr);
2660 LInstruction* DoMathExp(HUnaryMathOperation* instr); 2603 LInstruction* DoMathExp(HUnaryMathOperation* instr);
2661 LInstruction* DoMathSqrt(HUnaryMathOperation* instr); 2604 LInstruction* DoMathSqrt(HUnaryMathOperation* instr);
2662 LInstruction* DoMathPowHalf(HUnaryMathOperation* instr); 2605 LInstruction* DoMathPowHalf(HUnaryMathOperation* instr);
2663 LInstruction* DoMathClz32(HUnaryMathOperation* instr); 2606 LInstruction* DoMathClz32(HUnaryMathOperation* instr);
2664 LInstruction* DoDivByPowerOf2I(HDiv* instr); 2607 LInstruction* DoDivByPowerOf2I(HDiv* instr);
2665 LInstruction* DoDivByConstI(HDiv* instr);
2666 LInstruction* DoDivI(HBinaryOperation* instr); 2608 LInstruction* DoDivI(HBinaryOperation* instr);
2667 LInstruction* DoModByPowerOf2I(HMod* instr); 2609 LInstruction* DoModByPowerOf2I(HMod* instr);
2668 LInstruction* DoModByConstI(HMod* instr);
2669 LInstruction* DoModI(HMod* instr); 2610 LInstruction* DoModI(HMod* instr);
2670 LInstruction* DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr); 2611 LInstruction* DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr);
2671 LInstruction* DoFlooringDivByConstI(HMathFloorOfDiv* instr); 2612 LInstruction* DoFlooringDivByConstI(HMathFloorOfDiv* instr);
2672 2613
2673 private: 2614 private:
2674 enum Status { 2615 enum Status {
2675 UNUSED, 2616 UNUSED,
2676 BUILDING, 2617 BUILDING,
2677 DONE, 2618 DONE,
2678 ABORTED 2619 ABORTED
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
2791 2732
2792 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2733 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2793 }; 2734 };
2794 2735
2795 #undef DECLARE_HYDROGEN_ACCESSOR 2736 #undef DECLARE_HYDROGEN_ACCESSOR
2796 #undef DECLARE_CONCRETE_INSTRUCTION 2737 #undef DECLARE_CONCRETE_INSTRUCTION
2797 2738
2798 } } // namespace v8::int 2739 } } // namespace v8::int
2799 2740
2800 #endif // V8_X64_LITHIUM_X64_H_ 2741 #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