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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 node->ReplaceInput(0, in1); | 105 node->ReplaceInput(0, in1); |
106 node->ReplaceInput(1, in0); | 106 node->ReplaceInput(1, in0); |
107 } | 107 } |
108 // Use DefineSameAsFirst for binary ops that clobber their inputs, e.g. the | 108 // Use DefineSameAsFirst for binary ops that clobber their inputs, e.g. the |
109 // NEON vzip, vuzp, and vtrn instructions. | 109 // NEON vzip, vuzp, and vtrn instructions. |
110 selector->Emit(opcode, g.DefineSameAsFirst(node), | 110 selector->Emit(opcode, g.DefineSameAsFirst(node), |
111 g.UseRegister(node->InputAt(0)), | 111 g.UseRegister(node->InputAt(0)), |
112 g.UseRegister(node->InputAt(1))); | 112 g.UseRegister(node->InputAt(1))); |
113 } | 113 } |
114 | 114 |
115 void VisitRRRR(InstructionSelector* selector, ArchOpcode opcode, Node* node) { | |
116 ArmOperandGenerator g(selector); | |
117 // Use DefineSameAsFirst for ternary ops that clobber their first input, | |
118 // e.g. the NEON vbsl instruction. | |
119 selector->Emit( | |
120 opcode, g.DefineSameAsFirst(node), g.UseRegister(node->InputAt(0)), | |
121 g.UseRegister(node->InputAt(1)), g.UseRegister(node->InputAt(2))); | |
122 } | |
123 | |
124 void VisitRRI(InstructionSelector* selector, ArchOpcode opcode, Node* node) { | 115 void VisitRRI(InstructionSelector* selector, ArchOpcode opcode, Node* node) { |
125 ArmOperandGenerator g(selector); | 116 ArmOperandGenerator g(selector); |
126 int32_t imm = OpParameter<int32_t>(node); | 117 int32_t imm = OpParameter<int32_t>(node); |
127 selector->Emit(opcode, g.DefineAsRegister(node), | 118 selector->Emit(opcode, g.DefineAsRegister(node), |
128 g.UseRegister(node->InputAt(0)), g.UseImmediate(imm)); | 119 g.UseRegister(node->InputAt(0)), g.UseImmediate(imm)); |
129 } | 120 } |
130 | 121 |
131 void VisitRRIR(InstructionSelector* selector, ArchOpcode opcode, Node* node) { | 122 void VisitRRIR(InstructionSelector* selector, ArchOpcode opcode, Node* node) { |
132 ArmOperandGenerator g(selector); | 123 ArmOperandGenerator g(selector); |
133 int32_t imm = OpParameter<int32_t>(node); | 124 int32_t imm = OpParameter<int32_t>(node); |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 case MachineRepresentation::kTaggedSigned: // Fall through. | 443 case MachineRepresentation::kTaggedSigned: // Fall through. |
453 case MachineRepresentation::kTaggedPointer: // Fall through. | 444 case MachineRepresentation::kTaggedPointer: // Fall through. |
454 case MachineRepresentation::kTagged: // Fall through. | 445 case MachineRepresentation::kTagged: // Fall through. |
455 case MachineRepresentation::kWord32: | 446 case MachineRepresentation::kWord32: |
456 opcode = kArmLdr; | 447 opcode = kArmLdr; |
457 break; | 448 break; |
458 case MachineRepresentation::kSimd128: | 449 case MachineRepresentation::kSimd128: |
459 opcode = kArmVld1S128; | 450 opcode = kArmVld1S128; |
460 break; | 451 break; |
461 case MachineRepresentation::kWord64: // Fall through. | 452 case MachineRepresentation::kWord64: // Fall through. |
462 case MachineRepresentation::kSimd1x4: // Fall through. | |
463 case MachineRepresentation::kSimd1x8: // Fall through. | |
464 case MachineRepresentation::kSimd1x16: // Fall through. | |
465 case MachineRepresentation::kNone: | 453 case MachineRepresentation::kNone: |
466 UNREACHABLE(); | 454 UNREACHABLE(); |
467 return; | 455 return; |
468 } | 456 } |
469 | 457 |
470 InstructionOperand output = g.DefineAsRegister(node); | 458 InstructionOperand output = g.DefineAsRegister(node); |
471 EmitLoad(this, opcode, &output, base, index); | 459 EmitLoad(this, opcode, &output, base, index); |
472 } | 460 } |
473 | 461 |
474 void InstructionSelector::VisitProtectedLoad(Node* node) { | 462 void InstructionSelector::VisitProtectedLoad(Node* node) { |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 case MachineRepresentation::kTaggedSigned: // Fall through. | 530 case MachineRepresentation::kTaggedSigned: // Fall through. |
543 case MachineRepresentation::kTaggedPointer: // Fall through. | 531 case MachineRepresentation::kTaggedPointer: // Fall through. |
544 case MachineRepresentation::kTagged: // Fall through. | 532 case MachineRepresentation::kTagged: // Fall through. |
545 case MachineRepresentation::kWord32: | 533 case MachineRepresentation::kWord32: |
546 opcode = kArmStr; | 534 opcode = kArmStr; |
547 break; | 535 break; |
548 case MachineRepresentation::kSimd128: | 536 case MachineRepresentation::kSimd128: |
549 opcode = kArmVst1S128; | 537 opcode = kArmVst1S128; |
550 break; | 538 break; |
551 case MachineRepresentation::kWord64: // Fall through. | 539 case MachineRepresentation::kWord64: // Fall through. |
552 case MachineRepresentation::kSimd1x4: // Fall through. | |
553 case MachineRepresentation::kSimd1x8: // Fall through. | |
554 case MachineRepresentation::kSimd1x16: // Fall through. | |
555 case MachineRepresentation::kNone: | 540 case MachineRepresentation::kNone: |
556 UNREACHABLE(); | 541 UNREACHABLE(); |
557 return; | 542 return; |
558 } | 543 } |
559 | 544 |
560 InstructionOperand inputs[4]; | 545 InstructionOperand inputs[4]; |
561 size_t input_count = 0; | 546 size_t input_count = 0; |
562 inputs[input_count++] = g.UseRegister(value); | 547 inputs[input_count++] = g.UseRegister(value); |
563 inputs[input_count++] = g.UseRegister(base); | 548 inputs[input_count++] = g.UseRegister(base); |
564 EmitStore(this, opcode, input_count, inputs, index); | 549 EmitStore(this, opcode, input_count, inputs, index); |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 break; | 736 break; |
752 case MachineRepresentation::kFloat64: | 737 case MachineRepresentation::kFloat64: |
753 opcode = kCheckedLoadFloat64; | 738 opcode = kCheckedLoadFloat64; |
754 break; | 739 break; |
755 case MachineRepresentation::kBit: // Fall through. | 740 case MachineRepresentation::kBit: // Fall through. |
756 case MachineRepresentation::kTaggedSigned: // Fall through. | 741 case MachineRepresentation::kTaggedSigned: // Fall through. |
757 case MachineRepresentation::kTaggedPointer: // Fall through. | 742 case MachineRepresentation::kTaggedPointer: // Fall through. |
758 case MachineRepresentation::kTagged: // Fall through. | 743 case MachineRepresentation::kTagged: // Fall through. |
759 case MachineRepresentation::kWord64: // Fall through. | 744 case MachineRepresentation::kWord64: // Fall through. |
760 case MachineRepresentation::kSimd128: // Fall through. | 745 case MachineRepresentation::kSimd128: // Fall through. |
761 case MachineRepresentation::kSimd1x4: // Fall through. | |
762 case MachineRepresentation::kSimd1x8: // Fall through. | |
763 case MachineRepresentation::kSimd1x16: // Fall through. | |
764 case MachineRepresentation::kNone: | 746 case MachineRepresentation::kNone: |
765 UNREACHABLE(); | 747 UNREACHABLE(); |
766 return; | 748 return; |
767 } | 749 } |
768 InstructionOperand offset_operand = g.UseRegister(offset); | 750 InstructionOperand offset_operand = g.UseRegister(offset); |
769 InstructionOperand length_operand = g.CanBeImmediate(length, kArmCmp) | 751 InstructionOperand length_operand = g.CanBeImmediate(length, kArmCmp) |
770 ? g.UseImmediate(length) | 752 ? g.UseImmediate(length) |
771 : g.UseRegister(length); | 753 : g.UseRegister(length); |
772 Emit(opcode | AddressingModeField::encode(kMode_Offset_RR), | 754 Emit(opcode | AddressingModeField::encode(kMode_Offset_RR), |
773 g.DefineAsRegister(node), offset_operand, length_operand, | 755 g.DefineAsRegister(node), offset_operand, length_operand, |
(...skipping 24 matching lines...) Expand all Loading... |
798 break; | 780 break; |
799 case MachineRepresentation::kFloat64: | 781 case MachineRepresentation::kFloat64: |
800 opcode = kCheckedStoreFloat64; | 782 opcode = kCheckedStoreFloat64; |
801 break; | 783 break; |
802 case MachineRepresentation::kBit: // Fall through. | 784 case MachineRepresentation::kBit: // Fall through. |
803 case MachineRepresentation::kTaggedSigned: // Fall through. | 785 case MachineRepresentation::kTaggedSigned: // Fall through. |
804 case MachineRepresentation::kTaggedPointer: // Fall through. | 786 case MachineRepresentation::kTaggedPointer: // Fall through. |
805 case MachineRepresentation::kTagged: // Fall through. | 787 case MachineRepresentation::kTagged: // Fall through. |
806 case MachineRepresentation::kWord64: // Fall through. | 788 case MachineRepresentation::kWord64: // Fall through. |
807 case MachineRepresentation::kSimd128: // Fall through. | 789 case MachineRepresentation::kSimd128: // Fall through. |
808 case MachineRepresentation::kSimd1x4: // Fall through. | |
809 case MachineRepresentation::kSimd1x8: // Fall through. | |
810 case MachineRepresentation::kSimd1x16: // Fall through. | |
811 case MachineRepresentation::kNone: | 790 case MachineRepresentation::kNone: |
812 UNREACHABLE(); | 791 UNREACHABLE(); |
813 return; | 792 return; |
814 } | 793 } |
815 InstructionOperand offset_operand = g.UseRegister(offset); | 794 InstructionOperand offset_operand = g.UseRegister(offset); |
816 InstructionOperand length_operand = g.CanBeImmediate(length, kArmCmp) | 795 InstructionOperand length_operand = g.CanBeImmediate(length, kArmCmp) |
817 ? g.UseImmediate(length) | 796 ? g.UseImmediate(length) |
818 : g.UseRegister(length); | 797 : g.UseRegister(length); |
819 Emit(opcode | AddressingModeField::encode(kMode_Offset_RR), g.NoOutput(), | 798 Emit(opcode | AddressingModeField::encode(kMode_Offset_RR), g.NoOutput(), |
820 offset_operand, length_operand, g.UseRegister(value), | 799 offset_operand, length_operand, g.UseRegister(value), |
(...skipping 1562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2383 VISIT_ATOMIC_BINOP(Xor) | 2362 VISIT_ATOMIC_BINOP(Xor) |
2384 #undef VISIT_ATOMIC_BINOP | 2363 #undef VISIT_ATOMIC_BINOP |
2385 | 2364 |
2386 #define SIMD_TYPE_LIST(V) \ | 2365 #define SIMD_TYPE_LIST(V) \ |
2387 V(F32x4) \ | 2366 V(F32x4) \ |
2388 V(I32x4) \ | 2367 V(I32x4) \ |
2389 V(I16x8) \ | 2368 V(I16x8) \ |
2390 V(I8x16) | 2369 V(I8x16) |
2391 | 2370 |
2392 #define SIMD_FORMAT_LIST(V) \ | 2371 #define SIMD_FORMAT_LIST(V) \ |
2393 V(32x4) \ | 2372 V(32x4, 4) \ |
2394 V(16x8) \ | 2373 V(16x8, 8) \ |
2395 V(8x16) | 2374 V(8x16, 16) |
2396 | |
2397 #define SIMD_ZERO_OP_LIST(V) \ | |
2398 V(S128Zero) \ | |
2399 V(S1x4Zero) \ | |
2400 V(S1x8Zero) \ | |
2401 V(S1x16Zero) | |
2402 | 2375 |
2403 #define SIMD_UNOP_LIST(V) \ | 2376 #define SIMD_UNOP_LIST(V) \ |
2404 V(F32x4SConvertI32x4, kArmF32x4SConvertI32x4) \ | 2377 V(F32x4SConvertI32x4, kArmF32x4SConvertI32x4) \ |
2405 V(F32x4UConvertI32x4, kArmF32x4UConvertI32x4) \ | 2378 V(F32x4UConvertI32x4, kArmF32x4UConvertI32x4) \ |
2406 V(F32x4Abs, kArmF32x4Abs) \ | 2379 V(F32x4Abs, kArmF32x4Abs) \ |
2407 V(F32x4Neg, kArmF32x4Neg) \ | 2380 V(F32x4Neg, kArmF32x4Neg) \ |
2408 V(F32x4RecipApprox, kArmF32x4RecipApprox) \ | 2381 V(F32x4RecipApprox, kArmF32x4RecipApprox) \ |
2409 V(F32x4RecipSqrtApprox, kArmF32x4RecipSqrtApprox) \ | 2382 V(F32x4RecipSqrtApprox, kArmF32x4RecipSqrtApprox) \ |
2410 V(I32x4SConvertF32x4, kArmI32x4SConvertF32x4) \ | 2383 V(I32x4SConvertF32x4, kArmI32x4SConvertF32x4) \ |
2411 V(I32x4SConvertI16x8Low, kArmI32x4SConvertI16x8Low) \ | 2384 V(I32x4SConvertI16x8Low, kArmI32x4SConvertI16x8Low) \ |
2412 V(I32x4SConvertI16x8High, kArmI32x4SConvertI16x8High) \ | 2385 V(I32x4SConvertI16x8High, kArmI32x4SConvertI16x8High) \ |
2413 V(I32x4Neg, kArmI32x4Neg) \ | 2386 V(I32x4Neg, kArmI32x4Neg) \ |
2414 V(I32x4UConvertF32x4, kArmI32x4UConvertF32x4) \ | 2387 V(I32x4UConvertF32x4, kArmI32x4UConvertF32x4) \ |
2415 V(I32x4UConvertI16x8Low, kArmI32x4UConvertI16x8Low) \ | 2388 V(I32x4UConvertI16x8Low, kArmI32x4UConvertI16x8Low) \ |
2416 V(I32x4UConvertI16x8High, kArmI32x4UConvertI16x8High) \ | 2389 V(I32x4UConvertI16x8High, kArmI32x4UConvertI16x8High) \ |
2417 V(I16x8SConvertI8x16Low, kArmI16x8SConvertI8x16Low) \ | 2390 V(I16x8SConvertI8x16Low, kArmI16x8SConvertI8x16Low) \ |
2418 V(I16x8SConvertI8x16High, kArmI16x8SConvertI8x16High) \ | 2391 V(I16x8SConvertI8x16High, kArmI16x8SConvertI8x16High) \ |
2419 V(I16x8Neg, kArmI16x8Neg) \ | 2392 V(I16x8Neg, kArmI16x8Neg) \ |
2420 V(I16x8UConvertI8x16Low, kArmI16x8UConvertI8x16Low) \ | 2393 V(I16x8UConvertI8x16Low, kArmI16x8UConvertI8x16Low) \ |
2421 V(I16x8UConvertI8x16High, kArmI16x8UConvertI8x16High) \ | 2394 V(I16x8UConvertI8x16High, kArmI16x8UConvertI8x16High) \ |
2422 V(I8x16Neg, kArmI8x16Neg) \ | 2395 V(I8x16Neg, kArmI8x16Neg) \ |
2423 V(S128Not, kArmS128Not) \ | 2396 V(S128Not, kArmS128Not) \ |
2424 V(S1x4Not, kArmS128Not) \ | |
2425 V(S1x4AnyTrue, kArmS1x4AnyTrue) \ | 2397 V(S1x4AnyTrue, kArmS1x4AnyTrue) \ |
2426 V(S1x4AllTrue, kArmS1x4AllTrue) \ | 2398 V(S1x4AllTrue, kArmS1x4AllTrue) \ |
2427 V(S1x8Not, kArmS128Not) \ | |
2428 V(S1x8AnyTrue, kArmS1x8AnyTrue) \ | 2399 V(S1x8AnyTrue, kArmS1x8AnyTrue) \ |
2429 V(S1x8AllTrue, kArmS1x8AllTrue) \ | 2400 V(S1x8AllTrue, kArmS1x8AllTrue) \ |
2430 V(S1x16Not, kArmS128Not) \ | |
2431 V(S1x16AnyTrue, kArmS1x16AnyTrue) \ | 2401 V(S1x16AnyTrue, kArmS1x16AnyTrue) \ |
2432 V(S1x16AllTrue, kArmS1x16AllTrue) | 2402 V(S1x16AllTrue, kArmS1x16AllTrue) |
2433 | 2403 |
2434 #define SIMD_SHIFT_OP_LIST(V) \ | 2404 #define SIMD_SHIFT_OP_LIST(V) \ |
2435 V(I32x4Shl) \ | 2405 V(I32x4Shl) \ |
2436 V(I32x4ShrS) \ | 2406 V(I32x4ShrS) \ |
2437 V(I32x4ShrU) \ | 2407 V(I32x4ShrU) \ |
2438 V(I16x8Shl) \ | 2408 V(I16x8Shl) \ |
2439 V(I16x8ShrS) \ | 2409 V(I16x8ShrS) \ |
2440 V(I16x8ShrU) \ | 2410 V(I16x8ShrU) \ |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2501 V(I8x16GeS, kArmI8x16GeS) \ | 2471 V(I8x16GeS, kArmI8x16GeS) \ |
2502 V(I8x16UConvertI16x8, kArmI8x16UConvertI16x8) \ | 2472 V(I8x16UConvertI16x8, kArmI8x16UConvertI16x8) \ |
2503 V(I8x16AddSaturateU, kArmI8x16AddSaturateU) \ | 2473 V(I8x16AddSaturateU, kArmI8x16AddSaturateU) \ |
2504 V(I8x16SubSaturateU, kArmI8x16SubSaturateU) \ | 2474 V(I8x16SubSaturateU, kArmI8x16SubSaturateU) \ |
2505 V(I8x16MinU, kArmI8x16MinU) \ | 2475 V(I8x16MinU, kArmI8x16MinU) \ |
2506 V(I8x16MaxU, kArmI8x16MaxU) \ | 2476 V(I8x16MaxU, kArmI8x16MaxU) \ |
2507 V(I8x16GtU, kArmI8x16GtU) \ | 2477 V(I8x16GtU, kArmI8x16GtU) \ |
2508 V(I8x16GeU, kArmI8x16GeU) \ | 2478 V(I8x16GeU, kArmI8x16GeU) \ |
2509 V(S128And, kArmS128And) \ | 2479 V(S128And, kArmS128And) \ |
2510 V(S128Or, kArmS128Or) \ | 2480 V(S128Or, kArmS128Or) \ |
2511 V(S128Xor, kArmS128Xor) \ | 2481 V(S128Xor, kArmS128Xor) |
2512 V(S1x4And, kArmS128And) \ | 2482 |
2513 V(S1x4Or, kArmS128Or) \ | 2483 void InstructionSelector::VisitS128Zero(Node* node) { |
2514 V(S1x4Xor, kArmS128Xor) \ | 2484 ArmOperandGenerator g(this); |
2515 V(S1x8And, kArmS128And) \ | 2485 Emit(kArmS128Zero, g.DefineAsRegister(node), g.DefineAsRegister(node)); |
2516 V(S1x8Or, kArmS128Or) \ | 2486 } |
2517 V(S1x8Xor, kArmS128Xor) \ | |
2518 V(S1x16And, kArmS128And) \ | |
2519 V(S1x16Or, kArmS128Or) \ | |
2520 V(S1x16Xor, kArmS128Xor) | |
2521 | 2487 |
2522 #define SIMD_VISIT_SPLAT(Type) \ | 2488 #define SIMD_VISIT_SPLAT(Type) \ |
2523 void InstructionSelector::Visit##Type##Splat(Node* node) { \ | 2489 void InstructionSelector::Visit##Type##Splat(Node* node) { \ |
2524 VisitRR(this, kArm##Type##Splat, node); \ | 2490 VisitRR(this, kArm##Type##Splat, node); \ |
2525 } | 2491 } |
2526 SIMD_TYPE_LIST(SIMD_VISIT_SPLAT) | 2492 SIMD_TYPE_LIST(SIMD_VISIT_SPLAT) |
2527 #undef SIMD_VISIT_SPLAT | 2493 #undef SIMD_VISIT_SPLAT |
2528 | 2494 |
2529 #define SIMD_VISIT_EXTRACT_LANE(Type) \ | 2495 #define SIMD_VISIT_EXTRACT_LANE(Type) \ |
2530 void InstructionSelector::Visit##Type##ExtractLane(Node* node) { \ | 2496 void InstructionSelector::Visit##Type##ExtractLane(Node* node) { \ |
2531 VisitRRI(this, kArm##Type##ExtractLane, node); \ | 2497 VisitRRI(this, kArm##Type##ExtractLane, node); \ |
2532 } | 2498 } |
2533 SIMD_TYPE_LIST(SIMD_VISIT_EXTRACT_LANE) | 2499 SIMD_TYPE_LIST(SIMD_VISIT_EXTRACT_LANE) |
2534 #undef SIMD_VISIT_EXTRACT_LANE | 2500 #undef SIMD_VISIT_EXTRACT_LANE |
2535 | 2501 |
2536 #define SIMD_VISIT_REPLACE_LANE(Type) \ | 2502 #define SIMD_VISIT_REPLACE_LANE(Type) \ |
2537 void InstructionSelector::Visit##Type##ReplaceLane(Node* node) { \ | 2503 void InstructionSelector::Visit##Type##ReplaceLane(Node* node) { \ |
2538 VisitRRIR(this, kArm##Type##ReplaceLane, node); \ | 2504 VisitRRIR(this, kArm##Type##ReplaceLane, node); \ |
2539 } | 2505 } |
2540 SIMD_TYPE_LIST(SIMD_VISIT_REPLACE_LANE) | 2506 SIMD_TYPE_LIST(SIMD_VISIT_REPLACE_LANE) |
2541 #undef SIMD_VISIT_REPLACE_LANE | 2507 #undef SIMD_VISIT_REPLACE_LANE |
2542 | 2508 |
2543 #define SIMD_VISIT_ZERO_OP(Name) \ | |
2544 void InstructionSelector::Visit##Name(Node* node) { \ | |
2545 ArmOperandGenerator g(this); \ | |
2546 Emit(kArmS128Zero, g.DefineAsRegister(node), g.DefineAsRegister(node)); \ | |
2547 } | |
2548 SIMD_ZERO_OP_LIST(SIMD_VISIT_ZERO_OP) | |
2549 #undef SIMD_VISIT_ZERO_OP | |
2550 | |
2551 #define SIMD_VISIT_UNOP(Name, instruction) \ | 2509 #define SIMD_VISIT_UNOP(Name, instruction) \ |
2552 void InstructionSelector::Visit##Name(Node* node) { \ | 2510 void InstructionSelector::Visit##Name(Node* node) { \ |
2553 VisitRR(this, instruction, node); \ | 2511 VisitRR(this, instruction, node); \ |
2554 } | 2512 } |
2555 SIMD_UNOP_LIST(SIMD_VISIT_UNOP) | 2513 SIMD_UNOP_LIST(SIMD_VISIT_UNOP) |
2556 #undef SIMD_VISIT_UNOP | 2514 #undef SIMD_VISIT_UNOP |
2557 | 2515 |
2558 #define SIMD_VISIT_SHIFT_OP(Name) \ | 2516 #define SIMD_VISIT_SHIFT_OP(Name) \ |
2559 void InstructionSelector::Visit##Name(Node* node) { \ | 2517 void InstructionSelector::Visit##Name(Node* node) { \ |
2560 VisitRRI(this, kArm##Name, node); \ | 2518 VisitRRI(this, kArm##Name, node); \ |
2561 } | 2519 } |
2562 SIMD_SHIFT_OP_LIST(SIMD_VISIT_SHIFT_OP) | 2520 SIMD_SHIFT_OP_LIST(SIMD_VISIT_SHIFT_OP) |
2563 #undef SIMD_VISIT_SHIFT_OP | 2521 #undef SIMD_VISIT_SHIFT_OP |
2564 | 2522 |
2565 #define SIMD_VISIT_BINOP(Name, instruction) \ | 2523 #define SIMD_VISIT_BINOP(Name, instruction) \ |
2566 void InstructionSelector::Visit##Name(Node* node) { \ | 2524 void InstructionSelector::Visit##Name(Node* node) { \ |
2567 VisitRRR(this, instruction, node); \ | 2525 VisitRRR(this, instruction, node); \ |
2568 } | 2526 } |
2569 SIMD_BINOP_LIST(SIMD_VISIT_BINOP) | 2527 SIMD_BINOP_LIST(SIMD_VISIT_BINOP) |
2570 #undef SIMD_VISIT_BINOP | 2528 #undef SIMD_VISIT_BINOP |
2571 | 2529 |
2572 #define SIMD_VISIT_SELECT_OP(format) \ | 2530 void InstructionSelector::VisitS128Select(Node* node) { |
2573 void InstructionSelector::VisitS##format##Select(Node* node) { \ | 2531 ArmOperandGenerator g(this); |
2574 VisitRRRR(this, kArmS128Select, node); \ | 2532 Emit(kArmS128Select, g.DefineSameAsFirst(node), |
2575 } | 2533 g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)), |
2576 SIMD_FORMAT_LIST(SIMD_VISIT_SELECT_OP) | 2534 g.UseRegister(node->InputAt(2))); |
2577 #undef SIMD_VISIT_SELECT_OP | 2535 } |
2578 | 2536 |
2579 namespace { | 2537 namespace { |
2580 template <int LANES> | 2538 template <int LANES> |
2581 struct ShuffleEntry { | 2539 struct ShuffleEntry { |
2582 uint8_t shuffle[LANES]; | 2540 uint8_t shuffle[LANES]; |
2583 ArchOpcode opcode; | 2541 ArchOpcode opcode; |
2584 }; | 2542 }; |
2585 | 2543 |
2586 static const ShuffleEntry<4> arch_s32x4_shuffles[] = { | 2544 static const ShuffleEntry<4> arch_s32x4_shuffles[] = { |
2587 {{0, 4, 1, 5}, kArmS32x4ZipLeft}, | 2545 {{0, 4, 1, 5}, kArmS32x4ZipLeft}, |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2827 Vector<MachineType> req_aligned = Vector<MachineType>::New(2); | 2785 Vector<MachineType> req_aligned = Vector<MachineType>::New(2); |
2828 req_aligned[0] = MachineType::Float32(); | 2786 req_aligned[0] = MachineType::Float32(); |
2829 req_aligned[1] = MachineType::Float64(); | 2787 req_aligned[1] = MachineType::Float64(); |
2830 return MachineOperatorBuilder::AlignmentRequirements:: | 2788 return MachineOperatorBuilder::AlignmentRequirements:: |
2831 SomeUnalignedAccessUnsupported(req_aligned, req_aligned); | 2789 SomeUnalignedAccessUnsupported(req_aligned, req_aligned); |
2832 } | 2790 } |
2833 | 2791 |
2834 } // namespace compiler | 2792 } // namespace compiler |
2835 } // namespace internal | 2793 } // namespace internal |
2836 } // namespace v8 | 2794 } // namespace v8 |
OLD | NEW |