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))}; |
401 | 407 |
402 void InstructionSelector::VisitWord32PairShl(Node* node) { UNIMPLEMENTED(); } | 408 InstructionOperand outputs[] = { |
| 409 g.DefineAsRegister(node), |
| 410 g.DefineAsRegister(NodeProperties::FindProjection(node, 1))}; |
403 | 411 |
404 void InstructionSelector::VisitWord32PairShr(Node* node) { UNIMPLEMENTED(); } | 412 Emit(kMipsAddPair, 2, outputs, 4, inputs); |
| 413 } |
405 | 414 |
406 void InstructionSelector::VisitWord32PairSar(Node* node) { UNIMPLEMENTED(); } | 415 void InstructionSelector::VisitInt32PairSub(Node* node) { |
| 416 MipsOperandGenerator g(this); |
| 417 |
| 418 // We use UseUniqueRegister here to avoid register sharing with the output |
| 419 // register. |
| 420 InstructionOperand inputs[] = {g.UseUniqueRegister(node->InputAt(0)), |
| 421 g.UseUniqueRegister(node->InputAt(1)), |
| 422 g.UseUniqueRegister(node->InputAt(2)), |
| 423 g.UseUniqueRegister(node->InputAt(3))}; |
| 424 InstructionOperand outputs[] = { |
| 425 g.DefineAsRegister(node), |
| 426 g.DefineAsRegister(NodeProperties::FindProjection(node, 1))}; |
| 427 Emit(kMipsSubPair, 2, outputs, 4, inputs); |
| 428 } |
| 429 |
| 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 } |
| 439 |
| 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}; |
| 445 |
| 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 } |
407 | 498 |
408 void InstructionSelector::VisitWord32Ror(Node* node) { | 499 void InstructionSelector::VisitWord32Ror(Node* node) { |
409 VisitRRO(this, kMipsRor, node); | 500 VisitRRO(this, kMipsRor, node); |
410 } | 501 } |
411 | 502 |
412 | 503 |
413 void InstructionSelector::VisitWord32Clz(Node* node) { | 504 void InstructionSelector::VisitWord32Clz(Node* node) { |
414 VisitRR(this, kMipsClz, node); | 505 VisitRR(this, kMipsClz, node); |
415 } | 506 } |
416 | 507 |
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1396 MachineOperatorBuilder::kFloat32Max | | 1487 MachineOperatorBuilder::kFloat32Max | |
1397 MachineOperatorBuilder::kFloat32RoundDown | | 1488 MachineOperatorBuilder::kFloat32RoundDown | |
1398 MachineOperatorBuilder::kFloat32RoundUp | | 1489 MachineOperatorBuilder::kFloat32RoundUp | |
1399 MachineOperatorBuilder::kFloat32RoundTruncate | | 1490 MachineOperatorBuilder::kFloat32RoundTruncate | |
1400 MachineOperatorBuilder::kFloat32RoundTiesEven; | 1491 MachineOperatorBuilder::kFloat32RoundTiesEven; |
1401 } | 1492 } |
1402 | 1493 |
1403 } // namespace compiler | 1494 } // namespace compiler |
1404 } // namespace internal | 1495 } // namespace internal |
1405 } // namespace v8 | 1496 } // namespace v8 |
OLD | NEW |