| 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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 break; | 404 break; |
| 405 case MachineRepresentation::kWord32: | 405 case MachineRepresentation::kWord32: |
| 406 opcode = load_rep.IsUnsigned() ? kMips64Lwu : kMips64Lw; | 406 opcode = load_rep.IsUnsigned() ? kMips64Lwu : kMips64Lw; |
| 407 break; | 407 break; |
| 408 case MachineRepresentation::kTaggedSigned: // Fall through. | 408 case MachineRepresentation::kTaggedSigned: // Fall through. |
| 409 case MachineRepresentation::kTaggedPointer: // Fall through. | 409 case MachineRepresentation::kTaggedPointer: // Fall through. |
| 410 case MachineRepresentation::kTagged: // Fall through. | 410 case MachineRepresentation::kTagged: // Fall through. |
| 411 case MachineRepresentation::kWord64: | 411 case MachineRepresentation::kWord64: |
| 412 opcode = kMips64Ld; | 412 opcode = kMips64Ld; |
| 413 break; | 413 break; |
| 414 case MachineRepresentation::kSimd128: // Fall through. | 414 case MachineRepresentation::kSimd128: |
| 415 opcode = kMips64MsaLd; |
| 416 break; |
| 415 case MachineRepresentation::kSimd1x4: // Fall through. | 417 case MachineRepresentation::kSimd1x4: // Fall through. |
| 416 case MachineRepresentation::kSimd1x8: // Fall through. | 418 case MachineRepresentation::kSimd1x8: // Fall through. |
| 417 case MachineRepresentation::kSimd1x16: // Fall through. | 419 case MachineRepresentation::kSimd1x16: // Fall through. |
| 418 case MachineRepresentation::kNone: | 420 case MachineRepresentation::kNone: |
| 419 UNREACHABLE(); | 421 UNREACHABLE(); |
| 420 return; | 422 return; |
| 421 } | 423 } |
| 422 | 424 |
| 423 EmitLoad(this, node, opcode); | 425 EmitLoad(this, node, opcode); |
| 424 } | 426 } |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 break; | 486 break; |
| 485 case MachineRepresentation::kWord32: | 487 case MachineRepresentation::kWord32: |
| 486 opcode = kMips64Sw; | 488 opcode = kMips64Sw; |
| 487 break; | 489 break; |
| 488 case MachineRepresentation::kTaggedSigned: // Fall through. | 490 case MachineRepresentation::kTaggedSigned: // Fall through. |
| 489 case MachineRepresentation::kTaggedPointer: // Fall through. | 491 case MachineRepresentation::kTaggedPointer: // Fall through. |
| 490 case MachineRepresentation::kTagged: // Fall through. | 492 case MachineRepresentation::kTagged: // Fall through. |
| 491 case MachineRepresentation::kWord64: | 493 case MachineRepresentation::kWord64: |
| 492 opcode = kMips64Sd; | 494 opcode = kMips64Sd; |
| 493 break; | 495 break; |
| 494 case MachineRepresentation::kSimd128: // Fall through. | 496 case MachineRepresentation::kSimd128: |
| 497 opcode = kMips64MsaSt; |
| 498 break; |
| 495 case MachineRepresentation::kSimd1x4: // Fall through. | 499 case MachineRepresentation::kSimd1x4: // Fall through. |
| 496 case MachineRepresentation::kSimd1x8: // Fall through. | 500 case MachineRepresentation::kSimd1x8: // Fall through. |
| 497 case MachineRepresentation::kSimd1x16: // Fall through. | 501 case MachineRepresentation::kSimd1x16: // Fall through. |
| 498 case MachineRepresentation::kNone: | 502 case MachineRepresentation::kNone: |
| 499 UNREACHABLE(); | 503 UNREACHABLE(); |
| 500 return; | 504 return; |
| 501 } | 505 } |
| 502 | 506 |
| 503 if (g.CanBeImmediate(index, opcode)) { | 507 if (g.CanBeImmediate(index, opcode)) { |
| 504 Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(), | 508 Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(), |
| (...skipping 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1778 break; | 1782 break; |
| 1779 case MachineRepresentation::kWord32: | 1783 case MachineRepresentation::kWord32: |
| 1780 opcode = load_rep.IsUnsigned() ? kMips64Ulwu : kMips64Ulw; | 1784 opcode = load_rep.IsUnsigned() ? kMips64Ulwu : kMips64Ulw; |
| 1781 break; | 1785 break; |
| 1782 case MachineRepresentation::kTaggedSigned: // Fall through. | 1786 case MachineRepresentation::kTaggedSigned: // Fall through. |
| 1783 case MachineRepresentation::kTaggedPointer: // Fall through. | 1787 case MachineRepresentation::kTaggedPointer: // Fall through. |
| 1784 case MachineRepresentation::kTagged: // Fall through. | 1788 case MachineRepresentation::kTagged: // Fall through. |
| 1785 case MachineRepresentation::kWord64: | 1789 case MachineRepresentation::kWord64: |
| 1786 opcode = kMips64Uld; | 1790 opcode = kMips64Uld; |
| 1787 break; | 1791 break; |
| 1788 case MachineRepresentation::kSimd128: // Fall through. | 1792 case MachineRepresentation::kSimd128: |
| 1793 opcode = kMips64MsaLd; |
| 1794 break; |
| 1789 case MachineRepresentation::kSimd1x4: // Fall through. | 1795 case MachineRepresentation::kSimd1x4: // Fall through. |
| 1790 case MachineRepresentation::kSimd1x8: // Fall through. | 1796 case MachineRepresentation::kSimd1x8: // Fall through. |
| 1791 case MachineRepresentation::kSimd1x16: // Fall through. | 1797 case MachineRepresentation::kSimd1x16: // Fall through. |
| 1792 case MachineRepresentation::kNone: | 1798 case MachineRepresentation::kNone: |
| 1793 UNREACHABLE(); | 1799 UNREACHABLE(); |
| 1794 return; | 1800 return; |
| 1795 } | 1801 } |
| 1796 | 1802 |
| 1797 if (g.CanBeImmediate(index, opcode)) { | 1803 if (g.CanBeImmediate(index, opcode)) { |
| 1798 Emit(opcode | AddressingModeField::encode(kMode_MRI), | 1804 Emit(opcode | AddressingModeField::encode(kMode_MRI), |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1831 break; | 1837 break; |
| 1832 case MachineRepresentation::kWord32: | 1838 case MachineRepresentation::kWord32: |
| 1833 opcode = kMips64Usw; | 1839 opcode = kMips64Usw; |
| 1834 break; | 1840 break; |
| 1835 case MachineRepresentation::kTaggedSigned: // Fall through. | 1841 case MachineRepresentation::kTaggedSigned: // Fall through. |
| 1836 case MachineRepresentation::kTaggedPointer: // Fall through. | 1842 case MachineRepresentation::kTaggedPointer: // Fall through. |
| 1837 case MachineRepresentation::kTagged: // Fall through. | 1843 case MachineRepresentation::kTagged: // Fall through. |
| 1838 case MachineRepresentation::kWord64: | 1844 case MachineRepresentation::kWord64: |
| 1839 opcode = kMips64Usd; | 1845 opcode = kMips64Usd; |
| 1840 break; | 1846 break; |
| 1841 case MachineRepresentation::kSimd128: // Fall through. | 1847 case MachineRepresentation::kSimd128: |
| 1848 opcode = kMips64MsaSt; |
| 1849 break; |
| 1842 case MachineRepresentation::kSimd1x4: // Fall through. | 1850 case MachineRepresentation::kSimd1x4: // Fall through. |
| 1843 case MachineRepresentation::kSimd1x8: // Fall through. | 1851 case MachineRepresentation::kSimd1x8: // Fall through. |
| 1844 case MachineRepresentation::kSimd1x16: // Fall through. | 1852 case MachineRepresentation::kSimd1x16: // Fall through. |
| 1845 case MachineRepresentation::kNone: | 1853 case MachineRepresentation::kNone: |
| 1846 UNREACHABLE(); | 1854 UNREACHABLE(); |
| 1847 return; | 1855 return; |
| 1848 } | 1856 } |
| 1849 | 1857 |
| 1850 if (g.CanBeImmediate(index, opcode)) { | 1858 if (g.CanBeImmediate(index, opcode)) { |
| 1851 Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(), | 1859 Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(), |
| (...skipping 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3086 } | 3094 } |
| 3087 | 3095 |
| 3088 void InstructionSelector::VisitS128Xor(Node* node) { | 3096 void InstructionSelector::VisitS128Xor(Node* node) { |
| 3089 VisitRRR(this, kMips64S128Xor, node); | 3097 VisitRRR(this, kMips64S128Xor, node); |
| 3090 } | 3098 } |
| 3091 | 3099 |
| 3092 void InstructionSelector::VisitS128Not(Node* node) { | 3100 void InstructionSelector::VisitS128Not(Node* node) { |
| 3093 VisitRR(this, kMips64S128Not, node); | 3101 VisitRR(this, kMips64S128Not, node); |
| 3094 } | 3102 } |
| 3095 | 3103 |
| 3104 void InstructionSelector::VisitS1x4And(Node* node) { |
| 3105 VisitRRR(this, kMips64S128And, node); |
| 3106 } |
| 3107 |
| 3108 void InstructionSelector::VisitS1x4Or(Node* node) { |
| 3109 VisitRRR(this, kMips64S128Or, node); |
| 3110 } |
| 3111 |
| 3112 void InstructionSelector::VisitS1x4Xor(Node* node) { |
| 3113 VisitRRR(this, kMips64S128Xor, node); |
| 3114 } |
| 3115 |
| 3116 void InstructionSelector::VisitS1x4Not(Node* node) { |
| 3117 VisitRR(this, kMips64S128Not, node); |
| 3118 } |
| 3119 |
| 3120 void InstructionSelector::VisitS1x4AnyTrue(Node* node) { |
| 3121 VisitRR(this, kMips64S1x4AnyTrue, node); |
| 3122 } |
| 3123 |
| 3124 void InstructionSelector::VisitS1x4AllTrue(Node* node) { |
| 3125 VisitRR(this, kMips64S1x4AllTrue, node); |
| 3126 } |
| 3127 |
| 3128 void InstructionSelector::VisitS1x8And(Node* node) { |
| 3129 VisitRRR(this, kMips64S128And, node); |
| 3130 } |
| 3131 |
| 3132 void InstructionSelector::VisitS1x8Or(Node* node) { |
| 3133 VisitRRR(this, kMips64S128Or, node); |
| 3134 } |
| 3135 |
| 3136 void InstructionSelector::VisitS1x8Xor(Node* node) { |
| 3137 VisitRRR(this, kMips64S128Xor, node); |
| 3138 } |
| 3139 |
| 3140 void InstructionSelector::VisitS1x8Not(Node* node) { |
| 3141 VisitRR(this, kMips64S128Not, node); |
| 3142 } |
| 3143 |
| 3144 void InstructionSelector::VisitS1x8AnyTrue(Node* node) { |
| 3145 VisitRR(this, kMips64S1x8AnyTrue, node); |
| 3146 } |
| 3147 |
| 3148 void InstructionSelector::VisitS1x8AllTrue(Node* node) { |
| 3149 VisitRR(this, kMips64S1x8AllTrue, node); |
| 3150 } |
| 3151 |
| 3152 void InstructionSelector::VisitS1x16And(Node* node) { |
| 3153 VisitRRR(this, kMips64S128And, node); |
| 3154 } |
| 3155 |
| 3156 void InstructionSelector::VisitS1x16Or(Node* node) { |
| 3157 VisitRRR(this, kMips64S128Or, node); |
| 3158 } |
| 3159 |
| 3160 void InstructionSelector::VisitS1x16Xor(Node* node) { |
| 3161 VisitRRR(this, kMips64S128Xor, node); |
| 3162 } |
| 3163 |
| 3164 void InstructionSelector::VisitS1x16Not(Node* node) { |
| 3165 VisitRR(this, kMips64S128Not, node); |
| 3166 } |
| 3167 |
| 3168 void InstructionSelector::VisitS1x16AnyTrue(Node* node) { |
| 3169 VisitRR(this, kMips64S1x16AnyTrue, node); |
| 3170 } |
| 3171 |
| 3172 void InstructionSelector::VisitS1x16AllTrue(Node* node) { |
| 3173 VisitRR(this, kMips64S1x16AllTrue, node); |
| 3174 } |
| 3175 |
| 3096 // static | 3176 // static |
| 3097 MachineOperatorBuilder::Flags | 3177 MachineOperatorBuilder::Flags |
| 3098 InstructionSelector::SupportedMachineOperatorFlags() { | 3178 InstructionSelector::SupportedMachineOperatorFlags() { |
| 3099 MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::kNoFlags; | 3179 MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::kNoFlags; |
| 3100 return flags | MachineOperatorBuilder::kWord32Ctz | | 3180 return flags | MachineOperatorBuilder::kWord32Ctz | |
| 3101 MachineOperatorBuilder::kWord64Ctz | | 3181 MachineOperatorBuilder::kWord64Ctz | |
| 3102 MachineOperatorBuilder::kWord32Popcnt | | 3182 MachineOperatorBuilder::kWord32Popcnt | |
| 3103 MachineOperatorBuilder::kWord64Popcnt | | 3183 MachineOperatorBuilder::kWord64Popcnt | |
| 3104 MachineOperatorBuilder::kWord32ShiftIsSafe | | 3184 MachineOperatorBuilder::kWord32ShiftIsSafe | |
| 3105 MachineOperatorBuilder::kInt32DivIsSafe | | 3185 MachineOperatorBuilder::kInt32DivIsSafe | |
| (...skipping 19 matching lines...) Expand all Loading... |
| 3125 } else { | 3205 } else { |
| 3126 DCHECK(kArchVariant == kMips64r2); | 3206 DCHECK(kArchVariant == kMips64r2); |
| 3127 return MachineOperatorBuilder::AlignmentRequirements:: | 3207 return MachineOperatorBuilder::AlignmentRequirements:: |
| 3128 NoUnalignedAccessSupport(); | 3208 NoUnalignedAccessSupport(); |
| 3129 } | 3209 } |
| 3130 } | 3210 } |
| 3131 | 3211 |
| 3132 } // namespace compiler | 3212 } // namespace compiler |
| 3133 } // namespace internal | 3213 } // namespace internal |
| 3134 } // namespace v8 | 3214 } // namespace v8 |
| OLD | NEW |