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

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

Issue 697053002: [x86] Fix register constraints for multiply high and modulus. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add test case. Created 6 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
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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 } 413 }
414 414
415 415
416 void InstructionSelector::VisitInt64Mul(Node* node) { 416 void InstructionSelector::VisitInt64Mul(Node* node) {
417 VisitMul(this, node, kX64Imul); 417 VisitMul(this, node, kX64Imul);
418 } 418 }
419 419
420 420
421 void InstructionSelector::VisitInt32MulHigh(Node* node) { 421 void InstructionSelector::VisitInt32MulHigh(Node* node) {
422 X64OperandGenerator g(this); 422 X64OperandGenerator g(this);
423 InstructionOperand* temps[] = {g.TempRegister(rax)};
424 Emit(kX64ImulHigh32, g.DefineAsFixed(node, rdx), 423 Emit(kX64ImulHigh32, g.DefineAsFixed(node, rdx),
425 g.UseFixed(node->InputAt(0), rax), g.UseUniqueRegister(node->InputAt(1)), 424 g.UseFixed(node->InputAt(0), rax),
426 arraysize(temps), temps); 425 g.UseUniqueRegister(node->InputAt(1)));
427 } 426 }
428 427
429 428
430 static void VisitDiv(InstructionSelector* selector, Node* node, 429 static void VisitDiv(InstructionSelector* selector, Node* node,
431 ArchOpcode opcode) { 430 ArchOpcode opcode) {
432 X64OperandGenerator g(selector); 431 X64OperandGenerator g(selector);
433 InstructionOperand* temps[] = {g.TempRegister(rdx)}; 432 InstructionOperand* temps[] = {g.TempRegister(rdx)};
434 selector->Emit( 433 selector->Emit(
435 opcode, g.DefineAsFixed(node, rax), g.UseFixed(node->InputAt(0), rax), 434 opcode, g.DefineAsFixed(node, rax), g.UseFixed(node->InputAt(0), rax),
436 g.UseUniqueRegister(node->InputAt(1)), arraysize(temps), temps); 435 g.UseUniqueRegister(node->InputAt(1)), arraysize(temps), temps);
(...skipping 16 matching lines...) Expand all
453 452
454 453
455 void InstructionSelector::VisitUint64Div(Node* node) { 454 void InstructionSelector::VisitUint64Div(Node* node) {
456 VisitDiv(this, node, kX64Udiv); 455 VisitDiv(this, node, kX64Udiv);
457 } 456 }
458 457
459 458
460 static void VisitMod(InstructionSelector* selector, Node* node, 459 static void VisitMod(InstructionSelector* selector, Node* node,
461 ArchOpcode opcode) { 460 ArchOpcode opcode) {
462 X64OperandGenerator g(selector); 461 X64OperandGenerator g(selector);
463 InstructionOperand* temps[] = {g.TempRegister(rax), g.TempRegister(rdx)}; 462 selector->Emit(opcode, g.DefineAsFixed(node, rdx),
464 selector->Emit( 463 g.UseFixed(node->InputAt(0), rax),
465 opcode, g.DefineAsFixed(node, rdx), g.UseFixed(node->InputAt(0), rax), 464 g.UseUniqueRegister(node->InputAt(1)));
466 g.UseUniqueRegister(node->InputAt(1)), arraysize(temps), temps);
467 } 465 }
468 466
469 467
470 void InstructionSelector::VisitInt32Mod(Node* node) { 468 void InstructionSelector::VisitInt32Mod(Node* node) {
471 VisitMod(this, node, kX64Idiv32); 469 VisitMod(this, node, kX64Idiv32);
472 } 470 }
473 471
474 472
475 void InstructionSelector::VisitInt64Mod(Node* node) { 473 void InstructionSelector::VisitInt64Mod(Node* node) {
476 VisitMod(this, node, kX64Idiv); 474 VisitMod(this, node, kX64Idiv);
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
1058 if (CpuFeatures::IsSupported(SSE4_1)) { 1056 if (CpuFeatures::IsSupported(SSE4_1)) {
1059 return MachineOperatorBuilder::kFloat64Floor | 1057 return MachineOperatorBuilder::kFloat64Floor |
1060 MachineOperatorBuilder::kFloat64Ceil | 1058 MachineOperatorBuilder::kFloat64Ceil |
1061 MachineOperatorBuilder::kFloat64RoundTruncate; 1059 MachineOperatorBuilder::kFloat64RoundTruncate;
1062 } 1060 }
1063 return MachineOperatorBuilder::kNoFlags; 1061 return MachineOperatorBuilder::kNoFlags;
1064 } 1062 }
1065 } // namespace compiler 1063 } // namespace compiler
1066 } // namespace internal 1064 } // namespace internal
1067 } // namespace v8 1065 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/ia32/instruction-selector-ia32.cc ('k') | test/mjsunit/compiler/regress-register-allocator2.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698