| 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/compiler/machine-operator.h" | 5 #include "src/compiler/machine-operator.h" |
| 6 | 6 |
| 7 #include "src/base/lazy-instance.h" | 7 #include "src/base/lazy-instance.h" |
| 8 #include "src/compiler/opcodes.h" | 8 #include "src/compiler/opcodes.h" |
| 9 #include "src/compiler/operator.h" | 9 #include "src/compiler/operator.h" |
| 10 | 10 |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 V(I8x16MaxU, Operator::kCommutative, 2, 0, 1) \ | 326 V(I8x16MaxU, Operator::kCommutative, 2, 0, 1) \ |
| 327 V(I8x16GtU, Operator::kNoProperties, 2, 0, 1) \ | 327 V(I8x16GtU, Operator::kNoProperties, 2, 0, 1) \ |
| 328 V(I8x16GeU, Operator::kNoProperties, 2, 0, 1) \ | 328 V(I8x16GeU, Operator::kNoProperties, 2, 0, 1) \ |
| 329 V(S128Load, Operator::kNoProperties, 2, 0, 1) \ | 329 V(S128Load, Operator::kNoProperties, 2, 0, 1) \ |
| 330 V(S128Store, Operator::kNoProperties, 3, 0, 1) \ | 330 V(S128Store, Operator::kNoProperties, 3, 0, 1) \ |
| 331 V(S128Zero, Operator::kNoProperties, 0, 0, 1) \ | 331 V(S128Zero, Operator::kNoProperties, 0, 0, 1) \ |
| 332 V(S128And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ | 332 V(S128And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ |
| 333 V(S128Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ | 333 V(S128Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ |
| 334 V(S128Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ | 334 V(S128Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ |
| 335 V(S128Not, Operator::kNoProperties, 1, 0, 1) \ | 335 V(S128Not, Operator::kNoProperties, 1, 0, 1) \ |
| 336 V(S32x4Select, Operator::kNoProperties, 3, 0, 1) \ | 336 V(S128Select, Operator::kNoProperties, 3, 0, 1) \ |
| 337 V(S16x8Select, Operator::kNoProperties, 3, 0, 1) \ | |
| 338 V(S8x16Select, Operator::kNoProperties, 3, 0, 1) \ | |
| 339 V(S1x4Zero, Operator::kNoProperties, 0, 0, 1) \ | |
| 340 V(S1x4And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ | |
| 341 V(S1x4Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ | |
| 342 V(S1x4Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ | |
| 343 V(S1x4Not, Operator::kNoProperties, 1, 0, 1) \ | |
| 344 V(S1x4AnyTrue, Operator::kNoProperties, 1, 0, 1) \ | 337 V(S1x4AnyTrue, Operator::kNoProperties, 1, 0, 1) \ |
| 345 V(S1x4AllTrue, Operator::kNoProperties, 1, 0, 1) \ | 338 V(S1x4AllTrue, Operator::kNoProperties, 1, 0, 1) \ |
| 346 V(S1x8Zero, Operator::kNoProperties, 0, 0, 1) \ | |
| 347 V(S1x8And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ | |
| 348 V(S1x8Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ | |
| 349 V(S1x8Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ | |
| 350 V(S1x8Not, Operator::kNoProperties, 1, 0, 1) \ | |
| 351 V(S1x8AnyTrue, Operator::kNoProperties, 1, 0, 1) \ | 339 V(S1x8AnyTrue, Operator::kNoProperties, 1, 0, 1) \ |
| 352 V(S1x8AllTrue, Operator::kNoProperties, 1, 0, 1) \ | 340 V(S1x8AllTrue, Operator::kNoProperties, 1, 0, 1) \ |
| 353 V(S1x16Zero, Operator::kNoProperties, 0, 0, 1) \ | |
| 354 V(S1x16And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ | |
| 355 V(S1x16Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ | |
| 356 V(S1x16Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ | |
| 357 V(S1x16Not, Operator::kNoProperties, 1, 0, 1) \ | |
| 358 V(S1x16AnyTrue, Operator::kNoProperties, 1, 0, 1) \ | 341 V(S1x16AnyTrue, Operator::kNoProperties, 1, 0, 1) \ |
| 359 V(S1x16AllTrue, Operator::kNoProperties, 1, 0, 1) | 342 V(S1x16AllTrue, Operator::kNoProperties, 1, 0, 1) |
| 360 | 343 |
| 361 #define PURE_OPTIONAL_OP_LIST(V) \ | 344 #define PURE_OPTIONAL_OP_LIST(V) \ |
| 362 V(Word32Ctz, Operator::kNoProperties, 1, 0, 1) \ | 345 V(Word32Ctz, Operator::kNoProperties, 1, 0, 1) \ |
| 363 V(Word64Ctz, Operator::kNoProperties, 1, 0, 1) \ | 346 V(Word64Ctz, Operator::kNoProperties, 1, 0, 1) \ |
| 364 V(Word32ReverseBits, Operator::kNoProperties, 1, 0, 1) \ | 347 V(Word32ReverseBits, Operator::kNoProperties, 1, 0, 1) \ |
| 365 V(Word64ReverseBits, Operator::kNoProperties, 1, 0, 1) \ | 348 V(Word64ReverseBits, Operator::kNoProperties, 1, 0, 1) \ |
| 366 V(Word32ReverseBytes, Operator::kNoProperties, 1, 0, 1) \ | 349 V(Word32ReverseBytes, Operator::kNoProperties, 1, 0, 1) \ |
| 367 V(Word64ReverseBytes, Operator::kNoProperties, 1, 0, 1) \ | 350 V(Word64ReverseBytes, Operator::kNoProperties, 1, 0, 1) \ |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 714 | 697 |
| 715 const Operator* MachineOperatorBuilder::UnalignedStore( | 698 const Operator* MachineOperatorBuilder::UnalignedStore( |
| 716 UnalignedStoreRepresentation rep) { | 699 UnalignedStoreRepresentation rep) { |
| 717 switch (rep) { | 700 switch (rep) { |
| 718 #define STORE(kRep) \ | 701 #define STORE(kRep) \ |
| 719 case MachineRepresentation::kRep: \ | 702 case MachineRepresentation::kRep: \ |
| 720 return &cache_.kUnalignedStore##kRep; | 703 return &cache_.kUnalignedStore##kRep; |
| 721 MACHINE_REPRESENTATION_LIST(STORE) | 704 MACHINE_REPRESENTATION_LIST(STORE) |
| 722 #undef STORE | 705 #undef STORE |
| 723 case MachineRepresentation::kBit: | 706 case MachineRepresentation::kBit: |
| 724 case MachineRepresentation::kSimd1x4: | |
| 725 case MachineRepresentation::kSimd1x8: | |
| 726 case MachineRepresentation::kSimd1x16: | |
| 727 case MachineRepresentation::kNone: | 707 case MachineRepresentation::kNone: |
| 728 break; | 708 break; |
| 729 } | 709 } |
| 730 UNREACHABLE(); | 710 UNREACHABLE(); |
| 731 } | 711 } |
| 732 | 712 |
| 733 #define PURE(Name, properties, value_input_count, control_input_count, \ | 713 #define PURE(Name, properties, value_input_count, control_input_count, \ |
| 734 output_count) \ | 714 output_count) \ |
| 735 const Operator* MachineOperatorBuilder::Name() { return &cache_.k##Name; } | 715 const Operator* MachineOperatorBuilder::Name() { return &cache_.k##Name; } |
| 736 PURE_OP_LIST(PURE) | 716 PURE_OP_LIST(PURE) |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 799 return &cache_.k##Store##kRep##MapWriteBarrier; \ | 779 return &cache_.k##Store##kRep##MapWriteBarrier; \ |
| 800 case kPointerWriteBarrier: \ | 780 case kPointerWriteBarrier: \ |
| 801 return &cache_.k##Store##kRep##PointerWriteBarrier; \ | 781 return &cache_.k##Store##kRep##PointerWriteBarrier; \ |
| 802 case kFullWriteBarrier: \ | 782 case kFullWriteBarrier: \ |
| 803 return &cache_.k##Store##kRep##FullWriteBarrier; \ | 783 return &cache_.k##Store##kRep##FullWriteBarrier; \ |
| 804 } \ | 784 } \ |
| 805 break; | 785 break; |
| 806 MACHINE_REPRESENTATION_LIST(STORE) | 786 MACHINE_REPRESENTATION_LIST(STORE) |
| 807 #undef STORE | 787 #undef STORE |
| 808 case MachineRepresentation::kBit: | 788 case MachineRepresentation::kBit: |
| 809 case MachineRepresentation::kSimd1x4: | |
| 810 case MachineRepresentation::kSimd1x8: | |
| 811 case MachineRepresentation::kSimd1x16: | |
| 812 case MachineRepresentation::kNone: | 789 case MachineRepresentation::kNone: |
| 813 break; | 790 break; |
| 814 } | 791 } |
| 815 UNREACHABLE(); | 792 UNREACHABLE(); |
| 816 } | 793 } |
| 817 | 794 |
| 818 const Operator* MachineOperatorBuilder::ProtectedStore( | 795 const Operator* MachineOperatorBuilder::ProtectedStore( |
| 819 MachineRepresentation rep) { | 796 MachineRepresentation rep) { |
| 820 switch (rep) { | 797 switch (rep) { |
| 821 #define STORE(kRep) \ | 798 #define STORE(kRep) \ |
| 822 case MachineRepresentation::kRep: \ | 799 case MachineRepresentation::kRep: \ |
| 823 return &cache_.kProtectedStore##kRep; \ | 800 return &cache_.kProtectedStore##kRep; \ |
| 824 break; | 801 break; |
| 825 MACHINE_REPRESENTATION_LIST(STORE) | 802 MACHINE_REPRESENTATION_LIST(STORE) |
| 826 #undef STORE | 803 #undef STORE |
| 827 case MachineRepresentation::kBit: | 804 case MachineRepresentation::kBit: |
| 828 case MachineRepresentation::kSimd1x4: | |
| 829 case MachineRepresentation::kSimd1x8: | |
| 830 case MachineRepresentation::kSimd1x16: | |
| 831 case MachineRepresentation::kNone: | 805 case MachineRepresentation::kNone: |
| 832 break; | 806 break; |
| 833 } | 807 } |
| 834 UNREACHABLE(); | 808 UNREACHABLE(); |
| 835 } | 809 } |
| 836 | 810 |
| 837 const Operator* MachineOperatorBuilder::UnsafePointerAdd() { | 811 const Operator* MachineOperatorBuilder::UnsafePointerAdd() { |
| 838 return &cache_.kUnsafePointerAdd; | 812 return &cache_.kUnsafePointerAdd; |
| 839 } | 813 } |
| 840 | 814 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 864 | 838 |
| 865 const Operator* MachineOperatorBuilder::CheckedStore( | 839 const Operator* MachineOperatorBuilder::CheckedStore( |
| 866 CheckedStoreRepresentation rep) { | 840 CheckedStoreRepresentation rep) { |
| 867 switch (rep) { | 841 switch (rep) { |
| 868 #define STORE(kRep) \ | 842 #define STORE(kRep) \ |
| 869 case MachineRepresentation::kRep: \ | 843 case MachineRepresentation::kRep: \ |
| 870 return &cache_.kCheckedStore##kRep; | 844 return &cache_.kCheckedStore##kRep; |
| 871 MACHINE_REPRESENTATION_LIST(STORE) | 845 MACHINE_REPRESENTATION_LIST(STORE) |
| 872 #undef STORE | 846 #undef STORE |
| 873 case MachineRepresentation::kBit: | 847 case MachineRepresentation::kBit: |
| 874 case MachineRepresentation::kSimd1x4: | |
| 875 case MachineRepresentation::kSimd1x8: | |
| 876 case MachineRepresentation::kSimd1x16: | |
| 877 case MachineRepresentation::kNone: | 848 case MachineRepresentation::kNone: |
| 878 break; | 849 break; |
| 879 } | 850 } |
| 880 UNREACHABLE(); | 851 UNREACHABLE(); |
| 881 } | 852 } |
| 882 | 853 |
| 883 const Operator* MachineOperatorBuilder::AtomicLoad(LoadRepresentation rep) { | 854 const Operator* MachineOperatorBuilder::AtomicLoad(LoadRepresentation rep) { |
| 884 #define LOAD(Type) \ | 855 #define LOAD(Type) \ |
| 885 if (rep == MachineType::Type()) { \ | 856 if (rep == MachineType::Type()) { \ |
| 886 return &cache_.kAtomicLoad##Type; \ | 857 return &cache_.kAtomicLoad##Type; \ |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1030 uint8_t* array = zone_->NewArray<uint8_t>(16); | 1001 uint8_t* array = zone_->NewArray<uint8_t>(16); |
| 1031 memcpy(array, shuffle, 16); | 1002 memcpy(array, shuffle, 16); |
| 1032 return new (zone_) | 1003 return new (zone_) |
| 1033 Operator1<uint8_t*>(IrOpcode::kS8x16Shuffle, Operator::kPure, "Shuffle", | 1004 Operator1<uint8_t*>(IrOpcode::kS8x16Shuffle, Operator::kPure, "Shuffle", |
| 1034 2, 0, 0, 1, 0, 0, array); | 1005 2, 0, 0, 1, 0, 0, array); |
| 1035 } | 1006 } |
| 1036 | 1007 |
| 1037 } // namespace compiler | 1008 } // namespace compiler |
| 1038 } // namespace internal | 1009 } // namespace internal |
| 1039 } // namespace v8 | 1010 } // namespace v8 |
| OLD | NEW |