machine-operator.cc 78.8 KB
Newer Older
1 2 3 4 5
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "src/compiler/machine-operator.h"
6
#include <type_traits>
7 8 9 10 11 12 13 14

#include "src/compiler/opcodes.h"
#include "src/compiler/operator.h"

namespace v8 {
namespace internal {
namespace compiler {

15
bool operator==(StoreRepresentation lhs, StoreRepresentation rhs) {
16
  return lhs.representation() == rhs.representation() &&
17
         lhs.write_barrier_kind() == rhs.write_barrier_kind();
18 19 20
}


21 22 23
bool operator!=(StoreRepresentation lhs, StoreRepresentation rhs) {
  return !(lhs == rhs);
}
24 25


26
size_t hash_value(StoreRepresentation rep) {
27
  return base::hash_combine(rep.representation(), rep.write_barrier_kind());
28 29 30 31
}


std::ostream& operator<<(std::ostream& os, StoreRepresentation rep) {
32
  return os << rep.representation() << ", " << rep.write_barrier_kind();
33
}
34

35
size_t hash_value(MemoryAccessKind kind) { return static_cast<size_t>(kind); }
36

37
std::ostream& operator<<(std::ostream& os, MemoryAccessKind kind) {
38
  switch (kind) {
39
    case MemoryAccessKind::kNormal:
40
      return os << "kNormal";
41
    case MemoryAccessKind::kUnaligned:
42
      return os << "kUnaligned";
43
    case MemoryAccessKind::kProtected:
44 45 46 47 48 49 50 51 52
      return os << "kProtected";
  }
  UNREACHABLE();
}

size_t hash_value(LoadTransformation rep) { return static_cast<size_t>(rep); }

std::ostream& operator<<(std::ostream& os, LoadTransformation rep) {
  switch (rep) {
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
    case LoadTransformation::kS128Load8Splat:
      return os << "kS128Load8Splat";
    case LoadTransformation::kS128Load16Splat:
      return os << "kS128Load16Splat";
    case LoadTransformation::kS128Load32Splat:
      return os << "kS128Load32Splat";
    case LoadTransformation::kS128Load64Splat:
      return os << "kS128Load64Splat";
    case LoadTransformation::kS128Load8x8S:
      return os << "kS128Load8x8S";
    case LoadTransformation::kS128Load8x8U:
      return os << "kS128Load8x8U";
    case LoadTransformation::kS128Load16x4S:
      return os << "kS128Load16x4S";
    case LoadTransformation::kS128Load16x4U:
      return os << "kS128Load16x4U";
    case LoadTransformation::kS128Load32x2S:
      return os << "kS128Load32x2S";
    case LoadTransformation::kS128Load32x2U:
      return os << "kS128Load32x2U";
73 74 75 76
    case LoadTransformation::kS128Load32Zero:
      return os << "kS128Load32Zero";
    case LoadTransformation::kS128Load64Zero:
      return os << "kS128Load64Zero";
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
  }
  UNREACHABLE();
}

size_t hash_value(LoadTransformParameters params) {
  return base::hash_combine(params.kind, params.transformation);
}

std::ostream& operator<<(std::ostream& os, LoadTransformParameters params) {
  return os << "(" << params.kind << " " << params.transformation << ")";
}

LoadTransformParameters const& LoadTransformParametersOf(Operator const* op) {
  DCHECK_EQ(IrOpcode::kLoadTransform, op->opcode());
  return OpParameter<LoadTransformParameters>(op);
}

bool operator==(LoadTransformParameters lhs, LoadTransformParameters rhs) {
  return lhs.transformation == rhs.transformation && lhs.kind == rhs.kind;
}

bool operator!=(LoadTransformParameters lhs, LoadTransformParameters rhs) {
  return !(lhs == rhs);
}
101

102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
size_t hash_value(LoadLaneParameters params) {
  return base::hash_combine(params.kind, params.rep, params.laneidx);
}

std::ostream& operator<<(std::ostream& os, LoadLaneParameters params) {
  return os << "(" << params.kind << " " << params.rep << " " << params.laneidx
            << ")";
}

LoadLaneParameters const& LoadLaneParametersOf(Operator const* op) {
  DCHECK_EQ(IrOpcode::kLoadLane, op->opcode());
  return OpParameter<LoadLaneParameters>(op);
}

bool operator==(LoadLaneParameters lhs, LoadLaneParameters rhs) {
  return lhs.kind == rhs.kind && lhs.rep == rhs.rep &&
         lhs.laneidx == rhs.laneidx;
}

121
LoadRepresentation LoadRepresentationOf(Operator const* op) {
122
  DCHECK(IrOpcode::kLoad == op->opcode() ||
123
         IrOpcode::kProtectedLoad == op->opcode() ||
124
         IrOpcode::kWord32AtomicLoad == op->opcode() ||
125
         IrOpcode::kWord64AtomicLoad == op->opcode() ||
126
         IrOpcode::kWord32AtomicPairLoad == op->opcode() ||
127
         IrOpcode::kPoisonedLoad == op->opcode() ||
128
         IrOpcode::kUnalignedLoad == op->opcode());
129 130 131
  return OpParameter<LoadRepresentation>(op);
}

132
StoreRepresentation const& StoreRepresentationOf(Operator const* op) {
133 134
  DCHECK(IrOpcode::kStore == op->opcode() ||
         IrOpcode::kProtectedStore == op->opcode());
135 136 137
  return OpParameter<StoreRepresentation>(op);
}

138 139 140 141 142
UnalignedStoreRepresentation const& UnalignedStoreRepresentationOf(
    Operator const* op) {
  DCHECK_EQ(IrOpcode::kUnalignedStore, op->opcode());
  return OpParameter<UnalignedStoreRepresentation>(op);
}
143

144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
size_t hash_value(StoreLaneParameters params) {
  return base::hash_combine(params.kind, params.rep, params.laneidx);
}

std::ostream& operator<<(std::ostream& os, StoreLaneParameters params) {
  return os << "(" << params.kind << " " << params.rep << " " << params.laneidx
            << ")";
}

StoreLaneParameters const& StoreLaneParametersOf(Operator const* op) {
  DCHECK_EQ(IrOpcode::kStoreLane, op->opcode());
  return OpParameter<StoreLaneParameters>(op);
}

bool operator==(StoreLaneParameters lhs, StoreLaneParameters rhs) {
  return lhs.kind == rhs.kind && lhs.rep == rhs.rep &&
         lhs.laneidx == rhs.laneidx;
}

163 164 165 166 167 168 169 170 171 172 173 174 175
bool operator==(StackSlotRepresentation lhs, StackSlotRepresentation rhs) {
  return lhs.size() == rhs.size() && lhs.alignment() == rhs.alignment();
}

bool operator!=(StackSlotRepresentation lhs, StackSlotRepresentation rhs) {
  return !(lhs == rhs);
}

size_t hash_value(StackSlotRepresentation rep) {
  return base::hash_combine(rep.size(), rep.alignment());
}

std::ostream& operator<<(std::ostream& os, StackSlotRepresentation rep) {
176
  return os << rep.size() << ", " << rep.alignment();
177 178 179
}

StackSlotRepresentation const& StackSlotRepresentationOf(Operator const* op) {
180
  DCHECK_EQ(IrOpcode::kStackSlot, op->opcode());
181
  return OpParameter<StackSlotRepresentation>(op);
182
}
183

184
MachineRepresentation AtomicStoreRepresentationOf(Operator const* op) {
185
  DCHECK(IrOpcode::kWord32AtomicStore == op->opcode() ||
186
         IrOpcode::kWord64AtomicStore == op->opcode());
187 188 189
  return OpParameter<MachineRepresentation>(op);
}

190
MachineType AtomicOpType(Operator const* op) {
191 192 193
  return OpParameter<MachineType>(op);
}

194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209
size_t hash_value(ShiftKind kind) { return static_cast<size_t>(kind); }
V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os, ShiftKind kind) {
  switch (kind) {
    case ShiftKind::kNormal:
      return os << "Normal";
    case ShiftKind::kShiftOutZeros:
      return os << "ShiftOutZeros";
  }
}

ShiftKind ShiftKindOf(Operator const* op) {
  DCHECK(IrOpcode::kWord32Sar == op->opcode() ||
         IrOpcode::kWord64Sar == op->opcode());
  return OpParameter<ShiftKind>(op);
}

210 211
// The format is:
// V(Name, properties, value_input_count, control_input_count, output_count)
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
#define PURE_BINARY_OP_LIST_32(V)                                           \
  V(Word32And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1)    \
  V(Word32Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1)     \
  V(Word32Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1)    \
  V(Word32Shl, Operator::kNoProperties, 2, 0, 1)                            \
  V(Word32Shr, Operator::kNoProperties, 2, 0, 1)                            \
  V(Word32Ror, Operator::kNoProperties, 2, 0, 1)                            \
  V(Word32Equal, Operator::kCommutative, 2, 0, 1)                           \
  V(Int32Add, Operator::kAssociative | Operator::kCommutative, 2, 0, 1)     \
  V(Int32Sub, Operator::kNoProperties, 2, 0, 1)                             \
  V(Int32Mul, Operator::kAssociative | Operator::kCommutative, 2, 0, 1)     \
  V(Int32MulHigh, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \
  V(Int32Div, Operator::kNoProperties, 2, 1, 1)                             \
  V(Int32Mod, Operator::kNoProperties, 2, 1, 1)                             \
  V(Int32LessThan, Operator::kNoProperties, 2, 0, 1)                        \
  V(Int32LessThanOrEqual, Operator::kNoProperties, 2, 0, 1)                 \
  V(Uint32Div, Operator::kNoProperties, 2, 1, 1)                            \
  V(Uint32LessThan, Operator::kNoProperties, 2, 0, 1)                       \
  V(Uint32LessThanOrEqual, Operator::kNoProperties, 2, 0, 1)                \
  V(Uint32Mod, Operator::kNoProperties, 2, 1, 1)                            \
  V(Uint32MulHigh, Operator::kAssociative | Operator::kCommutative, 2, 0, 1)

234 235
// The format is:
// V(Name, properties, value_input_count, control_input_count, output_count)
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
#define PURE_BINARY_OP_LIST_64(V)                                        \
  V(Word64And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \
  V(Word64Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1)  \
  V(Word64Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \
  V(Word64Shl, Operator::kNoProperties, 2, 0, 1)                         \
  V(Word64Shr, Operator::kNoProperties, 2, 0, 1)                         \
  V(Word64Ror, Operator::kNoProperties, 2, 0, 1)                         \
  V(Word64Equal, Operator::kCommutative, 2, 0, 1)                        \
  V(Int64Add, Operator::kAssociative | Operator::kCommutative, 2, 0, 1)  \
  V(Int64Sub, Operator::kNoProperties, 2, 0, 1)                          \
  V(Int64Mul, Operator::kAssociative | Operator::kCommutative, 2, 0, 1)  \
  V(Int64Div, Operator::kNoProperties, 2, 1, 1)                          \
  V(Int64Mod, Operator::kNoProperties, 2, 1, 1)                          \
  V(Int64LessThan, Operator::kNoProperties, 2, 0, 1)                     \
  V(Int64LessThanOrEqual, Operator::kNoProperties, 2, 0, 1)              \
  V(Uint64Div, Operator::kNoProperties, 2, 1, 1)                         \
  V(Uint64Mod, Operator::kNoProperties, 2, 1, 1)                         \
  V(Uint64LessThan, Operator::kNoProperties, 2, 0, 1)                    \
  V(Uint64LessThanOrEqual, Operator::kNoProperties, 2, 0, 1)

256 257
// The format is:
// V(Name, properties, value_input_count, control_input_count, output_count)
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379
#define MACHINE_PURE_OP_LIST(V)                                            \
  PURE_BINARY_OP_LIST_32(V)                                                \
  PURE_BINARY_OP_LIST_64(V)                                                \
  V(Word32Clz, Operator::kNoProperties, 1, 0, 1)                           \
  V(Word64Clz, Operator::kNoProperties, 1, 0, 1)                           \
  V(Word32ReverseBytes, Operator::kNoProperties, 1, 0, 1)                  \
  V(Word64ReverseBytes, Operator::kNoProperties, 1, 0, 1)                  \
  V(Simd128ReverseBytes, Operator::kNoProperties, 1, 0, 1)                 \
  V(BitcastTaggedToWordForTagAndSmiBits, Operator::kNoProperties, 1, 0, 1) \
  V(BitcastWordToTaggedSigned, Operator::kNoProperties, 1, 0, 1)           \
  V(TruncateFloat64ToWord32, Operator::kNoProperties, 1, 0, 1)             \
  V(ChangeFloat32ToFloat64, Operator::kNoProperties, 1, 0, 1)              \
  V(ChangeFloat64ToInt32, Operator::kNoProperties, 1, 0, 1)                \
  V(ChangeFloat64ToInt64, Operator::kNoProperties, 1, 0, 1)                \
  V(ChangeFloat64ToUint32, Operator::kNoProperties, 1, 0, 1)               \
  V(ChangeFloat64ToUint64, Operator::kNoProperties, 1, 0, 1)               \
  V(TruncateFloat64ToInt64, Operator::kNoProperties, 1, 0, 1)              \
  V(TruncateFloat64ToUint32, Operator::kNoProperties, 1, 0, 1)             \
  V(TryTruncateFloat32ToInt64, Operator::kNoProperties, 1, 0, 2)           \
  V(TryTruncateFloat64ToInt64, Operator::kNoProperties, 1, 0, 2)           \
  V(TryTruncateFloat32ToUint64, Operator::kNoProperties, 1, 0, 2)          \
  V(TryTruncateFloat64ToUint64, Operator::kNoProperties, 1, 0, 2)          \
  V(ChangeInt32ToFloat64, Operator::kNoProperties, 1, 0, 1)                \
  V(ChangeInt64ToFloat64, Operator::kNoProperties, 1, 0, 1)                \
  V(Float64SilenceNaN, Operator::kNoProperties, 1, 0, 1)                   \
  V(RoundFloat64ToInt32, Operator::kNoProperties, 1, 0, 1)                 \
  V(RoundInt32ToFloat32, Operator::kNoProperties, 1, 0, 1)                 \
  V(RoundInt64ToFloat32, Operator::kNoProperties, 1, 0, 1)                 \
  V(RoundInt64ToFloat64, Operator::kNoProperties, 1, 0, 1)                 \
  V(RoundUint32ToFloat32, Operator::kNoProperties, 1, 0, 1)                \
  V(RoundUint64ToFloat32, Operator::kNoProperties, 1, 0, 1)                \
  V(RoundUint64ToFloat64, Operator::kNoProperties, 1, 0, 1)                \
  V(BitcastWord32ToWord64, Operator::kNoProperties, 1, 0, 1)               \
  V(ChangeInt32ToInt64, Operator::kNoProperties, 1, 0, 1)                  \
  V(ChangeUint32ToFloat64, Operator::kNoProperties, 1, 0, 1)               \
  V(ChangeUint32ToUint64, Operator::kNoProperties, 1, 0, 1)                \
  V(TruncateFloat64ToFloat32, Operator::kNoProperties, 1, 0, 1)            \
  V(TruncateInt64ToInt32, Operator::kNoProperties, 1, 0, 1)                \
  V(BitcastFloat32ToInt32, Operator::kNoProperties, 1, 0, 1)               \
  V(BitcastFloat64ToInt64, Operator::kNoProperties, 1, 0, 1)               \
  V(BitcastInt32ToFloat32, Operator::kNoProperties, 1, 0, 1)               \
  V(BitcastInt64ToFloat64, Operator::kNoProperties, 1, 0, 1)               \
  V(SignExtendWord8ToInt32, Operator::kNoProperties, 1, 0, 1)              \
  V(SignExtendWord16ToInt32, Operator::kNoProperties, 1, 0, 1)             \
  V(SignExtendWord8ToInt64, Operator::kNoProperties, 1, 0, 1)              \
  V(SignExtendWord16ToInt64, Operator::kNoProperties, 1, 0, 1)             \
  V(SignExtendWord32ToInt64, Operator::kNoProperties, 1, 0, 1)             \
  V(Float32Abs, Operator::kNoProperties, 1, 0, 1)                          \
  V(Float32Add, Operator::kCommutative, 2, 0, 1)                           \
  V(Float32Sub, Operator::kNoProperties, 2, 0, 1)                          \
  V(Float32Mul, Operator::kCommutative, 2, 0, 1)                           \
  V(Float32Div, Operator::kNoProperties, 2, 0, 1)                          \
  V(Float32Neg, Operator::kNoProperties, 1, 0, 1)                          \
  V(Float32Sqrt, Operator::kNoProperties, 1, 0, 1)                         \
  V(Float32Max, Operator::kAssociative | Operator::kCommutative, 2, 0, 1)  \
  V(Float32Min, Operator::kAssociative | Operator::kCommutative, 2, 0, 1)  \
  V(Float64Abs, Operator::kNoProperties, 1, 0, 1)                          \
  V(Float64Acos, Operator::kNoProperties, 1, 0, 1)                         \
  V(Float64Acosh, Operator::kNoProperties, 1, 0, 1)                        \
  V(Float64Asin, Operator::kNoProperties, 1, 0, 1)                         \
  V(Float64Asinh, Operator::kNoProperties, 1, 0, 1)                        \
  V(Float64Atan, Operator::kNoProperties, 1, 0, 1)                         \
  V(Float64Atan2, Operator::kNoProperties, 2, 0, 1)                        \
  V(Float64Atanh, Operator::kNoProperties, 1, 0, 1)                        \
  V(Float64Cbrt, Operator::kNoProperties, 1, 0, 1)                         \
  V(Float64Cos, Operator::kNoProperties, 1, 0, 1)                          \
  V(Float64Cosh, Operator::kNoProperties, 1, 0, 1)                         \
  V(Float64Exp, Operator::kNoProperties, 1, 0, 1)                          \
  V(Float64Expm1, Operator::kNoProperties, 1, 0, 1)                        \
  V(Float64Log, Operator::kNoProperties, 1, 0, 1)                          \
  V(Float64Log1p, Operator::kNoProperties, 1, 0, 1)                        \
  V(Float64Log2, Operator::kNoProperties, 1, 0, 1)                         \
  V(Float64Log10, Operator::kNoProperties, 1, 0, 1)                        \
  V(Float64Max, Operator::kAssociative | Operator::kCommutative, 2, 0, 1)  \
  V(Float64Min, Operator::kAssociative | Operator::kCommutative, 2, 0, 1)  \
  V(Float64Neg, Operator::kNoProperties, 1, 0, 1)                          \
  V(Float64Add, Operator::kCommutative, 2, 0, 1)                           \
  V(Float64Sub, Operator::kNoProperties, 2, 0, 1)                          \
  V(Float64Mul, Operator::kCommutative, 2, 0, 1)                           \
  V(Float64Div, Operator::kNoProperties, 2, 0, 1)                          \
  V(Float64Mod, Operator::kNoProperties, 2, 0, 1)                          \
  V(Float64Pow, Operator::kNoProperties, 2, 0, 1)                          \
  V(Float64Sin, Operator::kNoProperties, 1, 0, 1)                          \
  V(Float64Sinh, Operator::kNoProperties, 1, 0, 1)                         \
  V(Float64Sqrt, Operator::kNoProperties, 1, 0, 1)                         \
  V(Float64Tan, Operator::kNoProperties, 1, 0, 1)                          \
  V(Float64Tanh, Operator::kNoProperties, 1, 0, 1)                         \
  V(Float32Equal, Operator::kCommutative, 2, 0, 1)                         \
  V(Float32LessThan, Operator::kNoProperties, 2, 0, 1)                     \
  V(Float32LessThanOrEqual, Operator::kNoProperties, 2, 0, 1)              \
  V(Float64Equal, Operator::kCommutative, 2, 0, 1)                         \
  V(Float64LessThan, Operator::kNoProperties, 2, 0, 1)                     \
  V(Float64LessThanOrEqual, Operator::kNoProperties, 2, 0, 1)              \
  V(Float64ExtractLowWord32, Operator::kNoProperties, 1, 0, 1)             \
  V(Float64ExtractHighWord32, Operator::kNoProperties, 1, 0, 1)            \
  V(Float64InsertLowWord32, Operator::kNoProperties, 2, 0, 1)              \
  V(Float64InsertHighWord32, Operator::kNoProperties, 2, 0, 1)             \
  V(LoadStackCheckOffset, Operator::kNoProperties, 0, 0, 1)                \
  V(LoadFramePointer, Operator::kNoProperties, 0, 0, 1)                    \
  V(LoadParentFramePointer, Operator::kNoProperties, 0, 0, 1)              \
  V(Int32PairAdd, Operator::kNoProperties, 4, 0, 2)                        \
  V(Int32PairSub, Operator::kNoProperties, 4, 0, 2)                        \
  V(Int32PairMul, Operator::kNoProperties, 4, 0, 2)                        \
  V(Word32PairShl, Operator::kNoProperties, 3, 0, 2)                       \
  V(Word32PairShr, Operator::kNoProperties, 3, 0, 2)                       \
  V(Word32PairSar, Operator::kNoProperties, 3, 0, 2)                       \
  V(F64x2Splat, Operator::kNoProperties, 1, 0, 1)                          \
  V(F64x2Abs, Operator::kNoProperties, 1, 0, 1)                            \
  V(F64x2Neg, Operator::kNoProperties, 1, 0, 1)                            \
  V(F64x2Sqrt, Operator::kNoProperties, 1, 0, 1)                           \
  V(F64x2Add, Operator::kCommutative, 2, 0, 1)                             \
  V(F64x2Sub, Operator::kNoProperties, 2, 0, 1)                            \
  V(F64x2Mul, Operator::kCommutative, 2, 0, 1)                             \
  V(F64x2Div, Operator::kNoProperties, 2, 0, 1)                            \
  V(F64x2Min, Operator::kCommutative, 2, 0, 1)                             \
  V(F64x2Max, Operator::kCommutative, 2, 0, 1)                             \
  V(F64x2Eq, Operator::kCommutative, 2, 0, 1)                              \
  V(F64x2Ne, Operator::kCommutative, 2, 0, 1)                              \
  V(F64x2Lt, Operator::kNoProperties, 2, 0, 1)                             \
  V(F64x2Le, Operator::kNoProperties, 2, 0, 1)                             \
  V(F64x2Qfma, Operator::kNoProperties, 3, 0, 1)                           \
  V(F64x2Qfms, Operator::kNoProperties, 3, 0, 1)                           \
380 381
  V(F64x2Pmin, Operator::kNoProperties, 2, 0, 1)                           \
  V(F64x2Pmax, Operator::kNoProperties, 2, 0, 1)                           \
382 383 384 385
  V(F64x2Ceil, Operator::kNoProperties, 1, 0, 1)                           \
  V(F64x2Floor, Operator::kNoProperties, 1, 0, 1)                          \
  V(F64x2Trunc, Operator::kNoProperties, 1, 0, 1)                          \
  V(F64x2NearestInt, Operator::kNoProperties, 1, 0, 1)                     \
386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406
  V(F32x4Splat, Operator::kNoProperties, 1, 0, 1)                          \
  V(F32x4SConvertI32x4, Operator::kNoProperties, 1, 0, 1)                  \
  V(F32x4UConvertI32x4, Operator::kNoProperties, 1, 0, 1)                  \
  V(F32x4Abs, Operator::kNoProperties, 1, 0, 1)                            \
  V(F32x4Neg, Operator::kNoProperties, 1, 0, 1)                            \
  V(F32x4Sqrt, Operator::kNoProperties, 1, 0, 1)                           \
  V(F32x4RecipApprox, Operator::kNoProperties, 1, 0, 1)                    \
  V(F32x4RecipSqrtApprox, Operator::kNoProperties, 1, 0, 1)                \
  V(F32x4Add, Operator::kCommutative, 2, 0, 1)                             \
  V(F32x4AddHoriz, Operator::kNoProperties, 2, 0, 1)                       \
  V(F32x4Sub, Operator::kNoProperties, 2, 0, 1)                            \
  V(F32x4Mul, Operator::kCommutative, 2, 0, 1)                             \
  V(F32x4Div, Operator::kNoProperties, 2, 0, 1)                            \
  V(F32x4Min, Operator::kCommutative, 2, 0, 1)                             \
  V(F32x4Max, Operator::kCommutative, 2, 0, 1)                             \
  V(F32x4Eq, Operator::kCommutative, 2, 0, 1)                              \
  V(F32x4Ne, Operator::kCommutative, 2, 0, 1)                              \
  V(F32x4Lt, Operator::kNoProperties, 2, 0, 1)                             \
  V(F32x4Le, Operator::kNoProperties, 2, 0, 1)                             \
  V(F32x4Qfma, Operator::kNoProperties, 3, 0, 1)                           \
  V(F32x4Qfms, Operator::kNoProperties, 3, 0, 1)                           \
407 408
  V(F32x4Pmin, Operator::kNoProperties, 2, 0, 1)                           \
  V(F32x4Pmax, Operator::kNoProperties, 2, 0, 1)                           \
409 410 411 412
  V(F32x4Ceil, Operator::kNoProperties, 1, 0, 1)                           \
  V(F32x4Floor, Operator::kNoProperties, 1, 0, 1)                          \
  V(F32x4Trunc, Operator::kNoProperties, 1, 0, 1)                          \
  V(F32x4NearestInt, Operator::kNoProperties, 1, 0, 1)                     \
413 414 415
  V(I64x2Splat, Operator::kNoProperties, 1, 0, 1)                          \
  V(I64x2SplatI32Pair, Operator::kNoProperties, 2, 0, 1)                   \
  V(I64x2Neg, Operator::kNoProperties, 1, 0, 1)                            \
416 417 418 419
  V(I64x2SConvertI32x4Low, Operator::kNoProperties, 1, 0, 1)               \
  V(I64x2SConvertI32x4High, Operator::kNoProperties, 1, 0, 1)              \
  V(I64x2UConvertI32x4Low, Operator::kNoProperties, 1, 0, 1)               \
  V(I64x2UConvertI32x4High, Operator::kNoProperties, 1, 0, 1)              \
420
  V(I64x2BitMask, Operator::kNoProperties, 1, 0, 1)                        \
421 422 423 424 425 426 427
  V(I64x2Shl, Operator::kNoProperties, 2, 0, 1)                            \
  V(I64x2ShrS, Operator::kNoProperties, 2, 0, 1)                           \
  V(I64x2Add, Operator::kCommutative, 2, 0, 1)                             \
  V(I64x2Sub, Operator::kNoProperties, 2, 0, 1)                            \
  V(I64x2Mul, Operator::kCommutative, 2, 0, 1)                             \
  V(I64x2Eq, Operator::kCommutative, 2, 0, 1)                              \
  V(I64x2ShrU, Operator::kNoProperties, 2, 0, 1)                           \
428 429 430 431
  V(I64x2ExtMulLowI32x4S, Operator::kCommutative, 2, 0, 1)                 \
  V(I64x2ExtMulHighI32x4S, Operator::kCommutative, 2, 0, 1)                \
  V(I64x2ExtMulLowI32x4U, Operator::kCommutative, 2, 0, 1)                 \
  V(I64x2ExtMulHighI32x4U, Operator::kCommutative, 2, 0, 1)                \
432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456
  V(I32x4Splat, Operator::kNoProperties, 1, 0, 1)                          \
  V(I32x4SConvertF32x4, Operator::kNoProperties, 1, 0, 1)                  \
  V(I32x4SConvertI16x8Low, Operator::kNoProperties, 1, 0, 1)               \
  V(I32x4SConvertI16x8High, Operator::kNoProperties, 1, 0, 1)              \
  V(I32x4Neg, Operator::kNoProperties, 1, 0, 1)                            \
  V(I32x4Shl, Operator::kNoProperties, 2, 0, 1)                            \
  V(I32x4ShrS, Operator::kNoProperties, 2, 0, 1)                           \
  V(I32x4Add, Operator::kCommutative, 2, 0, 1)                             \
  V(I32x4AddHoriz, Operator::kNoProperties, 2, 0, 1)                       \
  V(I32x4Sub, Operator::kNoProperties, 2, 0, 1)                            \
  V(I32x4Mul, Operator::kCommutative, 2, 0, 1)                             \
  V(I32x4MinS, Operator::kCommutative, 2, 0, 1)                            \
  V(I32x4MaxS, Operator::kCommutative, 2, 0, 1)                            \
  V(I32x4Eq, Operator::kCommutative, 2, 0, 1)                              \
  V(I32x4Ne, Operator::kCommutative, 2, 0, 1)                              \
  V(I32x4GtS, Operator::kNoProperties, 2, 0, 1)                            \
  V(I32x4GeS, Operator::kNoProperties, 2, 0, 1)                            \
  V(I32x4UConvertF32x4, Operator::kNoProperties, 1, 0, 1)                  \
  V(I32x4UConvertI16x8Low, Operator::kNoProperties, 1, 0, 1)               \
  V(I32x4UConvertI16x8High, Operator::kNoProperties, 1, 0, 1)              \
  V(I32x4ShrU, Operator::kNoProperties, 2, 0, 1)                           \
  V(I32x4MinU, Operator::kCommutative, 2, 0, 1)                            \
  V(I32x4MaxU, Operator::kCommutative, 2, 0, 1)                            \
  V(I32x4GtU, Operator::kNoProperties, 2, 0, 1)                            \
  V(I32x4GeU, Operator::kNoProperties, 2, 0, 1)                            \
457
  V(I32x4Abs, Operator::kNoProperties, 1, 0, 1)                            \
458
  V(I32x4BitMask, Operator::kNoProperties, 1, 0, 1)                        \
459
  V(I32x4DotI16x8S, Operator::kCommutative, 2, 0, 1)                       \
460 461 462 463
  V(I32x4ExtMulLowI16x8S, Operator::kCommutative, 2, 0, 1)                 \
  V(I32x4ExtMulHighI16x8S, Operator::kCommutative, 2, 0, 1)                \
  V(I32x4ExtMulLowI16x8U, Operator::kCommutative, 2, 0, 1)                 \
  V(I32x4ExtMulHighI16x8U, Operator::kCommutative, 2, 0, 1)                \
464 465 466 467 468 469 470 471
  V(I16x8Splat, Operator::kNoProperties, 1, 0, 1)                          \
  V(I16x8SConvertI8x16Low, Operator::kNoProperties, 1, 0, 1)               \
  V(I16x8SConvertI8x16High, Operator::kNoProperties, 1, 0, 1)              \
  V(I16x8Neg, Operator::kNoProperties, 1, 0, 1)                            \
  V(I16x8Shl, Operator::kNoProperties, 2, 0, 1)                            \
  V(I16x8ShrS, Operator::kNoProperties, 2, 0, 1)                           \
  V(I16x8SConvertI32x4, Operator::kNoProperties, 2, 0, 1)                  \
  V(I16x8Add, Operator::kCommutative, 2, 0, 1)                             \
472
  V(I16x8AddSatS, Operator::kCommutative, 2, 0, 1)                         \
473 474
  V(I16x8AddHoriz, Operator::kNoProperties, 2, 0, 1)                       \
  V(I16x8Sub, Operator::kNoProperties, 2, 0, 1)                            \
475
  V(I16x8SubSatS, Operator::kNoProperties, 2, 0, 1)                        \
476 477 478 479 480 481 482 483 484 485 486
  V(I16x8Mul, Operator::kCommutative, 2, 0, 1)                             \
  V(I16x8MinS, Operator::kCommutative, 2, 0, 1)                            \
  V(I16x8MaxS, Operator::kCommutative, 2, 0, 1)                            \
  V(I16x8Eq, Operator::kCommutative, 2, 0, 1)                              \
  V(I16x8Ne, Operator::kCommutative, 2, 0, 1)                              \
  V(I16x8GtS, Operator::kNoProperties, 2, 0, 1)                            \
  V(I16x8GeS, Operator::kNoProperties, 2, 0, 1)                            \
  V(I16x8UConvertI8x16Low, Operator::kNoProperties, 1, 0, 1)               \
  V(I16x8UConvertI8x16High, Operator::kNoProperties, 1, 0, 1)              \
  V(I16x8ShrU, Operator::kNoProperties, 2, 0, 1)                           \
  V(I16x8UConvertI32x4, Operator::kNoProperties, 2, 0, 1)                  \
487 488
  V(I16x8AddSatU, Operator::kCommutative, 2, 0, 1)                         \
  V(I16x8SubSatU, Operator::kNoProperties, 2, 0, 1)                        \
489 490 491 492
  V(I16x8MinU, Operator::kCommutative, 2, 0, 1)                            \
  V(I16x8MaxU, Operator::kCommutative, 2, 0, 1)                            \
  V(I16x8GtU, Operator::kNoProperties, 2, 0, 1)                            \
  V(I16x8GeU, Operator::kNoProperties, 2, 0, 1)                            \
493
  V(I16x8RoundingAverageU, Operator::kCommutative, 2, 0, 1)                \
494
  V(I16x8Q15MulRSatS, Operator::kCommutative, 2, 0, 1)                     \
495
  V(I16x8Abs, Operator::kNoProperties, 1, 0, 1)                            \
496
  V(I16x8BitMask, Operator::kNoProperties, 1, 0, 1)                        \
497 498 499 500
  V(I16x8ExtMulLowI8x16S, Operator::kCommutative, 2, 0, 1)                 \
  V(I16x8ExtMulHighI8x16S, Operator::kCommutative, 2, 0, 1)                \
  V(I16x8ExtMulLowI8x16U, Operator::kCommutative, 2, 0, 1)                 \
  V(I16x8ExtMulHighI8x16U, Operator::kCommutative, 2, 0, 1)                \
501 502 503 504 505 506
  V(I8x16Splat, Operator::kNoProperties, 1, 0, 1)                          \
  V(I8x16Neg, Operator::kNoProperties, 1, 0, 1)                            \
  V(I8x16Shl, Operator::kNoProperties, 2, 0, 1)                            \
  V(I8x16ShrS, Operator::kNoProperties, 2, 0, 1)                           \
  V(I8x16SConvertI16x8, Operator::kNoProperties, 2, 0, 1)                  \
  V(I8x16Add, Operator::kCommutative, 2, 0, 1)                             \
507
  V(I8x16AddSatS, Operator::kCommutative, 2, 0, 1)                         \
508
  V(I8x16Sub, Operator::kNoProperties, 2, 0, 1)                            \
509
  V(I8x16SubSatS, Operator::kNoProperties, 2, 0, 1)                        \
510 511 512 513 514 515 516 517 518
  V(I8x16Mul, Operator::kCommutative, 2, 0, 1)                             \
  V(I8x16MinS, Operator::kCommutative, 2, 0, 1)                            \
  V(I8x16MaxS, Operator::kCommutative, 2, 0, 1)                            \
  V(I8x16Eq, Operator::kCommutative, 2, 0, 1)                              \
  V(I8x16Ne, Operator::kCommutative, 2, 0, 1)                              \
  V(I8x16GtS, Operator::kNoProperties, 2, 0, 1)                            \
  V(I8x16GeS, Operator::kNoProperties, 2, 0, 1)                            \
  V(I8x16ShrU, Operator::kNoProperties, 2, 0, 1)                           \
  V(I8x16UConvertI16x8, Operator::kNoProperties, 2, 0, 1)                  \
519 520
  V(I8x16AddSatU, Operator::kCommutative, 2, 0, 1)                         \
  V(I8x16SubSatU, Operator::kNoProperties, 2, 0, 1)                        \
521 522 523 524
  V(I8x16MinU, Operator::kCommutative, 2, 0, 1)                            \
  V(I8x16MaxU, Operator::kCommutative, 2, 0, 1)                            \
  V(I8x16GtU, Operator::kNoProperties, 2, 0, 1)                            \
  V(I8x16GeU, Operator::kNoProperties, 2, 0, 1)                            \
525
  V(I8x16RoundingAverageU, Operator::kCommutative, 2, 0, 1)                \
526
  V(I8x16Popcnt, Operator::kNoProperties, 1, 0, 1)                         \
527
  V(I8x16Abs, Operator::kNoProperties, 1, 0, 1)                            \
528
  V(I8x16BitMask, Operator::kNoProperties, 1, 0, 1)                        \
529 530 531 532 533 534 535 536
  V(S128Load, Operator::kNoProperties, 2, 0, 1)                            \
  V(S128Store, Operator::kNoProperties, 3, 0, 1)                           \
  V(S128Zero, Operator::kNoProperties, 0, 0, 1)                            \
  V(S128And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1)     \
  V(S128Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1)      \
  V(S128Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1)     \
  V(S128Not, Operator::kNoProperties, 1, 0, 1)                             \
  V(S128Select, Operator::kNoProperties, 3, 0, 1)                          \
537
  V(S128AndNot, Operator::kNoProperties, 2, 0, 1)                          \
538 539 540 541 542 543
  V(V32x4AnyTrue, Operator::kNoProperties, 1, 0, 1)                        \
  V(V32x4AllTrue, Operator::kNoProperties, 1, 0, 1)                        \
  V(V16x8AnyTrue, Operator::kNoProperties, 1, 0, 1)                        \
  V(V16x8AllTrue, Operator::kNoProperties, 1, 0, 1)                        \
  V(V8x16AnyTrue, Operator::kNoProperties, 1, 0, 1)                        \
  V(V8x16AllTrue, Operator::kNoProperties, 1, 0, 1)                        \
544
  V(I8x16Swizzle, Operator::kNoProperties, 2, 0, 1)
545

546 547
// The format is:
// V(Name, properties, value_input_count, control_input_count, output_count)
548
#define PURE_OPTIONAL_OP_LIST(V)                            \
549
  V(Word32Ctz, Operator::kNoProperties, 1, 0, 1)            \
550
  V(Word64Ctz, Operator::kNoProperties, 1, 0, 1)            \
551 552
  V(Word32Rol, Operator::kNoProperties, 2, 0, 1)            \
  V(Word64Rol, Operator::kNoProperties, 2, 0, 1)            \
553 554
  V(Word32ReverseBits, Operator::kNoProperties, 1, 0, 1)    \
  V(Word64ReverseBits, Operator::kNoProperties, 1, 0, 1)    \
555 556
  V(Int32AbsWithOverflow, Operator::kNoProperties, 1, 0, 2) \
  V(Int64AbsWithOverflow, Operator::kNoProperties, 1, 0, 2) \
557
  V(Word32Popcnt, Operator::kNoProperties, 1, 0, 1)         \
558
  V(Word64Popcnt, Operator::kNoProperties, 1, 0, 1)         \
559
  V(Float32RoundDown, Operator::kNoProperties, 1, 0, 1)     \
560
  V(Float64RoundDown, Operator::kNoProperties, 1, 0, 1)     \
561
  V(Float32RoundUp, Operator::kNoProperties, 1, 0, 1)       \
562
  V(Float64RoundUp, Operator::kNoProperties, 1, 0, 1)       \
563
  V(Float32RoundTruncate, Operator::kNoProperties, 1, 0, 1) \
564
  V(Float64RoundTruncate, Operator::kNoProperties, 1, 0, 1) \
565
  V(Float64RoundTiesAway, Operator::kNoProperties, 1, 0, 1) \
566
  V(Float32RoundTiesEven, Operator::kNoProperties, 1, 0, 1) \
567
  V(Float64RoundTiesEven, Operator::kNoProperties, 1, 0, 1)
568

569 570
// The format is:
// V(Name, properties, value_input_count, control_input_count, output_count)
571 572 573
#define OVERFLOW_OP_LIST(V)                                                \
  V(Int32AddWithOverflow, Operator::kAssociative | Operator::kCommutative) \
  V(Int32SubWithOverflow, Operator::kNoProperties)                         \
574
  V(Int32MulWithOverflow, Operator::kAssociative | Operator::kCommutative) \
575 576 577
  V(Int64AddWithOverflow, Operator::kAssociative | Operator::kCommutative) \
  V(Int64SubWithOverflow, Operator::kNoProperties)

578
#define MACHINE_TYPE_LIST(V) \
579 580
  V(Float32)                 \
  V(Float64)                 \
581
  V(Simd128)                 \
582 583 584 585 586 587 588 589 590
  V(Int8)                    \
  V(Uint8)                   \
  V(Int16)                   \
  V(Uint16)                  \
  V(Int32)                   \
  V(Uint32)                  \
  V(Int64)                   \
  V(Uint64)                  \
  V(Pointer)                 \
591 592
  V(TaggedSigned)            \
  V(TaggedPointer)           \
593 594 595
  V(AnyTagged)               \
  V(CompressedPointer)       \
  V(AnyCompressed)
596

597 598 599
#define MACHINE_REPRESENTATION_LIST(V) \
  V(kFloat32)                          \
  V(kFloat64)                          \
600
  V(kSimd128)                          \
601 602 603 604
  V(kWord8)                            \
  V(kWord16)                           \
  V(kWord32)                           \
  V(kWord64)                           \
605 606
  V(kTaggedSigned)                     \
  V(kTaggedPointer)                    \
607 608 609
  V(kTagged)                           \
  V(kCompressedPointer)                \
  V(kCompressed)
610

611
#define LOAD_TRANSFORM_LIST(V) \
612 613 614 615 616 617 618 619 620 621
  V(S128Load8Splat)            \
  V(S128Load16Splat)           \
  V(S128Load32Splat)           \
  V(S128Load64Splat)           \
  V(S128Load8x8S)              \
  V(S128Load8x8U)              \
  V(S128Load16x4S)             \
  V(S128Load16x4U)             \
  V(S128Load32x2S)             \
  V(S128Load32x2U)             \
622 623
  V(S128Load32Zero)            \
  V(S128Load64Zero)
624

625 626 627 628 629
#define ATOMIC_U32_TYPE_LIST(V) \
  V(Uint8)                      \
  V(Uint16)                     \
  V(Uint32)

630
#define ATOMIC_TYPE_LIST(V) \
631
  ATOMIC_U32_TYPE_LIST(V)   \
632 633
  V(Int8)                   \
  V(Int16)                  \
634
  V(Int32)
635

636 637
#define ATOMIC_U64_TYPE_LIST(V) \
  ATOMIC_U32_TYPE_LIST(V)       \
638 639
  V(Uint64)

640 641 642 643 644
#define ATOMIC_REPRESENTATION_LIST(V) \
  V(kWord8)                           \
  V(kWord16)                          \
  V(kWord32)

645 646 647 648
#define ATOMIC64_REPRESENTATION_LIST(V) \
  ATOMIC_REPRESENTATION_LIST(V)         \
  V(kWord64)

649
#define SIMD_LANE_OP_LIST(V) \
650
  V(F64x2, 2)                \
651
  V(F32x4, 4)                \
652
  V(I64x2, 2)                \
653 654 655
  V(I32x4, 4)                \
  V(I16x8, 8)                \
  V(I8x16, 16)
656

657 658 659 660 661 662 663 664 665
#define SIMD_I64x2_LANES(V) V(0) V(1)

#define SIMD_I32x4_LANES(V) SIMD_I64x2_LANES(V) V(2) V(3)

#define SIMD_I16x8_LANES(V) SIMD_I32x4_LANES(V) V(4) V(5) V(6) V(7)

#define SIMD_I8x16_LANES(V) \
  SIMD_I16x8_LANES(V) V(8) V(9) V(10) V(11) V(12) V(13) V(14) V(15)

666 667
#define STACK_SLOT_CACHED_SIZES_ALIGNMENTS_LIST(V) \
  V(4, 0) V(8, 0) V(16, 0) V(4, 4) V(8, 8) V(16, 16)
668

669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707
template <IrOpcode::Value op, int value_input_count, int effect_input_count,
          int control_input_count, int value_output_count,
          int effect_output_count, int control_output_count>
struct CachedOperator : public Operator {
  CachedOperator(Operator::Properties properties, const char* mnemonic)
      : Operator(op, properties, mnemonic, value_input_count,
                 effect_input_count, control_input_count, value_output_count,
                 effect_output_count, control_output_count) {}
};

template <IrOpcode::Value op, int value_input_count, int control_input_count,
          int value_output_count>
struct CachedPureOperator : public Operator {
  CachedPureOperator(Operator::Properties properties, const char* mnemonic)
      : Operator(op, Operator::kPure | properties, mnemonic, value_input_count,
                 0, control_input_count, value_output_count, 0, 0) {}
};

template <class Op>
const Operator* GetCachedOperator() {
  STATIC_ASSERT(std::is_trivially_destructible<Op>::value);
  static const Op op;
  return &op;
}

template <class Op>
const Operator* GetCachedOperator(Operator::Properties properties,
                                  const char* mnemonic) {
#ifdef DEBUG
  static Operator::Properties const initial_properties = properties;
  static const char* const initial_mnemonic = mnemonic;
  DCHECK_EQ(properties, initial_properties);
  DCHECK_EQ(mnemonic, initial_mnemonic);
#endif
  STATIC_ASSERT(std::is_trivially_destructible<Op>::value);
  static const Op op(properties, mnemonic);
  return &op;
}

708 709
struct StackSlotOperator : public Operator1<StackSlotRepresentation> {
  explicit StackSlotOperator(int size, int alignment)
710 711 712 713 714 715 716 717
      : Operator1(IrOpcode::kStackSlot, Operator::kNoDeopt | Operator::kNoThrow,
                  "StackSlot", 0, 0, 0, 1, 0, 0,
                  StackSlotRepresentation(size, alignment)) {}
};

template <int size, int alignment>
struct CachedStackSlotOperator : StackSlotOperator {
  CachedStackSlotOperator() : StackSlotOperator(size, alignment) {}
718 719
};

720 721
#define PURE(Name, properties, value_input_count, control_input_count,         \
             output_count)                                                     \
722 723 724 725 726 727 728 729 730
  const OptionalOperator MachineOperatorBuilder::Name() {                      \
    return OptionalOperator(                                                   \
        flags_ & k##Name,                                                      \
        GetCachedOperator<                                                     \
            CachedPureOperator<IrOpcode::k##Name, value_input_count,           \
                               control_input_count, output_count>>(properties, \
                                                                   #Name));    \
  }
PURE_OPTIONAL_OP_LIST(PURE)
731 732
#undef PURE

733 734 735 736 737 738 739
#define OVERFLOW_OP(Name, properties)                                     \
  const Operator* MachineOperatorBuilder::Name() {                        \
    return GetCachedOperator<                                             \
        CachedOperator<IrOpcode::k##Name, 2, 0, 1, 2, 0, 0>>(             \
        Operator::kEliminatable | Operator::kNoRead | properties, #Name); \
  }
OVERFLOW_OP_LIST(OVERFLOW_OP)
740 741
#undef OVERFLOW_OP

742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773
template <ShiftKind kind>
struct Word32SarOperator : Operator1<ShiftKind> {
  Word32SarOperator()
      : Operator1(IrOpcode::kWord32Sar, Operator::kPure, "Word32Sar", 2, 0, 0,
                  1, 0, 0, kind) {}
};

const Operator* MachineOperatorBuilder::Word32Sar(ShiftKind kind) {
  switch (kind) {
    case ShiftKind::kNormal:
      return GetCachedOperator<Word32SarOperator<ShiftKind::kNormal>>();
    case ShiftKind::kShiftOutZeros:
      return GetCachedOperator<Word32SarOperator<ShiftKind::kShiftOutZeros>>();
  }
}

template <ShiftKind kind>
struct Word64SarOperator : Operator1<ShiftKind> {
  Word64SarOperator()
      : Operator1(IrOpcode::kWord64Sar, Operator::kPure, "Word64Sar", 2, 0, 0,
                  1, 0, 0, kind) {}
};

const Operator* MachineOperatorBuilder::Word64Sar(ShiftKind kind) {
  switch (kind) {
    case ShiftKind::kNormal:
      return GetCachedOperator<Word64SarOperator<ShiftKind::kNormal>>();
    case ShiftKind::kShiftOutZeros:
      return GetCachedOperator<Word64SarOperator<ShiftKind::kShiftOutZeros>>();
  }
}

774 775 776 777 778 779
template <MachineRepresentation rep, MachineSemantic sem>
struct LoadOperator : public Operator1<LoadRepresentation> {
  LoadOperator()
      : Operator1(IrOpcode::kLoad, Operator::kEliminatable, "Load", 2, 1, 1, 1,
                  1, 0, LoadRepresentation(rep, sem)) {}
};
780

781 782 783 784 785 786 787
template <MachineRepresentation rep, MachineSemantic sem>
struct PoisonedLoadOperator : public Operator1<LoadRepresentation> {
  PoisonedLoadOperator()
      : Operator1(IrOpcode::kPoisonedLoad, Operator::kEliminatable,
                  "PoisonedLoad", 2, 1, 1, 1, 1, 0,
                  LoadRepresentation(rep, sem)) {}
};
788

789 790 791 792 793 794 795
template <MachineRepresentation rep, MachineSemantic sem>
struct UnalignedLoadOperator : public Operator1<LoadRepresentation> {
  UnalignedLoadOperator()
      : Operator1(IrOpcode::kUnalignedLoad, Operator::kEliminatable,
                  "UnalignedLoad", 2, 1, 1, 1, 1, 0,
                  LoadRepresentation(rep, sem)) {}
};
796

797 798 799 800 801 802 803
template <MachineRepresentation rep, MachineSemantic sem>
struct ProtectedLoadOperator : public Operator1<LoadRepresentation> {
  ProtectedLoadOperator()
      : Operator1(IrOpcode::kProtectedLoad,
                  Operator::kNoDeopt | Operator::kNoThrow, "ProtectedLoad", 2,
                  1, 1, 1, 1, 0, LoadRepresentation(rep, sem)) {}
};
804

805
template <MemoryAccessKind kind, LoadTransformation type>
806 807
struct LoadTransformOperator : public Operator1<LoadTransformParameters> {
  LoadTransformOperator()
808
      : Operator1(IrOpcode::kLoadTransform,
809
                  kind == MemoryAccessKind::kProtected
810 811
                      ? Operator::kNoDeopt | Operator::kNoThrow
                      : Operator::kEliminatable,
812 813 814
                  "LoadTransform", 2, 1, 1, 1, 1, 0,
                  LoadTransformParameters{kind, type}) {}
};
815

816
template <MemoryAccessKind kind, MachineRepresentation rep, MachineSemantic sem,
817 818 819 820 821
          uint8_t laneidx>
struct LoadLaneOperator : public Operator1<LoadLaneParameters> {
  LoadLaneOperator()
      : Operator1(
            IrOpcode::kLoadLane,
822
            kind == MemoryAccessKind::kProtected
823 824 825 826 827 828
                ? Operator::kNoDeopt | Operator::kNoThrow
                : Operator::kEliminatable,
            "LoadLane", 3, 1, 1, 1, 1, 0,
            LoadLaneParameters{kind, LoadRepresentation(rep, sem), laneidx}) {}
};

829 830 831 832 833 834 835 836
template <MachineRepresentation rep, WriteBarrierKind write_barrier_kind>
struct StoreOperator : public Operator1<StoreRepresentation> {
  StoreOperator()
      : Operator1(IrOpcode::kStore,
                  Operator::kNoDeopt | Operator::kNoRead | Operator::kNoThrow,
                  "Store", 3, 1, 1, 0, 1, 0,
                  StoreRepresentation(rep, write_barrier_kind)) {}
};
837

838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854
template <MachineRepresentation rep>
struct UnalignedStoreOperator : public Operator1<UnalignedStoreRepresentation> {
  UnalignedStoreOperator()
      : Operator1(IrOpcode::kUnalignedStore,
                  Operator::kNoDeopt | Operator::kNoRead | Operator::kNoThrow,
                  "UnalignedStore", 3, 1, 1, 0, 1, 0, rep) {}
};

template <MachineRepresentation rep>
struct ProtectedStoreOperator : public Operator1<StoreRepresentation> {
  ProtectedStoreOperator()
      : Operator1(IrOpcode::kProtectedStore,
                  Operator::kNoDeopt | Operator::kNoRead | Operator::kNoThrow,
                  "Store", 3, 1, 1, 0, 1, 0,
                  StoreRepresentation(rep, kNoWriteBarrier)) {}
};

855
template <MemoryAccessKind kind, MachineRepresentation rep, uint8_t laneidx>
856 857 858 859 860 861 862 863
struct StoreLaneOperator : public Operator1<StoreLaneParameters> {
  StoreLaneOperator()
      : Operator1(IrOpcode::kStoreLane,
                  Operator::kNoDeopt | Operator::kNoRead | Operator::kNoThrow,
                  "StoreLane", 3, 1, 1, 0, 1, 0,
                  StoreLaneParameters{kind, rep, laneidx}) {}
};

864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894
template <MachineRepresentation rep, MachineSemantic sem>
struct Word32AtomicLoadOperator : public Operator1<LoadRepresentation> {
  Word32AtomicLoadOperator()
      : Operator1(IrOpcode::kWord32AtomicLoad, Operator::kEliminatable,
                  "Word32AtomicLoad", 2, 1, 1, 1, 1, 0, MachineType(rep, sem)) {
  }
};

template <MachineRepresentation rep, MachineSemantic sem>
struct Word64AtomicLoadOperator : public Operator1<LoadRepresentation> {
  Word64AtomicLoadOperator()
      : Operator1(IrOpcode::kWord64AtomicLoad, Operator::kEliminatable,
                  "Word64AtomicLoad", 2, 1, 1, 1, 1, 0, MachineType(rep, sem)) {
  }
};

template <MachineRepresentation rep>
struct Word32AtomicStoreOperator : public Operator1<MachineRepresentation> {
  Word32AtomicStoreOperator()
      : Operator1(IrOpcode::kWord32AtomicStore,
                  Operator::kNoDeopt | Operator::kNoRead | Operator::kNoThrow,
                  "Word32AtomicStore", 3, 1, 1, 0, 1, 0, rep) {}
};

template <MachineRepresentation rep>
struct Word64AtomicStoreOperator : public Operator1<MachineRepresentation> {
  Word64AtomicStoreOperator()
      : Operator1(IrOpcode::kWord64AtomicStore,
                  Operator::kNoDeopt | Operator::kNoRead | Operator::kNoThrow,
                  "Word64AtomicStore", 3, 1, 1, 0, 1, 0, rep) {}
};
895

896 897 898 899 900 901
#define ATOMIC_OP(op)                                                         \
  template <MachineRepresentation rep, MachineSemantic sem>                   \
  struct op##Operator : public Operator1<MachineType> {                       \
    op##Operator()                                                            \
        : Operator1(IrOpcode::k##op, Operator::kNoDeopt | Operator::kNoThrow, \
                    #op, 3, 1, 1, 1, 1, 0, MachineType(rep, sem)) {}          \
902
  };
903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947
ATOMIC_OP(Word32AtomicAdd)
ATOMIC_OP(Word32AtomicSub)
ATOMIC_OP(Word32AtomicAnd)
ATOMIC_OP(Word32AtomicOr)
ATOMIC_OP(Word32AtomicXor)
ATOMIC_OP(Word32AtomicExchange)
ATOMIC_OP(Word64AtomicAdd)
ATOMIC_OP(Word64AtomicSub)
ATOMIC_OP(Word64AtomicAnd)
ATOMIC_OP(Word64AtomicOr)
ATOMIC_OP(Word64AtomicXor)
ATOMIC_OP(Word64AtomicExchange)
#undef ATOMIC_OP

template <MachineRepresentation rep, MachineSemantic sem>
struct Word32AtomicCompareExchangeOperator : public Operator1<MachineType> {
  Word32AtomicCompareExchangeOperator()
      : Operator1(IrOpcode::kWord32AtomicCompareExchange,
                  Operator::kNoDeopt | Operator::kNoThrow,
                  "Word32AtomicCompareExchange", 4, 1, 1, 1, 1, 0,
                  MachineType(rep, sem)) {}
};

template <MachineRepresentation rep, MachineSemantic sem>
struct Word64AtomicCompareExchangeOperator : public Operator1<MachineType> {
  Word64AtomicCompareExchangeOperator()
      : Operator1(IrOpcode::kWord64AtomicCompareExchange,
                  Operator::kNoDeopt | Operator::kNoThrow,
                  "Word64AtomicCompareExchange", 4, 1, 1, 1, 1, 0,
                  MachineType(rep, sem)) {}
};

struct Word32AtomicPairLoadOperator : public Operator {
  Word32AtomicPairLoadOperator()
      : Operator(IrOpcode::kWord32AtomicPairLoad,
                 Operator::kNoDeopt | Operator::kNoThrow,
                 "Word32AtomicPairLoad", 2, 1, 1, 2, 1, 0) {}
};

struct Word32AtomicPairStoreOperator : public Operator {
  Word32AtomicPairStoreOperator()
      : Operator(IrOpcode::kWord32AtomicPairStore,
                 Operator::kNoDeopt | Operator::kNoThrow,
                 "Word32AtomicPairStore", 4, 1, 1, 0, 1, 0) {}
};
948

949 950 951 952 953
#define ATOMIC_PAIR_OP(op)                                      \
  struct Word32AtomicPair##op##Operator : public Operator {     \
    Word32AtomicPair##op##Operator()                            \
        : Operator(IrOpcode::kWord32AtomicPair##op,             \
                   Operator::kNoDeopt | Operator::kNoThrow,     \
954 955 956 957 958 959 960 961
                   "Word32AtomicPair" #op, 4, 1, 1, 2, 1, 0) {} \
  };
ATOMIC_PAIR_OP(Add)
ATOMIC_PAIR_OP(Sub)
ATOMIC_PAIR_OP(And)
ATOMIC_PAIR_OP(Or)
ATOMIC_PAIR_OP(Xor)
ATOMIC_PAIR_OP(Exchange)
962 963
#undef ATOMIC_PAIR_OP

964 965 966 967 968 969
struct Word32AtomicPairCompareExchangeOperator : public Operator {
  Word32AtomicPairCompareExchangeOperator()
      : Operator(IrOpcode::kWord32AtomicPairCompareExchange,
                 Operator::kNoDeopt | Operator::kNoThrow,
                 "Word32AtomicPairCompareExchange", 6, 1, 1, 2, 1, 0) {}
};
970

971 972 973 974 975 976
struct MemoryBarrierOperator : public Operator {
  MemoryBarrierOperator()
      : Operator(IrOpcode::kMemoryBarrier,
                 Operator::kNoDeopt | Operator::kNoThrow, "MemoryBarrier", 0, 1,
                 1, 0, 1, 0) {}
};
977

978 979 980 981 982 983 984 985 986 987 988
// The {BitcastWordToTagged} operator must not be marked as pure (especially
// not idempotent), because otherwise the splitting logic in the Scheduler
// might decide to split these operators, thus potentially creating live
// ranges of allocation top across calls or other things that might allocate.
// See https://bugs.chromium.org/p/v8/issues/detail?id=6059 for more details.
struct BitcastWordToTaggedOperator : public Operator {
  BitcastWordToTaggedOperator()
      : Operator(IrOpcode::kBitcastWordToTagged,
                 Operator::kEliminatable | Operator::kNoWrite,
                 "BitcastWordToTagged", 1, 1, 1, 1, 1, 0) {}
};
989

990 991 992 993 994 995
struct BitcastTaggedToWordOperator : public Operator {
  BitcastTaggedToWordOperator()
      : Operator(IrOpcode::kBitcastTaggedToWord,
                 Operator::kEliminatable | Operator::kNoWrite,
                 "BitcastTaggedToWord", 1, 1, 1, 1, 1, 0) {}
};
996

997 998 999 1000 1001 1002
struct BitcastMaybeObjectToWordOperator : public Operator {
  BitcastMaybeObjectToWordOperator()
      : Operator(IrOpcode::kBitcastTaggedToWord,
                 Operator::kEliminatable | Operator::kNoWrite,
                 "BitcastMaybeObjectToWord", 1, 1, 1, 1, 1, 0) {}
};
1003

1004 1005 1006 1007 1008 1009
struct TaggedPoisonOnSpeculationOperator : public Operator {
  TaggedPoisonOnSpeculationOperator()
      : Operator(IrOpcode::kTaggedPoisonOnSpeculation,
                 Operator::kEliminatable | Operator::kNoWrite,
                 "TaggedPoisonOnSpeculation", 1, 1, 1, 1, 1, 0) {}
};
1010

1011 1012 1013 1014 1015 1016
struct Word32PoisonOnSpeculationOperator : public Operator {
  Word32PoisonOnSpeculationOperator()
      : Operator(IrOpcode::kWord32PoisonOnSpeculation,
                 Operator::kEliminatable | Operator::kNoWrite,
                 "Word32PoisonOnSpeculation", 1, 1, 1, 1, 1, 0) {}
};
1017

1018 1019 1020 1021 1022 1023
struct Word64PoisonOnSpeculationOperator : public Operator {
  Word64PoisonOnSpeculationOperator()
      : Operator(IrOpcode::kWord64PoisonOnSpeculation,
                 Operator::kEliminatable | Operator::kNoWrite,
                 "Word64PoisonOnSpeculation", 1, 1, 1, 1, 1, 0) {}
};
1024

1025 1026 1027 1028 1029
struct AbortCSAAssertOperator : public Operator {
  AbortCSAAssertOperator()
      : Operator(IrOpcode::kAbortCSAAssert, Operator::kNoThrow,
                 "AbortCSAAssert", 1, 1, 1, 0, 1, 0) {}
};
1030

1031 1032 1033 1034 1035
struct DebugBreakOperator : public Operator {
  DebugBreakOperator()
      : Operator(IrOpcode::kDebugBreak, Operator::kNoThrow, "DebugBreak", 0, 1,
                 1, 0, 1, 0) {}
};
1036

1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047
struct UnsafePointerAddOperator : public Operator {
  UnsafePointerAddOperator()
      : Operator(IrOpcode::kUnsafePointerAdd, Operator::kKontrol,
                 "UnsafePointerAdd", 2, 1, 1, 1, 1, 0) {}
};

template <StackCheckKind kind>
struct StackPointerGreaterThanOperator : public Operator1<StackCheckKind> {
  StackPointerGreaterThanOperator()
      : Operator1(IrOpcode::kStackPointerGreaterThan, Operator::kEliminatable,
                  "StackPointerGreaterThan", 1, 1, 0, 1, 1, 0, kind) {}
1048 1049
};

1050 1051
struct CommentOperator : public Operator1<const char*> {
  explicit CommentOperator(const char* msg)
1052 1053
      : Operator1(IrOpcode::kComment, Operator::kNoThrow | Operator::kNoWrite,
                  "Comment", 0, 1, 1, 0, 1, 0, msg) {}
1054
};
1055

1056 1057 1058
MachineOperatorBuilder::MachineOperatorBuilder(
    Zone* zone, MachineRepresentation word, Flags flags,
    AlignmentRequirements alignmentRequirements)
1059
    : zone_(zone),
1060 1061 1062
      word_(word),
      flags_(flags),
      alignment_requirements_(alignmentRequirements) {
1063 1064
  DCHECK(word == MachineRepresentation::kWord32 ||
         word == MachineRepresentation::kWord64);
1065 1066
}

1067
const Operator* MachineOperatorBuilder::UnalignedLoad(LoadRepresentation rep) {
1068 1069 1070 1071 1072
#define LOAD(Type)                                                  \
  if (rep == MachineType::Type()) {                                 \
    return GetCachedOperator<                                       \
        UnalignedLoadOperator<MachineType::Type().representation(), \
                              MachineType::Type().semantic()>>();   \
1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083
  }
  MACHINE_TYPE_LIST(LOAD)
#undef LOAD
  UNREACHABLE();
}

const Operator* MachineOperatorBuilder::UnalignedStore(
    UnalignedStoreRepresentation rep) {
  switch (rep) {
#define STORE(kRep)                 \
  case MachineRepresentation::kRep: \
1084 1085
    return GetCachedOperator<       \
        UnalignedStoreOperator<MachineRepresentation::kRep>>();
1086 1087 1088 1089 1090 1091 1092 1093
    MACHINE_REPRESENTATION_LIST(STORE)
#undef STORE
    case MachineRepresentation::kBit:
    case MachineRepresentation::kNone:
      break;
  }
  UNREACHABLE();
}
1094

1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143
template <TruncateKind kind>
struct TruncateFloat32ToUint32Operator : Operator1<TruncateKind> {
  TruncateFloat32ToUint32Operator()
      : Operator1(IrOpcode::kTruncateFloat32ToUint32, Operator::kPure,
                  "TruncateFloat32ToUint32", 1, 0, 0, 1, 0, 0, kind) {}
};

const Operator* MachineOperatorBuilder::TruncateFloat32ToUint32(
    TruncateKind kind) {
  switch (kind) {
    case TruncateKind::kArchitectureDefault:
      return GetCachedOperator<TruncateFloat32ToUint32Operator<
          TruncateKind::kArchitectureDefault>>();
    case TruncateKind::kSetOverflowToMin:
      return GetCachedOperator<
          TruncateFloat32ToUint32Operator<TruncateKind::kSetOverflowToMin>>();
  }
}

template <TruncateKind kind>
struct TruncateFloat32ToInt32Operator : Operator1<TruncateKind> {
  TruncateFloat32ToInt32Operator()
      : Operator1(IrOpcode::kTruncateFloat32ToInt32, Operator::kPure,
                  "TruncateFloat32ToInt32", 1, 0, 0, 1, 0, 0, kind) {}
};

const Operator* MachineOperatorBuilder::TruncateFloat32ToInt32(
    TruncateKind kind) {
  switch (kind) {
    case TruncateKind::kArchitectureDefault:
      return GetCachedOperator<
          TruncateFloat32ToInt32Operator<TruncateKind::kArchitectureDefault>>();
    case TruncateKind::kSetOverflowToMin:
      return GetCachedOperator<
          TruncateFloat32ToInt32Operator<TruncateKind::kSetOverflowToMin>>();
  }
}

size_t hash_value(TruncateKind kind) { return static_cast<size_t>(kind); }

std::ostream& operator<<(std::ostream& os, TruncateKind kind) {
  switch (kind) {
    case TruncateKind::kArchitectureDefault:
      return os << "kArchitectureDefault";
    case TruncateKind::kSetOverflowToMin:
      return os << "kSetOverflowToMin";
  }
}

1144 1145 1146 1147 1148 1149 1150
#define PURE(Name, properties, value_input_count, control_input_count,     \
             output_count)                                                 \
  const Operator* MachineOperatorBuilder::Name() {                         \
    return GetCachedOperator<                                              \
        CachedPureOperator<IrOpcode::k##Name, value_input_count,           \
                           control_input_count, output_count>>(properties, \
                                                               #Name);     \
1151
  }
1152
MACHINE_PURE_OP_LIST(PURE)
1153
#undef PURE
1154

1155
const Operator* MachineOperatorBuilder::Load(LoadRepresentation rep) {
1156 1157 1158 1159 1160
#define LOAD(Type)                                         \
  if (rep == MachineType::Type()) {                        \
    return GetCachedOperator<                              \
        LoadOperator<MachineType::Type().representation(), \
                     MachineType::Type().semantic()>>();   \
1161
  }
1162
  MACHINE_TYPE_LIST(LOAD)
1163
#undef LOAD
1164
  UNREACHABLE();
1165 1166
}

1167
const Operator* MachineOperatorBuilder::PoisonedLoad(LoadRepresentation rep) {
1168 1169 1170 1171 1172
#define LOAD(Type)                                                 \
  if (rep == MachineType::Type()) {                                \
    return GetCachedOperator<                                      \
        PoisonedLoadOperator<MachineType::Type().representation(), \
                             MachineType::Type().semantic()>>();   \
1173 1174 1175 1176 1177 1178
  }
  MACHINE_TYPE_LIST(LOAD)
#undef LOAD
  UNREACHABLE();
}

1179
const Operator* MachineOperatorBuilder::ProtectedLoad(LoadRepresentation rep) {
1180 1181 1182 1183 1184
#define LOAD(Type)                                                  \
  if (rep == MachineType::Type()) {                                 \
    return GetCachedOperator<                                       \
        ProtectedLoadOperator<MachineType::Type().representation(), \
                              MachineType::Type().semantic()>>();   \
1185 1186 1187 1188
  }
  MACHINE_TYPE_LIST(LOAD)
#undef LOAD
  UNREACHABLE();
1189 1190
}

1191
const Operator* MachineOperatorBuilder::LoadTransform(
1192 1193 1194 1195 1196 1197
    MemoryAccessKind kind, LoadTransformation transform) {
#define LOAD_TRANSFORM_KIND(TYPE, KIND)                             \
  if (kind == MemoryAccessKind::k##KIND &&                          \
      transform == LoadTransformation::k##TYPE) {                   \
    return GetCachedOperator<LoadTransformOperator<                 \
        MemoryAccessKind::k##KIND, LoadTransformation::k##TYPE>>(); \
1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209
  }
#define LOAD_TRANSFORM(TYPE)           \
  LOAD_TRANSFORM_KIND(TYPE, Normal)    \
  LOAD_TRANSFORM_KIND(TYPE, Unaligned) \
  LOAD_TRANSFORM_KIND(TYPE, Protected)

  LOAD_TRANSFORM_LIST(LOAD_TRANSFORM)
#undef LOAD_TRANSFORM
#undef LOAD_TRANSFORM_KIND
  UNREACHABLE();
}

1210
const Operator* MachineOperatorBuilder::LoadLane(MemoryAccessKind kind,
1211 1212
                                                 LoadRepresentation rep,
                                                 uint8_t laneidx) {
1213 1214 1215 1216 1217 1218
#define LOAD_LANE_KIND(TYPE, KIND, LANEIDX)                              \
  if (kind == MemoryAccessKind::k##KIND && rep == MachineType::TYPE() && \
      laneidx == LANEIDX) {                                              \
    return GetCachedOperator<LoadLaneOperator<                           \
        MemoryAccessKind::k##KIND, MachineType::TYPE().representation(), \
        MachineType::TYPE().semantic(), LANEIDX>>();                     \
1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243
  }

#define LOAD_LANE_T(T, LANE)         \
  LOAD_LANE_KIND(T, Normal, LANE)    \
  LOAD_LANE_KIND(T, Unaligned, LANE) \
  LOAD_LANE_KIND(T, Protected, LANE)

#define LOAD_LANE_INT8(LANE) LOAD_LANE_T(Int8, LANE)
#define LOAD_LANE_INT16(LANE) LOAD_LANE_T(Int16, LANE)
#define LOAD_LANE_INT32(LANE) LOAD_LANE_T(Int32, LANE)
#define LOAD_LANE_INT64(LANE) LOAD_LANE_T(Int64, LANE)

  // Semicolons unnecessary, but helps formatting.
  SIMD_I8x16_LANES(LOAD_LANE_INT8);
  SIMD_I16x8_LANES(LOAD_LANE_INT16);
  SIMD_I32x4_LANES(LOAD_LANE_INT32);
  SIMD_I64x2_LANES(LOAD_LANE_INT64);
#undef LOAD_LANE_INT8
#undef LOAD_LANE_INT16
#undef LOAD_LANE_INT32
#undef LOAD_LANE_INT64
#undef LOAD_LANE_KIND
  UNREACHABLE();
}

1244
const Operator* MachineOperatorBuilder::StoreLane(MemoryAccessKind kind,
1245 1246
                                                  MachineRepresentation rep,
                                                  uint8_t laneidx) {
1247 1248 1249 1250 1251
#define STORE_LANE_KIND(REP, KIND, LANEIDX)                                 \
  if (kind == MemoryAccessKind::k##KIND &&                                  \
      rep == MachineRepresentation::REP && laneidx == LANEIDX) {            \
    return GetCachedOperator<StoreLaneOperator<                             \
        MemoryAccessKind::k##KIND, MachineRepresentation::REP, LANEIDX>>(); \
1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276
  }

#define STORE_LANE_T(T, LANE)         \
  STORE_LANE_KIND(T, Normal, LANE)    \
  STORE_LANE_KIND(T, Unaligned, LANE) \
  STORE_LANE_KIND(T, Protected, LANE)

#define STORE_LANE_WORD8(LANE) STORE_LANE_T(kWord8, LANE)
#define STORE_LANE_WORD16(LANE) STORE_LANE_T(kWord16, LANE)
#define STORE_LANE_WORD32(LANE) STORE_LANE_T(kWord32, LANE)
#define STORE_LANE_WORD64(LANE) STORE_LANE_T(kWord64, LANE)

  // Semicolons unnecessary, but helps formatting.
  SIMD_I8x16_LANES(STORE_LANE_WORD8);
  SIMD_I16x8_LANES(STORE_LANE_WORD16);
  SIMD_I32x4_LANES(STORE_LANE_WORD32);
  SIMD_I64x2_LANES(STORE_LANE_WORD64);
#undef STORE_LANE_WORD8
#undef STORE_LANE_WORD16
#undef STORE_LANE_WORD32
#undef STORE_LANE_WORD64
#undef STORE_LANE_KIND
  UNREACHABLE();
}

1277
const Operator* MachineOperatorBuilder::StackSlot(int size, int alignment) {
1278
  DCHECK_LE(0, size);
1279
  DCHECK(alignment == 0 || alignment == 4 || alignment == 8 || alignment == 16);
1280 1281 1282
#define CASE_CACHED_SIZE(Size, Alignment)                                 \
  if (size == Size && alignment == Alignment) {                           \
    return GetCachedOperator<CachedStackSlotOperator<Size, Alignment>>(); \
1283
  }
1284 1285 1286

  STACK_SLOT_CACHED_SIZES_ALIGNMENTS_LIST(CASE_CACHED_SIZE)

1287
#undef CASE_CACHED_SIZE
1288
  return zone_->New<StackSlotOperator>(size, alignment);
1289 1290
}

1291 1292 1293
const Operator* MachineOperatorBuilder::StackSlot(MachineRepresentation rep,
                                                  int alignment) {
  return StackSlot(1 << ElementSizeLog2Of(rep), alignment);
1294
}
1295

1296
const Operator* MachineOperatorBuilder::Store(StoreRepresentation store_rep) {
1297
  switch (store_rep.representation()) {
1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319
#define STORE(kRep)                                                           \
  case MachineRepresentation::kRep:                                           \
    switch (store_rep.write_barrier_kind()) {                                 \
      case kNoWriteBarrier:                                                   \
        return GetCachedOperator<                                             \
            StoreOperator<MachineRepresentation::kRep, kNoWriteBarrier>>();   \
      case kAssertNoWriteBarrier:                                             \
        return GetCachedOperator<StoreOperator<MachineRepresentation::kRep,   \
                                               kAssertNoWriteBarrier>>();     \
      case kMapWriteBarrier:                                                  \
        return GetCachedOperator<                                             \
            StoreOperator<MachineRepresentation::kRep, kMapWriteBarrier>>();  \
      case kPointerWriteBarrier:                                              \
        return GetCachedOperator<StoreOperator<MachineRepresentation::kRep,   \
                                               kPointerWriteBarrier>>();      \
      case kEphemeronKeyWriteBarrier:                                         \
        return GetCachedOperator<StoreOperator<MachineRepresentation::kRep,   \
                                               kEphemeronKeyWriteBarrier>>(); \
      case kFullWriteBarrier:                                                 \
        return GetCachedOperator<                                             \
            StoreOperator<MachineRepresentation::kRep, kFullWriteBarrier>>(); \
    }                                                                         \
1320 1321
    break;
    MACHINE_REPRESENTATION_LIST(STORE)
1322
#undef STORE
1323 1324
    case MachineRepresentation::kBit:
    case MachineRepresentation::kNone:
1325 1326
      break;
  }
1327
  UNREACHABLE();
1328
}
1329

1330 1331 1332
const Operator* MachineOperatorBuilder::ProtectedStore(
    MachineRepresentation rep) {
  switch (rep) {
1333 1334 1335 1336
#define STORE(kRep)                                             \
  case MachineRepresentation::kRep:                             \
    return GetCachedOperator<                                   \
        ProtectedStoreOperator<MachineRepresentation::kRep>>(); \
1337 1338 1339 1340 1341 1342 1343 1344 1345 1346
    break;
    MACHINE_REPRESENTATION_LIST(STORE)
#undef STORE
    case MachineRepresentation::kBit:
    case MachineRepresentation::kNone:
      break;
  }
  UNREACHABLE();
}

1347
const Operator* MachineOperatorBuilder::UnsafePointerAdd() {
1348
  return GetCachedOperator<UnsafePointerAddOperator>();
1349 1350
}

1351 1352 1353 1354
const Operator* MachineOperatorBuilder::StackPointerGreaterThan(
    StackCheckKind kind) {
  switch (kind) {
    case StackCheckKind::kJSFunctionEntry:
1355 1356
      return GetCachedOperator<
          StackPointerGreaterThanOperator<StackCheckKind::kJSFunctionEntry>>();
1357
    case StackCheckKind::kJSIterationBody:
1358 1359
      return GetCachedOperator<
          StackPointerGreaterThanOperator<StackCheckKind::kJSIterationBody>>();
1360
    case StackCheckKind::kCodeStubAssembler:
1361 1362
      return GetCachedOperator<StackPointerGreaterThanOperator<
          StackCheckKind::kCodeStubAssembler>>();
1363
    case StackCheckKind::kWasm:
1364 1365
      return GetCachedOperator<
          StackPointerGreaterThanOperator<StackCheckKind::kWasm>>();
1366 1367
  }
  UNREACHABLE();
1368 1369
}

1370
const Operator* MachineOperatorBuilder::BitcastWordToTagged() {
1371
  return GetCachedOperator<BitcastWordToTaggedOperator>();
1372 1373
}

1374
const Operator* MachineOperatorBuilder::BitcastTaggedToWord() {
1375
  return GetCachedOperator<BitcastTaggedToWordOperator>();
1376 1377
}

1378
const Operator* MachineOperatorBuilder::BitcastMaybeObjectToWord() {
1379
  return GetCachedOperator<BitcastMaybeObjectToWordOperator>();
1380 1381
}

1382
const Operator* MachineOperatorBuilder::AbortCSAAssert() {
1383
  return GetCachedOperator<AbortCSAAssertOperator>();
1384 1385
}

1386
const Operator* MachineOperatorBuilder::DebugBreak() {
1387
  return GetCachedOperator<DebugBreakOperator>();
1388
}
1389

1390
const Operator* MachineOperatorBuilder::Comment(const char* msg) {
1391
  return zone_->New<CommentOperator>(msg);
1392 1393
}

1394
const Operator* MachineOperatorBuilder::MemBarrier() {
1395
  return GetCachedOperator<MemoryBarrierOperator>();
1396 1397
}

1398 1399
const Operator* MachineOperatorBuilder::Word32AtomicLoad(
    LoadRepresentation rep) {
1400 1401 1402 1403 1404
#define LOAD(Type)                                                     \
  if (rep == MachineType::Type()) {                                    \
    return GetCachedOperator<                                          \
        Word32AtomicLoadOperator<MachineType::Type().representation(), \
                                 MachineType::Type().semantic()>>();   \
1405 1406 1407 1408 1409 1410
  }
  ATOMIC_TYPE_LIST(LOAD)
#undef LOAD
  UNREACHABLE();
}

1411 1412
const Operator* MachineOperatorBuilder::Word32AtomicStore(
    MachineRepresentation rep) {
1413 1414 1415 1416
#define STORE(kRep)                                                \
  if (rep == MachineRepresentation::kRep) {                        \
    return GetCachedOperator<                                      \
        Word32AtomicStoreOperator<MachineRepresentation::kRep>>(); \
1417 1418 1419 1420 1421 1422
  }
  ATOMIC_REPRESENTATION_LIST(STORE)
#undef STORE
  UNREACHABLE();
}

1423
const Operator* MachineOperatorBuilder::Word32AtomicExchange(MachineType type) {
1424 1425 1426 1427 1428
#define EXCHANGE(Type)                                                     \
  if (type == MachineType::Type()) {                                       \
    return GetCachedOperator<                                              \
        Word32AtomicExchangeOperator<MachineType::Type().representation(), \
                                     MachineType::Type().semantic()>>();   \
1429 1430 1431 1432 1433 1434
  }
  ATOMIC_TYPE_LIST(EXCHANGE)
#undef EXCHANGE
  UNREACHABLE();
}

1435
const Operator* MachineOperatorBuilder::Word32AtomicCompareExchange(
1436
    MachineType type) {
1437 1438 1439 1440 1441
#define COMPARE_EXCHANGE(Type)                                    \
  if (type == MachineType::Type()) {                              \
    return GetCachedOperator<Word32AtomicCompareExchangeOperator< \
        MachineType::Type().representation(),                     \
        MachineType::Type().semantic()>>();                       \
1442 1443 1444 1445 1446 1447
  }
  ATOMIC_TYPE_LIST(COMPARE_EXCHANGE)
#undef COMPARE_EXCHANGE
  UNREACHABLE();
}

1448
const Operator* MachineOperatorBuilder::Word32AtomicAdd(MachineType type) {
1449 1450 1451 1452 1453
#define ADD(Type)                                                     \
  if (type == MachineType::Type()) {                                  \
    return GetCachedOperator<                                         \
        Word32AtomicAddOperator<MachineType::Type().representation(), \
                                MachineType::Type().semantic()>>();   \
1454 1455 1456 1457 1458 1459
  }
  ATOMIC_TYPE_LIST(ADD)
#undef ADD
  UNREACHABLE();
}

1460
const Operator* MachineOperatorBuilder::Word32AtomicSub(MachineType type) {
1461 1462 1463 1464 1465
#define SUB(Type)                                                     \
  if (type == MachineType::Type()) {                                  \
    return GetCachedOperator<                                         \
        Word32AtomicSubOperator<MachineType::Type().representation(), \
                                MachineType::Type().semantic()>>();   \
1466 1467 1468 1469 1470 1471
  }
  ATOMIC_TYPE_LIST(SUB)
#undef SUB
  UNREACHABLE();
}

1472
const Operator* MachineOperatorBuilder::Word32AtomicAnd(MachineType type) {
1473 1474 1475 1476 1477
#define AND(Type)                                                     \
  if (type == MachineType::Type()) {                                  \
    return GetCachedOperator<                                         \
        Word32AtomicAndOperator<MachineType::Type().representation(), \
                                MachineType::Type().semantic()>>();   \
1478 1479 1480 1481 1482 1483
  }
  ATOMIC_TYPE_LIST(AND)
#undef AND
  UNREACHABLE();
}

1484
const Operator* MachineOperatorBuilder::Word32AtomicOr(MachineType type) {
1485 1486 1487 1488 1489
#define OR(Type)                                                     \
  if (type == MachineType::Type()) {                                 \
    return GetCachedOperator<                                        \
        Word32AtomicOrOperator<MachineType::Type().representation(), \
                               MachineType::Type().semantic()>>();   \
1490 1491 1492 1493 1494 1495
  }
  ATOMIC_TYPE_LIST(OR)
#undef OR
  UNREACHABLE();
}

1496
const Operator* MachineOperatorBuilder::Word32AtomicXor(MachineType type) {
1497 1498 1499 1500 1501
#define XOR(Type)                                                     \
  if (type == MachineType::Type()) {                                  \
    return GetCachedOperator<                                         \
        Word32AtomicXorOperator<MachineType::Type().representation(), \
                                MachineType::Type().semantic()>>();   \
1502 1503 1504 1505 1506 1507
  }
  ATOMIC_TYPE_LIST(XOR)
#undef XOR
  UNREACHABLE();
}

1508 1509
const Operator* MachineOperatorBuilder::Word64AtomicLoad(
    LoadRepresentation rep) {
1510 1511 1512 1513 1514
#define LOAD(Type)                                                     \
  if (rep == MachineType::Type()) {                                    \
    return GetCachedOperator<                                          \
        Word64AtomicLoadOperator<MachineType::Type().representation(), \
                                 MachineType::Type().semantic()>>();   \
1515
  }
1516
  ATOMIC_U64_TYPE_LIST(LOAD)
1517 1518 1519 1520 1521 1522
#undef LOAD
  UNREACHABLE();
}

const Operator* MachineOperatorBuilder::Word64AtomicStore(
    MachineRepresentation rep) {
1523 1524 1525 1526
#define STORE(kRep)                                                \
  if (rep == MachineRepresentation::kRep) {                        \
    return GetCachedOperator<                                      \
        Word64AtomicStoreOperator<MachineRepresentation::kRep>>(); \
1527 1528 1529 1530 1531 1532
  }
  ATOMIC64_REPRESENTATION_LIST(STORE)
#undef STORE
  UNREACHABLE();
}

1533
const Operator* MachineOperatorBuilder::Word64AtomicAdd(MachineType type) {
1534 1535 1536 1537 1538
#define ADD(Type)                                                     \
  if (type == MachineType::Type()) {                                  \
    return GetCachedOperator<                                         \
        Word64AtomicAddOperator<MachineType::Type().representation(), \
                                MachineType::Type().semantic()>>();   \
1539
  }
1540
  ATOMIC_U64_TYPE_LIST(ADD)
1541 1542 1543 1544
#undef ADD
  UNREACHABLE();
}

1545
const Operator* MachineOperatorBuilder::Word64AtomicSub(MachineType type) {
1546 1547 1548 1549 1550
#define SUB(Type)                                                     \
  if (type == MachineType::Type()) {                                  \
    return GetCachedOperator<                                         \
        Word64AtomicSubOperator<MachineType::Type().representation(), \
                                MachineType::Type().semantic()>>();   \
1551
  }
1552
  ATOMIC_U64_TYPE_LIST(SUB)
1553 1554 1555 1556
#undef SUB
  UNREACHABLE();
}

1557
const Operator* MachineOperatorBuilder::Word64AtomicAnd(MachineType type) {
1558 1559 1560 1561 1562
#define AND(Type)                                                     \
  if (type == MachineType::Type()) {                                  \
    return GetCachedOperator<                                         \
        Word64AtomicAndOperator<MachineType::Type().representation(), \
                                MachineType::Type().semantic()>>();   \
1563
  }
1564
  ATOMIC_U64_TYPE_LIST(AND)
1565 1566 1567 1568
#undef AND
  UNREACHABLE();
}

1569
const Operator* MachineOperatorBuilder::Word64AtomicOr(MachineType type) {
1570 1571 1572 1573 1574
#define OR(Type)                                                     \
  if (type == MachineType::Type()) {                                 \
    return GetCachedOperator<                                        \
        Word64AtomicOrOperator<MachineType::Type().representation(), \
                               MachineType::Type().semantic()>>();   \
1575
  }
1576
  ATOMIC_U64_TYPE_LIST(OR)
1577 1578 1579 1580
#undef OR
  UNREACHABLE();
}

1581
const Operator* MachineOperatorBuilder::Word64AtomicXor(MachineType type) {
1582 1583 1584 1585 1586
#define XOR(Type)                                                     \
  if (type == MachineType::Type()) {                                  \
    return GetCachedOperator<                                         \
        Word64AtomicXorOperator<MachineType::Type().representation(), \
                                MachineType::Type().semantic()>>();   \
1587
  }
1588
  ATOMIC_U64_TYPE_LIST(XOR)
1589 1590 1591 1592
#undef XOR
  UNREACHABLE();
}

1593
const Operator* MachineOperatorBuilder::Word64AtomicExchange(MachineType type) {
1594 1595 1596 1597 1598
#define EXCHANGE(Type)                                                     \
  if (type == MachineType::Type()) {                                       \
    return GetCachedOperator<                                              \
        Word64AtomicExchangeOperator<MachineType::Type().representation(), \
                                     MachineType::Type().semantic()>>();   \
1599
  }
1600
  ATOMIC_U64_TYPE_LIST(EXCHANGE)
1601 1602 1603 1604 1605
#undef EXCHANGE
  UNREACHABLE();
}

const Operator* MachineOperatorBuilder::Word64AtomicCompareExchange(
1606
    MachineType type) {
1607 1608 1609 1610 1611
#define COMPARE_EXCHANGE(Type)                                    \
  if (type == MachineType::Type()) {                              \
    return GetCachedOperator<Word64AtomicCompareExchangeOperator< \
        MachineType::Type().representation(),                     \
        MachineType::Type().semantic()>>();                       \
1612
  }
1613
  ATOMIC_U64_TYPE_LIST(COMPARE_EXCHANGE)
1614 1615 1616 1617
#undef COMPARE_EXCHANGE
  UNREACHABLE();
}

1618
const Operator* MachineOperatorBuilder::Word32AtomicPairLoad() {
1619
  return GetCachedOperator<Word32AtomicPairLoadOperator>();
1620 1621 1622
}

const Operator* MachineOperatorBuilder::Word32AtomicPairStore() {
1623
  return GetCachedOperator<Word32AtomicPairStoreOperator>();
1624 1625
}

1626
const Operator* MachineOperatorBuilder::Word32AtomicPairAdd() {
1627
  return GetCachedOperator<Word32AtomicPairAddOperator>();
1628 1629 1630
}

const Operator* MachineOperatorBuilder::Word32AtomicPairSub() {
1631
  return GetCachedOperator<Word32AtomicPairSubOperator>();
1632 1633 1634
}

const Operator* MachineOperatorBuilder::Word32AtomicPairAnd() {
1635
  return GetCachedOperator<Word32AtomicPairAndOperator>();
1636 1637 1638
}

const Operator* MachineOperatorBuilder::Word32AtomicPairOr() {
1639
  return GetCachedOperator<Word32AtomicPairOrOperator>();
1640 1641 1642
}

const Operator* MachineOperatorBuilder::Word32AtomicPairXor() {
1643
  return GetCachedOperator<Word32AtomicPairXorOperator>();
1644 1645
}

1646
const Operator* MachineOperatorBuilder::Word32AtomicPairExchange() {
1647
  return GetCachedOperator<Word32AtomicPairExchangeOperator>();
1648 1649 1650
}

const Operator* MachineOperatorBuilder::Word32AtomicPairCompareExchange() {
1651
  return GetCachedOperator<Word32AtomicPairCompareExchangeOperator>();
1652 1653
}

1654
const Operator* MachineOperatorBuilder::TaggedPoisonOnSpeculation() {
1655
  return GetCachedOperator<TaggedPoisonOnSpeculationOperator>();
1656 1657 1658
}

const Operator* MachineOperatorBuilder::Word32PoisonOnSpeculation() {
1659
  return GetCachedOperator<Word32PoisonOnSpeculationOperator>();
1660 1661 1662
}

const Operator* MachineOperatorBuilder::Word64PoisonOnSpeculation() {
1663
  return GetCachedOperator<Word64PoisonOnSpeculationOperator>();
1664 1665
}

1666 1667 1668 1669
#define EXTRACT_LANE_OP(Type, Sign, lane_count)                                \
  const Operator* MachineOperatorBuilder::Type##ExtractLane##Sign(             \
      int32_t lane_index) {                                                    \
    DCHECK(0 <= lane_index && lane_index < lane_count);                        \
1670
    return zone_->New<Operator1<int32_t>>(                                     \
1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683
        IrOpcode::k##Type##ExtractLane##Sign, Operator::kPure, "Extract lane", \
        1, 0, 0, 1, 0, 0, lane_index);                                         \
  }
EXTRACT_LANE_OP(F64x2, , 2)
EXTRACT_LANE_OP(F32x4, , 4)
EXTRACT_LANE_OP(I64x2, , 2)
EXTRACT_LANE_OP(I32x4, , 4)
EXTRACT_LANE_OP(I16x8, U, 8)
EXTRACT_LANE_OP(I16x8, S, 8)
EXTRACT_LANE_OP(I8x16, U, 16)
EXTRACT_LANE_OP(I8x16, S, 16)
#undef EXTRACT_LANE_OP

1684 1685 1686 1687 1688 1689 1690
#define REPLACE_LANE_OP(Type, lane_count)                                     \
  const Operator* MachineOperatorBuilder::Type##ReplaceLane(                  \
      int32_t lane_index) {                                                   \
    DCHECK(0 <= lane_index && lane_index < lane_count);                       \
    return zone_->New<Operator1<int32_t>>(IrOpcode::k##Type##ReplaceLane,     \
                                          Operator::kPure, "Replace lane", 2, \
                                          0, 0, 1, 0, 0, lane_index);         \
1691
  }
1692 1693
SIMD_LANE_OP_LIST(REPLACE_LANE_OP)
#undef REPLACE_LANE_OP
1694

1695 1696 1697
const Operator* MachineOperatorBuilder::I64x2ReplaceLaneI32Pair(
    int32_t lane_index) {
  DCHECK(0 <= lane_index && lane_index < 2);
1698 1699 1700
  return zone_->New<Operator1<int32_t>>(IrOpcode::kI64x2ReplaceLaneI32Pair,
                                        Operator::kPure, "Replace lane", 3, 0,
                                        0, 1, 0, 0, lane_index);
1701 1702
}

1703 1704 1705
bool operator==(S128ImmediateParameter const& lhs,
                S128ImmediateParameter const& rhs) {
  return (lhs.immediate() == rhs.immediate());
1706 1707
}

1708 1709
bool operator!=(S128ImmediateParameter const& lhs,
                S128ImmediateParameter const& rhs) {
1710 1711 1712
  return !(lhs == rhs);
}

1713 1714
size_t hash_value(S128ImmediateParameter const& p) {
  return base::hash_range(p.immediate().begin(), p.immediate().end());
1715
}
1716

1717
std::ostream& operator<<(std::ostream& os, S128ImmediateParameter const& p) {
1718 1719 1720 1721 1722 1723 1724
  for (int i = 0; i < 16; i++) {
    const char* separator = (i < 15) ? "," : "";
    os << static_cast<uint32_t>(p[i]) << separator;
  }
  return os;
}

1725
S128ImmediateParameter const& S128ImmediateParameterOf(Operator const* op) {
1726
  DCHECK(IrOpcode::kI8x16Shuffle == op->opcode() ||
1727 1728 1729 1730 1731
         IrOpcode::kS128Const == op->opcode());
  return OpParameter<S128ImmediateParameter>(op);
}

const Operator* MachineOperatorBuilder::S128Const(const uint8_t value[16]) {
1732
  return zone_->New<Operator1<S128ImmediateParameter>>(
1733 1734
      IrOpcode::kS128Const, Operator::kPure, "Immediate", 0, 0, 0, 1, 0, 0,
      S128ImmediateParameter(value));
1735 1736
}

1737
const Operator* MachineOperatorBuilder::I8x16Shuffle(
1738
    const uint8_t shuffle[16]) {
1739
  return zone_->New<Operator1<S128ImmediateParameter>>(
1740
      IrOpcode::kI8x16Shuffle, Operator::kPure, "Shuffle", 2, 0, 0, 1, 0, 0,
1741
      S128ImmediateParameter(shuffle));
1742 1743
}

1744 1745 1746 1747 1748
StackCheckKind StackCheckKindOf(Operator const* op) {
  DCHECK_EQ(IrOpcode::kStackPointerGreaterThan, op->opcode());
  return OpParameter<StackCheckKind>(op);
}

1749 1750 1751 1752 1753 1754 1755 1756
#undef PURE_BINARY_OP_LIST_32
#undef PURE_BINARY_OP_LIST_64
#undef MACHINE_PURE_OP_LIST
#undef PURE_OPTIONAL_OP_LIST
#undef OVERFLOW_OP_LIST
#undef MACHINE_TYPE_LIST
#undef MACHINE_REPRESENTATION_LIST
#undef ATOMIC_TYPE_LIST
1757 1758
#undef ATOMIC_U64_TYPE_LIST
#undef ATOMIC_U32_TYPE_LIST
1759
#undef ATOMIC_REPRESENTATION_LIST
1760
#undef ATOMIC64_REPRESENTATION_LIST
1761 1762
#undef SIMD_LANE_OP_LIST
#undef STACK_SLOT_CACHED_SIZES_ALIGNMENTS_LIST
1763
#undef LOAD_TRANSFORM_LIST
1764

1765 1766 1767
}  // namespace compiler
}  // namespace internal
}  // namespace v8