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) { | 455 void InstructionSelector::VisitFloat32Max(Node* node) { UNREACHABLE(); } |
456 DCHECK(kArchVariant == kMips32r6); | |
457 VisitRRR(this, kMipsMaxS, node); | |
458 } | |
459 | 456 |
460 | 457 |
461 void InstructionSelector::VisitFloat64Max(Node* node) { | 458 void InstructionSelector::VisitFloat64Max(Node* node) { UNREACHABLE(); } |
462 DCHECK(kArchVariant == kMips32r6); | |
463 VisitRRR(this, kMipsMaxD, node); | |
464 } | |
465 | 459 |
466 | 460 |
467 void InstructionSelector::VisitFloat32Min(Node* node) { | 461 void InstructionSelector::VisitFloat32Min(Node* node) { UNREACHABLE(); } |
468 DCHECK(kArchVariant == kMips32r6); | |
469 VisitRRR(this, kMipsMinS, node); | |
470 } | |
471 | 462 |
472 | 463 |
473 void InstructionSelector::VisitFloat64Min(Node* node) { | 464 void InstructionSelector::VisitFloat64Min(Node* node) { UNREACHABLE(); } |
474 DCHECK(kArchVariant == kMips32r6); | |
475 VisitRRR(this, kMipsMinD, node); | |
476 } | |
477 | 465 |
478 | 466 |
479 void InstructionSelector::VisitFloat32Abs(Node* node) { | 467 void InstructionSelector::VisitFloat32Abs(Node* node) { |
480 VisitRR(this, kMipsAbsS, node); | 468 VisitRR(this, kMipsAbsS, node); |
481 } | 469 } |
482 | 470 |
483 | 471 |
484 void InstructionSelector::VisitFloat64Abs(Node* node) { | 472 void InstructionSelector::VisitFloat64Abs(Node* node) { |
485 VisitRR(this, kMipsAbsD, node); | 473 VisitRR(this, kMipsAbsD, node); |
486 } | 474 } |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1088 Node* right = node->InputAt(1); | 1076 Node* right = node->InputAt(1); |
1089 Emit(kMipsFloat64InsertHighWord32, g.DefineSameAsFirst(node), | 1077 Emit(kMipsFloat64InsertHighWord32, g.DefineSameAsFirst(node), |
1090 g.UseRegister(left), g.UseRegister(right)); | 1078 g.UseRegister(left), g.UseRegister(right)); |
1091 } | 1079 } |
1092 | 1080 |
1093 | 1081 |
1094 // static | 1082 // static |
1095 MachineOperatorBuilder::Flags | 1083 MachineOperatorBuilder::Flags |
1096 InstructionSelector::SupportedMachineOperatorFlags() { | 1084 InstructionSelector::SupportedMachineOperatorFlags() { |
1097 MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::kNoFlags; | 1085 MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::kNoFlags; |
1098 if (IsMipsArchVariant(kMips32r6)) { | |
1099 flags |= MachineOperatorBuilder::kFloat32Max | | |
1100 MachineOperatorBuilder::kFloat32Min | | |
1101 MachineOperatorBuilder::kFloat64Max | | |
1102 MachineOperatorBuilder::kFloat64Min; | |
1103 } | |
1104 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) && | 1086 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) && |
1105 IsFp64Mode()) { | 1087 IsFp64Mode()) { |
1106 flags |= MachineOperatorBuilder::kFloat64RoundDown | | 1088 flags |= MachineOperatorBuilder::kFloat64RoundDown | |
1107 MachineOperatorBuilder::kFloat64RoundTruncate; | 1089 MachineOperatorBuilder::kFloat64RoundTruncate; |
1108 } | 1090 } |
1109 return flags; | 1091 return flags; |
1110 } | 1092 } |
1111 | 1093 |
1112 } // namespace compiler | 1094 } // namespace compiler |
1113 } // namespace internal | 1095 } // namespace internal |
1114 } // namespace v8 | 1096 } // namespace v8 |
OLD | NEW |