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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 } | 388 } |
389 } | 389 } |
390 VisitRRO(this, kMipsShr, node); | 390 VisitRRO(this, kMipsShr, node); |
391 } | 391 } |
392 | 392 |
393 | 393 |
394 void InstructionSelector::VisitWord32Sar(Node* node) { | 394 void InstructionSelector::VisitWord32Sar(Node* node) { |
395 VisitRRO(this, kMipsSar, node); | 395 VisitRRO(this, kMipsSar, node); |
396 } | 396 } |
397 | 397 |
398 void InstructionSelector::VisitInt32PairAdd(Node* node) { UNIMPLEMENTED(); } | 398 void InstructionSelector::VisitInt32PairAdd(Node* node) { |
| 399 MipsOperandGenerator g(this); |
399 | 400 |
400 void InstructionSelector::VisitInt32PairSub(Node* node) { UNIMPLEMENTED(); } | 401 // We use UseUniqueRegister here to avoid register sharing with the output |
| 402 // register. |
| 403 InstructionOperand inputs[] = {g.UseUniqueRegister(node->InputAt(0)), |
| 404 g.UseUniqueRegister(node->InputAt(1)), |
| 405 g.UseUniqueRegister(node->InputAt(2)), |
| 406 g.UseUniqueRegister(node->InputAt(3))}; |
| 407 InstructionOperand outputs[] = { |
| 408 g.DefineAsRegister(node), |
| 409 g.DefineAsRegister(NodeProperties::FindProjection(node, 1))}; |
| 410 Emit(kMipsAddPair, 2, outputs, 4, inputs); |
| 411 } |
| 412 |
| 413 void InstructionSelector::VisitInt32PairSub(Node* node) { |
| 414 MipsOperandGenerator g(this); |
| 415 |
| 416 // We use UseUniqueRegister here to avoid register sharing with the output |
| 417 // register. |
| 418 InstructionOperand inputs[] = {g.UseUniqueRegister(node->InputAt(0)), |
| 419 g.UseUniqueRegister(node->InputAt(1)), |
| 420 g.UseUniqueRegister(node->InputAt(2)), |
| 421 g.UseUniqueRegister(node->InputAt(3))}; |
| 422 InstructionOperand outputs[] = { |
| 423 g.DefineAsRegister(node), |
| 424 g.DefineAsRegister(NodeProperties::FindProjection(node, 1))}; |
| 425 Emit(kMipsSubPair, 2, outputs, 4, inputs); |
| 426 } |
401 | 427 |
402 void InstructionSelector::VisitInt32PairMul(Node* node) { UNIMPLEMENTED(); } | 428 void InstructionSelector::VisitInt32PairMul(Node* node) { UNIMPLEMENTED(); } |
403 | 429 |
404 void InstructionSelector::VisitWord32PairShl(Node* node) { UNIMPLEMENTED(); } | 430 void InstructionSelector::VisitWord32PairShl(Node* node) { |
| 431 MipsOperandGenerator g(this); |
| 432 Int32Matcher m(node->InputAt(2)); |
| 433 InstructionOperand shift_operand; |
| 434 if (m.HasValue()) { |
| 435 shift_operand = g.UseImmediate(m.node()); |
| 436 } else { |
| 437 shift_operand = g.UseUniqueRegister(m.node()); |
| 438 } |
405 | 439 |
406 void InstructionSelector::VisitWord32PairShr(Node* node) { UNIMPLEMENTED(); } | 440 // We use UseUniqueRegister here to avoid register sharing with the output |
| 441 // register. |
| 442 InstructionOperand inputs[] = {g.UseUniqueRegister(node->InputAt(0)), |
| 443 g.UseUniqueRegister(node->InputAt(1)), |
| 444 shift_operand}; |
407 | 445 |
408 void InstructionSelector::VisitWord32PairSar(Node* node) { UNIMPLEMENTED(); } | 446 InstructionOperand outputs[] = { |
| 447 g.DefineAsRegister(node), |
| 448 g.DefineAsRegister(NodeProperties::FindProjection(node, 1))}; |
| 449 |
| 450 Emit(kMipsShlPair, 2, outputs, 3, inputs); |
| 451 } |
| 452 |
| 453 void InstructionSelector::VisitWord32PairShr(Node* node) { |
| 454 MipsOperandGenerator g(this); |
| 455 Int32Matcher m(node->InputAt(2)); |
| 456 InstructionOperand shift_operand; |
| 457 if (m.HasValue()) { |
| 458 shift_operand = g.UseImmediate(m.node()); |
| 459 } else { |
| 460 shift_operand = g.UseUniqueRegister(m.node()); |
| 461 } |
| 462 |
| 463 // We use UseUniqueRegister here to avoid register sharing with the output |
| 464 // register. |
| 465 InstructionOperand inputs[] = {g.UseUniqueRegister(node->InputAt(0)), |
| 466 g.UseUniqueRegister(node->InputAt(1)), |
| 467 shift_operand}; |
| 468 |
| 469 InstructionOperand outputs[] = { |
| 470 g.DefineAsRegister(node), |
| 471 g.DefineAsRegister(NodeProperties::FindProjection(node, 1))}; |
| 472 |
| 473 Emit(kMipsShrPair, 2, outputs, 3, inputs); |
| 474 } |
| 475 |
| 476 void InstructionSelector::VisitWord32PairSar(Node* node) { |
| 477 MipsOperandGenerator g(this); |
| 478 Int32Matcher m(node->InputAt(2)); |
| 479 InstructionOperand shift_operand; |
| 480 if (m.HasValue()) { |
| 481 shift_operand = g.UseImmediate(m.node()); |
| 482 } else { |
| 483 shift_operand = g.UseUniqueRegister(m.node()); |
| 484 } |
| 485 |
| 486 // We use UseUniqueRegister here to avoid register sharing with the output |
| 487 // register. |
| 488 InstructionOperand inputs[] = {g.UseUniqueRegister(node->InputAt(0)), |
| 489 g.UseUniqueRegister(node->InputAt(1)), |
| 490 shift_operand}; |
| 491 |
| 492 InstructionOperand outputs[] = { |
| 493 g.DefineAsRegister(node), |
| 494 g.DefineAsRegister(NodeProperties::FindProjection(node, 1))}; |
| 495 |
| 496 Emit(kMipsSarPair, 2, outputs, 3, inputs); |
| 497 } |
409 | 498 |
410 void InstructionSelector::VisitWord32Ror(Node* node) { | 499 void InstructionSelector::VisitWord32Ror(Node* node) { |
411 VisitRRO(this, kMipsRor, node); | 500 VisitRRO(this, kMipsRor, node); |
412 } | 501 } |
413 | 502 |
414 | 503 |
415 void InstructionSelector::VisitWord32Clz(Node* node) { | 504 void InstructionSelector::VisitWord32Clz(Node* node) { |
416 VisitRR(this, kMipsClz, node); | 505 VisitRR(this, kMipsClz, node); |
417 } | 506 } |
418 | 507 |
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1398 MachineOperatorBuilder::kFloat32Max | | 1487 MachineOperatorBuilder::kFloat32Max | |
1399 MachineOperatorBuilder::kFloat32RoundDown | | 1488 MachineOperatorBuilder::kFloat32RoundDown | |
1400 MachineOperatorBuilder::kFloat32RoundUp | | 1489 MachineOperatorBuilder::kFloat32RoundUp | |
1401 MachineOperatorBuilder::kFloat32RoundTruncate | | 1490 MachineOperatorBuilder::kFloat32RoundTruncate | |
1402 MachineOperatorBuilder::kFloat32RoundTiesEven; | 1491 MachineOperatorBuilder::kFloat32RoundTiesEven; |
1403 } | 1492 } |
1404 | 1493 |
1405 } // namespace compiler | 1494 } // namespace compiler |
1406 } // namespace internal | 1495 } // namespace internal |
1407 } // namespace v8 | 1496 } // namespace v8 |
OLD | NEW |