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

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

Issue 13841003: Separate Math Lithium operations. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 7 years, 8 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/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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 V(LoadExternalArrayPointer) \ 126 V(LoadExternalArrayPointer) \
127 V(LoadFunctionPrototype) \ 127 V(LoadFunctionPrototype) \
128 V(LoadGlobalCell) \ 128 V(LoadGlobalCell) \
129 V(LoadGlobalGeneric) \ 129 V(LoadGlobalGeneric) \
130 V(LoadKeyed) \ 130 V(LoadKeyed) \
131 V(LoadKeyedGeneric) \ 131 V(LoadKeyedGeneric) \
132 V(LoadNamedField) \ 132 V(LoadNamedField) \
133 V(LoadNamedFieldPolymorphic) \ 133 V(LoadNamedFieldPolymorphic) \
134 V(LoadNamedGeneric) \ 134 V(LoadNamedGeneric) \
135 V(MapEnumLength) \ 135 V(MapEnumLength) \
136 V(MathAbs) \
137 V(MathCos) \
136 V(MathExp) \ 138 V(MathExp) \
139 V(MathFloor) \
140 V(MathLog) \
137 V(MathMinMax) \ 141 V(MathMinMax) \
142 V(MathPowHalf) \
143 V(MathRound) \
144 V(MathSin) \
145 V(MathSqrt) \
146 V(MathTan) \
138 V(ModI) \ 147 V(ModI) \
139 V(MulI) \ 148 V(MulI) \
140 V(MultiplyAddD) \ 149 V(MultiplyAddD) \
141 V(NumberTagD) \ 150 V(NumberTagD) \
142 V(NumberTagI) \ 151 V(NumberTagI) \
143 V(NumberTagU) \ 152 V(NumberTagU) \
144 V(NumberUntagD) \ 153 V(NumberUntagD) \
145 V(ObjectLiteral) \ 154 V(ObjectLiteral) \
146 V(OsrEntry) \ 155 V(OsrEntry) \
147 V(OuterContext) \ 156 V(OuterContext) \
(...skipping 22 matching lines...) Expand all
170 V(StringLength) \ 179 V(StringLength) \
171 V(SubI) \ 180 V(SubI) \
172 V(TaggedToI) \ 181 V(TaggedToI) \
173 V(ThisFunction) \ 182 V(ThisFunction) \
174 V(Throw) \ 183 V(Throw) \
175 V(ToFastProperties) \ 184 V(ToFastProperties) \
176 V(TransitionElementsKind) \ 185 V(TransitionElementsKind) \
177 V(TrapAllocationMemento) \ 186 V(TrapAllocationMemento) \
178 V(Typeof) \ 187 V(Typeof) \
179 V(TypeofIsAndBranch) \ 188 V(TypeofIsAndBranch) \
180 V(UnaryMathOperation) \
181 V(UnknownOSRValue) \ 189 V(UnknownOSRValue) \
182 V(ValueOf) \ 190 V(ValueOf) \
183 V(ForInPrepareMap) \ 191 V(ForInPrepareMap) \
184 V(ForInCacheArray) \ 192 V(ForInCacheArray) \
185 V(CheckMapValue) \ 193 V(CheckMapValue) \
186 V(LoadFieldByIndex) \ 194 V(LoadFieldByIndex) \
187 V(DateField) \ 195 V(DateField) \
188 V(WrapReceiver) \ 196 V(WrapReceiver) \
189 V(Drop) \ 197 V(Drop) \
190 V(InnerAllocatedObject) 198 V(InnerAllocatedObject)
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 663
656 Token::Value op() const { return hydrogen()->token(); } 664 Token::Value op() const { return hydrogen()->token(); }
657 bool is_double() const { 665 bool is_double() const {
658 return hydrogen()->representation().IsDouble(); 666 return hydrogen()->representation().IsDouble();
659 } 667 }
660 668
661 virtual void PrintDataTo(StringStream* stream); 669 virtual void PrintDataTo(StringStream* stream);
662 }; 670 };
663 671
664 672
665 class LUnaryMathOperation: public LTemplateInstruction<1, 1, 1> { 673 class LMathFloor: public LTemplateInstruction<1, 1, 1> {
666 public: 674 public:
667 LUnaryMathOperation(LOperand* value, LOperand* temp) { 675 LMathFloor(LOperand* value, LOperand* temp) {
668 inputs_[0] = value; 676 inputs_[0] = value;
669 temps_[0] = temp; 677 temps_[0] = temp;
670 } 678 }
671 679
672 LOperand* value() { return inputs_[0]; } 680 LOperand* value() { return inputs_[0]; }
673 LOperand* temp() { return temps_[0]; } 681 LOperand* temp() { return temps_[0]; }
674 682
675 DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary-math-operation") 683 DECLARE_CONCRETE_INSTRUCTION(MathFloor, "math-floor")
676 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) 684 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
677
678 virtual void PrintDataTo(StringStream* stream);
679 BuiltinFunctionId op() const { return hydrogen()->op(); }
680 }; 685 };
681 686
682 687
688 class LMathRound: public LTemplateInstruction<1, 1, 1> {
689 public:
690 LMathRound(LOperand* value, LOperand* temp) {
691 inputs_[0] = value;
692 temps_[0] = temp;
693 }
694
695 LOperand* value() { return inputs_[0]; }
696 LOperand* temp() { return temps_[0]; }
697
698 DECLARE_CONCRETE_INSTRUCTION(MathRound, "math-round")
699 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
700 };
701
702
703 class LMathAbs: public LTemplateInstruction<1, 1, 0> {
704 public:
705 explicit LMathAbs(LOperand* value) {
706 inputs_[0] = value;
707 }
708
709 LOperand* value() { return inputs_[0]; }
710
711 DECLARE_CONCRETE_INSTRUCTION(MathAbs, "math-abs")
712 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
713 };
714
715
716 class LMathLog: public LTemplateInstruction<1, 1, 0> {
717 public:
718 explicit LMathLog(LOperand* value) {
719 inputs_[0] = value;
720 }
721
722 LOperand* value() { return inputs_[0]; }
723
724 DECLARE_CONCRETE_INSTRUCTION(MathLog, "math-log")
725 };
726
727
728 class LMathSin: public LTemplateInstruction<1, 1, 0> {
729 public:
730 explicit LMathSin(LOperand* value) {
731 inputs_[0] = value;
732 }
733
734 LOperand* value() { return inputs_[0]; }
735
736 DECLARE_CONCRETE_INSTRUCTION(MathSin, "math-sin")
737 };
738
739
740 class LMathCos: public LTemplateInstruction<1, 1, 0> {
741 public:
742 explicit LMathCos(LOperand* value) {
743 inputs_[0] = value;
744 }
745
746 LOperand* value() { return inputs_[0]; }
747
748 DECLARE_CONCRETE_INSTRUCTION(MathCos, "math-cos")
749 };
750
751
752 class LMathTan: public LTemplateInstruction<1, 1, 0> {
753 public:
754 explicit LMathTan(LOperand* value) {
755 inputs_[0] = value;
756 }
757
758 LOperand* value() { return inputs_[0]; }
759
760 DECLARE_CONCRETE_INSTRUCTION(MathTan, "math-tan")
761 };
762
763
683 class LMathExp: public LTemplateInstruction<1, 1, 3> { 764 class LMathExp: public LTemplateInstruction<1, 1, 3> {
684 public: 765 public:
685 LMathExp(LOperand* value, 766 LMathExp(LOperand* value,
686 LOperand* double_temp, 767 LOperand* double_temp,
687 LOperand* temp1, 768 LOperand* temp1,
688 LOperand* temp2) { 769 LOperand* temp2) {
689 inputs_[0] = value; 770 inputs_[0] = value;
690 temps_[0] = temp1; 771 temps_[0] = temp1;
691 temps_[1] = temp2; 772 temps_[1] = temp2;
692 temps_[2] = double_temp; 773 temps_[2] = double_temp;
693 ExternalReference::InitializeMathExpData(); 774 ExternalReference::InitializeMathExpData();
694 } 775 }
695 776
696 LOperand* value() { return inputs_[0]; } 777 LOperand* value() { return inputs_[0]; }
697 LOperand* temp1() { return temps_[0]; } 778 LOperand* temp1() { return temps_[0]; }
698 LOperand* temp2() { return temps_[1]; } 779 LOperand* temp2() { return temps_[1]; }
699 LOperand* double_temp() { return temps_[2]; } 780 LOperand* double_temp() { return temps_[2]; }
700 781
701 DECLARE_CONCRETE_INSTRUCTION(MathExp, "math-exp") 782 DECLARE_CONCRETE_INSTRUCTION(MathExp, "math-exp")
702
703 virtual void PrintDataTo(StringStream* stream);
704 }; 783 };
705 784
706 785
786 class LMathSqrt: public LTemplateInstruction<1, 1, 0> {
787 public:
788 explicit LMathSqrt(LOperand* value) {
789 inputs_[0] = value;
790 }
791
792 LOperand* value() { return inputs_[0]; }
793
794 DECLARE_CONCRETE_INSTRUCTION(MathSqrt, "math-sqrt")
795 };
796
797
798 class LMathPowHalf: public LTemplateInstruction<1, 1, 1> {
799 public:
800 LMathPowHalf(LOperand* value, LOperand* temp) {
801 inputs_[0] = value;
802 temps_[0] = temp;
803 }
804
805 LOperand* value() { return inputs_[0]; }
806 LOperand* temp() { return temps_[0]; }
807
808 DECLARE_CONCRETE_INSTRUCTION(MathPowHalf, "math-pow-half")
809 };
810
811
707 class LCmpObjectEqAndBranch: public LControlInstruction<2, 0> { 812 class LCmpObjectEqAndBranch: public LControlInstruction<2, 0> {
708 public: 813 public:
709 LCmpObjectEqAndBranch(LOperand* left, LOperand* right) { 814 LCmpObjectEqAndBranch(LOperand* left, LOperand* right) {
710 inputs_[0] = left; 815 inputs_[0] = left;
711 inputs_[1] = right; 816 inputs_[1] = right;
712 } 817 }
713 818
714 LOperand* left() { return inputs_[0]; } 819 LOperand* left() { return inputs_[0]; }
715 LOperand* right() { return inputs_[1]; } 820 LOperand* right() { return inputs_[1]; }
716 821
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
1247 class LMathMinMax: public LTemplateInstruction<1, 2, 0> { 1352 class LMathMinMax: public LTemplateInstruction<1, 2, 0> {
1248 public: 1353 public:
1249 LMathMinMax(LOperand* left, LOperand* right) { 1354 LMathMinMax(LOperand* left, LOperand* right) {
1250 inputs_[0] = left; 1355 inputs_[0] = left;
1251 inputs_[1] = right; 1356 inputs_[1] = right;
1252 } 1357 }
1253 1358
1254 LOperand* left() { return inputs_[0]; } 1359 LOperand* left() { return inputs_[0]; }
1255 LOperand* right() { return inputs_[1]; } 1360 LOperand* right() { return inputs_[1]; }
1256 1361
1257 DECLARE_CONCRETE_INSTRUCTION(MathMinMax, "min-max") 1362 DECLARE_CONCRETE_INSTRUCTION(MathMinMax, "math-min-max")
1258 DECLARE_HYDROGEN_ACCESSOR(MathMinMax) 1363 DECLARE_HYDROGEN_ACCESSOR(MathMinMax)
1259 }; 1364 };
1260 1365
1261 1366
1262 class LPower: public LTemplateInstruction<1, 2, 0> { 1367 class LPower: public LTemplateInstruction<1, 2, 0> {
1263 public: 1368 public:
1264 LPower(LOperand* left, LOperand* right) { 1369 LPower(LOperand* left, LOperand* right) {
1265 inputs_[0] = left; 1370 inputs_[0] = left;
1266 inputs_[1] = right; 1371 inputs_[1] = right;
1267 } 1372 }
(...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after
2535 // Build the sequence for the graph. 2640 // Build the sequence for the graph.
2536 LPlatformChunk* Build(); 2641 LPlatformChunk* Build();
2537 2642
2538 // Declare methods that deal with the individual node types. 2643 // Declare methods that deal with the individual node types.
2539 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); 2644 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node);
2540 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) 2645 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO)
2541 #undef DECLARE_DO 2646 #undef DECLARE_DO
2542 2647
2543 LInstruction* DoMultiplyAdd(HMul* mul, HValue* addend); 2648 LInstruction* DoMultiplyAdd(HMul* mul, HValue* addend);
2544 2649
2650 LInstruction* DoMathFloor(HUnaryMathOperation* instr);
2651 LInstruction* DoMathRound(HUnaryMathOperation* instr);
2652 LInstruction* DoMathAbs(HUnaryMathOperation* instr);
2653 LInstruction* DoMathLog(HUnaryMathOperation* instr);
2654 LInstruction* DoMathSin(HUnaryMathOperation* instr);
2655 LInstruction* DoMathCos(HUnaryMathOperation* instr);
2656 LInstruction* DoMathTan(HUnaryMathOperation* instr);
2657 LInstruction* DoMathExp(HUnaryMathOperation* instr);
2658 LInstruction* DoMathSqrt(HUnaryMathOperation* instr);
2659 LInstruction* DoMathPowHalf(HUnaryMathOperation* instr);
2660
2545 private: 2661 private:
2546 enum Status { 2662 enum Status {
2547 UNUSED, 2663 UNUSED,
2548 BUILDING, 2664 BUILDING,
2549 DONE, 2665 DONE,
2550 ABORTED 2666 ABORTED
2551 }; 2667 };
2552 2668
2553 LPlatformChunk* chunk() const { return chunk_; } 2669 LPlatformChunk* chunk() const { return chunk_; }
2554 CompilationInfo* info() const { return info_; } 2670 CompilationInfo* info() const { return info_; }
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
2667 2783
2668 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2784 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2669 }; 2785 };
2670 2786
2671 #undef DECLARE_HYDROGEN_ACCESSOR 2787 #undef DECLARE_HYDROGEN_ACCESSOR
2672 #undef DECLARE_CONCRETE_INSTRUCTION 2788 #undef DECLARE_CONCRETE_INSTRUCTION
2673 2789
2674 } } // namespace v8::internal 2790 } } // namespace v8::internal
2675 2791
2676 #endif // V8_MIPS_LITHIUM_MIPS_H_ 2792 #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