OLD | NEW |
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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 } | 445 } |
446 | 446 |
447 | 447 |
448 void InstructionSelector::VisitFloat64Mod(Node* node) { | 448 void InstructionSelector::VisitFloat64Mod(Node* node) { |
449 MipsOperandGenerator g(this); | 449 MipsOperandGenerator g(this); |
450 Emit(kMipsModD, g.DefineAsFixed(node, f0), g.UseFixed(node->InputAt(0), f12), | 450 Emit(kMipsModD, g.DefineAsFixed(node, f0), g.UseFixed(node->InputAt(0), f12), |
451 g.UseFixed(node->InputAt(1), f14))->MarkAsCall(); | 451 g.UseFixed(node->InputAt(1), f14))->MarkAsCall(); |
452 } | 452 } |
453 | 453 |
454 | 454 |
455 void InstructionSelector::VisitFloat32Max(Node* node) { UNREACHABLE(); } | 455 void InstructionSelector::VisitFloat32Max(Node* node) { |
| 456 DCHECK(kArchVariant == kMips32r6); |
| 457 VisitRRR(this, kMipsMaxS, node); |
| 458 } |
456 | 459 |
457 | 460 |
458 void InstructionSelector::VisitFloat64Max(Node* node) { UNREACHABLE(); } | 461 void InstructionSelector::VisitFloat64Max(Node* node) { |
| 462 DCHECK(kArchVariant == kMips32r6); |
| 463 VisitRRR(this, kMipsMaxD, node); |
| 464 } |
459 | 465 |
460 | 466 |
461 void InstructionSelector::VisitFloat32Min(Node* node) { UNREACHABLE(); } | 467 void InstructionSelector::VisitFloat32Min(Node* node) { |
| 468 DCHECK(kArchVariant == kMips32r6); |
| 469 VisitRRR(this, kMipsMinS, node); |
| 470 } |
462 | 471 |
463 | 472 |
464 void InstructionSelector::VisitFloat64Min(Node* node) { UNREACHABLE(); } | 473 void InstructionSelector::VisitFloat64Min(Node* node) { |
| 474 DCHECK(kArchVariant == kMips32r6); |
| 475 VisitRRR(this, kMipsMinD, node); |
| 476 } |
465 | 477 |
466 | 478 |
467 void InstructionSelector::VisitFloat32Abs(Node* node) { | 479 void InstructionSelector::VisitFloat32Abs(Node* node) { |
468 VisitRR(this, kMipsAbsS, node); | 480 VisitRR(this, kMipsAbsS, node); |
469 } | 481 } |
470 | 482 |
471 | 483 |
472 void InstructionSelector::VisitFloat64Abs(Node* node) { | 484 void InstructionSelector::VisitFloat64Abs(Node* node) { |
473 VisitRR(this, kMipsAbsD, node); | 485 VisitRR(this, kMipsAbsD, node); |
474 } | 486 } |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1052 Node* right = node->InputAt(1); | 1064 Node* right = node->InputAt(1); |
1053 Emit(kMipsFloat64InsertHighWord32, g.DefineSameAsFirst(node), | 1065 Emit(kMipsFloat64InsertHighWord32, g.DefineSameAsFirst(node), |
1054 g.UseRegister(left), g.UseRegister(right)); | 1066 g.UseRegister(left), g.UseRegister(right)); |
1055 } | 1067 } |
1056 | 1068 |
1057 | 1069 |
1058 // static | 1070 // static |
1059 MachineOperatorBuilder::Flags | 1071 MachineOperatorBuilder::Flags |
1060 InstructionSelector::SupportedMachineOperatorFlags() { | 1072 InstructionSelector::SupportedMachineOperatorFlags() { |
1061 MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::kNoFlags; | 1073 MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::kNoFlags; |
| 1074 if (IsMipsArchVariant(kMips32r6)) { |
| 1075 flags |= MachineOperatorBuilder::kFloat32Max | |
| 1076 MachineOperatorBuilder::kFloat32Min | |
| 1077 MachineOperatorBuilder::kFloat64Max | |
| 1078 MachineOperatorBuilder::kFloat64Min; |
| 1079 } |
1062 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) && | 1080 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) && |
1063 IsFp64Mode()) { | 1081 IsFp64Mode()) { |
1064 flags |= MachineOperatorBuilder::kFloat64RoundDown | | 1082 flags |= MachineOperatorBuilder::kFloat64RoundDown | |
1065 MachineOperatorBuilder::kFloat64RoundTruncate; | 1083 MachineOperatorBuilder::kFloat64RoundTruncate; |
1066 } | 1084 } |
1067 return flags; | 1085 return flags; |
1068 } | 1086 } |
1069 | 1087 |
1070 } // namespace compiler | 1088 } // namespace compiler |
1071 } // namespace internal | 1089 } // namespace internal |
1072 } // namespace v8 | 1090 } // namespace v8 |
OLD | NEW |