Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(459)

Side by Side Diff: src/compiler/machine-operator.h

Issue 2122853002: Implement UnaligedLoad and UnaligedStore turbofan operators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 #ifndef V8_COMPILER_MACHINE_OPERATOR_H_ 5 #ifndef V8_COMPILER_MACHINE_OPERATOR_H_
6 #define V8_COMPILER_MACHINE_OPERATOR_H_ 6 #define V8_COMPILER_MACHINE_OPERATOR_H_
7 7
8 #include "src/base/flags.h" 8 #include "src/base/flags.h"
9 #include "src/machine-type.h" 9 #include "src/machine-type.h"
10 10
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 bool operator==(StoreRepresentation, StoreRepresentation); 64 bool operator==(StoreRepresentation, StoreRepresentation);
65 bool operator!=(StoreRepresentation, StoreRepresentation); 65 bool operator!=(StoreRepresentation, StoreRepresentation);
66 66
67 size_t hash_value(StoreRepresentation); 67 size_t hash_value(StoreRepresentation);
68 68
69 std::ostream& operator<<(std::ostream&, StoreRepresentation); 69 std::ostream& operator<<(std::ostream&, StoreRepresentation);
70 70
71 StoreRepresentation const& StoreRepresentationOf(Operator const*); 71 StoreRepresentation const& StoreRepresentationOf(Operator const*);
72 72
73 typedef MachineType UnalignedLoadRepresentation;
74
75 UnalignedLoadRepresentation UnalignedLoadRepresentationOf(Operator const*);
76
77 // An UnalignedStore needs a MachineType.
78 typedef MachineRepresentation UnalignedStoreRepresentation;
79
80 UnalignedStoreRepresentation const& UnalignedStoreRepresentationOf(
81 Operator const*);
73 82
74 // A CheckedLoad needs a MachineType. 83 // A CheckedLoad needs a MachineType.
75 typedef MachineType CheckedLoadRepresentation; 84 typedef MachineType CheckedLoadRepresentation;
76 85
77 CheckedLoadRepresentation CheckedLoadRepresentationOf(Operator const*); 86 CheckedLoadRepresentation CheckedLoadRepresentationOf(Operator const*);
78 87
79 88
80 // A CheckedStore needs a MachineType. 89 // A CheckedStore needs a MachineType.
81 typedef MachineRepresentation CheckedStoreRepresentation; 90 typedef MachineRepresentation CheckedStoreRepresentation;
82 91
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 kUint32DivIsSafe = 1u << 14, 123 kUint32DivIsSafe = 1u << 14,
115 kWord32ShiftIsSafe = 1u << 15, 124 kWord32ShiftIsSafe = 1u << 15,
116 kWord32Ctz = 1u << 16, 125 kWord32Ctz = 1u << 16,
117 kWord64Ctz = 1u << 17, 126 kWord64Ctz = 1u << 17,
118 kWord32Popcnt = 1u << 18, 127 kWord32Popcnt = 1u << 18,
119 kWord64Popcnt = 1u << 19, 128 kWord64Popcnt = 1u << 19,
120 kWord32ReverseBits = 1u << 20, 129 kWord32ReverseBits = 1u << 20,
121 kWord64ReverseBits = 1u << 21, 130 kWord64ReverseBits = 1u << 21,
122 kFloat32Neg = 1u << 22, 131 kFloat32Neg = 1u << 22,
123 kFloat64Neg = 1u << 23, 132 kFloat64Neg = 1u << 23,
124 kAllOptionalOps = 133 kUnalignedLoad = 1u << 24,
titzer 2016/07/11 08:40:00 Isn't this superfluous with the AlignmentRequireme
ivica.bogosavljevic 2016/07/11 09:34:43 Acknowledged.
125 kFloat32Max | kFloat32Min | kFloat64Max | kFloat64Min | 134 kUnalignedStore = 1u << 25,
126 kFloat32RoundDown | kFloat64RoundDown | kFloat32RoundUp | 135 kAllOptionalOps = kFloat32Max | kFloat32Min | kFloat64Max | kFloat64Min |
127 kFloat64RoundUp | kFloat32RoundTruncate | kFloat64RoundTruncate | 136 kFloat32RoundDown | kFloat64RoundDown | kFloat32RoundUp |
128 kFloat64RoundTiesAway | kFloat32RoundTiesEven | kFloat64RoundTiesEven | 137 kFloat64RoundUp | kFloat32RoundTruncate |
129 kWord32Ctz | kWord64Ctz | kWord32Popcnt | kWord64Popcnt | 138 kFloat64RoundTruncate | kFloat64RoundTiesAway |
130 kWord32ReverseBits | kWord64ReverseBits | kFloat32Neg | kFloat64Neg 139 kFloat32RoundTiesEven | kFloat64RoundTiesEven |
140 kWord32Ctz | kWord64Ctz | kWord32Popcnt | kWord64Popcnt |
141 kWord32ReverseBits | kWord64ReverseBits | kFloat32Neg |
142 kFloat64Neg | kUnalignedLoad | kUnalignedStore
131 }; 143 };
132 typedef base::Flags<Flag, unsigned> Flags; 144 typedef base::Flags<Flag, unsigned> Flags;
133 145
134 class AlignmentRequirements { 146 class AlignmentRequirements {
135 public: 147 public:
136 enum UnalignedAccessSupport { kNoSupport, kSomeSupport, kFullSupport }; 148 enum UnalignedAccessSupport { kNoSupport, kSomeSupport, kFullSupport };
137 149
138 bool IsUnalignedLoadSupported(const MachineType& machineType, 150 bool IsUnalignedLoadSupported(const MachineType& machineType,
139 uint8_t alignment) const { 151 uint8_t alignment) const {
140 return IsUnalignedSupported(unalignedLoadSupportedTypes_, machineType, 152 return IsUnalignedSupported(unalignedLoadSupportedTypes_, machineType,
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 const Operator* Simd128Or(); 606 const Operator* Simd128Or();
595 const Operator* Simd128Xor(); 607 const Operator* Simd128Xor();
596 const Operator* Simd128Not(); 608 const Operator* Simd128Not();
597 609
598 // load [base + index] 610 // load [base + index]
599 const Operator* Load(LoadRepresentation rep); 611 const Operator* Load(LoadRepresentation rep);
600 612
601 // store [base + index], value 613 // store [base + index], value
602 const Operator* Store(StoreRepresentation rep); 614 const Operator* Store(StoreRepresentation rep);
603 615
616 // unaligned load [base + index]
617 const OptionalOperator UnalignedLoad(UnalignedLoadRepresentation rep);
618
619 // unaligned store [base + index], value
620 const OptionalOperator UnalignedStore(UnalignedStoreRepresentation rep);
621
604 const Operator* StackSlot(MachineRepresentation rep); 622 const Operator* StackSlot(MachineRepresentation rep);
605 623
606 // Access to the machine stack. 624 // Access to the machine stack.
607 const Operator* LoadStackPointer(); 625 const Operator* LoadStackPointer();
608 const Operator* LoadFramePointer(); 626 const Operator* LoadFramePointer();
609 const Operator* LoadParentFramePointer(); 627 const Operator* LoadParentFramePointer();
610 628
611 // checked-load heap, index, length 629 // checked-load heap, index, length
612 const Operator* CheckedLoad(CheckedLoadRepresentation); 630 const Operator* CheckedLoad(CheckedLoadRepresentation);
613 // checked-store heap, index, length, value 631 // checked-store heap, index, length, value
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 }; 694 };
677 695
678 696
679 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) 697 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags)
680 698
681 } // namespace compiler 699 } // namespace compiler
682 } // namespace internal 700 } // namespace internal
683 } // namespace v8 701 } // namespace v8
684 702
685 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ 703 #endif // V8_COMPILER_MACHINE_OPERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698