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

Side by Side Diff: src/compiler/opcodes.h

Issue 951903003: [turbofan] Strength reduction for inline comparisons. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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_OPCODES_H_ 5 #ifndef V8_COMPILER_OPCODES_H_
6 #define V8_COMPILER_OPCODES_H_ 6 #define V8_COMPILER_OPCODES_H_
7 7
8 // Opcodes for control operators. 8 // Opcodes for control operators.
9 #define INNER_CONTROL_OP_LIST(V) \ 9 #define INNER_CONTROL_OP_LIST(V) \
10 V(Dead) \ 10 V(Dead) \
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 V(JSDebugger) 133 V(JSDebugger)
134 134
135 #define JS_OP_LIST(V) \ 135 #define JS_OP_LIST(V) \
136 JS_SIMPLE_BINOP_LIST(V) \ 136 JS_SIMPLE_BINOP_LIST(V) \
137 JS_SIMPLE_UNOP_LIST(V) \ 137 JS_SIMPLE_UNOP_LIST(V) \
138 JS_OBJECT_OP_LIST(V) \ 138 JS_OBJECT_OP_LIST(V) \
139 JS_CONTEXT_OP_LIST(V) \ 139 JS_CONTEXT_OP_LIST(V) \
140 JS_OTHER_OP_LIST(V) 140 JS_OTHER_OP_LIST(V)
141 141
142 // Opcodes for VirtuaMachine-level operators. 142 // Opcodes for VirtuaMachine-level operators.
143 #define SIMPLIFIED_OP_LIST(V) \ 143 #define SIMPLIFIED_COMPARE_BINOP_LIST(V) \
144 V(AnyToBoolean) \ 144 V(NumberEqual) \
145 V(BooleanNot) \ 145 V(NumberLessThan) \
146 V(BooleanToNumber) \ 146 V(NumberLessThanOrEqual) \
147 V(NumberEqual) \ 147 V(ReferenceEqual) \
148 V(NumberLessThan) \ 148 V(StringEqual) \
149 V(NumberLessThanOrEqual) \ 149 V(StringLessThan) \
150 V(NumberAdd) \ 150 V(StringLessThanOrEqual)
151 V(NumberSubtract) \ 151
152 V(NumberMultiply) \ 152 #define SIMPLIFIED_OP_LIST(V) \
153 V(NumberDivide) \ 153 SIMPLIFIED_COMPARE_BINOP_LIST(V) \
154 V(NumberModulus) \ 154 V(AnyToBoolean) \
155 V(NumberToInt32) \ 155 V(BooleanNot) \
156 V(NumberToUint32) \ 156 V(BooleanToNumber) \
157 V(PlainPrimitiveToNumber) \ 157 V(NumberAdd) \
158 V(ReferenceEqual) \ 158 V(NumberSubtract) \
159 V(StringEqual) \ 159 V(NumberMultiply) \
160 V(StringLessThan) \ 160 V(NumberDivide) \
161 V(StringLessThanOrEqual) \ 161 V(NumberModulus) \
162 V(StringAdd) \ 162 V(NumberToInt32) \
163 V(ChangeTaggedToInt32) \ 163 V(NumberToUint32) \
164 V(ChangeTaggedToUint32) \ 164 V(PlainPrimitiveToNumber) \
165 V(ChangeTaggedToFloat64) \ 165 V(StringAdd) \
166 V(ChangeInt32ToTagged) \ 166 V(ChangeTaggedToInt32) \
167 V(ChangeUint32ToTagged) \ 167 V(ChangeTaggedToUint32) \
168 V(ChangeFloat64ToTagged) \ 168 V(ChangeTaggedToFloat64) \
169 V(ChangeBoolToBit) \ 169 V(ChangeInt32ToTagged) \
170 V(ChangeBitToBool) \ 170 V(ChangeUint32ToTagged) \
171 V(LoadField) \ 171 V(ChangeFloat64ToTagged) \
172 V(LoadBuffer) \ 172 V(ChangeBoolToBit) \
173 V(LoadElement) \ 173 V(ChangeBitToBool) \
174 V(StoreField) \ 174 V(LoadField) \
175 V(StoreBuffer) \ 175 V(LoadBuffer) \
176 V(StoreElement) \ 176 V(LoadElement) \
177 V(ObjectIsSmi) \ 177 V(StoreField) \
178 V(StoreBuffer) \
179 V(StoreElement) \
180 V(ObjectIsSmi) \
178 V(ObjectIsNonNegativeSmi) 181 V(ObjectIsNonNegativeSmi)
179 182
180 // Opcodes for Machine-level operators. 183 // Opcodes for Machine-level operators.
181 #define MACHINE_OP_LIST(V) \ 184 #define MACHINE_COMPARE_BINOP_LIST(V) \
182 V(Load) \ 185 V(Word32Equal) \
183 V(Store) \ 186 V(Word64Equal) \
184 V(Word32And) \ 187 V(Int32LessThan) \
185 V(Word32Or) \ 188 V(Int32LessThanOrEqual) \
186 V(Word32Xor) \ 189 V(Uint32LessThan) \
187 V(Word32Shl) \ 190 V(Uint32LessThanOrEqual) \
188 V(Word32Shr) \ 191 V(Int64LessThan) \
189 V(Word32Sar) \ 192 V(Int64LessThanOrEqual) \
190 V(Word32Ror) \ 193 V(Uint64LessThan) \
191 V(Word32Equal) \ 194 V(Float64Equal) \
192 V(Word64And) \ 195 V(Float64LessThan) \
193 V(Word64Or) \ 196 V(Float64LessThanOrEqual)
194 V(Word64Xor) \ 197
195 V(Word64Shl) \ 198 #define MACHINE_OP_LIST(V) \
196 V(Word64Shr) \ 199 MACHINE_COMPARE_BINOP_LIST(V) \
197 V(Word64Sar) \ 200 V(Load) \
198 V(Word64Ror) \ 201 V(Store) \
199 V(Word64Equal) \ 202 V(Word32And) \
200 V(Int32Add) \ 203 V(Word32Or) \
201 V(Int32AddWithOverflow) \ 204 V(Word32Xor) \
202 V(Int32Sub) \ 205 V(Word32Shl) \
203 V(Int32SubWithOverflow) \ 206 V(Word32Shr) \
204 V(Int32Mul) \ 207 V(Word32Sar) \
205 V(Int32MulHigh) \ 208 V(Word32Ror) \
206 V(Int32Div) \ 209 V(Word64And) \
207 V(Int32Mod) \ 210 V(Word64Or) \
208 V(Int32LessThan) \ 211 V(Word64Xor) \
209 V(Int32LessThanOrEqual) \ 212 V(Word64Shl) \
210 V(Uint32Div) \ 213 V(Word64Shr) \
211 V(Uint32LessThan) \ 214 V(Word64Sar) \
212 V(Uint32LessThanOrEqual) \ 215 V(Word64Ror) \
213 V(Uint32Mod) \ 216 V(Int32Add) \
214 V(Uint32MulHigh) \ 217 V(Int32AddWithOverflow) \
215 V(Int64Add) \ 218 V(Int32Sub) \
216 V(Int64Sub) \ 219 V(Int32SubWithOverflow) \
217 V(Int64Mul) \ 220 V(Int32Mul) \
218 V(Int64Div) \ 221 V(Int32MulHigh) \
219 V(Int64Mod) \ 222 V(Int32Div) \
220 V(Int64LessThan) \ 223 V(Int32Mod) \
221 V(Int64LessThanOrEqual) \ 224 V(Uint32Div) \
222 V(Uint64Div) \ 225 V(Uint32Mod) \
223 V(Uint64LessThan) \ 226 V(Uint32MulHigh) \
224 V(Uint64Mod) \ 227 V(Int64Add) \
225 V(ChangeFloat32ToFloat64) \ 228 V(Int64Sub) \
226 V(ChangeFloat64ToInt32) \ 229 V(Int64Mul) \
227 V(ChangeFloat64ToUint32) \ 230 V(Int64Div) \
228 V(ChangeInt32ToFloat64) \ 231 V(Int64Mod) \
229 V(ChangeInt32ToInt64) \ 232 V(Uint64Div) \
230 V(ChangeUint32ToFloat64) \ 233 V(Uint64Mod) \
231 V(ChangeUint32ToUint64) \ 234 V(ChangeFloat32ToFloat64) \
232 V(TruncateFloat64ToFloat32) \ 235 V(ChangeFloat64ToInt32) \
233 V(TruncateFloat64ToInt32) \ 236 V(ChangeFloat64ToUint32) \
234 V(TruncateInt64ToInt32) \ 237 V(ChangeInt32ToFloat64) \
235 V(Float64Add) \ 238 V(ChangeInt32ToInt64) \
236 V(Float64Sub) \ 239 V(ChangeUint32ToFloat64) \
237 V(Float64Mul) \ 240 V(ChangeUint32ToUint64) \
238 V(Float64Div) \ 241 V(TruncateFloat64ToFloat32) \
239 V(Float64Mod) \ 242 V(TruncateFloat64ToInt32) \
240 V(Float64Sqrt) \ 243 V(TruncateInt64ToInt32) \
241 V(Float64Equal) \ 244 V(Float64Add) \
242 V(Float64LessThan) \ 245 V(Float64Sub) \
243 V(Float64LessThanOrEqual) \ 246 V(Float64Mul) \
244 V(Float64Floor) \ 247 V(Float64Div) \
245 V(Float64Ceil) \ 248 V(Float64Mod) \
246 V(Float64RoundTruncate) \ 249 V(Float64Sqrt) \
247 V(Float64RoundTiesAway) \ 250 V(Float64Floor) \
248 V(LoadStackPointer) \ 251 V(Float64Ceil) \
249 V(CheckedLoad) \ 252 V(Float64RoundTruncate) \
253 V(Float64RoundTiesAway) \
254 V(LoadStackPointer) \
255 V(CheckedLoad) \
250 V(CheckedStore) 256 V(CheckedStore)
251 257
252 #define VALUE_OP_LIST(V) \ 258 #define VALUE_OP_LIST(V) \
253 COMMON_OP_LIST(V) \ 259 COMMON_OP_LIST(V) \
254 SIMPLIFIED_OP_LIST(V) \ 260 SIMPLIFIED_OP_LIST(V) \
255 MACHINE_OP_LIST(V) \ 261 MACHINE_OP_LIST(V) \
256 JS_OP_LIST(V) 262 JS_OP_LIST(V)
257 263
258 // The combination of all operators at all levels and the common operators. 264 // The combination of all operators at all levels and the common operators.
259 #define ALL_OP_LIST(V) \ 265 #define ALL_OP_LIST(V) \
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 return kInt32Constant <= value && value <= kHeapConstant; 307 return kInt32Constant <= value && value <= kHeapConstant;
302 } 308 }
303 309
304 static bool IsPhiOpcode(Value value) { 310 static bool IsPhiOpcode(Value value) {
305 return value == kPhi || value == kEffectPhi; 311 return value == kPhi || value == kEffectPhi;
306 } 312 }
307 313
308 static bool IsMergeOpcode(Value value) { 314 static bool IsMergeOpcode(Value value) {
309 return value == kMerge || value == kLoop; 315 return value == kMerge || value == kLoop;
310 } 316 }
317
318 // Returns true if opcode for comparison operator.
319 static bool IsComparisonOpcode(Value value) {
320 return (kJSEqual <= value && value <= kJSGreaterThanOrEqual) ||
321 (kNumberEqual <= value && value <= kStringLessThanOrEqual) ||
322 (kWord32Equal <= value && value <= kFloat64LessThanOrEqual);
323 }
311 }; 324 };
312 325
313 } // namespace compiler 326 } // namespace compiler
314 } // namespace internal 327 } // namespace internal
315 } // namespace v8 328 } // namespace v8
316 329
317 #endif // V8_COMPILER_OPCODES_H_ 330 #endif // V8_COMPILER_OPCODES_H_
OLDNEW
« no previous file with comments | « src/compiler/node-matchers.cc ('k') | test/unittests/compiler/machine-operator-reducer-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698