v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
opcodes.h
Go to the documentation of this file.
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
3// found in the LICENSE file.
4
5#ifndef V8_COMPILER_OPCODES_H_
6#define V8_COMPILER_OPCODES_H_
7
8#include <iosfwd>
9
10#include "src/common/globals.h"
11
12// Opcodes for control operators.
13#define CONTROL_OP_LIST(V) \
14 V(Start) \
15 V(Loop) \
16 V(Branch) \
17 V(Switch) \
18 V(IfTrue) \
19 V(IfFalse) \
20 V(IfSuccess) \
21 V(IfException) \
22 V(IfValue) \
23 V(IfDefault) \
24 V(Merge) \
25 V(Deoptimize) \
26 V(DeoptimizeIf) \
27 V(DeoptimizeUnless) \
28 V(Assert) \
29 V(TrapIf) \
30 V(TrapUnless) \
31 V(Return) \
32 V(TailCall) \
33 V(Terminate) \
34 V(Throw) \
35 V(End)
36
37#define MACHINE_LEVEL_CONSTANT_OP_LIST(V) \
38 V(Int32Constant) \
39 V(Int64Constant) \
40 V(TaggedIndexConstant) \
41 V(Float32Constant) \
42 V(Float64Constant) \
43 V(CompressedHeapConstant) \
44 V(RelocatableInt32Constant) \
45 V(RelocatableInt64Constant)
46
47#define JS_LEVEL_CONSTANT_OP_LIST(V) \
48 V(ExternalConstant) \
49 V(NumberConstant) \
50 V(PointerConstant) \
51 V(HeapConstant) \
52 V(TrustedHeapConstant)
53
54// Opcodes for constant operators.
55#define CONSTANT_OP_LIST(V) \
56 JS_LEVEL_CONSTANT_OP_LIST(V) \
57 MACHINE_LEVEL_CONSTANT_OP_LIST(V)
58
59#define INNER_OP_LIST(V) \
60 V(Select) \
61 V(Phi) \
62 V(EffectPhi) \
63 V(InductionVariablePhi) \
64 V(Checkpoint) \
65 V(BeginRegion) \
66 V(FinishRegion) \
67 V(FrameState) \
68 V(StateValues) \
69 V(TypedStateValues) \
70 V(ArgumentsElementsState) \
71 V(ArgumentsLengthState) \
72 V(ObjectState) \
73 V(ObjectId) \
74 V(TypedObjectState) \
75 V(Call) \
76 V(Parameter) \
77 V(OsrValue) \
78 V(LoopExit) \
79 V(LoopExitValue) \
80 V(LoopExitEffect) \
81 V(Projection) \
82 V(Retain) \
83 V(MapGuard) \
84 V(TypeGuard) \
85 V(EnterMachineGraph) \
86 V(ExitMachineGraph)
87
88#define COMMON_OP_LIST(V) \
89 CONSTANT_OP_LIST(V) \
90 INNER_OP_LIST(V) \
91 V(Unreachable) \
92 V(DeadValue) \
93 V(Dead) \
94 V(Plug) \
95 V(SLVerifierHint) \
96 V(StaticAssert)
97
98// Opcodes for JavaScript operators.
99// Arguments are JSName (the name with a 'JS' prefix), and Name.
100#define JS_COMPARE_BINOP_LIST(V) \
101 V(JSEqual, Equal) \
102 V(JSStrictEqual, StrictEqual) \
103 V(JSLessThan, LessThan) \
104 V(JSGreaterThan, GreaterThan) \
105 V(JSLessThanOrEqual, LessThanOrEqual) \
106 V(JSGreaterThanOrEqual, GreaterThanOrEqual)
107
108#define JS_BITWISE_BINOP_LIST(V) \
109 V(JSBitwiseOr, BitwiseOr) \
110 V(JSBitwiseXor, BitwiseXor) \
111 V(JSBitwiseAnd, BitwiseAnd) \
112 V(JSShiftLeft, ShiftLeft) \
113 V(JSShiftRight, ShiftRight) \
114 V(JSShiftRightLogical, ShiftRightLogical)
115
116#define JS_ARITH_BINOP_LIST(V) \
117 V(JSAdd, Add) \
118 V(JSSubtract, Subtract) \
119 V(JSMultiply, Multiply) \
120 V(JSDivide, Divide) \
121 V(JSModulus, Modulus) \
122 V(JSExponentiate, Exponentiate)
123
124#define JS_SIMPLE_BINOP_LIST(V) \
125 JS_COMPARE_BINOP_LIST(V) \
126 JS_BITWISE_BINOP_LIST(V) \
127 JS_ARITH_BINOP_LIST(V) \
128 V(JSHasInPrototypeChain) \
129 V(JSInstanceOf) \
130 V(JSOrdinaryHasInstance)
131
132#define JS_CONVERSION_UNOP_LIST(V) \
133 V(JSToLength) \
134 V(JSToName) \
135 V(JSToNumber) \
136 V(JSToNumberConvertBigInt) \
137 V(JSToBigInt) \
138 V(JSToBigIntConvertNumber) \
139 V(JSToNumeric) \
140 V(JSToObject) \
141 V(JSToString) \
142 V(JSParseInt)
143
144#define JS_BITWISE_UNOP_LIST(V) \
145 V(JSBitwiseNot, BitwiseNot) \
146 V(JSNegate, Negate)
147
148#define JS_ARITH_UNOP_LIST(V) \
149 V(JSDecrement, Decrement) \
150 V(JSIncrement, Increment)
151
152#define JS_SIMPLE_UNOP_LIST(V) \
153 JS_ARITH_UNOP_LIST(V) \
154 JS_BITWISE_UNOP_LIST(V) \
155 JS_CONVERSION_UNOP_LIST(V)
156
157#define JS_CREATE_OP_LIST(V) \
158 V(JSCloneObject) \
159 V(JSCreate) \
160 V(JSCreateArguments) \
161 V(JSCreateArray) \
162 V(JSCreateArrayFromIterable) \
163 V(JSCreateArrayIterator) \
164 V(JSCreateAsyncFunctionObject) \
165 V(JSCreateBoundFunction) \
166 V(JSCreateClosure) \
167 V(JSCreateCollectionIterator) \
168 V(JSCreateEmptyLiteralArray) \
169 V(JSCreateEmptyLiteralObject) \
170 V(JSCreateGeneratorObject) \
171 V(JSCreateIterResultObject) \
172 V(JSCreateKeyValueArray) \
173 V(JSCreateLiteralArray) \
174 V(JSCreateLiteralObject) \
175 V(JSCreateLiteralRegExp) \
176 V(JSCreateObject) \
177 V(JSCreateStringWrapper) \
178 V(JSCreatePromise) \
179 V(JSCreateStringIterator) \
180 V(JSCreateTypedArray) \
181 V(JSGetTemplateObject)
182
183#define JS_OBJECT_OP_LIST(V) \
184 JS_CREATE_OP_LIST(V) \
185 V(JSLoadProperty) \
186 V(JSLoadNamed) \
187 V(JSLoadNamedFromSuper) \
188 V(JSLoadGlobal) \
189 V(JSSetKeyedProperty) \
190 V(JSDefineKeyedOwnProperty) \
191 V(JSSetNamedProperty) \
192 V(JSDefineNamedOwnProperty) \
193 V(JSStoreGlobal) \
194 V(JSDefineKeyedOwnPropertyInLiteral) \
195 V(JSStoreInArrayLiteral) \
196 V(JSDeleteProperty) \
197 V(JSHasProperty) \
198 V(JSGetSuperConstructor) \
199 V(JSFindNonDefaultConstructorOrConstruct)
200
201#define JS_CONTEXT_OP_LIST(V) \
202 V(JSHasContextExtension) \
203 V(JSLoadContext) \
204 V(JSLoadScriptContext) \
205 V(JSStoreContext) \
206 V(JSStoreScriptContext) \
207 V(JSCreateFunctionContext) \
208 V(JSCreateCatchContext) \
209 V(JSCreateWithContext) \
210 V(JSCreateBlockContext)
211
212#define JS_CALL_OP_LIST(V) \
213 V(JSCall) \
214 V(JSCallForwardVarargs) \
215 V(JSCallWithArrayLike) \
216 V(JSCallWithSpread) \
217 IF_WASM(V, JSWasmCall)
218
219#define JS_CONSTRUCT_OP_LIST(V) \
220 V(JSConstructForwardVarargs) \
221 V(JSConstructForwardAllArgs) \
222 V(JSConstruct) \
223 V(JSConstructWithArrayLike) \
224 V(JSConstructWithSpread)
225
226#define JS_OTHER_OP_LIST(V) \
227 JS_CALL_OP_LIST(V) \
228 JS_CONSTRUCT_OP_LIST(V) \
229 V(JSAsyncFunctionEnter) \
230 V(JSAsyncFunctionReject) \
231 V(JSAsyncFunctionResolve) \
232 V(JSCallRuntime) \
233 V(JSForInEnumerate) \
234 V(JSForInNext) \
235 V(JSForInPrepare) \
236 V(JSGetIterator) \
237 V(JSLoadMessage) \
238 V(JSStoreMessage) \
239 V(JSLoadModule) \
240 V(JSStoreModule) \
241 V(JSGetImportMeta) \
242 V(JSGeneratorStore) \
243 V(JSGeneratorRestoreContinuation) \
244 V(JSGeneratorRestoreContext) \
245 V(JSGeneratorRestoreRegister) \
246 V(JSGeneratorRestoreInputOrDebugPos) \
247 V(JSFulfillPromise) \
248 V(JSPerformPromiseThen) \
249 V(JSPromiseResolve) \
250 V(JSRejectPromise) \
251 V(JSResolvePromise) \
252 V(JSStackCheck) \
253 V(JSObjectIsArray) \
254 V(JSRegExpTest) \
255 V(JSDebugger)
256
257#define JS_OP_LIST(V) \
258 JS_SIMPLE_BINOP_LIST(V) \
259 JS_SIMPLE_UNOP_LIST(V) \
260 JS_OBJECT_OP_LIST(V) \
261 JS_CONTEXT_OP_LIST(V) \
262 JS_OTHER_OP_LIST(V)
263
264// Opcodes for VirtuaMachine-level operators.
265#define SIMPLIFIED_CHANGE_OP_LIST(V) \
266 V(ChangeTaggedSignedToInt32) \
267 V(ChangeTaggedSignedToInt64) \
268 V(ChangeTaggedToInt32) \
269 V(ChangeTaggedToInt64) \
270 V(ChangeTaggedToUint32) \
271 V(ChangeTaggedToFloat64) \
272 V(ChangeTaggedToTaggedSigned) \
273 V(ChangeInt31ToTaggedSigned) \
274 V(ChangeInt32ToTagged) \
275 V(ChangeInt64ToTagged) \
276 V(ChangeUint32ToTagged) \
277 V(ChangeUint64ToTagged) \
278 V(ChangeFloat64ToTagged) \
279 V(ChangeFloat64ToTaggedPointer) \
280 V(ChangeTaggedToBit) \
281 V(ChangeBitToTagged) \
282 V(ChangeInt64ToBigInt) \
283 V(ChangeUint64ToBigInt) \
284 V(TruncateBigIntToWord64) \
285 V(TruncateTaggedToWord32) \
286 V(TruncateTaggedToFloat64) \
287 V(TruncateTaggedToBit) \
288 V(TruncateTaggedPointerToBit)
289
290#define SIMPLIFIED_CHECKED_OP_LIST(V) \
291 V(CheckedInt32Add) \
292 V(CheckedInt32Sub) \
293 V(CheckedInt32Div) \
294 V(CheckedInt32Mod) \
295 V(CheckedUint32Div) \
296 V(CheckedUint32Mod) \
297 V(CheckedInt32Mul) \
298 V(CheckedInt64Add) \
299 V(CheckedAdditiveSafeIntegerAdd) \
300 V(CheckedAdditiveSafeIntegerSub) \
301 V(CheckedInt64Sub) \
302 V(CheckedInt64Mul) \
303 V(CheckedInt64Div) \
304 V(CheckedInt64Mod) \
305 V(CheckedInt32ToTaggedSigned) \
306 V(CheckedInt64ToInt32) \
307 V(CheckedInt64ToTaggedSigned) \
308 V(CheckedUint32Bounds) \
309 V(CheckedUint32ToInt32) \
310 V(CheckedUint32ToTaggedSigned) \
311 V(CheckedUint64Bounds) \
312 V(CheckedUint64ToInt32) \
313 V(CheckedUint64ToInt64) \
314 V(CheckedUint64ToTaggedSigned) \
315 V(CheckedFloat64ToInt32) \
316 V(CheckedFloat64ToInt64) \
317 V(CheckedFloat64ToAdditiveSafeInteger) \
318 V(CheckedTaggedSignedToInt32) \
319 V(CheckedTaggedToInt32) \
320 V(CheckedTaggedToArrayIndex) \
321 V(CheckedTruncateTaggedToWord32) \
322 V(CheckedTaggedToFloat64) \
323 V(CheckedTaggedToAdditiveSafeInteger) \
324 V(CheckedTaggedToInt64) \
325 V(CheckedTaggedToTaggedSigned) \
326 V(CheckedTaggedToTaggedPointer)
327
328#define SIMPLIFIED_COMPARE_BINOP_LIST(V) \
329 V(NumberEqual) \
330 V(NumberLessThan) \
331 V(NumberLessThanOrEqual) \
332 V(SpeculativeNumberEqual) \
333 V(SpeculativeNumberLessThan) \
334 V(SpeculativeNumberLessThanOrEqual) \
335 V(ReferenceEqual) \
336 V(SameValue) \
337 V(SameValueNumbersOnly) \
338 V(NumberSameValue) \
339 V(StringEqual) \
340 V(StringLessThan) \
341 V(StringLessThanOrEqual) \
342 V(BigIntEqual) \
343 V(BigIntLessThan) \
344 V(BigIntLessThanOrEqual) \
345 V(SpeculativeBigIntEqual) \
346 V(SpeculativeBigIntLessThan) \
347 V(SpeculativeBigIntLessThanOrEqual)
348
349#define SIMPLIFIED_NUMBER_BINOP_LIST(V) \
350 V(NumberAdd) \
351 V(NumberSubtract) \
352 V(NumberMultiply) \
353 V(NumberDivide) \
354 V(NumberModulus) \
355 V(NumberBitwiseOr) \
356 V(NumberBitwiseXor) \
357 V(NumberBitwiseAnd) \
358 V(NumberShiftLeft) \
359 V(NumberShiftRight) \
360 V(NumberShiftRightLogical) \
361 V(NumberAtan2) \
362 V(NumberImul) \
363 V(NumberMax) \
364 V(NumberMin) \
365 V(NumberPow)
366
367#define SIMPLIFIED_BIGINT_BINOP_LIST(V) \
368 V(BigIntAdd) \
369 V(BigIntSubtract) \
370 V(BigIntMultiply) \
371 V(BigIntDivide) \
372 V(BigIntModulus) \
373 V(BigIntBitwiseAnd) \
374 V(BigIntBitwiseOr) \
375 V(BigIntBitwiseXor) \
376 V(BigIntShiftLeft) \
377 V(BigIntShiftRight)
378
379#define SIMPLIFIED_SPECULATIVE_NUMBER_BINOP_LIST(V) \
380 V(SpeculativeNumberAdd) \
381 V(SpeculativeNumberSubtract) \
382 V(SpeculativeNumberMultiply) \
383 V(SpeculativeNumberPow) \
384 V(SpeculativeNumberDivide) \
385 V(SpeculativeNumberModulus) \
386 V(SpeculativeNumberBitwiseAnd) \
387 V(SpeculativeNumberBitwiseOr) \
388 V(SpeculativeNumberBitwiseXor) \
389 V(SpeculativeNumberShiftLeft) \
390 V(SpeculativeNumberShiftRight) \
391 V(SpeculativeNumberShiftRightLogical) \
392 V(SpeculativeAdditiveSafeIntegerAdd) \
393 V(SpeculativeAdditiveSafeIntegerSubtract) \
394 V(SpeculativeSmallIntegerAdd) \
395 V(SpeculativeSmallIntegerSubtract)
396
397#define SIMPLIFIED_NUMBER_UNOP_LIST(V) \
398 V(NumberAbs) \
399 V(NumberAcos) \
400 V(NumberAcosh) \
401 V(NumberAsin) \
402 V(NumberAsinh) \
403 V(NumberAtan) \
404 V(NumberAtanh) \
405 V(NumberCbrt) \
406 V(NumberCeil) \
407 V(NumberClz32) \
408 V(NumberCos) \
409 V(NumberCosh) \
410 V(NumberExp) \
411 V(NumberExpm1) \
412 V(NumberFloor) \
413 V(NumberFround) \
414 V(NumberLog) \
415 V(NumberLog1p) \
416 V(NumberLog2) \
417 V(NumberLog10) \
418 V(NumberRound) \
419 V(NumberSign) \
420 V(NumberSin) \
421 V(NumberSinh) \
422 V(NumberSqrt) \
423 V(NumberTan) \
424 V(NumberTanh) \
425 V(NumberTrunc) \
426 V(NumberToBoolean) \
427 V(NumberToInt32) \
428 V(NumberToString) \
429 V(NumberToUint32) \
430 V(NumberToUint8Clamped) \
431 V(Integral32OrMinusZeroToBigInt) \
432 V(NumberSilenceNaN)
433
434#define SIMPLIFIED_BIGINT_UNOP_LIST(V) \
435 V(BigIntNegate) \
436 V(CheckBigInt) \
437 V(CheckedBigIntToBigInt64)
438
439#define SIMPLIFIED_SPECULATIVE_NUMBER_UNOP_LIST(V) V(SpeculativeToNumber)
440
441#ifdef V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA
442#define SIMPLIFIED_CPED_OP_LIST(V) \
443 V(GetContinuationPreservedEmbedderData) \
444 V(SetContinuationPreservedEmbedderData)
445#else
446#define SIMPLIFIED_CPED_OP_LIST(V)
447#endif // V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA
448
449#define SIMPLIFIED_OTHER_OP_LIST(V) \
450 V(Allocate) \
451 V(AllocateRaw) \
452 V(ArgumentsLength) \
453 V(AssertType) \
454 V(BooleanNot) \
455 V(ChangeFloat64HoleToTagged) \
456 V(CheckBounds) \
457 V(CheckClosure) \
458 V(CheckEqualsInternalizedString) \
459 V(CheckEqualsSymbol) \
460 V(CheckFloat64Hole) \
461 V(CheckHeapObject) \
462 V(CheckIf) \
463 V(CheckInternalizedString) \
464 V(CheckMaps) \
465 V(CheckNotTaggedHole) \
466 V(CheckNumber) \
467 V(CheckNumberFitsInt32) \
468 V(CheckReceiver) \
469 V(CheckReceiverOrNullOrUndefined) \
470 V(CheckSmi) \
471 V(CheckString) \
472 V(CheckStringOrStringWrapper) \
473 V(CheckSymbol) \
474 V(CheckTurboshaftTypeOf) \
475 V(CompareMaps) \
476 V(ConvertReceiver) \
477 V(ConvertTaggedHoleToUndefined) \
478 V(DateNow) \
479 V(DoubleArrayMax) \
480 V(DoubleArrayMin) \
481 V(EnsureWritableFastElements) \
482 V(FastApiCall) \
483 V(FindOrderedHashMapEntry) \
484 V(FindOrderedHashMapEntryForInt32Key) \
485 V(FindOrderedHashSetEntry) \
486 V(InitializeImmutableInObject) \
487 V(LoadDataViewElement) \
488 V(LoadElement) \
489 V(LoadField) \
490 V(LoadFieldByIndex) \
491 V(LoadFromObject) \
492 V(LoadImmutableFromObject) \
493 V(LoadMessage) \
494 V(LoadStackArgument) \
495 V(LoadTypedElement) \
496 V(MaybeGrowFastElements) \
497 V(NewArgumentsElements) \
498 V(NewConsString) \
499 V(NewDoubleElements) \
500 V(NewSmiOrObjectElements) \
501 V(NumberIsFinite) \
502 V(NumberIsFloat64Hole) \
503 V(NumberIsInteger) \
504 V(NumberIsMinusZero) \
505 V(NumberIsNaN) \
506 V(NumberIsSafeInteger) \
507 V(ObjectIsArrayBufferView) \
508 V(ObjectIsBigInt) \
509 V(ObjectIsCallable) \
510 V(ObjectIsConstructor) \
511 V(ObjectIsDetectableCallable) \
512 V(ObjectIsFiniteNumber) \
513 V(ObjectIsInteger) \
514 V(ObjectIsMinusZero) \
515 V(ObjectIsNaN) \
516 V(ObjectIsNonCallable) \
517 V(ObjectIsNumber) \
518 V(ObjectIsReceiver) \
519 V(ObjectIsSafeInteger) \
520 V(ObjectIsSmi) \
521 V(ObjectIsString) \
522 V(ObjectIsSymbol) \
523 V(ObjectIsUndetectable) \
524 V(PlainPrimitiveToFloat64) \
525 V(PlainPrimitiveToNumber) \
526 V(PlainPrimitiveToWord32) \
527 V(RestLength) \
528 V(RuntimeAbort) \
529 V(StoreDataViewElement) \
530 V(StoreElement) \
531 V(StoreField) \
532 V(StoreMessage) \
533 V(StoreSignedSmallElement) \
534 V(StoreToObject) \
535 V(StoreTypedElement) \
536 V(StringCharCodeAt) \
537 V(StringCodePointAt) \
538 V(StringConcat) \
539 V(StringFromCodePointAt) \
540 V(StringFromSingleCharCode) \
541 V(StringFromSingleCodePoint) \
542 V(StringIndexOf) \
543 V(StringLength) \
544 V(StringWrapperLength) \
545 V(StringSubstring) \
546 V(StringToLowerCaseIntl) \
547 V(StringToNumber) \
548 V(StringToUpperCaseIntl) \
549 V(ToBoolean) \
550 V(TransitionAndStoreElement) \
551 V(TransitionAndStoreNonNumberElement) \
552 V(TransitionAndStoreNumberElement) \
553 V(TransitionElementsKind) \
554 V(TransitionElementsKindOrCheckMap) \
555 V(TypedArrayLength) \
556 V(TypeOf) \
557 V(Unsigned32Divide) \
558 V(VerifyType) \
559 SIMPLIFIED_CPED_OP_LIST(V)
560
561#define SIMPLIFIED_SPECULATIVE_BIGINT_BINOP_LIST(V) \
562 V(SpeculativeBigIntAdd) \
563 V(SpeculativeBigIntSubtract) \
564 V(SpeculativeBigIntMultiply) \
565 V(SpeculativeBigIntDivide) \
566 V(SpeculativeBigIntModulus) \
567 V(SpeculativeBigIntBitwiseAnd) \
568 V(SpeculativeBigIntBitwiseOr) \
569 V(SpeculativeBigIntBitwiseXor) \
570 V(SpeculativeBigIntShiftLeft) \
571 V(SpeculativeBigIntShiftRight)
572
573#define SIMPLIFIED_SPECULATIVE_BIGINT_UNOP_LIST(V) \
574 V(SpeculativeBigIntAsIntN) \
575 V(SpeculativeBigIntAsUintN) \
576 V(SpeculativeBigIntNegate) \
577 V(SpeculativeToBigInt)
578
579#define SIMPLIFIED_WASM_OP_LIST(V) \
580 V(AssertNotNull) \
581 V(IsNull) \
582 V(IsNotNull) \
583 V(Null) \
584 V(RttCanon) \
585 V(WasmTypeCast) \
586 V(WasmTypeCastAbstract) \
587 V(WasmTypeCheck) \
588 V(WasmTypeCheckAbstract) \
589 V(WasmAnyConvertExtern) \
590 V(WasmExternConvertAny) \
591 V(WasmStructGet) \
592 V(WasmStructSet) \
593 V(WasmArrayGet) \
594 V(WasmArraySet) \
595 V(WasmArrayLength) \
596 V(WasmArrayInitializeLength) \
597 V(StringAsWtf16) \
598 V(StringPrepareForGetCodeunit)
599
600#define SIMPLIFIED_OP_LIST(V) \
601 SIMPLIFIED_CHANGE_OP_LIST(V) \
602 SIMPLIFIED_CHECKED_OP_LIST(V) \
603 SIMPLIFIED_COMPARE_BINOP_LIST(V) \
604 SIMPLIFIED_NUMBER_BINOP_LIST(V) \
605 SIMPLIFIED_BIGINT_BINOP_LIST(V) \
606 SIMPLIFIED_SPECULATIVE_NUMBER_BINOP_LIST(V) \
607 SIMPLIFIED_NUMBER_UNOP_LIST(V) \
608 SIMPLIFIED_BIGINT_UNOP_LIST(V) \
609 SIMPLIFIED_SPECULATIVE_NUMBER_UNOP_LIST(V) \
610 SIMPLIFIED_SPECULATIVE_BIGINT_UNOP_LIST(V) \
611 SIMPLIFIED_SPECULATIVE_BIGINT_BINOP_LIST(V) \
612 IF_WASM(SIMPLIFIED_WASM_OP_LIST, V) \
613 SIMPLIFIED_OTHER_OP_LIST(V)
614
615// Opcodes for Machine-level operators.
616#define MACHINE_UNOP_32_LIST(V) \
617 V(Word32Clz) \
618 V(Word32Ctz) \
619 V(Int32AbsWithOverflow) \
620 V(Word32ReverseBits) \
621 V(Word32ReverseBytes)
622
623#define MACHINE_COMPARE_BINOP_LIST(V) \
624 V(Word32Equal) \
625 V(Word64Equal) \
626 V(Int32LessThan) \
627 V(Int32LessThanOrEqual) \
628 V(Uint32LessThan) \
629 V(Uint32LessThanOrEqual) \
630 V(Int64LessThan) \
631 V(Int64LessThanOrEqual) \
632 V(Uint64LessThan) \
633 V(Uint64LessThanOrEqual) \
634 V(Float32Equal) \
635 V(Float32LessThan) \
636 V(Float32LessThanOrEqual) \
637 V(Float64Equal) \
638 V(Float64LessThan) \
639 V(Float64LessThanOrEqual)
640
641#define MACHINE_BINOP_32_LIST(V) \
642 V(Word32And) \
643 V(Word32Or) \
644 V(Word32Xor) \
645 V(Word32Shl) \
646 V(Word32Shr) \
647 V(Word32Sar) \
648 V(Word32Rol) \
649 V(Word32Ror) \
650 V(Int32Add) \
651 V(Int32AddWithOverflow) \
652 V(Int32Sub) \
653 V(Int32SubWithOverflow) \
654 V(Int32Mul) \
655 V(Int32MulWithOverflow) \
656 V(Int32MulHigh) \
657 V(Int32Div) \
658 V(Int32Mod) \
659 V(Uint32Div) \
660 V(Uint32Mod) \
661 V(Uint32MulHigh)
662
663#define MACHINE_BINOP_64_LIST(V) \
664 V(Word64And) \
665 V(Word64Or) \
666 V(Word64Xor) \
667 V(Word64Shl) \
668 V(Word64Shr) \
669 V(Word64Sar) \
670 V(Word64Rol) \
671 V(Word64Ror) \
672 V(Word64RolLowerable) \
673 V(Word64RorLowerable) \
674 V(Int64Add) \
675 V(Int64AddWithOverflow) \
676 V(Int64Sub) \
677 V(Int64SubWithOverflow) \
678 V(Int64Mul) \
679 V(Int64MulHigh) \
680 V(Int64MulWithOverflow) \
681 V(Int64Div) \
682 V(Int64Mod) \
683 V(Uint64Div) \
684 V(Uint64Mod) \
685 V(Uint64MulHigh)
686
687#define MACHINE_FLOAT32_UNOP_LIST(V) \
688 V(Float32Abs) \
689 V(Float32Neg) \
690 V(Float32RoundDown) \
691 V(Float32RoundTiesEven) \
692 V(Float32RoundTruncate) \
693 V(Float32RoundUp) \
694 V(Float32Sqrt)
695
696#define MACHINE_FLOAT32_BINOP_LIST(V) \
697 V(Float32Add) \
698 V(Float32Sub) \
699 V(Float32Mul) \
700 V(Float32Div) \
701 V(Float32Max) \
702 V(Float32Min)
703
704#define MACHINE_FLOAT64_UNOP_LIST(V) \
705 V(Float64Abs) \
706 V(Float64Acos) \
707 V(Float64Acosh) \
708 V(Float64Asin) \
709 V(Float64Asinh) \
710 V(Float64Atan) \
711 V(Float64Atanh) \
712 V(Float64Cbrt) \
713 V(Float64Cos) \
714 V(Float64Cosh) \
715 V(Float64Exp) \
716 V(Float64Expm1) \
717 V(Float64Log) \
718 V(Float64Log1p) \
719 V(Float64Log10) \
720 V(Float64Log2) \
721 V(Float64Neg) \
722 V(Float64RoundDown) \
723 V(Float64RoundTiesAway) \
724 V(Float64RoundTiesEven) \
725 V(Float64RoundTruncate) \
726 V(Float64RoundUp) \
727 V(Float64Sin) \
728 V(Float64Sinh) \
729 V(Float64Sqrt) \
730 V(Float64Tan) \
731 V(Float64Tanh)
732
733#define MACHINE_FLOAT64_BINOP_LIST(V) \
734 V(Float64Atan2) \
735 V(Float64Max) \
736 V(Float64Min) \
737 V(Float64Add) \
738 V(Float64Sub) \
739 V(Float64Mul) \
740 V(Float64Div) \
741 V(Float64Mod) \
742 V(Float64Pow)
743
744#define MACHINE_ATOMIC_OP_LIST(V) \
745 V(Word32AtomicLoad) \
746 V(Word32AtomicStore) \
747 V(Word32AtomicExchange) \
748 V(Word32AtomicCompareExchange) \
749 V(Word32AtomicAdd) \
750 V(Word32AtomicSub) \
751 V(Word32AtomicAnd) \
752 V(Word32AtomicOr) \
753 V(Word32AtomicXor) \
754 V(Word32AtomicPairLoad) \
755 V(Word32AtomicPairStore) \
756 V(Word32AtomicPairAdd) \
757 V(Word32AtomicPairSub) \
758 V(Word32AtomicPairAnd) \
759 V(Word32AtomicPairOr) \
760 V(Word32AtomicPairXor) \
761 V(Word32AtomicPairExchange) \
762 V(Word32AtomicPairCompareExchange) \
763 V(Word64AtomicLoad) \
764 V(Word64AtomicStore) \
765 V(Word64AtomicAdd) \
766 V(Word64AtomicSub) \
767 V(Word64AtomicAnd) \
768 V(Word64AtomicOr) \
769 V(Word64AtomicXor) \
770 V(Word64AtomicExchange) \
771 V(Word64AtomicCompareExchange)
772
773#define MACHINE_OP_LIST(V) \
774 MACHINE_UNOP_32_LIST(V) \
775 MACHINE_BINOP_32_LIST(V) \
776 MACHINE_BINOP_64_LIST(V) \
777 MACHINE_COMPARE_BINOP_LIST(V) \
778 MACHINE_FLOAT32_BINOP_LIST(V) \
779 MACHINE_FLOAT32_UNOP_LIST(V) \
780 MACHINE_FLOAT64_BINOP_LIST(V) \
781 MACHINE_FLOAT64_UNOP_LIST(V) \
782 MACHINE_ATOMIC_OP_LIST(V) \
783 V(AbortCSADcheck) \
784 V(DebugBreak) \
785 V(Comment) \
786 V(Load) \
787 V(LoadImmutable) \
788 V(Store) \
789 V(StorePair) \
790 V(StoreIndirectPointer) \
791 V(StackSlot) \
792 V(Word32Popcnt) \
793 V(Word64Popcnt) \
794 V(Word64Clz) \
795 V(Word64Ctz) \
796 V(Word64ClzLowerable) \
797 V(Word64CtzLowerable) \
798 V(Word64ReverseBits) \
799 V(Word64ReverseBytes) \
800 V(Simd128ReverseBytes) \
801 V(Int64AbsWithOverflow) \
802 V(BitcastTaggedToWord) \
803 V(BitcastTaggedToWordForTagAndSmiBits) \
804 V(BitcastWordToTagged) \
805 V(BitcastWordToTaggedSigned) \
806 V(TruncateFloat64ToWord32) \
807 V(ChangeFloat32ToFloat64) \
808 V(ChangeFloat64ToInt32) \
809 V(ChangeFloat64ToInt64) \
810 V(ChangeFloat64ToUint32) \
811 V(ChangeFloat64ToUint64) \
812 V(Float64SilenceNaN) \
813 V(TruncateFloat64ToInt64) \
814 V(TruncateFloat64ToUint32) \
815 V(TruncateFloat32ToInt32) \
816 V(TruncateFloat32ToUint32) \
817 V(TryTruncateFloat32ToInt64) \
818 V(TryTruncateFloat64ToInt64) \
819 V(TryTruncateFloat32ToUint64) \
820 V(TryTruncateFloat64ToUint64) \
821 V(TryTruncateFloat64ToInt32) \
822 V(TryTruncateFloat64ToUint32) \
823 V(ChangeInt32ToFloat64) \
824 V(BitcastWord32ToWord64) \
825 V(ChangeInt32ToInt64) \
826 V(ChangeInt64ToFloat64) \
827 V(ChangeUint32ToFloat64) \
828 V(ChangeUint32ToUint64) \
829 V(ChangeFloat16RawBitsToFloat64) \
830 V(TruncateFloat64ToFloat32) \
831 V(TruncateFloat64ToFloat16RawBits) \
832 V(TruncateInt64ToInt32) \
833 V(RoundFloat64ToInt32) \
834 V(RoundInt32ToFloat32) \
835 V(RoundInt64ToFloat32) \
836 V(RoundInt64ToFloat64) \
837 V(RoundUint32ToFloat32) \
838 V(RoundUint64ToFloat32) \
839 V(RoundUint64ToFloat64) \
840 V(BitcastFloat32ToInt32) \
841 V(BitcastFloat64ToInt64) \
842 V(BitcastInt32ToFloat32) \
843 V(BitcastInt64ToFloat64) \
844 V(Float64ExtractLowWord32) \
845 V(Float64ExtractHighWord32) \
846 V(Float64InsertLowWord32) \
847 V(Float64InsertHighWord32) \
848 V(Word32Select) \
849 V(Word64Select) \
850 V(Float32Select) \
851 V(Float64Select) \
852 V(LoadStackCheckOffset) \
853 V(LoadFramePointer) \
854 IF_WASM(V, LoadStackPointer) \
855 IF_WASM(V, SetStackPointer) \
856 V(LoadParentFramePointer) \
857 V(LoadRootRegister) \
858 V(UnalignedLoad) \
859 V(UnalignedStore) \
860 V(Int32PairAdd) \
861 V(Int32PairSub) \
862 V(Int32PairMul) \
863 V(Word32PairShl) \
864 V(Word32PairShr) \
865 V(Word32PairSar) \
866 V(ProtectedLoad) \
867 V(ProtectedStore) \
868 V(LoadTrapOnNull) \
869 V(StoreTrapOnNull) \
870 V(MemoryBarrier) \
871 V(SignExtendWord8ToInt32) \
872 V(SignExtendWord16ToInt32) \
873 V(SignExtendWord8ToInt64) \
874 V(SignExtendWord16ToInt64) \
875 V(SignExtendWord32ToInt64) \
876 V(StackPointerGreaterThan) \
877 V(TraceInstruction)
878
879#define MACHINE_SIMD128_OP_LIST(V) \
880 IF_WASM(V, F64x2Splat) \
881 IF_WASM(V, F64x2ExtractLane) \
882 IF_WASM(V, F64x2ReplaceLane) \
883 IF_WASM(V, F64x2Abs) \
884 IF_WASM(V, F64x2Neg) \
885 IF_WASM(V, F64x2Sqrt) \
886 IF_WASM(V, F64x2Add) \
887 IF_WASM(V, F64x2Sub) \
888 IF_WASM(V, F64x2Mul) \
889 IF_WASM(V, F64x2Div) \
890 IF_WASM(V, F64x2Min) \
891 IF_WASM(V, F64x2Max) \
892 IF_WASM(V, F64x2Eq) \
893 IF_WASM(V, F64x2Ne) \
894 IF_WASM(V, F64x2Lt) \
895 IF_WASM(V, F64x2Le) \
896 IF_WASM(V, F64x2Qfma) \
897 IF_WASM(V, F64x2Qfms) \
898 IF_WASM(V, F64x2Pmin) \
899 IF_WASM(V, F64x2Pmax) \
900 IF_WASM(V, F64x2Ceil) \
901 IF_WASM(V, F64x2Floor) \
902 IF_WASM(V, F64x2Trunc) \
903 IF_WASM(V, F64x2NearestInt) \
904 IF_WASM(V, F64x2ConvertLowI32x4S) \
905 IF_WASM(V, F64x2ConvertLowI32x4U) \
906 IF_WASM(V, F64x2PromoteLowF32x4) \
907 IF_WASM(V, F32x4Splat) \
908 IF_WASM(V, F32x4ExtractLane) \
909 IF_WASM(V, F32x4ReplaceLane) \
910 IF_WASM(V, F32x4SConvertI32x4) \
911 IF_WASM(V, F32x4UConvertI32x4) \
912 IF_WASM(V, F32x4Abs) \
913 IF_WASM(V, F32x4Neg) \
914 IF_WASM(V, F32x4Sqrt) \
915 IF_WASM(V, F32x4Add) \
916 IF_WASM(V, F32x4Sub) \
917 IF_WASM(V, F32x4Mul) \
918 IF_WASM(V, F32x4Div) \
919 IF_WASM(V, F32x4Min) \
920 IF_WASM(V, F32x4Max) \
921 IF_WASM(V, F32x4Eq) \
922 IF_WASM(V, F32x4Ne) \
923 IF_WASM(V, F32x4Lt) \
924 IF_WASM(V, F32x4Le) \
925 IF_WASM(V, F32x4Gt) \
926 IF_WASM(V, F32x4Ge) \
927 IF_WASM(V, F32x4Qfma) \
928 IF_WASM(V, F32x4Qfms) \
929 IF_WASM(V, F32x4Pmin) \
930 IF_WASM(V, F32x4Pmax) \
931 IF_WASM(V, F32x4Ceil) \
932 IF_WASM(V, F32x4Floor) \
933 IF_WASM(V, F32x4Trunc) \
934 IF_WASM(V, F32x4NearestInt) \
935 IF_WASM(V, F32x4DemoteF64x2Zero) \
936 IF_WASM(V, F16x8Splat) \
937 IF_WASM(V, F16x8ExtractLane) \
938 IF_WASM(V, F16x8ReplaceLane) \
939 IF_WASM(V, F16x8Abs) \
940 IF_WASM(V, F16x8Neg) \
941 IF_WASM(V, F16x8Sqrt) \
942 IF_WASM(V, F16x8Ceil) \
943 IF_WASM(V, F16x8Floor) \
944 IF_WASM(V, F16x8Trunc) \
945 IF_WASM(V, F16x8NearestInt) \
946 IF_WASM(V, F16x8Add) \
947 IF_WASM(V, F16x8Sub) \
948 IF_WASM(V, F16x8Mul) \
949 IF_WASM(V, F16x8Div) \
950 IF_WASM(V, F16x8Min) \
951 IF_WASM(V, F16x8Max) \
952 IF_WASM(V, F16x8Pmin) \
953 IF_WASM(V, F16x8Pmax) \
954 IF_WASM(V, F16x8Eq) \
955 IF_WASM(V, F16x8Ne) \
956 IF_WASM(V, F16x8Lt) \
957 IF_WASM(V, F16x8Le) \
958 IF_WASM(V, F16x8Gt) \
959 IF_WASM(V, F16x8Ge) \
960 IF_WASM(V, I16x8SConvertF16x8) \
961 IF_WASM(V, I16x8UConvertF16x8) \
962 IF_WASM(V, F16x8SConvertI16x8) \
963 IF_WASM(V, F16x8UConvertI16x8) \
964 IF_WASM(V, F16x8DemoteF32x4Zero) \
965 IF_WASM(V, F16x8DemoteF64x2Zero) \
966 IF_WASM(V, F32x4PromoteLowF16x8) \
967 IF_WASM(V, F16x8Qfma) \
968 IF_WASM(V, F16x8Qfms) \
969 IF_WASM(V, I64x2Splat) \
970 IF_WASM(V, I64x2SplatI32Pair) \
971 IF_WASM(V, I64x2ExtractLane) \
972 IF_WASM(V, I64x2ReplaceLane) \
973 IF_WASM(V, I64x2ReplaceLaneI32Pair) \
974 IF_WASM(V, I64x2Abs) \
975 IF_WASM(V, I64x2Neg) \
976 IF_WASM(V, I64x2SConvertI32x4Low) \
977 IF_WASM(V, I64x2SConvertI32x4High) \
978 IF_WASM(V, I64x2UConvertI32x4Low) \
979 IF_WASM(V, I64x2UConvertI32x4High) \
980 IF_WASM(V, I64x2BitMask) \
981 IF_WASM(V, I64x2Shl) \
982 IF_WASM(V, I64x2ShrS) \
983 IF_WASM(V, I64x2Add) \
984 IF_WASM(V, I64x2Sub) \
985 IF_WASM(V, I64x2Mul) \
986 IF_WASM(V, I64x2Eq) \
987 IF_WASM(V, I64x2Ne) \
988 IF_WASM(V, I64x2GtS) \
989 IF_WASM(V, I64x2GeS) \
990 IF_WASM(V, I64x2ShrU) \
991 IF_WASM(V, I64x2ExtMulLowI32x4S) \
992 IF_WASM(V, I64x2ExtMulHighI32x4S) \
993 IF_WASM(V, I64x2ExtMulLowI32x4U) \
994 IF_WASM(V, I64x2ExtMulHighI32x4U) \
995 IF_WASM(V, I32x4Splat) \
996 IF_WASM(V, I32x4ExtractLane) \
997 IF_WASM(V, I32x4ReplaceLane) \
998 IF_WASM(V, I32x4SConvertF32x4) \
999 IF_WASM(V, I32x4SConvertI16x8Low) \
1000 IF_WASM(V, I32x4SConvertI16x8High) \
1001 IF_WASM(V, I32x4Neg) \
1002 IF_WASM(V, I32x4Shl) \
1003 IF_WASM(V, I32x4ShrS) \
1004 IF_WASM(V, I32x4Add) \
1005 IF_WASM(V, I32x4Sub) \
1006 IF_WASM(V, I32x4Mul) \
1007 IF_WASM(V, I32x4MinS) \
1008 IF_WASM(V, I32x4MaxS) \
1009 IF_WASM(V, I32x4Eq) \
1010 IF_WASM(V, I32x4Ne) \
1011 IF_WASM(V, I32x4LtS) \
1012 IF_WASM(V, I32x4LeS) \
1013 IF_WASM(V, I32x4GtS) \
1014 IF_WASM(V, I32x4GeS) \
1015 IF_WASM(V, I32x4UConvertF32x4) \
1016 IF_WASM(V, I32x4UConvertI16x8Low) \
1017 IF_WASM(V, I32x4UConvertI16x8High) \
1018 IF_WASM(V, I32x4ShrU) \
1019 IF_WASM(V, I32x4MinU) \
1020 IF_WASM(V, I32x4MaxU) \
1021 IF_WASM(V, I32x4LtU) \
1022 IF_WASM(V, I32x4LeU) \
1023 IF_WASM(V, I32x4GtU) \
1024 IF_WASM(V, I32x4GeU) \
1025 IF_WASM(V, I32x4Abs) \
1026 IF_WASM(V, I32x4BitMask) \
1027 IF_WASM(V, I32x4DotI16x8S) \
1028 IF_WASM(V, I32x4ExtMulLowI16x8S) \
1029 IF_WASM(V, I32x4ExtMulHighI16x8S) \
1030 IF_WASM(V, I32x4ExtMulLowI16x8U) \
1031 IF_WASM(V, I32x4ExtMulHighI16x8U) \
1032 IF_WASM(V, I32x4ExtAddPairwiseI16x8S) \
1033 IF_WASM(V, I32x4ExtAddPairwiseI16x8U) \
1034 IF_WASM(V, I32x4TruncSatF64x2SZero) \
1035 IF_WASM(V, I32x4TruncSatF64x2UZero) \
1036 IF_WASM(V, I16x8Splat) \
1037 IF_WASM(V, I16x8ExtractLaneU) \
1038 IF_WASM(V, I16x8ExtractLaneS) \
1039 IF_WASM(V, I16x8ReplaceLane) \
1040 IF_WASM(V, I16x8SConvertI8x16Low) \
1041 IF_WASM(V, I16x8SConvertI8x16High) \
1042 IF_WASM(V, I16x8Neg) \
1043 IF_WASM(V, I16x8Shl) \
1044 IF_WASM(V, I16x8ShrS) \
1045 IF_WASM(V, I16x8SConvertI32x4) \
1046 IF_WASM(V, I16x8Add) \
1047 IF_WASM(V, I16x8AddSatS) \
1048 IF_WASM(V, I16x8Sub) \
1049 IF_WASM(V, I16x8SubSatS) \
1050 IF_WASM(V, I16x8Mul) \
1051 IF_WASM(V, I16x8MinS) \
1052 IF_WASM(V, I16x8MaxS) \
1053 IF_WASM(V, I16x8Eq) \
1054 IF_WASM(V, I16x8Ne) \
1055 IF_WASM(V, I16x8LtS) \
1056 IF_WASM(V, I16x8LeS) \
1057 IF_WASM(V, I16x8GtS) \
1058 IF_WASM(V, I16x8GeS) \
1059 IF_WASM(V, I16x8UConvertI8x16Low) \
1060 IF_WASM(V, I16x8UConvertI8x16High) \
1061 IF_WASM(V, I16x8ShrU) \
1062 IF_WASM(V, I16x8UConvertI32x4) \
1063 IF_WASM(V, I16x8AddSatU) \
1064 IF_WASM(V, I16x8SubSatU) \
1065 IF_WASM(V, I16x8MinU) \
1066 IF_WASM(V, I16x8MaxU) \
1067 IF_WASM(V, I16x8LtU) \
1068 IF_WASM(V, I16x8LeU) \
1069 IF_WASM(V, I16x8GtU) \
1070 IF_WASM(V, I16x8GeU) \
1071 IF_WASM(V, I16x8RoundingAverageU) \
1072 IF_WASM(V, I16x8Q15MulRSatS) \
1073 IF_WASM(V, I16x8Abs) \
1074 IF_WASM(V, I16x8BitMask) \
1075 IF_WASM(V, I16x8ExtMulLowI8x16S) \
1076 IF_WASM(V, I16x8ExtMulHighI8x16S) \
1077 IF_WASM(V, I16x8ExtMulLowI8x16U) \
1078 IF_WASM(V, I16x8ExtMulHighI8x16U) \
1079 IF_WASM(V, I16x8ExtAddPairwiseI8x16S) \
1080 IF_WASM(V, I16x8ExtAddPairwiseI8x16U) \
1081 V(I8x16Splat) \
1082 IF_WASM(V, I8x16ExtractLaneU) \
1083 IF_WASM(V, I8x16ExtractLaneS) \
1084 IF_WASM(V, I8x16ReplaceLane) \
1085 IF_WASM(V, I8x16SConvertI16x8) \
1086 IF_WASM(V, I8x16Neg) \
1087 IF_WASM(V, I8x16Shl) \
1088 IF_WASM(V, I8x16ShrS) \
1089 IF_WASM(V, I8x16Add) \
1090 IF_WASM(V, I8x16AddSatS) \
1091 IF_WASM(V, I8x16Sub) \
1092 IF_WASM(V, I8x16SubSatS) \
1093 IF_WASM(V, I8x16MinS) \
1094 IF_WASM(V, I8x16MaxS) \
1095 V(I8x16Eq) \
1096 IF_WASM(V, I8x16Ne) \
1097 IF_WASM(V, I8x16LtS) \
1098 IF_WASM(V, I8x16LeS) \
1099 IF_WASM(V, I8x16GtS) \
1100 IF_WASM(V, I8x16GeS) \
1101 IF_WASM(V, I8x16UConvertI16x8) \
1102 IF_WASM(V, I8x16AddSatU) \
1103 IF_WASM(V, I8x16SubSatU) \
1104 IF_WASM(V, I8x16ShrU) \
1105 IF_WASM(V, I8x16MinU) \
1106 IF_WASM(V, I8x16MaxU) \
1107 IF_WASM(V, I8x16LtU) \
1108 IF_WASM(V, I8x16LeU) \
1109 IF_WASM(V, I8x16GtU) \
1110 IF_WASM(V, I8x16GeU) \
1111 IF_WASM(V, I8x16RoundingAverageU) \
1112 IF_WASM(V, I8x16Popcnt) \
1113 IF_WASM(V, I8x16Abs) \
1114 V(I8x16BitMask) \
1115 IF_WASM(V, S128Zero) \
1116 IF_WASM(V, S128Const) \
1117 IF_WASM(V, S128Not) \
1118 IF_WASM(V, S128And) \
1119 IF_WASM(V, S128Or) \
1120 IF_WASM(V, S128Xor) \
1121 IF_WASM(V, S128Select) \
1122 IF_WASM(V, S128AndNot) \
1123 IF_WASM(V, I8x16Swizzle) \
1124 IF_WASM(V, I8x16RelaxedLaneSelect) \
1125 IF_WASM(V, I16x8RelaxedLaneSelect) \
1126 IF_WASM(V, I32x4RelaxedLaneSelect) \
1127 IF_WASM(V, I64x2RelaxedLaneSelect) \
1128 IF_WASM(V, F32x4RelaxedMin) \
1129 IF_WASM(V, F32x4RelaxedMax) \
1130 IF_WASM(V, F64x2RelaxedMin) \
1131 IF_WASM(V, F64x2RelaxedMax) \
1132 IF_WASM(V, I32x4RelaxedTruncF32x4S) \
1133 IF_WASM(V, I32x4RelaxedTruncF32x4U) \
1134 IF_WASM(V, I32x4RelaxedTruncF64x2SZero) \
1135 IF_WASM(V, I32x4RelaxedTruncF64x2UZero) \
1136 IF_WASM(V, I16x8RelaxedQ15MulRS) \
1137 IF_WASM(V, I16x8DotI8x16I7x16S) \
1138 IF_WASM(V, I32x4DotI8x16I7x16AddS) \
1139 IF_WASM(V, I8x16AddReduce) \
1140 IF_WASM(V, I16x8AddReduce) \
1141 IF_WASM(V, I32x4AddReduce) \
1142 IF_WASM(V, I64x2AddReduce) \
1143 IF_WASM(V, F32x4AddReduce) \
1144 IF_WASM(V, F64x2AddReduce) \
1145 IF_WASM(V, I8x16Shuffle) \
1146 IF_WASM(V, I8x8Shuffle) \
1147 IF_WASM(V, I8x4Shuffle) \
1148 IF_WASM(V, I8x2Shuffle) \
1149 IF_WASM(V, V128AnyTrue) \
1150 IF_WASM(V, I64x2AllTrue) \
1151 IF_WASM(V, I32x4AllTrue) \
1152 IF_WASM(V, I16x8AllTrue) \
1153 IF_WASM(V, I8x16AllTrue) \
1154 IF_WASM(V, LoadTransform) \
1155 IF_WASM(V, LoadLane) \
1156 IF_WASM(V, StoreLane)
1157
1158// SIMD256 for AVX
1159#define MACHINE_SIMD256_OP_LIST(V) \
1160 V(F64x4Min) \
1161 V(F64x4Max) \
1162 V(F64x4Add) \
1163 V(F64x4Abs) \
1164 V(F64x4Neg) \
1165 V(F64x4Sqrt) \
1166 V(F32x8Add) \
1167 V(I64x4Add) \
1168 V(I32x8Add) \
1169 V(I16x16Add) \
1170 V(I8x32Add) \
1171 V(F64x4Sub) \
1172 V(F32x8Sub) \
1173 V(I64x4Sub) \
1174 V(I32x8Sub) \
1175 V(I16x16Sub) \
1176 V(I8x32Sub) \
1177 V(F64x4Mul) \
1178 V(F32x8Mul) \
1179 V(I64x4Mul) \
1180 V(I32x8Mul) \
1181 V(I16x16Mul) \
1182 V(F64x4Div) \
1183 V(F32x8Div) \
1184 V(I16x16AddSatS) \
1185 V(I8x32AddSatS) \
1186 V(I16x16AddSatU) \
1187 V(I8x32AddSatU) \
1188 V(I16x16SubSatS) \
1189 V(I8x32SubSatS) \
1190 V(I16x16SubSatU) \
1191 V(I8x32SubSatU) \
1192 V(F32x8Pmin) \
1193 V(F32x8Pmax) \
1194 V(F32x8Eq) \
1195 V(F64x4Eq) \
1196 V(I64x4Eq) \
1197 V(I32x8Eq) \
1198 V(I16x16Eq) \
1199 V(I8x32Eq) \
1200 V(F32x8Ne) \
1201 V(F64x4Ne) \
1202 V(I64x4GtS) \
1203 V(I32x8GtS) \
1204 V(I16x16GtS) \
1205 V(I8x32GtS) \
1206 V(F64x4Lt) \
1207 V(F32x8Lt) \
1208 V(F64x4Le) \
1209 V(F32x8Le) \
1210 V(I32x8MinS) \
1211 V(I16x16MinS) \
1212 V(I8x32MinS) \
1213 V(I32x8MinU) \
1214 V(I16x16MinU) \
1215 V(I8x32MinU) \
1216 V(I32x8MaxS) \
1217 V(I16x16MaxS) \
1218 V(I8x32MaxS) \
1219 V(I32x8MaxU) \
1220 V(I16x16MaxU) \
1221 V(I8x32MaxU) \
1222 V(F32x8Min) \
1223 V(F32x8Max) \
1224 V(I64x4Ne) \
1225 V(I64x4GeS) \
1226 V(I32x8Ne) \
1227 V(I32x8GtU) \
1228 V(I32x8GeS) \
1229 V(I32x8GeU) \
1230 V(I16x16Ne) \
1231 V(I16x16GtU) \
1232 V(I16x16GeS) \
1233 V(I16x16GeU) \
1234 V(I8x32Ne) \
1235 V(I8x32GtU) \
1236 V(I8x32GeS) \
1237 V(I8x32GeU) \
1238 V(I32x8SConvertF32x8) \
1239 V(I32x8UConvertF32x8) \
1240 V(F64x4ConvertI32x4S) \
1241 V(F32x8SConvertI32x8) \
1242 V(F32x8UConvertI32x8) \
1243 V(F32x4DemoteF64x4) \
1244 V(I64x4SConvertI32x4) \
1245 V(I64x4UConvertI32x4) \
1246 V(I32x8SConvertI16x8) \
1247 V(I32x8UConvertI16x8) \
1248 V(I16x16SConvertI8x16) \
1249 V(I16x16UConvertI8x16) \
1250 V(I16x16SConvertI32x8) \
1251 V(I16x16UConvertI32x8) \
1252 V(I8x32SConvertI16x16) \
1253 V(I8x32UConvertI16x16) \
1254 V(F32x8Abs) \
1255 V(F32x8Neg) \
1256 V(F32x8Sqrt) \
1257 V(I32x8Abs) \
1258 V(I32x8Neg) \
1259 V(I16x16Abs) \
1260 V(I16x16Neg) \
1261 V(I8x32Abs) \
1262 V(I8x32Neg) \
1263 V(I64x4Shl) \
1264 V(I64x4ShrU) \
1265 V(I32x8Shl) \
1266 V(I32x8ShrS) \
1267 V(I32x8ShrU) \
1268 V(I16x16Shl) \
1269 V(I16x16ShrS) \
1270 V(I16x16ShrU) \
1271 V(I32x8DotI16x16S) \
1272 V(I16x16RoundingAverageU) \
1273 V(I8x32RoundingAverageU) \
1274 V(I64x4ExtMulI32x4S) \
1275 V(I64x4ExtMulI32x4U) \
1276 V(I32x8ExtMulI16x8S) \
1277 V(I32x8ExtMulI16x8U) \
1278 V(I16x16ExtMulI8x16S) \
1279 V(I16x16ExtMulI8x16U) \
1280 V(I32x8ExtAddPairwiseI16x16S) \
1281 V(I32x8ExtAddPairwiseI16x16U) \
1282 V(I16x16ExtAddPairwiseI8x32S) \
1283 V(I16x16ExtAddPairwiseI8x32U) \
1284 V(ExtractF128) \
1285 V(S256Const) \
1286 V(S256Zero) \
1287 V(S256Not) \
1288 V(S256And) \
1289 V(S256Or) \
1290 V(S256Xor) \
1291 V(S256Select) \
1292 V(S256AndNot) \
1293 V(I64x4Splat) \
1294 V(I32x8Splat) \
1295 V(I16x16Splat) \
1296 V(I8x32Splat) \
1297 V(F64x4Pmin) \
1298 V(F64x4Pmax) \
1299 V(F64x4Splat) \
1300 V(F32x8Splat) \
1301 V(I8x32Shuffle) \
1302 V(F32x8Qfma) \
1303 V(F32x8Qfms) \
1304 V(F64x4Qfma) \
1305 V(F64x4Qfms) \
1306 V(I64x4RelaxedLaneSelect) \
1307 V(I32x8RelaxedLaneSelect) \
1308 V(I16x16RelaxedLaneSelect) \
1309 V(I8x32RelaxedLaneSelect) \
1310 V(I32x8DotI8x32I7x32AddS) \
1311 V(I16x16DotI8x32I7x32S) \
1312 V(F32x8RelaxedMin) \
1313 V(F32x8RelaxedMax) \
1314 V(F64x4RelaxedMin) \
1315 V(F64x4RelaxedMax) \
1316 V(I32x8RelaxedTruncF32x8S) \
1317 V(I32x8RelaxedTruncF32x8U)
1318
1319#define VALUE_OP_LIST(V) \
1320 COMMON_OP_LIST(V) \
1321 SIMPLIFIED_OP_LIST(V) \
1322 MACHINE_OP_LIST(V) \
1323 MACHINE_SIMD128_OP_LIST(V) \
1324 IF_WASM(MACHINE_SIMD256_OP_LIST, V) \
1325 JS_OP_LIST(V)
1326
1327// The combination of all operators at all levels and the common operators.
1328#define ALL_OP_LIST(V) \
1329 CONTROL_OP_LIST(V) \
1330 VALUE_OP_LIST(V)
1331
1332namespace v8 {
1333namespace internal {
1334namespace compiler {
1335
1336// Declare an enumeration with all the opcodes at all levels so that they
1337// can be globally, uniquely numbered.
1339 public:
1340 enum Value {
1341#define DECLARE_OPCODE(x, ...) k##x,
1343#undef DECLARE_OPCODE
1344 kLast = -1
1345#define COUNT_OPCODE(...) +1
1347#undef COUNT_OPCODE
1349
1350 // Returns the mnemonic name of an opcode.
1351 static char const* Mnemonic(Value value);
1352
1353 // Returns true if opcode for common operator.
1354 static bool IsCommonOpcode(Value value) {
1355 return kStart <= value && value <= kStaticAssert;
1356 }
1357
1358 // Returns true if opcode for control operator.
1359 static bool IsControlOpcode(Value value) {
1360 return kStart <= value && value <= kEnd;
1361 }
1362
1363 // Returns true if opcode for JavaScript operator.
1364 static bool IsJsOpcode(Value value) {
1365 return kJSEqual <= value && value <= kJSDebugger;
1366 }
1367
1368 // Returns true if opcode for machine operator.
1369 static bool IsMachineOpcode(Value value) {
1370 return kWord32Clz <= value && value <= kTraceInstruction;
1371 }
1372
1373 // Returns true iff opcode is a machine-level constant.
1374 static bool IsMachineConstantOpcode(Value value) {
1375 switch (value) {
1376#define CASE(name) \
1377 case k##name: \
1378 return true;
1380#undef CASE
1381 default:
1382 return false;
1383 }
1384 }
1385
1386 // Returns true if opcode for constant operator.
1387 static bool IsConstantOpcode(Value value) {
1388#define CASE(Name) \
1389 case k##Name: \
1390 return true;
1391 switch (value) {
1393 default:
1394 return false;
1395 }
1396#undef CASE
1397 UNREACHABLE();
1398 }
1399
1400 static bool IsPhiOpcode(Value value) {
1401 return value == kPhi || value == kEffectPhi;
1402 }
1403
1404 static bool IsMergeOpcode(Value value) {
1405 return value == kMerge || value == kLoop;
1406 }
1407
1408 static bool IsIfProjectionOpcode(Value value) {
1409 return kIfTrue <= value && value <= kIfDefault;
1410 }
1411
1412 // Returns true if opcode terminates control flow in a graph (i.e.
1413 // respective nodes are expected to have control uses by the graphs {End}
1414 // node only).
1415 static bool IsGraphTerminator(Value value) {
1416 return value == kDeoptimize || value == kReturn || value == kTailCall ||
1417 value == kTerminate || value == kThrow;
1418 }
1419
1420 // Returns true if opcode can be inlined.
1421 static bool IsInlineeOpcode(Value value) {
1422 return value == kJSConstruct || value == kJSCall;
1423 }
1424
1425 // Returns true if opcode for comparison operator.
1426 static bool IsComparisonOpcode(Value value) {
1427#define CASE(Name, ...) \
1428 case k##Name: \
1429 return true;
1430 switch (value) {
1434 default:
1435 return false;
1436 }
1437#undef CASE
1438 UNREACHABLE();
1439 }
1440
1442 return kJSCreateFunctionContext <= value && value <= kJSCreateBlockContext;
1443 }
1444
1445 // These opcode take the feedback vector as an input, and implement
1446 // feedback-collecting logic in generic lowering.
1448#define CASE(Name, ...) \
1449 case k##Name: \
1450 return true;
1451 switch (value) {
1457 case kJSCall:
1458 case kJSCallWithArrayLike:
1459 case kJSCallWithSpread:
1460 case kJSCloneObject:
1461 case kJSConstruct:
1462 case kJSConstructWithArrayLike:
1463 case kJSConstructWithSpread:
1464 case kJSCreateEmptyLiteralArray:
1465 case kJSCreateLiteralArray:
1466 case kJSCreateLiteralObject:
1467 case kJSCreateLiteralRegExp:
1468 case kJSDefineKeyedOwnProperty:
1469 case kJSForInNext:
1470 case kJSForInPrepare:
1471 case kJSGetIterator:
1472 case kJSGetTemplateObject:
1473 case kJSHasProperty:
1474 case kJSInstanceOf:
1475 case kJSLoadGlobal:
1476 case kJSLoadNamed:
1477 case kJSLoadNamedFromSuper:
1478 case kJSLoadProperty:
1479 case kJSDefineKeyedOwnPropertyInLiteral:
1480 case kJSStoreGlobal:
1481 case kJSStoreInArrayLiteral:
1482 case kJSSetNamedProperty:
1483 case kJSDefineNamedOwnProperty:
1484 case kJSSetKeyedProperty:
1485 return true;
1486 default:
1487 return false;
1488 }
1489#undef CASE
1490 UNREACHABLE();
1491 }
1492
1493 static bool IsFeedbackCollectingOpcode(int16_t value) {
1494 DCHECK(0 <= value && value <= kLast);
1495 return IsFeedbackCollectingOpcode(static_cast<IrOpcode::Value>(value));
1496 }
1497
1498 static bool isAtomicOpOpcode(Value value) {
1499 switch (value) {
1500 #define CASE(Name, ...) \
1501 case k##Name: \
1502 return true;
1504 default:
1505 return false;
1506 #undef CASE
1507 }
1508 UNREACHABLE();
1509 }
1510
1511#if V8_ENABLE_WEBASSEMBLY
1512 static bool IsSimd128Opcode(Value value) {
1513#define CASE(Name, ...) case k##Name:
1514 switch (value) {
1516 return true;
1517 default:
1518 return false;
1519 }
1520#undef CASE
1521 UNREACHABLE();
1522 }
1523#endif // V8_ENABLE_WEBASSEMBLY
1524};
1525
1526V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, IrOpcode::Value);
1527
1528} // namespace compiler
1529} // namespace internal
1530} // namespace v8
1531
1532#endif // V8_COMPILER_OPCODES_H_
#define CASE(Name,...)
static bool isAtomicOpOpcode(Value value)
Definition opcodes.h:1498
static bool IsConstantOpcode(Value value)
Definition opcodes.h:1387
static bool IsContextChainExtendingOpcode(Value value)
Definition opcodes.h:1441
static bool IsMachineOpcode(Value value)
Definition opcodes.h:1369
static bool IsJsOpcode(Value value)
Definition opcodes.h:1364
static bool IsMergeOpcode(Value value)
Definition opcodes.h:1404
static bool IsGraphTerminator(Value value)
Definition opcodes.h:1415
static bool IsFeedbackCollectingOpcode(int16_t value)
Definition opcodes.h:1493
static bool IsCommonOpcode(Value value)
Definition opcodes.h:1354
static bool IsPhiOpcode(Value value)
Definition opcodes.h:1400
static bool IsInlineeOpcode(Value value)
Definition opcodes.h:1421
static bool IsMachineConstantOpcode(Value value)
Definition opcodes.h:1374
static bool IsComparisonOpcode(Value value)
Definition opcodes.h:1426
static bool IsControlOpcode(Value value)
Definition opcodes.h:1359
static bool IsIfProjectionOpcode(Value value)
Definition opcodes.h:1408
static bool IsFeedbackCollectingOpcode(Value value)
Definition opcodes.h:1447
std::ostream & operator<<(std::ostream &os, AccessMode access_mode)
@ kStart
#define CONSTANT_OP_LIST(V)
Definition opcodes.h:55
#define JS_COMPARE_BINOP_LIST(V)
Definition opcodes.h:100
#define JS_BITWISE_BINOP_LIST(V)
Definition opcodes.h:108
#define COUNT_OPCODE(...)
#define JS_BITWISE_UNOP_LIST(V)
Definition opcodes.h:144
#define ALL_OP_LIST(V)
Definition opcodes.h:1328
#define SIMPLIFIED_COMPARE_BINOP_LIST(V)
Definition opcodes.h:328
#define JS_ARITH_UNOP_LIST(V)
Definition opcodes.h:148
#define MACHINE_COMPARE_BINOP_LIST(V)
Definition opcodes.h:623
#define MACHINE_ATOMIC_OP_LIST(V)
Definition opcodes.h:744
#define MACHINE_SIMD128_OP_LIST(V)
Definition opcodes.h:879
#define DECLARE_OPCODE(x,...)
Definition opcodes.h:1341
#define JS_ARITH_BINOP_LIST(V)
Definition opcodes.h:116
#define MACHINE_LEVEL_CONSTANT_OP_LIST(V)
Definition opcodes.h:37
#define UNREACHABLE()
Definition logging.h:67
#define DCHECK(condition)
Definition logging.h:482
#define V8_EXPORT_PRIVATE
Definition macros.h:460