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

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

Issue 206373004: MIPS: Implement flooring division by a constant via truncating division by a constant. (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 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 734
735 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByPowerOf2I, 735 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByPowerOf2I,
736 "flooring-div-by-power-of-2-i") 736 "flooring-div-by-power-of-2-i")
737 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) 737 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
738 738
739 private: 739 private:
740 int32_t divisor_; 740 int32_t divisor_;
741 }; 741 };
742 742
743 743
744 class LFlooringDivByConstI V8_FINAL : public LTemplateInstruction<1, 1, 0> { 744 class LFlooringDivByConstI V8_FINAL : public LTemplateInstruction<1, 1, 2> {
745 public: 745 public:
746 LFlooringDivByConstI(LOperand* dividend, int32_t divisor) { 746 LFlooringDivByConstI(LOperand* dividend, int32_t divisor, LOperand* temp) {
747 inputs_[0] = dividend; 747 inputs_[0] = dividend;
748 divisor_ = divisor; 748 divisor_ = divisor;
749 temps_[0] = temp;
749 } 750 }
750 751
751 LOperand* dividend() { return inputs_[0]; } 752 LOperand* dividend() { return inputs_[0]; }
752 int32_t divisor() const { return divisor_; } 753 int32_t divisor() const { return divisor_; }
753 LOperand* temp1() { return temps_[0]; } 754 LOperand* temp() { return temps_[0]; }
754 755
755 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByConstI, "flooring-div-by-const-i") 756 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByConstI, "flooring-div-by-const-i")
756 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) 757 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
757 758
758 private: 759 private:
759 int32_t divisor_; 760 int32_t divisor_;
760 }; 761 };
761 762
762 763
763 class LMulI V8_FINAL : public LTemplateInstruction<1, 2, 0> { 764 class LMulI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
(...skipping 2034 matching lines...) Expand 10 before | Expand all | Expand 10 after
2798 2799
2799 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2800 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2800 }; 2801 };
2801 2802
2802 #undef DECLARE_HYDROGEN_ACCESSOR 2803 #undef DECLARE_HYDROGEN_ACCESSOR
2803 #undef DECLARE_CONCRETE_INSTRUCTION 2804 #undef DECLARE_CONCRETE_INSTRUCTION
2804 2805
2805 } } // namespace v8::internal 2806 } } // namespace v8::internal
2806 2807
2807 #endif // V8_MIPS_LITHIUM_MIPS_H_ 2808 #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