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

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

Issue 200423004: MIPS: Fix Lithium div, mod and floor. (Closed) Base URL: https://github.com/v8/v8.git@gbl
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
« 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(ConstructDouble) \ 83 V(ConstructDouble) \
84 V(Context) \ 84 V(Context) \
85 V(DateField) \ 85 V(DateField) \
86 V(DebugBreak) \ 86 V(DebugBreak) \
87 V(DeclareGlobals) \ 87 V(DeclareGlobals) \
88 V(Deoptimize) \ 88 V(Deoptimize) \
89 V(DivByConstI) \
90 V(DivByPowerOf2I) \
89 V(DivI) \ 91 V(DivI) \
90 V(DoubleToI) \ 92 V(DoubleToI) \
91 V(DoubleBits) \ 93 V(DoubleBits) \
92 V(DoubleToSmi) \ 94 V(DoubleToSmi) \
93 V(Drop) \ 95 V(Drop) \
94 V(Dummy) \ 96 V(Dummy) \
95 V(DummyUse) \ 97 V(DummyUse) \
96 V(FlooringDivByConstI) \ 98 V(FlooringDivByConstI) \
97 V(FlooringDivByPowerOf2I) \ 99 V(FlooringDivByPowerOf2I) \
98 V(ForInCacheArray) \ 100 V(ForInCacheArray) \
(...skipping 24 matching lines...) Expand all
123 V(LoadGlobalGeneric) \ 125 V(LoadGlobalGeneric) \
124 V(LoadKeyed) \ 126 V(LoadKeyed) \
125 V(LoadKeyedGeneric) \ 127 V(LoadKeyedGeneric) \
126 V(LoadNamedField) \ 128 V(LoadNamedField) \
127 V(LoadNamedGeneric) \ 129 V(LoadNamedGeneric) \
128 V(MapEnumLength) \ 130 V(MapEnumLength) \
129 V(MathAbs) \ 131 V(MathAbs) \
130 V(MathExp) \ 132 V(MathExp) \
131 V(MathClz32) \ 133 V(MathClz32) \
132 V(MathFloor) \ 134 V(MathFloor) \
133 V(MathFloorOfDiv) \
134 V(MathLog) \ 135 V(MathLog) \
135 V(MathMinMax) \ 136 V(MathMinMax) \
136 V(MathPowHalf) \ 137 V(MathPowHalf) \
137 V(MathRound) \ 138 V(MathRound) \
138 V(MathSqrt) \ 139 V(MathSqrt) \
140 V(ModByConstI) \
139 V(ModByPowerOf2I) \ 141 V(ModByPowerOf2I) \
140 V(ModI) \ 142 V(ModI) \
141 V(MulI) \ 143 V(MulI) \
142 V(MultiplyAddD) \ 144 V(MultiplyAddD) \
143 V(NumberTagD) \ 145 V(NumberTagD) \
144 V(NumberTagI) \ 146 V(NumberTagI) \
145 V(NumberTagU) \ 147 V(NumberTagU) \
146 V(NumberUntagD) \ 148 V(NumberUntagD) \
147 V(OsrEntry) \ 149 V(OsrEntry) \
148 V(Parameter) \ 150 V(Parameter) \
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 int32_t divisor() const { return divisor_; } 630 int32_t divisor() const { return divisor_; }
629 631
630 DECLARE_CONCRETE_INSTRUCTION(ModByPowerOf2I, "mod-by-power-of-2-i") 632 DECLARE_CONCRETE_INSTRUCTION(ModByPowerOf2I, "mod-by-power-of-2-i")
631 DECLARE_HYDROGEN_ACCESSOR(Mod) 633 DECLARE_HYDROGEN_ACCESSOR(Mod)
632 634
633 private: 635 private:
634 int32_t divisor_; 636 int32_t divisor_;
635 }; 637 };
636 638
637 639
640 class LModByConstI V8_FINAL : public LTemplateInstruction<1, 1, 0> {
641 public:
642 LModByConstI(LOperand* dividend, int32_t divisor) {
643 inputs_[0] = dividend;
644 divisor_ = divisor;
645 }
646
647 LOperand* dividend() { return inputs_[0]; }
648 int32_t divisor() const { return divisor_; }
649
650 DECLARE_CONCRETE_INSTRUCTION(ModByConstI, "mod-by-const-i")
651 DECLARE_HYDROGEN_ACCESSOR(Mod)
652
653 private:
654 int32_t divisor_;
655 };
656
657
638 class LModI V8_FINAL : public LTemplateInstruction<1, 2, 3> { 658 class LModI V8_FINAL : public LTemplateInstruction<1, 2, 3> {
639 public: 659 public:
640 LModI(LOperand* left, 660 LModI(LOperand* left,
641 LOperand* right) { 661 LOperand* right) {
642 inputs_[0] = left; 662 inputs_[0] = left;
643 inputs_[1] = right; 663 inputs_[1] = right;
644 } 664 }
645 665
646 LOperand* left() { return inputs_[0]; } 666 LOperand* left() { return inputs_[0]; }
647 LOperand* right() { return inputs_[1]; } 667 LOperand* right() { return inputs_[1]; }
648 668
649 DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i") 669 DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i")
650 DECLARE_HYDROGEN_ACCESSOR(Mod) 670 DECLARE_HYDROGEN_ACCESSOR(Mod)
651 }; 671 };
652 672
653 673
674 class LDivByPowerOf2I V8_FINAL : public LTemplateInstruction<1, 1, 0> {
675 public:
676 LDivByPowerOf2I(LOperand* dividend, int32_t divisor) {
677 inputs_[0] = dividend;
678 divisor_ = divisor;
679 }
680
681 LOperand* dividend() { return inputs_[0]; }
682 int32_t divisor() const { return divisor_; }
683
684 DECLARE_CONCRETE_INSTRUCTION(DivByPowerOf2I, "div-by-power-of-2-i")
685 DECLARE_HYDROGEN_ACCESSOR(Div)
686
687 private:
688 int32_t divisor_;
689 };
690
691
692 class LDivByConstI V8_FINAL : public LTemplateInstruction<1, 1, 0> {
693 public:
694 LDivByConstI(LOperand* dividend, int32_t divisor) {
695 inputs_[0] = dividend;
696 divisor_ = divisor;
697 }
698
699 LOperand* dividend() { return inputs_[0]; }
700 int32_t divisor() const { return divisor_; }
701
702 DECLARE_CONCRETE_INSTRUCTION(DivByConstI, "div-by-const-i")
703 DECLARE_HYDROGEN_ACCESSOR(Div)
704
705 private:
706 int32_t divisor_;
707 };
708
709
654 class LDivI V8_FINAL : public LTemplateInstruction<1, 2, 0> { 710 class LDivI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
655 public: 711 public:
656 LDivI(LOperand* left, LOperand* right) { 712 LDivI(LOperand* left, LOperand* right) {
657 inputs_[0] = left; 713 inputs_[0] = left;
658 inputs_[1] = right; 714 inputs_[1] = right;
659 } 715 }
660 716
661 LOperand* left() { return inputs_[0]; } 717 LOperand* left() { return inputs_[0]; }
662 LOperand* right() { return inputs_[1]; } 718 LOperand* right() { return inputs_[1]; }
663 719
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 LOperand* temp1() { return temps_[0]; } 753 LOperand* temp1() { return temps_[0]; }
698 754
699 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByConstI, "flooring-div-by-const-i") 755 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByConstI, "flooring-div-by-const-i")
700 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) 756 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
701 757
702 private: 758 private:
703 int32_t divisor_; 759 int32_t divisor_;
704 }; 760 };
705 761
706 762
707 class LMathFloorOfDiv V8_FINAL : public LTemplateInstruction<1, 2, 1> {
708 public:
709 LMathFloorOfDiv(LOperand* left,
710 LOperand* right,
711 LOperand* temp = NULL) {
712 inputs_[0] = left;
713 inputs_[1] = right;
714 temps_[0] = temp;
715 }
716
717 LOperand* left() { return inputs_[0]; }
718 LOperand* right() { return inputs_[1]; }
719 LOperand* temp() { return temps_[0]; }
720
721 DECLARE_CONCRETE_INSTRUCTION(MathFloorOfDiv, "math-floor-of-div")
722 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
723 };
724
725
726 class LMulI V8_FINAL : public LTemplateInstruction<1, 2, 0> { 763 class LMulI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
727 public: 764 public:
728 LMulI(LOperand* left, LOperand* right) { 765 LMulI(LOperand* left, LOperand* right) {
729 inputs_[0] = left; 766 inputs_[0] = left;
730 inputs_[1] = right; 767 inputs_[1] = right;
731 } 768 }
732 769
733 LOperand* left() { return inputs_[0]; } 770 LOperand* left() { return inputs_[0]; }
734 LOperand* right() { return inputs_[1]; } 771 LOperand* right() { return inputs_[1]; }
735 772
(...skipping 1896 matching lines...) Expand 10 before | Expand all | Expand 10 after
2632 static bool HasMagicNumberForDivisor(int32_t divisor); 2669 static bool HasMagicNumberForDivisor(int32_t divisor);
2633 2670
2634 LInstruction* DoMathFloor(HUnaryMathOperation* instr); 2671 LInstruction* DoMathFloor(HUnaryMathOperation* instr);
2635 LInstruction* DoMathRound(HUnaryMathOperation* instr); 2672 LInstruction* DoMathRound(HUnaryMathOperation* instr);
2636 LInstruction* DoMathAbs(HUnaryMathOperation* instr); 2673 LInstruction* DoMathAbs(HUnaryMathOperation* instr);
2637 LInstruction* DoMathLog(HUnaryMathOperation* instr); 2674 LInstruction* DoMathLog(HUnaryMathOperation* instr);
2638 LInstruction* DoMathExp(HUnaryMathOperation* instr); 2675 LInstruction* DoMathExp(HUnaryMathOperation* instr);
2639 LInstruction* DoMathSqrt(HUnaryMathOperation* instr); 2676 LInstruction* DoMathSqrt(HUnaryMathOperation* instr);
2640 LInstruction* DoMathPowHalf(HUnaryMathOperation* instr); 2677 LInstruction* DoMathPowHalf(HUnaryMathOperation* instr);
2641 LInstruction* DoMathClz32(HUnaryMathOperation* instr); 2678 LInstruction* DoMathClz32(HUnaryMathOperation* instr);
2679 LInstruction* DoDivByPowerOf2I(HDiv* instr);
2680 LInstruction* DoDivByConstI(HDiv* instr);
2642 LInstruction* DoDivI(HBinaryOperation* instr); 2681 LInstruction* DoDivI(HBinaryOperation* instr);
2643 LInstruction* DoModByPowerOf2I(HMod* instr); 2682 LInstruction* DoModByPowerOf2I(HMod* instr);
2683 LInstruction* DoModByConstI(HMod* instr);
2644 LInstruction* DoModI(HMod* instr); 2684 LInstruction* DoModI(HMod* instr);
2645 LInstruction* DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr); 2685 LInstruction* DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr);
2646 LInstruction* DoFlooringDivByConstI(HMathFloorOfDiv* instr); 2686 LInstruction* DoFlooringDivByConstI(HMathFloorOfDiv* instr);
2647 2687
2648 private: 2688 private:
2649 enum Status { 2689 enum Status {
2650 UNUSED, 2690 UNUSED,
2651 BUILDING, 2691 BUILDING,
2652 DONE, 2692 DONE,
2653 ABORTED 2693 ABORTED
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
2758 2798
2759 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2799 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2760 }; 2800 };
2761 2801
2762 #undef DECLARE_HYDROGEN_ACCESSOR 2802 #undef DECLARE_HYDROGEN_ACCESSOR
2763 #undef DECLARE_CONCRETE_INSTRUCTION 2803 #undef DECLARE_CONCRETE_INSTRUCTION
2764 2804
2765 } } // namespace v8::internal 2805 } } // namespace v8::internal
2766 2806
2767 #endif // V8_MIPS_LITHIUM_MIPS_H_ 2807 #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