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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 void InstructionSelector::VisitUint32MulHigh(Node* node) { | 435 void InstructionSelector::VisitUint32MulHigh(Node* node) { |
436 MipsOperandGenerator g(this); | 436 MipsOperandGenerator g(this); |
437 Emit(kMipsMulHighU, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0)), | 437 Emit(kMipsMulHighU, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0)), |
438 g.UseRegister(node->InputAt(1))); | 438 g.UseRegister(node->InputAt(1))); |
439 } | 439 } |
440 | 440 |
441 | 441 |
442 void InstructionSelector::VisitInt32Div(Node* node) { | 442 void InstructionSelector::VisitInt32Div(Node* node) { |
443 MipsOperandGenerator g(this); | 443 MipsOperandGenerator g(this); |
444 Int32BinopMatcher m(node); | 444 Int32BinopMatcher m(node); |
445 Emit(kMipsDiv, g.DefineAsRegister(node), g.UseRegister(m.left().node()), | 445 Emit(kMipsDiv, g.DefineSameAsFirst(node), g.UseRegister(m.left().node()), |
446 g.UseRegister(m.right().node())); | 446 g.UseRegister(m.right().node())); |
447 } | 447 } |
448 | 448 |
449 | 449 |
450 void InstructionSelector::VisitUint32Div(Node* node) { | 450 void InstructionSelector::VisitUint32Div(Node* node) { |
451 MipsOperandGenerator g(this); | 451 MipsOperandGenerator g(this); |
452 Int32BinopMatcher m(node); | 452 Int32BinopMatcher m(node); |
453 Emit(kMipsDivU, g.DefineAsRegister(node), g.UseRegister(m.left().node()), | 453 Emit(kMipsDivU, g.DefineSameAsFirst(node), g.UseRegister(m.left().node()), |
454 g.UseRegister(m.right().node())); | 454 g.UseRegister(m.right().node())); |
455 } | 455 } |
456 | 456 |
457 | 457 |
458 void InstructionSelector::VisitInt32Mod(Node* node) { | 458 void InstructionSelector::VisitInt32Mod(Node* node) { |
459 MipsOperandGenerator g(this); | 459 MipsOperandGenerator g(this); |
460 Int32BinopMatcher m(node); | 460 Int32BinopMatcher m(node); |
461 Emit(kMipsMod, g.DefineAsRegister(node), g.UseRegister(m.left().node()), | 461 Emit(kMipsMod, g.DefineAsRegister(node), g.UseRegister(m.left().node()), |
462 g.UseRegister(m.right().node())); | 462 g.UseRegister(m.right().node())); |
463 } | 463 } |
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1212 MachineOperatorBuilder::Flags | 1212 MachineOperatorBuilder::Flags |
1213 InstructionSelector::SupportedMachineOperatorFlags() { | 1213 InstructionSelector::SupportedMachineOperatorFlags() { |
1214 MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::kNoFlags; | 1214 MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::kNoFlags; |
1215 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) && | 1215 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) && |
1216 IsFp64Mode()) { | 1216 IsFp64Mode()) { |
1217 flags |= MachineOperatorBuilder::kFloat64RoundDown | | 1217 flags |= MachineOperatorBuilder::kFloat64RoundDown | |
1218 MachineOperatorBuilder::kFloat64RoundUp | | 1218 MachineOperatorBuilder::kFloat64RoundUp | |
1219 MachineOperatorBuilder::kFloat64RoundTruncate | | 1219 MachineOperatorBuilder::kFloat64RoundTruncate | |
1220 MachineOperatorBuilder::kFloat64RoundTiesEven; | 1220 MachineOperatorBuilder::kFloat64RoundTiesEven; |
1221 } | 1221 } |
1222 return flags | MachineOperatorBuilder::kWord32ShiftIsSafe | | 1222 return flags | MachineOperatorBuilder::kInt32DivIsSafe | |
| 1223 MachineOperatorBuilder::kUint32DivIsSafe | |
| 1224 MachineOperatorBuilder::kWord32ShiftIsSafe | |
1223 MachineOperatorBuilder::kFloat64Min | | 1225 MachineOperatorBuilder::kFloat64Min | |
1224 MachineOperatorBuilder::kFloat64Max | | 1226 MachineOperatorBuilder::kFloat64Max | |
1225 MachineOperatorBuilder::kFloat32Min | | 1227 MachineOperatorBuilder::kFloat32Min | |
1226 MachineOperatorBuilder::kFloat32Max | | 1228 MachineOperatorBuilder::kFloat32Max | |
1227 MachineOperatorBuilder::kFloat32RoundDown | | 1229 MachineOperatorBuilder::kFloat32RoundDown | |
1228 MachineOperatorBuilder::kFloat32RoundUp | | 1230 MachineOperatorBuilder::kFloat32RoundUp | |
1229 MachineOperatorBuilder::kFloat32RoundTruncate | | 1231 MachineOperatorBuilder::kFloat32RoundTruncate | |
1230 MachineOperatorBuilder::kFloat32RoundTiesEven; | 1232 MachineOperatorBuilder::kFloat32RoundTiesEven; |
1231 } | 1233 } |
1232 | 1234 |
1233 } // namespace compiler | 1235 } // namespace compiler |
1234 } // namespace internal | 1236 } // namespace internal |
1235 } // namespace v8 | 1237 } // namespace v8 |
OLD | NEW |