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

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

Issue 1779713009: Implement optional turbofan UnalignedLoad and UnalignedStore operators (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Unaligned access simulate using load/shift/or and store/shift/and Created 4 years, 8 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 bool operator==(StoreRepresentation, StoreRepresentation); 84 bool operator==(StoreRepresentation, StoreRepresentation);
85 bool operator!=(StoreRepresentation, StoreRepresentation); 85 bool operator!=(StoreRepresentation, StoreRepresentation);
86 86
87 size_t hash_value(StoreRepresentation); 87 size_t hash_value(StoreRepresentation);
88 88
89 std::ostream& operator<<(std::ostream&, StoreRepresentation); 89 std::ostream& operator<<(std::ostream&, StoreRepresentation);
90 90
91 StoreRepresentation const& StoreRepresentationOf(Operator const*); 91 StoreRepresentation const& StoreRepresentationOf(Operator const*);
92 92
93 typedef MachineType UnalignedLoadRepresentation;
94
95 UnalignedLoadRepresentation UnalignedLoadRepresentationOf(Operator const*);
96
97 // An UnalignedStore needs a MachineType.
98 typedef MachineRepresentation UnalignedStoreRepresentation;
99
100 UnalignedStoreRepresentation const& UnalignedStoreRepresentationOf(
101 Operator const*);
93 102
94 // A CheckedLoad needs a MachineType. 103 // A CheckedLoad needs a MachineType.
95 typedef MachineType CheckedLoadRepresentation; 104 typedef MachineType CheckedLoadRepresentation;
96 105
97 CheckedLoadRepresentation CheckedLoadRepresentationOf(Operator const*); 106 CheckedLoadRepresentation CheckedLoadRepresentationOf(Operator const*);
98 107
99 108
100 // A CheckedStore needs a MachineType. 109 // A CheckedStore needs a MachineType.
101 typedef MachineRepresentation CheckedStoreRepresentation; 110 typedef MachineRepresentation CheckedStoreRepresentation;
102 111
(...skipping 27 matching lines...) Expand all
130 kFloat64RoundTiesAway = 1u << 12, 139 kFloat64RoundTiesAway = 1u << 12,
131 kInt32DivIsSafe = 1u << 13, 140 kInt32DivIsSafe = 1u << 13,
132 kUint32DivIsSafe = 1u << 14, 141 kUint32DivIsSafe = 1u << 14,
133 kWord32ShiftIsSafe = 1u << 15, 142 kWord32ShiftIsSafe = 1u << 15,
134 kWord32Ctz = 1u << 16, 143 kWord32Ctz = 1u << 16,
135 kWord64Ctz = 1u << 17, 144 kWord64Ctz = 1u << 17,
136 kWord32Popcnt = 1u << 18, 145 kWord32Popcnt = 1u << 18,
137 kWord64Popcnt = 1u << 19, 146 kWord64Popcnt = 1u << 19,
138 kWord32ReverseBits = 1u << 20, 147 kWord32ReverseBits = 1u << 20,
139 kWord64ReverseBits = 1u << 21, 148 kWord64ReverseBits = 1u << 21,
149 kUnalignedLoad = 1u << 22,
150 kUnalignedStore = 1u << 23,
140 kAllOptionalOps = kFloat32Max | kFloat32Min | kFloat64Max | kFloat64Min | 151 kAllOptionalOps = kFloat32Max | kFloat32Min | kFloat64Max | kFloat64Min |
141 kFloat32RoundDown | kFloat64RoundDown | kFloat32RoundUp | 152 kFloat32RoundDown | kFloat64RoundDown | kFloat32RoundUp |
142 kFloat64RoundUp | kFloat32RoundTruncate | 153 kFloat64RoundUp | kFloat32RoundTruncate |
143 kFloat64RoundTruncate | kFloat64RoundTiesAway | 154 kFloat64RoundTruncate | kFloat64RoundTiesAway |
144 kFloat32RoundTiesEven | kFloat64RoundTiesEven | 155 kFloat32RoundTiesEven | kFloat64RoundTiesEven |
145 kWord32Ctz | kWord64Ctz | kWord32Popcnt | kWord64Popcnt | 156 kWord32Ctz | kWord64Ctz | kWord32Popcnt | kWord64Popcnt |
146 kWord32ReverseBits | kWord64ReverseBits 157 kWord32ReverseBits | kWord64ReverseBits | kUnalignedLoad |
158 kUnalignedStore
147 }; 159 };
148 typedef base::Flags<Flag, unsigned> Flags; 160 typedef base::Flags<Flag, unsigned> Flags;
149 161
150 explicit MachineOperatorBuilder( 162 explicit MachineOperatorBuilder(
151 Zone* zone, 163 Zone* zone,
152 MachineRepresentation word = MachineType::PointerRepresentation(), 164 MachineRepresentation word = MachineType::PointerRepresentation(),
153 Flags supportedOperators = kNoFlags); 165 Flags supportedOperators = kNoFlags);
154 166
155 const Operator* Word32And(); 167 const Operator* Word32And();
156 const Operator* Word32Or(); 168 const Operator* Word32Or();
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 const Operator* Float64ExtractHighWord32(); 328 const Operator* Float64ExtractHighWord32();
317 const Operator* Float64InsertLowWord32(); 329 const Operator* Float64InsertLowWord32();
318 const Operator* Float64InsertHighWord32(); 330 const Operator* Float64InsertHighWord32();
319 331
320 // load [base + index] 332 // load [base + index]
321 const Operator* Load(LoadRepresentation rep); 333 const Operator* Load(LoadRepresentation rep);
322 334
323 // store [base + index], value 335 // store [base + index], value
324 const Operator* Store(StoreRepresentation rep); 336 const Operator* Store(StoreRepresentation rep);
325 337
338 // unaligned load [base + index]
339 const OptionalOperator UnalignedLoad(UnalignedLoadRepresentation rep);
340
341 // unaligned store [base + index], value
342 const OptionalOperator UnalignedStore(UnalignedStoreRepresentation rep);
343
326 const Operator* StackSlot(MachineRepresentation rep); 344 const Operator* StackSlot(MachineRepresentation rep);
327 345
328 // Access to the machine stack. 346 // Access to the machine stack.
329 const Operator* LoadStackPointer(); 347 const Operator* LoadStackPointer();
330 const Operator* LoadFramePointer(); 348 const Operator* LoadFramePointer();
331 const Operator* LoadParentFramePointer(); 349 const Operator* LoadParentFramePointer();
332 350
333 // checked-load heap, index, length 351 // checked-load heap, index, length
334 const Operator* CheckedLoad(CheckedLoadRepresentation); 352 const Operator* CheckedLoad(CheckedLoadRepresentation);
335 // checked-store heap, index, length, value 353 // checked-store heap, index, length, value
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 }; 397 };
380 398
381 399
382 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags) 400 DEFINE_OPERATORS_FOR_FLAGS(MachineOperatorBuilder::Flags)
383 401
384 } // namespace compiler 402 } // namespace compiler
385 } // namespace internal 403 } // namespace internal
386 } // namespace v8 404 } // namespace v8
387 405
388 #endif // V8_COMPILER_MACHINE_OPERATOR_H_ 406 #endif // V8_COMPILER_MACHINE_OPERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698