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

Side by Side Diff: src/compiler/ia32/instruction-selector-ia32.cc

Issue 654833002: [turbofan] Optimize division/modulus by constant. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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/compiler/ia32/instruction-codes-ia32.h ('k') | src/compiler/instruction-selector.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/instruction-selector-impl.h" 5 #include "src/compiler/instruction-selector-impl.h"
6 #include "src/compiler/node-matchers.h" 6 #include "src/compiler/node-matchers.h"
7 #include "src/compiler/node-properties-inl.h" 7 #include "src/compiler/node-properties-inl.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 } else { 448 } else {
449 if (g.CanBeBetterLeftOperand(right)) { 449 if (g.CanBeBetterLeftOperand(right)) {
450 std::swap(left, right); 450 std::swap(left, right);
451 } 451 }
452 Emit(kIA32Imul, g.DefineSameAsFirst(node), g.UseRegister(left), 452 Emit(kIA32Imul, g.DefineSameAsFirst(node), g.UseRegister(left),
453 g.Use(right)); 453 g.Use(right));
454 } 454 }
455 } 455 }
456 456
457 457
458 void InstructionSelector::VisitInt32MulHigh(Node* node) {
459 IA32OperandGenerator g(this);
460 InstructionOperand* temps[] = {g.TempRegister(eax)};
461 size_t temp_count = arraysize(temps);
462 Emit(kIA32ImulHigh, g.DefineAsFixed(node, edx),
463 g.UseFixed(node->InputAt(0), eax), g.UseRegister(node->InputAt(1)),
464 temp_count, temps);
465 }
466
467
458 static inline void VisitDiv(InstructionSelector* selector, Node* node, 468 static inline void VisitDiv(InstructionSelector* selector, Node* node,
459 ArchOpcode opcode) { 469 ArchOpcode opcode) {
460 IA32OperandGenerator g(selector); 470 IA32OperandGenerator g(selector);
461 InstructionOperand* temps[] = {g.TempRegister(edx)}; 471 InstructionOperand* temps[] = {g.TempRegister(edx)};
462 size_t temp_count = arraysize(temps); 472 size_t temp_count = arraysize(temps);
463 selector->Emit(opcode, g.DefineAsFixed(node, eax), 473 selector->Emit(opcode, g.DefineAsFixed(node, eax),
464 g.UseFixed(node->InputAt(0), eax), 474 g.UseFixed(node->InputAt(0), eax),
465 g.UseUnique(node->InputAt(1)), temp_count, temps); 475 g.UseUnique(node->InputAt(1)), temp_count, temps);
466 } 476 }
467 477
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 863
854 864
855 void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) { 865 void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) {
856 FlagsContinuation cont(kUnorderedLessThanOrEqual, node); 866 FlagsContinuation cont(kUnorderedLessThanOrEqual, node);
857 VisitFloat64Compare(this, node, &cont); 867 VisitFloat64Compare(this, node, &cont);
858 } 868 }
859 869
860 } // namespace compiler 870 } // namespace compiler
861 } // namespace internal 871 } // namespace internal
862 } // namespace v8 872 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/ia32/instruction-codes-ia32.h ('k') | src/compiler/instruction-selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698