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

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

Issue 10382033: x86/x64 port of Math.floor(x/y) to use integer division for specific divisor (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 7 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
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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 V(LoadFunctionPrototype) \ 119 V(LoadFunctionPrototype) \
120 V(LoadGlobalCell) \ 120 V(LoadGlobalCell) \
121 V(LoadGlobalGeneric) \ 121 V(LoadGlobalGeneric) \
122 V(LoadKeyedFastElement) \ 122 V(LoadKeyedFastElement) \
123 V(LoadKeyedFastDoubleElement) \ 123 V(LoadKeyedFastDoubleElement) \
124 V(LoadKeyedGeneric) \ 124 V(LoadKeyedGeneric) \
125 V(LoadKeyedSpecializedArrayElement) \ 125 V(LoadKeyedSpecializedArrayElement) \
126 V(LoadNamedField) \ 126 V(LoadNamedField) \
127 V(LoadNamedFieldPolymorphic) \ 127 V(LoadNamedFieldPolymorphic) \
128 V(LoadNamedGeneric) \ 128 V(LoadNamedGeneric) \
129 V(MathFloorOfDiv) \
129 V(MathPowHalf) \ 130 V(MathPowHalf) \
130 V(ModI) \ 131 V(ModI) \
131 V(MulI) \ 132 V(MulI) \
132 V(NumberTagD) \ 133 V(NumberTagD) \
133 V(NumberTagI) \ 134 V(NumberTagI) \
134 V(NumberUntagD) \ 135 V(NumberUntagD) \
135 V(ObjectLiteral) \ 136 V(ObjectLiteral) \
136 V(OsrEntry) \ 137 V(OsrEntry) \
137 V(OuterContext) \ 138 V(OuterContext) \
138 V(Parameter) \ 139 V(Parameter) \
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 inputs_[0] = left; 538 inputs_[0] = left;
538 inputs_[1] = right; 539 inputs_[1] = right;
539 temps_[0] = temp; 540 temps_[0] = temp;
540 } 541 }
541 542
542 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i") 543 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i")
543 DECLARE_HYDROGEN_ACCESSOR(Div) 544 DECLARE_HYDROGEN_ACCESSOR(Div)
544 }; 545 };
545 546
546 547
548 class LMathFloorOfDiv: public LTemplateInstruction<1, 2, 1> {
549 public:
550 LMathFloorOfDiv(LOperand* left,
551 LOperand* right,
552 LOperand* temp = NULL) {
553 inputs_[0] = left;
554 inputs_[1] = right;
555 temps_[0] = temp;
556 }
557
558 DECLARE_CONCRETE_INSTRUCTION(MathFloorOfDiv, "math-floor-of-div")
559 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
560 };
561
562
547 class LMulI: public LTemplateInstruction<1, 2, 1> { 563 class LMulI: public LTemplateInstruction<1, 2, 1> {
548 public: 564 public:
549 LMulI(LOperand* left, LOperand* right, LOperand* temp) { 565 LMulI(LOperand* left, LOperand* right, LOperand* temp) {
550 inputs_[0] = left; 566 inputs_[0] = left;
551 inputs_[1] = right; 567 inputs_[1] = right;
552 temps_[0] = temp; 568 temps_[0] = temp;
553 } 569 }
554 570
555 DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i") 571 DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i")
556 DECLARE_HYDROGEN_ACCESSOR(Mul) 572 DECLARE_HYDROGEN_ACCESSOR(Mul)
(...skipping 1820 matching lines...) Expand 10 before | Expand all | Expand 10 after
2377 pending_deoptimization_ast_id_(AstNode::kNoNumber) { } 2393 pending_deoptimization_ast_id_(AstNode::kNoNumber) { }
2378 2394
2379 // Build the sequence for the graph. 2395 // Build the sequence for the graph.
2380 LChunk* Build(); 2396 LChunk* Build();
2381 2397
2382 // Declare methods that deal with the individual node types. 2398 // Declare methods that deal with the individual node types.
2383 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); 2399 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node);
2384 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) 2400 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO)
2385 #undef DECLARE_DO 2401 #undef DECLARE_DO
2386 2402
2403 static HValue* SimplifiedDividendForMathFloorOfDiv(HValue* val);
2404 static HValue* SimplifiedDivisorForMathFloorOfDiv(HValue* val);
2405
2387 private: 2406 private:
2388 enum Status { 2407 enum Status {
2389 UNUSED, 2408 UNUSED,
2390 BUILDING, 2409 BUILDING,
2391 DONE, 2410 DONE,
2392 ABORTED 2411 ABORTED
2393 }; 2412 };
2394 2413
2395 LChunk* chunk() const { return chunk_; } 2414 LChunk* chunk() const { return chunk_; }
2396 CompilationInfo* info() const { return info_; } 2415 CompilationInfo* info() const { return info_; }
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
2512 2531
2513 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2532 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2514 }; 2533 };
2515 2534
2516 #undef DECLARE_HYDROGEN_ACCESSOR 2535 #undef DECLARE_HYDROGEN_ACCESSOR
2517 #undef DECLARE_CONCRETE_INSTRUCTION 2536 #undef DECLARE_CONCRETE_INSTRUCTION
2518 2537
2519 } } // namespace v8::internal 2538 } } // namespace v8::internal
2520 2539
2521 #endif // V8_IA32_LITHIUM_IA32_H_ 2540 #endif // V8_IA32_LITHIUM_IA32_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698