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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 break; | 387 break; |
388 case MachineRepresentation::kWord32: | 388 case MachineRepresentation::kWord32: |
389 opcode = load_rep.IsUnsigned() ? kMips64Lwu : kMips64Lw; | 389 opcode = load_rep.IsUnsigned() ? kMips64Lwu : kMips64Lw; |
390 break; | 390 break; |
391 case MachineRepresentation::kTaggedSigned: // Fall through. | 391 case MachineRepresentation::kTaggedSigned: // Fall through. |
392 case MachineRepresentation::kTaggedPointer: // Fall through. | 392 case MachineRepresentation::kTaggedPointer: // Fall through. |
393 case MachineRepresentation::kTagged: // Fall through. | 393 case MachineRepresentation::kTagged: // Fall through. |
394 case MachineRepresentation::kWord64: | 394 case MachineRepresentation::kWord64: |
395 opcode = kMips64Ld; | 395 opcode = kMips64Ld; |
396 break; | 396 break; |
397 case MachineRepresentation::kSimd128: // Fall through. | 397 case MachineRepresentation::kSimd128: |
| 398 opcode = kMips64MsaLd; |
| 399 break; |
398 case MachineRepresentation::kSimd1x4: // Fall through. | 400 case MachineRepresentation::kSimd1x4: // Fall through. |
399 case MachineRepresentation::kSimd1x8: // Fall through. | 401 case MachineRepresentation::kSimd1x8: // Fall through. |
400 case MachineRepresentation::kSimd1x16: // Fall through. | 402 case MachineRepresentation::kSimd1x16: // Fall through. |
401 case MachineRepresentation::kNone: | 403 case MachineRepresentation::kNone: |
402 UNREACHABLE(); | 404 UNREACHABLE(); |
403 return; | 405 return; |
404 } | 406 } |
405 | 407 |
406 EmitLoad(this, node, opcode); | 408 EmitLoad(this, node, opcode); |
407 } | 409 } |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 break; | 469 break; |
468 case MachineRepresentation::kWord32: | 470 case MachineRepresentation::kWord32: |
469 opcode = kMips64Sw; | 471 opcode = kMips64Sw; |
470 break; | 472 break; |
471 case MachineRepresentation::kTaggedSigned: // Fall through. | 473 case MachineRepresentation::kTaggedSigned: // Fall through. |
472 case MachineRepresentation::kTaggedPointer: // Fall through. | 474 case MachineRepresentation::kTaggedPointer: // Fall through. |
473 case MachineRepresentation::kTagged: // Fall through. | 475 case MachineRepresentation::kTagged: // Fall through. |
474 case MachineRepresentation::kWord64: | 476 case MachineRepresentation::kWord64: |
475 opcode = kMips64Sd; | 477 opcode = kMips64Sd; |
476 break; | 478 break; |
477 case MachineRepresentation::kSimd128: // Fall through. | 479 case MachineRepresentation::kSimd128: |
| 480 opcode = kMips64MsaSt; |
| 481 break; |
478 case MachineRepresentation::kSimd1x4: // Fall through. | 482 case MachineRepresentation::kSimd1x4: // Fall through. |
479 case MachineRepresentation::kSimd1x8: // Fall through. | 483 case MachineRepresentation::kSimd1x8: // Fall through. |
480 case MachineRepresentation::kSimd1x16: // Fall through. | 484 case MachineRepresentation::kSimd1x16: // Fall through. |
481 case MachineRepresentation::kNone: | 485 case MachineRepresentation::kNone: |
482 UNREACHABLE(); | 486 UNREACHABLE(); |
483 return; | 487 return; |
484 } | 488 } |
485 | 489 |
486 if (g.CanBeImmediate(index, opcode)) { | 490 if (g.CanBeImmediate(index, opcode)) { |
487 Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(), | 491 Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(), |
(...skipping 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1761 break; | 1765 break; |
1762 case MachineRepresentation::kWord32: | 1766 case MachineRepresentation::kWord32: |
1763 opcode = load_rep.IsUnsigned() ? kMips64Ulwu : kMips64Ulw; | 1767 opcode = load_rep.IsUnsigned() ? kMips64Ulwu : kMips64Ulw; |
1764 break; | 1768 break; |
1765 case MachineRepresentation::kTaggedSigned: // Fall through. | 1769 case MachineRepresentation::kTaggedSigned: // Fall through. |
1766 case MachineRepresentation::kTaggedPointer: // Fall through. | 1770 case MachineRepresentation::kTaggedPointer: // Fall through. |
1767 case MachineRepresentation::kTagged: // Fall through. | 1771 case MachineRepresentation::kTagged: // Fall through. |
1768 case MachineRepresentation::kWord64: | 1772 case MachineRepresentation::kWord64: |
1769 opcode = kMips64Uld; | 1773 opcode = kMips64Uld; |
1770 break; | 1774 break; |
1771 case MachineRepresentation::kSimd128: // Fall through. | 1775 case MachineRepresentation::kSimd128: |
| 1776 opcode = kMips64MsaLd; |
| 1777 break; |
1772 case MachineRepresentation::kSimd1x4: // Fall through. | 1778 case MachineRepresentation::kSimd1x4: // Fall through. |
1773 case MachineRepresentation::kSimd1x8: // Fall through. | 1779 case MachineRepresentation::kSimd1x8: // Fall through. |
1774 case MachineRepresentation::kSimd1x16: // Fall through. | 1780 case MachineRepresentation::kSimd1x16: // Fall through. |
1775 case MachineRepresentation::kNone: | 1781 case MachineRepresentation::kNone: |
1776 UNREACHABLE(); | 1782 UNREACHABLE(); |
1777 return; | 1783 return; |
1778 } | 1784 } |
1779 | 1785 |
1780 if (g.CanBeImmediate(index, opcode)) { | 1786 if (g.CanBeImmediate(index, opcode)) { |
1781 Emit(opcode | AddressingModeField::encode(kMode_MRI), | 1787 Emit(opcode | AddressingModeField::encode(kMode_MRI), |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1814 break; | 1820 break; |
1815 case MachineRepresentation::kWord32: | 1821 case MachineRepresentation::kWord32: |
1816 opcode = kMips64Usw; | 1822 opcode = kMips64Usw; |
1817 break; | 1823 break; |
1818 case MachineRepresentation::kTaggedSigned: // Fall through. | 1824 case MachineRepresentation::kTaggedSigned: // Fall through. |
1819 case MachineRepresentation::kTaggedPointer: // Fall through. | 1825 case MachineRepresentation::kTaggedPointer: // Fall through. |
1820 case MachineRepresentation::kTagged: // Fall through. | 1826 case MachineRepresentation::kTagged: // Fall through. |
1821 case MachineRepresentation::kWord64: | 1827 case MachineRepresentation::kWord64: |
1822 opcode = kMips64Usd; | 1828 opcode = kMips64Usd; |
1823 break; | 1829 break; |
1824 case MachineRepresentation::kSimd128: // Fall through. | 1830 case MachineRepresentation::kSimd128: |
| 1831 opcode = kMips64MsaSt; |
| 1832 break; |
1825 case MachineRepresentation::kSimd1x4: // Fall through. | 1833 case MachineRepresentation::kSimd1x4: // Fall through. |
1826 case MachineRepresentation::kSimd1x8: // Fall through. | 1834 case MachineRepresentation::kSimd1x8: // Fall through. |
1827 case MachineRepresentation::kSimd1x16: // Fall through. | 1835 case MachineRepresentation::kSimd1x16: // Fall through. |
1828 case MachineRepresentation::kNone: | 1836 case MachineRepresentation::kNone: |
1829 UNREACHABLE(); | 1837 UNREACHABLE(); |
1830 return; | 1838 return; |
1831 } | 1839 } |
1832 | 1840 |
1833 if (g.CanBeImmediate(index, opcode)) { | 1841 if (g.CanBeImmediate(index, opcode)) { |
1834 Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(), | 1842 Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(), |
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2719 } | 2727 } |
2720 | 2728 |
2721 void InstructionSelector::VisitF32x4SConvertI32x4(Node* node) { | 2729 void InstructionSelector::VisitF32x4SConvertI32x4(Node* node) { |
2722 VisitRR(this, kMips64F32x4SConvertI32x4, node); | 2730 VisitRR(this, kMips64F32x4SConvertI32x4, node); |
2723 } | 2731 } |
2724 | 2732 |
2725 void InstructionSelector::VisitF32x4UConvertI32x4(Node* node) { | 2733 void InstructionSelector::VisitF32x4UConvertI32x4(Node* node) { |
2726 VisitRR(this, kMips64F32x4UConvertI32x4, node); | 2734 VisitRR(this, kMips64F32x4UConvertI32x4, node); |
2727 } | 2735 } |
2728 | 2736 |
| 2737 void InstructionSelector::VisitS1x4And(Node* node) { |
| 2738 VisitRRR(this, kMips64S128And, node); |
| 2739 } |
| 2740 |
| 2741 void InstructionSelector::VisitS1x4Or(Node* node) { |
| 2742 VisitRRR(this, kMips64S128Or, node); |
| 2743 } |
| 2744 |
| 2745 void InstructionSelector::VisitS1x4Xor(Node* node) { |
| 2746 VisitRRR(this, kMips64S128Xor, node); |
| 2747 } |
| 2748 |
| 2749 void InstructionSelector::VisitS1x4Not(Node* node) { |
| 2750 VisitRR(this, kMips64S128Not, node); |
| 2751 } |
| 2752 |
| 2753 void InstructionSelector::VisitS1x4AnyTrue(Node* node) { |
| 2754 VisitRR(this, kMips64S1x4AnyTrue, node); |
| 2755 } |
| 2756 |
| 2757 void InstructionSelector::VisitS1x4AllTrue(Node* node) { |
| 2758 VisitRR(this, kMips64S1x4AllTrue, node); |
| 2759 } |
| 2760 |
| 2761 void InstructionSelector::VisitS1x8And(Node* node) { |
| 2762 VisitRRR(this, kMips64S128And, node); |
| 2763 } |
| 2764 |
| 2765 void InstructionSelector::VisitS1x8Or(Node* node) { |
| 2766 VisitRRR(this, kMips64S128Or, node); |
| 2767 } |
| 2768 |
| 2769 void InstructionSelector::VisitS1x8Xor(Node* node) { |
| 2770 VisitRRR(this, kMips64S128Xor, node); |
| 2771 } |
| 2772 |
| 2773 void InstructionSelector::VisitS1x8Not(Node* node) { |
| 2774 VisitRR(this, kMips64S128Not, node); |
| 2775 } |
| 2776 |
| 2777 void InstructionSelector::VisitS1x8AnyTrue(Node* node) { |
| 2778 VisitRR(this, kMips64S1x8AnyTrue, node); |
| 2779 } |
| 2780 |
| 2781 void InstructionSelector::VisitS1x8AllTrue(Node* node) { |
| 2782 VisitRR(this, kMips64S1x8AllTrue, node); |
| 2783 } |
| 2784 |
| 2785 void InstructionSelector::VisitS1x16And(Node* node) { |
| 2786 VisitRRR(this, kMips64S128And, node); |
| 2787 } |
| 2788 |
| 2789 void InstructionSelector::VisitS1x16Or(Node* node) { |
| 2790 VisitRRR(this, kMips64S128Or, node); |
| 2791 } |
| 2792 |
| 2793 void InstructionSelector::VisitS1x16Xor(Node* node) { |
| 2794 VisitRRR(this, kMips64S128Xor, node); |
| 2795 } |
| 2796 |
| 2797 void InstructionSelector::VisitS1x16Not(Node* node) { |
| 2798 VisitRR(this, kMips64S128Not, node); |
| 2799 } |
| 2800 |
| 2801 void InstructionSelector::VisitS1x16AnyTrue(Node* node) { |
| 2802 VisitRR(this, kMips64S1x16AnyTrue, node); |
| 2803 } |
| 2804 |
| 2805 void InstructionSelector::VisitS1x16AllTrue(Node* node) { |
| 2806 VisitRR(this, kMips64S1x16AllTrue, node); |
| 2807 } |
| 2808 |
2729 // static | 2809 // static |
2730 MachineOperatorBuilder::Flags | 2810 MachineOperatorBuilder::Flags |
2731 InstructionSelector::SupportedMachineOperatorFlags() { | 2811 InstructionSelector::SupportedMachineOperatorFlags() { |
2732 MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::kNoFlags; | 2812 MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::kNoFlags; |
2733 return flags | MachineOperatorBuilder::kWord32Ctz | | 2813 return flags | MachineOperatorBuilder::kWord32Ctz | |
2734 MachineOperatorBuilder::kWord64Ctz | | 2814 MachineOperatorBuilder::kWord64Ctz | |
2735 MachineOperatorBuilder::kWord32Popcnt | | 2815 MachineOperatorBuilder::kWord32Popcnt | |
2736 MachineOperatorBuilder::kWord64Popcnt | | 2816 MachineOperatorBuilder::kWord64Popcnt | |
2737 MachineOperatorBuilder::kWord32ShiftIsSafe | | 2817 MachineOperatorBuilder::kWord32ShiftIsSafe | |
2738 MachineOperatorBuilder::kInt32DivIsSafe | | 2818 MachineOperatorBuilder::kInt32DivIsSafe | |
(...skipping 19 matching lines...) Expand all Loading... |
2758 } else { | 2838 } else { |
2759 DCHECK(kArchVariant == kMips64r2); | 2839 DCHECK(kArchVariant == kMips64r2); |
2760 return MachineOperatorBuilder::AlignmentRequirements:: | 2840 return MachineOperatorBuilder::AlignmentRequirements:: |
2761 NoUnalignedAccessSupport(); | 2841 NoUnalignedAccessSupport(); |
2762 } | 2842 } |
2763 } | 2843 } |
2764 | 2844 |
2765 } // namespace compiler | 2845 } // namespace compiler |
2766 } // namespace internal | 2846 } // namespace internal |
2767 } // namespace v8 | 2847 } // namespace v8 |
OLD | NEW |