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

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

Issue 11308040: ARM: Emit RSB (reverse-subtract) for subtraction with constant lhs (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebase, address comments Created 8 years, 1 month 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 | « no previous file | src/arm/lithium-arm.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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 V(StoreKeyed) \ 159 V(StoreKeyed) \
160 V(StoreKeyedGeneric) \ 160 V(StoreKeyedGeneric) \
161 V(StoreNamedField) \ 161 V(StoreNamedField) \
162 V(StoreNamedGeneric) \ 162 V(StoreNamedGeneric) \
163 V(StringAdd) \ 163 V(StringAdd) \
164 V(StringCharCodeAt) \ 164 V(StringCharCodeAt) \
165 V(StringCharFromCode) \ 165 V(StringCharFromCode) \
166 V(StringCompareAndBranch) \ 166 V(StringCompareAndBranch) \
167 V(StringLength) \ 167 V(StringLength) \
168 V(SubI) \ 168 V(SubI) \
169 V(RSubI) \
169 V(TaggedToI) \ 170 V(TaggedToI) \
170 V(ThisFunction) \ 171 V(ThisFunction) \
171 V(Throw) \ 172 V(Throw) \
172 V(ToFastProperties) \ 173 V(ToFastProperties) \
173 V(TransitionElementsKind) \ 174 V(TransitionElementsKind) \
174 V(Typeof) \ 175 V(Typeof) \
175 V(TypeofIsAndBranch) \ 176 V(TypeofIsAndBranch) \
176 V(UnaryMathOperation) \ 177 V(UnaryMathOperation) \
177 V(UnknownOSRValue) \ 178 V(UnknownOSRValue) \
178 V(ValueOf) \ 179 V(ValueOf) \
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after
997 } 998 }
998 999
999 LOperand* left() { return inputs_[0]; } 1000 LOperand* left() { return inputs_[0]; }
1000 LOperand* right() { return inputs_[1]; } 1001 LOperand* right() { return inputs_[1]; }
1001 1002
1002 DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i") 1003 DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i")
1003 DECLARE_HYDROGEN_ACCESSOR(Sub) 1004 DECLARE_HYDROGEN_ACCESSOR(Sub)
1004 }; 1005 };
1005 1006
1006 1007
1008 class LRSubI: public LTemplateInstruction<1, 2, 0> {
1009 public:
1010 LRSubI(LOperand* left, LOperand* right) {
1011 inputs_[0] = left;
1012 inputs_[1] = right;
1013 }
1014
1015 LOperand* left() { return inputs_[0]; }
1016 LOperand* right() { return inputs_[1]; }
1017
1018 DECLARE_CONCRETE_INSTRUCTION(RSubI, "rsub-i")
1019 DECLARE_HYDROGEN_ACCESSOR(Sub)
1020 };
1021
1022
1007 class LConstantI: public LTemplateInstruction<1, 0, 0> { 1023 class LConstantI: public LTemplateInstruction<1, 0, 0> {
1008 public: 1024 public:
1009 DECLARE_CONCRETE_INSTRUCTION(ConstantI, "constant-i") 1025 DECLARE_CONCRETE_INSTRUCTION(ConstantI, "constant-i")
1010 DECLARE_HYDROGEN_ACCESSOR(Constant) 1026 DECLARE_HYDROGEN_ACCESSOR(Constant)
1011 1027
1012 int32_t value() const { return hydrogen()->Integer32Value(); } 1028 int32_t value() const { return hydrogen()->Integer32Value(); }
1013 }; 1029 };
1014 1030
1015 1031
1016 class LConstantD: public LTemplateInstruction<1, 0, 0> { 1032 class LConstantD: public LTemplateInstruction<1, 0, 0> {
(...skipping 1392 matching lines...) Expand 10 before | Expand all | Expand 10 after
2409 2425
2410 // Build the sequence for the graph. 2426 // Build the sequence for the graph.
2411 LPlatformChunk* Build(); 2427 LPlatformChunk* Build();
2412 2428
2413 // Declare methods that deal with the individual node types. 2429 // Declare methods that deal with the individual node types.
2414 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); 2430 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node);
2415 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) 2431 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO)
2416 #undef DECLARE_DO 2432 #undef DECLARE_DO
2417 2433
2418 LInstruction* DoMultiplyAdd(HMul* mul, HValue* addend); 2434 LInstruction* DoMultiplyAdd(HMul* mul, HValue* addend);
2435 LInstruction* DoRSub(HSub* instr);
2419 2436
2420 static bool HasMagicNumberForDivisor(int32_t divisor); 2437 static bool HasMagicNumberForDivisor(int32_t divisor);
2421 static HValue* SimplifiedDividendForMathFloorOfDiv(HValue* val); 2438 static HValue* SimplifiedDividendForMathFloorOfDiv(HValue* val);
2422 static HValue* SimplifiedDivisorForMathFloorOfDiv(HValue* val); 2439 static HValue* SimplifiedDivisorForMathFloorOfDiv(HValue* val);
2423 2440
2424 private: 2441 private:
2425 enum Status { 2442 enum Status {
2426 UNUSED, 2443 UNUSED,
2427 BUILDING, 2444 BUILDING,
2428 DONE, 2445 DONE,
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
2545 2562
2546 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2563 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2547 }; 2564 };
2548 2565
2549 #undef DECLARE_HYDROGEN_ACCESSOR 2566 #undef DECLARE_HYDROGEN_ACCESSOR
2550 #undef DECLARE_CONCRETE_INSTRUCTION 2567 #undef DECLARE_CONCRETE_INSTRUCTION
2551 2568
2552 } } // namespace v8::internal 2569 } } // namespace v8::internal
2553 2570
2554 #endif // V8_ARM_LITHIUM_ARM_H_ 2571 #endif // V8_ARM_LITHIUM_ARM_H_
OLDNEW
« no previous file with comments | « no previous file | src/arm/lithium-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698