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

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

Issue 1419753008: MIPS: [turbofan] Properly implement Float64/32 Min/Max instructions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove redundant functions. Created 5 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
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/base/adapters.h" 5 #include "src/base/adapters.h"
6 #include "src/base/bits.h" 6 #include "src/base/bits.h"
7 #include "src/compiler/instruction-selector-impl.h" 7 #include "src/compiler/instruction-selector-impl.h"
8 #include "src/compiler/node-matchers.h" 8 #include "src/compiler/node-matchers.h"
9 #include "src/compiler/node-properties.h" 9 #include "src/compiler/node-properties.h"
10 10
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 } 474 }
475 475
476 476
477 void InstructionSelector::VisitFloat64Mod(Node* node) { 477 void InstructionSelector::VisitFloat64Mod(Node* node) {
478 MipsOperandGenerator g(this); 478 MipsOperandGenerator g(this);
479 Emit(kMipsModD, g.DefineAsFixed(node, f0), g.UseFixed(node->InputAt(0), f12), 479 Emit(kMipsModD, g.DefineAsFixed(node, f0), g.UseFixed(node->InputAt(0), f12),
480 g.UseFixed(node->InputAt(1), f14))->MarkAsCall(); 480 g.UseFixed(node->InputAt(1), f14))->MarkAsCall();
481 } 481 }
482 482
483 483
484 void InstructionSelector::VisitFloat32Max(Node* node) { UNREACHABLE(); } 484 void InstructionSelector::VisitFloat32Max(Node* node) {
485 MipsOperandGenerator g(this);
486 if (IsMipsArchVariant(kMips32r6)) {
487 Emit(kMipsFloat32Max, g.DefineAsRegister(node),
488 g.UseUniqueRegister(node->InputAt(0)),
489 g.UseUniqueRegister(node->InputAt(1)));
490
491 } else {
492 // Reverse operands, and use same reg. for result and right operand.
493 Emit(kMipsFloat32Max, g.DefineSameAsFirst(node),
494 g.UseRegister(node->InputAt(1)), g.UseRegister(node->InputAt(0)));
495 }
496 }
485 497
486 498
487 void InstructionSelector::VisitFloat64Max(Node* node) { UNREACHABLE(); } 499 void InstructionSelector::VisitFloat64Max(Node* node) {
500 MipsOperandGenerator g(this);
501 if (IsMipsArchVariant(kMips32r6)) {
502 Emit(kMipsFloat64Max, g.DefineAsRegister(node),
503 g.UseUniqueRegister(node->InputAt(0)),
504 g.UseUniqueRegister(node->InputAt(1)));
505
506 } else {
507 // Reverse operands, and use same reg. for result and right operand.
508 Emit(kMipsFloat64Max, g.DefineSameAsFirst(node),
509 g.UseRegister(node->InputAt(1)), g.UseRegister(node->InputAt(0)));
510 }
511 }
488 512
489 513
490 void InstructionSelector::VisitFloat32Min(Node* node) { UNREACHABLE(); } 514 void InstructionSelector::VisitFloat32Min(Node* node) {
515 MipsOperandGenerator g(this);
516 if (IsMipsArchVariant(kMips32r6)) {
517 Emit(kMipsFloat32Min, g.DefineAsRegister(node),
518 g.UseUniqueRegister(node->InputAt(0)),
519 g.UseUniqueRegister(node->InputAt(1)));
520
521 } else {
522 // Reverse operands, and use same reg. for result and right operand.
523 Emit(kMipsFloat32Min, g.DefineSameAsFirst(node),
524 g.UseRegister(node->InputAt(1)), g.UseRegister(node->InputAt(0)));
525 }
526 }
491 527
492 528
493 void InstructionSelector::VisitFloat64Min(Node* node) { UNREACHABLE(); } 529 void InstructionSelector::VisitFloat64Min(Node* node) {
530 MipsOperandGenerator g(this);
531 if (IsMipsArchVariant(kMips32r6)) {
532 Emit(kMipsFloat64Min, g.DefineAsRegister(node),
533 g.UseUniqueRegister(node->InputAt(0)),
534 g.UseUniqueRegister(node->InputAt(1)));
535
536 } else {
537 // Reverse operands, and use same reg. for result and right operand.
538 Emit(kMipsFloat64Min, g.DefineSameAsFirst(node),
539 g.UseRegister(node->InputAt(1)), g.UseRegister(node->InputAt(0)));
540 }
541 }
494 542
495 543
496 void InstructionSelector::VisitFloat32Abs(Node* node) { 544 void InstructionSelector::VisitFloat32Abs(Node* node) {
497 VisitRR(this, kMipsAbsS, node); 545 VisitRR(this, kMipsAbsS, node);
498 } 546 }
499 547
500 548
501 void InstructionSelector::VisitFloat64Abs(Node* node) { 549 void InstructionSelector::VisitFloat64Abs(Node* node) {
502 VisitRR(this, kMipsAbsD, node); 550 VisitRR(this, kMipsAbsD, node);
503 } 551 }
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
1027 1075
1028 // static 1076 // static
1029 MachineOperatorBuilder::Flags 1077 MachineOperatorBuilder::Flags
1030 InstructionSelector::SupportedMachineOperatorFlags() { 1078 InstructionSelector::SupportedMachineOperatorFlags() {
1031 MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::kNoFlags; 1079 MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::kNoFlags;
1032 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) && 1080 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) &&
1033 IsFp64Mode()) { 1081 IsFp64Mode()) {
1034 flags |= MachineOperatorBuilder::kFloat64RoundDown | 1082 flags |= MachineOperatorBuilder::kFloat64RoundDown |
1035 MachineOperatorBuilder::kFloat64RoundTruncate; 1083 MachineOperatorBuilder::kFloat64RoundTruncate;
1036 } 1084 }
1037 return flags; 1085 return flags | MachineOperatorBuilder::kFloat64Min |
1086 MachineOperatorBuilder::kFloat64Max |
1087 MachineOperatorBuilder::kFloat32Min |
1088 MachineOperatorBuilder::kFloat32Max;
1038 } 1089 }
1039 1090
1040 } // namespace compiler 1091 } // namespace compiler
1041 } // namespace internal 1092 } // namespace internal
1042 } // namespace v8 1093 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/mips/instruction-codes-mips.h ('k') | src/compiler/mips64/code-generator-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698