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

Side by Side Diff: src/compiler/x64/instruction-selector-x64.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/x64/instruction-codes-x64.h ('k') | test/cctest/compiler/test-run-machops.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/generic-node-inl.h" 5 #include "src/compiler/generic-node-inl.h"
6 #include "src/compiler/instruction-selector-impl.h" 6 #include "src/compiler/instruction-selector-impl.h"
7 #include "src/compiler/node-matchers.h" 7 #include "src/compiler/node-matchers.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 VisitMul(this, node, kX64Imul32); 539 VisitMul(this, node, kX64Imul32);
540 } 540 }
541 541
542 542
543 void InstructionSelector::VisitInt64Mul(Node* node) { 543 void InstructionSelector::VisitInt64Mul(Node* node) {
544 if (TryEmitLeaMult(this, node, kX64Lea)) return; 544 if (TryEmitLeaMult(this, node, kX64Lea)) return;
545 VisitMul(this, node, kX64Imul); 545 VisitMul(this, node, kX64Imul);
546 } 546 }
547 547
548 548
549 void InstructionSelector::VisitInt32MulHigh(Node* node) {
550 X64OperandGenerator g(this);
551 InstructionOperand* temps[] = {g.TempRegister(rax)};
552 size_t temp_count = arraysize(temps);
553 Emit(kX64ImulHigh32, g.DefineAsFixed(node, rdx),
554 g.UseFixed(node->InputAt(0), rax), g.UseRegister(node->InputAt(1)),
555 temp_count, temps);
556 }
557
558
549 static void VisitDiv(InstructionSelector* selector, Node* node, 559 static void VisitDiv(InstructionSelector* selector, Node* node,
550 ArchOpcode opcode) { 560 ArchOpcode opcode) {
551 X64OperandGenerator g(selector); 561 X64OperandGenerator g(selector);
552 InstructionOperand* temps[] = {g.TempRegister(rdx)}; 562 InstructionOperand* temps[] = {g.TempRegister(rdx)};
553 selector->Emit( 563 selector->Emit(
554 opcode, g.DefineAsFixed(node, rax), g.UseFixed(node->InputAt(0), rax), 564 opcode, g.DefineAsFixed(node, rax), g.UseFixed(node->InputAt(0), rax),
555 g.UseUniqueRegister(node->InputAt(1)), arraysize(temps), temps); 565 g.UseUniqueRegister(node->InputAt(1)), arraysize(temps), temps);
556 } 566 }
557 567
558 568
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
1039 1049
1040 1050
1041 void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) { 1051 void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) {
1042 FlagsContinuation cont(kUnorderedLessThanOrEqual, node); 1052 FlagsContinuation cont(kUnorderedLessThanOrEqual, node);
1043 VisitFloat64Compare(this, node, &cont); 1053 VisitFloat64Compare(this, node, &cont);
1044 } 1054 }
1045 1055
1046 } // namespace compiler 1056 } // namespace compiler
1047 } // namespace internal 1057 } // namespace internal
1048 } // namespace v8 1058 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/x64/instruction-codes-x64.h ('k') | test/cctest/compiler/test-run-machops.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698