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

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

Issue 204583002: Implement flooring division by a constant via truncating division by a constant. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased 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 760 matching lines...) Expand 10 before | Expand all | Expand 10 after
771 771
772 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByPowerOf2I, 772 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByPowerOf2I,
773 "flooring-div-by-power-of-2-i") 773 "flooring-div-by-power-of-2-i")
774 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) 774 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
775 775
776 private: 776 private:
777 int32_t divisor_; 777 int32_t divisor_;
778 }; 778 };
779 779
780 780
781 class LFlooringDivByConstI V8_FINAL : public LTemplateInstruction<1, 1, 2> { 781 class LFlooringDivByConstI V8_FINAL : public LTemplateInstruction<1, 1, 3> {
782 public: 782 public:
783 LFlooringDivByConstI(LOperand* dividend, 783 LFlooringDivByConstI(LOperand* dividend,
784 int32_t divisor, 784 int32_t divisor,
785 LOperand* temp1, 785 LOperand* temp1,
786 LOperand* temp2) { 786 LOperand* temp2,
787 LOperand* temp3) {
787 inputs_[0] = dividend; 788 inputs_[0] = dividend;
788 divisor_ = divisor; 789 divisor_ = divisor;
789 temps_[0] = temp1; 790 temps_[0] = temp1;
790 temps_[1] = temp2; 791 temps_[1] = temp2;
792 temps_[2] = temp3;
791 } 793 }
792 794
793 LOperand* dividend() { return inputs_[0]; } 795 LOperand* dividend() { return inputs_[0]; }
794 int32_t divisor() const { return divisor_; } 796 int32_t divisor() const { return divisor_; }
795 LOperand* temp1() { return temps_[0]; } 797 LOperand* temp1() { return temps_[0]; }
796 LOperand* temp2() { return temps_[1]; } 798 LOperand* temp2() { return temps_[1]; }
799 LOperand* temp3() { return temps_[2]; }
797 800
798 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByConstI, "flooring-div-by-const-i") 801 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByConstI, "flooring-div-by-const-i")
799 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) 802 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
800 803
801 private: 804 private:
802 int32_t divisor_; 805 int32_t divisor_;
803 }; 806 };
804 807
805 808
806 class LMulI V8_FINAL : public LTemplateInstruction<1, 2, 1> { 809 class LMulI V8_FINAL : public LTemplateInstruction<1, 2, 1> {
(...skipping 2073 matching lines...) Expand 10 before | Expand all | Expand 10 after
2880 2883
2881 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2884 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2882 }; 2885 };
2883 2886
2884 #undef DECLARE_HYDROGEN_ACCESSOR 2887 #undef DECLARE_HYDROGEN_ACCESSOR
2885 #undef DECLARE_CONCRETE_INSTRUCTION 2888 #undef DECLARE_CONCRETE_INSTRUCTION
2886 2889
2887 } } // namespace v8::internal 2890 } } // namespace v8::internal
2888 2891
2889 #endif // V8_IA32_LITHIUM_IA32_H_ 2892 #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