diff options
Diffstat (limited to 'deps/v8/src/compiler/machine-operator.cc')
-rw-r--r-- | deps/v8/src/compiler/machine-operator.cc | 607 |
1 files changed, 359 insertions, 248 deletions
diff --git a/deps/v8/src/compiler/machine-operator.cc b/deps/v8/src/compiler/machine-operator.cc index 854c22e15e..2e66b17a9d 100644 --- a/deps/v8/src/compiler/machine-operator.cc +++ b/deps/v8/src/compiler/machine-operator.cc @@ -80,6 +80,10 @@ MachineRepresentation AtomicStoreRepresentationOf(Operator const* op) { return OpParameter<MachineRepresentation>(op); } +MachineType AtomicOpRepresentationOf(Operator const* op) { + return OpParameter<MachineType>(op); +} + #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) \ @@ -124,223 +128,222 @@ MachineRepresentation AtomicStoreRepresentationOf(Operator const* op) { V(Uint64LessThan, Operator::kNoProperties, 2, 0, 1) \ V(Uint64LessThanOrEqual, Operator::kNoProperties, 2, 0, 1) -#define 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(BitcastTaggedToWord, 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(ChangeFloat64ToUint32, Operator::kNoProperties, 1, 0, 1) \ - V(TruncateFloat64ToUint32, Operator::kNoProperties, 1, 0, 1) \ - V(TruncateFloat32ToInt32, Operator::kNoProperties, 1, 0, 1) \ - V(TruncateFloat32ToUint32, 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(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(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(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(LoadStackPointer, 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(CreateFloat32x4, Operator::kNoProperties, 4, 0, 1) \ - V(Float32x4Abs, Operator::kNoProperties, 1, 0, 1) \ - V(Float32x4Neg, Operator::kNoProperties, 1, 0, 1) \ - V(Float32x4Sqrt, Operator::kNoProperties, 1, 0, 1) \ - V(Float32x4RecipApprox, Operator::kNoProperties, 1, 0, 1) \ - V(Float32x4RecipSqrtApprox, Operator::kNoProperties, 1, 0, 1) \ - V(Float32x4Add, Operator::kCommutative, 2, 0, 1) \ - V(Float32x4Sub, Operator::kNoProperties, 2, 0, 1) \ - V(Float32x4Mul, Operator::kCommutative, 2, 0, 1) \ - V(Float32x4Div, Operator::kNoProperties, 2, 0, 1) \ - V(Float32x4Min, Operator::kCommutative, 2, 0, 1) \ - V(Float32x4Max, Operator::kCommutative, 2, 0, 1) \ - V(Float32x4MinNum, Operator::kCommutative, 2, 0, 1) \ - V(Float32x4MaxNum, Operator::kCommutative, 2, 0, 1) \ - V(Float32x4Equal, Operator::kCommutative, 2, 0, 1) \ - V(Float32x4NotEqual, Operator::kCommutative, 2, 0, 1) \ - V(Float32x4LessThan, Operator::kNoProperties, 2, 0, 1) \ - V(Float32x4LessThanOrEqual, Operator::kNoProperties, 2, 0, 1) \ - V(Float32x4GreaterThan, Operator::kNoProperties, 2, 0, 1) \ - V(Float32x4GreaterThanOrEqual, Operator::kNoProperties, 2, 0, 1) \ - V(Float32x4FromInt32x4, Operator::kNoProperties, 1, 0, 1) \ - V(Float32x4FromUint32x4, Operator::kNoProperties, 1, 0, 1) \ - V(CreateInt32x4, Operator::kNoProperties, 4, 0, 1) \ - V(Int32x4Neg, Operator::kNoProperties, 1, 0, 1) \ - V(Int32x4Add, Operator::kCommutative, 2, 0, 1) \ - V(Int32x4Sub, Operator::kNoProperties, 2, 0, 1) \ - V(Int32x4Mul, Operator::kCommutative, 2, 0, 1) \ - V(Int32x4Min, Operator::kCommutative, 2, 0, 1) \ - V(Int32x4Max, Operator::kCommutative, 2, 0, 1) \ - V(Int32x4Equal, Operator::kCommutative, 2, 0, 1) \ - V(Int32x4NotEqual, Operator::kCommutative, 2, 0, 1) \ - V(Int32x4LessThan, Operator::kNoProperties, 2, 0, 1) \ - V(Int32x4LessThanOrEqual, Operator::kNoProperties, 2, 0, 1) \ - V(Int32x4GreaterThan, Operator::kNoProperties, 2, 0, 1) \ - V(Int32x4GreaterThanOrEqual, Operator::kNoProperties, 2, 0, 1) \ - V(Int32x4FromFloat32x4, Operator::kNoProperties, 1, 0, 1) \ - V(Uint32x4Min, Operator::kCommutative, 2, 0, 1) \ - V(Uint32x4Max, Operator::kCommutative, 2, 0, 1) \ - V(Uint32x4LessThan, Operator::kNoProperties, 2, 0, 1) \ - V(Uint32x4LessThanOrEqual, Operator::kNoProperties, 2, 0, 1) \ - V(Uint32x4GreaterThan, Operator::kNoProperties, 2, 0, 1) \ - V(Uint32x4GreaterThanOrEqual, Operator::kNoProperties, 2, 0, 1) \ - V(Uint32x4FromFloat32x4, Operator::kNoProperties, 1, 0, 1) \ - V(Bool32x4And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ - V(Bool32x4Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ - V(Bool32x4Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ - V(Bool32x4Not, Operator::kNoProperties, 1, 0, 1) \ - V(Bool32x4AnyTrue, Operator::kNoProperties, 1, 0, 1) \ - V(Bool32x4AllTrue, Operator::kNoProperties, 1, 0, 1) \ - V(CreateInt16x8, Operator::kNoProperties, 8, 0, 1) \ - V(Int16x8Neg, Operator::kNoProperties, 1, 0, 1) \ - V(Int16x8Add, Operator::kCommutative, 2, 0, 1) \ - V(Int16x8AddSaturate, Operator::kCommutative, 2, 0, 1) \ - V(Int16x8Sub, Operator::kNoProperties, 2, 0, 1) \ - V(Int16x8SubSaturate, Operator::kNoProperties, 2, 0, 1) \ - V(Int16x8Mul, Operator::kCommutative, 2, 0, 1) \ - V(Int16x8Min, Operator::kCommutative, 2, 0, 1) \ - V(Int16x8Max, Operator::kCommutative, 2, 0, 1) \ - V(Int16x8Equal, Operator::kCommutative, 2, 0, 1) \ - V(Int16x8NotEqual, Operator::kCommutative, 2, 0, 1) \ - V(Int16x8LessThan, Operator::kNoProperties, 2, 0, 1) \ - V(Int16x8LessThanOrEqual, Operator::kNoProperties, 2, 0, 1) \ - V(Int16x8GreaterThan, Operator::kNoProperties, 2, 0, 1) \ - V(Int16x8GreaterThanOrEqual, Operator::kNoProperties, 2, 0, 1) \ - V(Uint16x8AddSaturate, Operator::kCommutative, 2, 0, 1) \ - V(Uint16x8SubSaturate, Operator::kNoProperties, 2, 0, 1) \ - V(Uint16x8Min, Operator::kCommutative, 2, 0, 1) \ - V(Uint16x8Max, Operator::kCommutative, 2, 0, 1) \ - V(Uint16x8LessThan, Operator::kNoProperties, 2, 0, 1) \ - V(Uint16x8LessThanOrEqual, Operator::kNoProperties, 2, 0, 1) \ - V(Uint16x8GreaterThan, Operator::kNoProperties, 2, 0, 1) \ - V(Uint16x8GreaterThanOrEqual, Operator::kNoProperties, 2, 0, 1) \ - V(Bool16x8And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ - V(Bool16x8Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ - V(Bool16x8Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ - V(Bool16x8Not, Operator::kNoProperties, 1, 0, 1) \ - V(Bool16x8AnyTrue, Operator::kNoProperties, 1, 0, 1) \ - V(Bool16x8AllTrue, Operator::kNoProperties, 1, 0, 1) \ - V(CreateInt8x16, Operator::kNoProperties, 16, 0, 1) \ - V(Int8x16Neg, Operator::kNoProperties, 1, 0, 1) \ - V(Int8x16Add, Operator::kCommutative, 2, 0, 1) \ - V(Int8x16AddSaturate, Operator::kCommutative, 2, 0, 1) \ - V(Int8x16Sub, Operator::kNoProperties, 2, 0, 1) \ - V(Int8x16SubSaturate, Operator::kNoProperties, 2, 0, 1) \ - V(Int8x16Mul, Operator::kCommutative, 2, 0, 1) \ - V(Int8x16Min, Operator::kCommutative, 2, 0, 1) \ - V(Int8x16Max, Operator::kCommutative, 2, 0, 1) \ - V(Int8x16Equal, Operator::kCommutative, 2, 0, 1) \ - V(Int8x16NotEqual, Operator::kCommutative, 2, 0, 1) \ - V(Int8x16LessThan, Operator::kNoProperties, 2, 0, 1) \ - V(Int8x16LessThanOrEqual, Operator::kNoProperties, 2, 0, 1) \ - V(Int8x16GreaterThan, Operator::kNoProperties, 2, 0, 1) \ - V(Int8x16GreaterThanOrEqual, Operator::kNoProperties, 2, 0, 1) \ - V(Uint8x16AddSaturate, Operator::kCommutative, 2, 0, 1) \ - V(Uint8x16SubSaturate, Operator::kNoProperties, 2, 0, 1) \ - V(Uint8x16Min, Operator::kCommutative, 2, 0, 1) \ - V(Uint8x16Max, Operator::kCommutative, 2, 0, 1) \ - V(Uint8x16LessThan, Operator::kNoProperties, 2, 0, 1) \ - V(Uint8x16LessThanOrEqual, Operator::kNoProperties, 2, 0, 1) \ - V(Uint8x16GreaterThan, Operator::kNoProperties, 2, 0, 1) \ - V(Uint8x16GreaterThanOrEqual, Operator::kNoProperties, 2, 0, 1) \ - V(Bool8x16And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ - V(Bool8x16Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ - V(Bool8x16Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ - V(Bool8x16Not, Operator::kNoProperties, 1, 0, 1) \ - V(Bool8x16AnyTrue, Operator::kNoProperties, 1, 0, 1) \ - V(Bool8x16AllTrue, Operator::kNoProperties, 1, 0, 1) \ - V(Simd128Load, Operator::kNoProperties, 2, 0, 1) \ - V(Simd128Load1, Operator::kNoProperties, 2, 0, 1) \ - V(Simd128Load2, Operator::kNoProperties, 2, 0, 1) \ - V(Simd128Load3, Operator::kNoProperties, 2, 0, 1) \ - V(Simd128Store, Operator::kNoProperties, 3, 0, 1) \ - V(Simd128Store1, Operator::kNoProperties, 3, 0, 1) \ - V(Simd128Store2, Operator::kNoProperties, 3, 0, 1) \ - V(Simd128Store3, Operator::kNoProperties, 3, 0, 1) \ - V(Simd128And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ - V(Simd128Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ - V(Simd128Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ - V(Simd128Not, Operator::kNoProperties, 1, 0, 1) \ - V(Simd32x4Select, Operator::kNoProperties, 3, 0, 1) \ - V(Simd16x8Select, Operator::kNoProperties, 3, 0, 1) \ - V(Simd8x16Select, Operator::kNoProperties, 3, 0, 1) +#define 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(BitcastTaggedToWord, 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(ChangeFloat64ToUint32, Operator::kNoProperties, 1, 0, 1) \ + V(ChangeFloat64ToUint64, Operator::kNoProperties, 1, 0, 1) \ + V(TruncateFloat64ToUint32, Operator::kNoProperties, 1, 0, 1) \ + V(TruncateFloat32ToInt32, Operator::kNoProperties, 1, 0, 1) \ + V(TruncateFloat32ToUint32, 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(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(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(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(LoadStackPointer, 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(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(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(F32x4MinNum, Operator::kCommutative, 2, 0, 1) \ + V(F32x4MaxNum, Operator::kCommutative, 2, 0, 1) \ + V(F32x4RecipRefine, Operator::kNoProperties, 2, 0, 1) \ + V(F32x4RecipSqrtRefine, Operator::kNoProperties, 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(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(I32x4Add, Operator::kCommutative, 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(I32x4LtS, Operator::kNoProperties, 2, 0, 1) \ + V(I32x4LeS, 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(I32x4MinU, Operator::kCommutative, 2, 0, 1) \ + V(I32x4MaxU, Operator::kCommutative, 2, 0, 1) \ + V(I32x4LtU, Operator::kNoProperties, 2, 0, 1) \ + V(I32x4LeU, Operator::kNoProperties, 2, 0, 1) \ + 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(I16x8SConvertI32x4, Operator::kNoProperties, 2, 0, 1) \ + V(I16x8Add, Operator::kCommutative, 2, 0, 1) \ + V(I16x8AddSaturateS, Operator::kCommutative, 2, 0, 1) \ + V(I16x8Sub, Operator::kNoProperties, 2, 0, 1) \ + V(I16x8SubSaturateS, Operator::kNoProperties, 2, 0, 1) \ + 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(I16x8LtS, Operator::kNoProperties, 2, 0, 1) \ + V(I16x8LeS, Operator::kNoProperties, 2, 0, 1) \ + V(I16x8UConvertI8x16Low, Operator::kNoProperties, 1, 0, 1) \ + V(I16x8UConvertI8x16High, Operator::kNoProperties, 1, 0, 1) \ + V(I16x8UConvertI32x4, Operator::kNoProperties, 2, 0, 1) \ + V(I16x8AddSaturateU, Operator::kCommutative, 2, 0, 1) \ + V(I16x8SubSaturateU, Operator::kNoProperties, 2, 0, 1) \ + V(I16x8MinU, Operator::kCommutative, 2, 0, 1) \ + V(I16x8MaxU, Operator::kCommutative, 2, 0, 1) \ + V(I16x8LtU, Operator::kNoProperties, 2, 0, 1) \ + V(I16x8LeU, Operator::kNoProperties, 2, 0, 1) \ + V(I8x16Splat, Operator::kNoProperties, 1, 0, 1) \ + V(I8x16Neg, Operator::kNoProperties, 1, 0, 1) \ + V(I8x16SConvertI16x8, Operator::kNoProperties, 2, 0, 1) \ + V(I8x16Add, Operator::kCommutative, 2, 0, 1) \ + V(I8x16AddSaturateS, Operator::kCommutative, 2, 0, 1) \ + V(I8x16Sub, Operator::kNoProperties, 2, 0, 1) \ + V(I8x16SubSaturateS, Operator::kNoProperties, 2, 0, 1) \ + 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(I8x16LtS, Operator::kNoProperties, 2, 0, 1) \ + V(I8x16LeS, Operator::kNoProperties, 2, 0, 1) \ + V(I8x16UConvertI16x8, Operator::kNoProperties, 2, 0, 1) \ + V(I8x16AddSaturateU, Operator::kCommutative, 2, 0, 1) \ + V(I8x16SubSaturateU, Operator::kNoProperties, 2, 0, 1) \ + V(I8x16MinU, Operator::kCommutative, 2, 0, 1) \ + V(I8x16MaxU, Operator::kCommutative, 2, 0, 1) \ + V(I8x16LtU, Operator::kNoProperties, 2, 0, 1) \ + V(I8x16LeU, Operator::kNoProperties, 2, 0, 1) \ + 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(S32x4Select, Operator::kNoProperties, 3, 0, 1) \ + V(S16x8Select, Operator::kNoProperties, 3, 0, 1) \ + V(S8x16Select, Operator::kNoProperties, 3, 0, 1) \ + V(S1x4Zero, Operator::kNoProperties, 0, 0, 1) \ + V(S1x4And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ + V(S1x4Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ + V(S1x4Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ + V(S1x4Not, Operator::kNoProperties, 1, 0, 1) \ + V(S1x4AnyTrue, Operator::kNoProperties, 1, 0, 1) \ + V(S1x4AllTrue, Operator::kNoProperties, 1, 0, 1) \ + V(S1x8Zero, Operator::kNoProperties, 0, 0, 1) \ + V(S1x8And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ + V(S1x8Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ + V(S1x8Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ + V(S1x8Not, Operator::kNoProperties, 1, 0, 1) \ + V(S1x8AnyTrue, Operator::kNoProperties, 1, 0, 1) \ + V(S1x8AllTrue, Operator::kNoProperties, 1, 0, 1) \ + V(S1x16Zero, Operator::kNoProperties, 0, 0, 1) \ + V(S1x16And, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ + V(S1x16Or, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ + V(S1x16Xor, Operator::kAssociative | Operator::kCommutative, 2, 0, 1) \ + V(S1x16Not, Operator::kNoProperties, 1, 0, 1) \ + V(S1x16AnyTrue, Operator::kNoProperties, 1, 0, 1) \ + V(S1x16AllTrue, Operator::kNoProperties, 1, 0, 1) #define PURE_OPTIONAL_OP_LIST(V) \ V(Word32Ctz, Operator::kNoProperties, 1, 0, 1) \ @@ -349,6 +352,8 @@ MachineRepresentation AtomicStoreRepresentationOf(Operator const* op) { V(Word64ReverseBits, Operator::kNoProperties, 1, 0, 1) \ V(Word32ReverseBytes, Operator::kNoProperties, 1, 0, 1) \ V(Word64ReverseBytes, Operator::kNoProperties, 1, 0, 1) \ + V(Int32AbsWithOverflow, Operator::kNoProperties, 1, 0, 1) \ + V(Int64AbsWithOverflow, Operator::kNoProperties, 1, 0, 1) \ V(Word32Popcnt, Operator::kNoProperties, 1, 0, 1) \ V(Word64Popcnt, Operator::kNoProperties, 1, 0, 1) \ V(Float32RoundDown, Operator::kNoProperties, 1, 0, 1) \ @@ -411,10 +416,10 @@ MachineRepresentation AtomicStoreRepresentationOf(Operator const* op) { V(kWord32) #define SIMD_LANE_OP_LIST(V) \ - V(Float32x4, 4) \ - V(Int32x4, 4) \ - V(Int16x8, 8) \ - V(Int8x16, 16) + V(F32x4, 4) \ + V(I32x4, 4) \ + V(I16x8, 8) \ + V(I8x16, 16) #define SIMD_FORMAT_LIST(V) \ V(32x4, 32) \ @@ -597,6 +602,38 @@ struct MachineOperatorGlobalCache { ATOMIC_REPRESENTATION_LIST(ATOMIC_STORE) #undef STORE +#define ATOMIC_OP(op, type) \ + struct op##type##Operator : public Operator1<MachineType> { \ + op##type##Operator() \ + : Operator1<MachineType>(IrOpcode::k##op, \ + Operator::kNoDeopt | Operator::kNoThrow, #op, \ + 3, 1, 1, 1, 1, 0, MachineType::type()) {} \ + }; \ + op##type##Operator k##op##type; +#define ATOMIC_OP_LIST(type) \ + ATOMIC_OP(AtomicExchange, type) \ + ATOMIC_OP(AtomicAdd, type) \ + ATOMIC_OP(AtomicSub, type) \ + ATOMIC_OP(AtomicAnd, type) \ + ATOMIC_OP(AtomicOr, type) \ + ATOMIC_OP(AtomicXor, type) + ATOMIC_TYPE_LIST(ATOMIC_OP_LIST) +#undef ATOMIC_OP_LIST +#undef ATOMIC_OP + +#define ATOMIC_COMPARE_EXCHANGE(Type) \ + struct AtomicCompareExchange##Type##Operator \ + : public Operator1<MachineType> { \ + AtomicCompareExchange##Type##Operator() \ + : Operator1<MachineType>(IrOpcode::kAtomicCompareExchange, \ + Operator::kNoDeopt | Operator::kNoThrow, \ + "AtomicCompareExchange", 4, 1, 1, 1, 1, 0, \ + MachineType::Type()) {} \ + }; \ + AtomicCompareExchange##Type##Operator kAtomicCompareExchange##Type; + ATOMIC_TYPE_LIST(ATOMIC_COMPARE_EXCHANGE) +#undef ATOMIC_COMPARE_EXCHANGE + // 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 @@ -853,6 +890,83 @@ const Operator* MachineOperatorBuilder::AtomicStore(MachineRepresentation rep) { return nullptr; } +const Operator* MachineOperatorBuilder::AtomicExchange(MachineType rep) { +#define EXCHANGE(kRep) \ + if (rep == MachineType::kRep()) { \ + return &cache_.kAtomicExchange##kRep; \ + } + ATOMIC_TYPE_LIST(EXCHANGE) +#undef EXCHANGE + UNREACHABLE(); + return nullptr; +} + +const Operator* MachineOperatorBuilder::AtomicCompareExchange(MachineType rep) { +#define COMPARE_EXCHANGE(kRep) \ + if (rep == MachineType::kRep()) { \ + return &cache_.kAtomicCompareExchange##kRep; \ + } + ATOMIC_TYPE_LIST(COMPARE_EXCHANGE) +#undef COMPARE_EXCHANGE + UNREACHABLE(); + return nullptr; +} + +const Operator* MachineOperatorBuilder::AtomicAdd(MachineType rep) { +#define ADD(kRep) \ + if (rep == MachineType::kRep()) { \ + return &cache_.kAtomicAdd##kRep; \ + } + ATOMIC_TYPE_LIST(ADD) +#undef ADD + UNREACHABLE(); + return nullptr; +} + +const Operator* MachineOperatorBuilder::AtomicSub(MachineType rep) { +#define SUB(kRep) \ + if (rep == MachineType::kRep()) { \ + return &cache_.kAtomicSub##kRep; \ + } + ATOMIC_TYPE_LIST(SUB) +#undef SUB + UNREACHABLE(); + return nullptr; +} + +const Operator* MachineOperatorBuilder::AtomicAnd(MachineType rep) { +#define AND(kRep) \ + if (rep == MachineType::kRep()) { \ + return &cache_.kAtomicAnd##kRep; \ + } + ATOMIC_TYPE_LIST(AND) +#undef AND + UNREACHABLE(); + return nullptr; +} + +const Operator* MachineOperatorBuilder::AtomicOr(MachineType rep) { +#define OR(kRep) \ + if (rep == MachineType::kRep()) { \ + return &cache_.kAtomicOr##kRep; \ + } + ATOMIC_TYPE_LIST(OR) +#undef OR + UNREACHABLE(); + return nullptr; +} + +const Operator* MachineOperatorBuilder::AtomicXor(MachineType rep) { +#define XOR(kRep) \ + if (rep == MachineType::kRep()) { \ + return &cache_.kAtomicXor##kRep; \ + } + ATOMIC_TYPE_LIST(XOR) +#undef XOR + UNREACHABLE(); + return nullptr; +} + #define SIMD_LANE_OPS(Type, lane_count) \ const Operator* MachineOperatorBuilder::Type##ExtractLane( \ int32_t lane_index) { \ @@ -871,38 +985,35 @@ const Operator* MachineOperatorBuilder::AtomicStore(MachineRepresentation rep) { SIMD_LANE_OP_LIST(SIMD_LANE_OPS) #undef SIMD_LANE_OPS -#define SIMD_SHIFT_OPS(format, bits) \ - const Operator* MachineOperatorBuilder::Int##format##ShiftLeftByScalar( \ - int32_t shift) { \ - DCHECK(0 <= shift && shift < bits); \ - return new (zone_) Operator1<int32_t>( \ - IrOpcode::kInt##format##ShiftLeftByScalar, Operator::kPure, \ - "Shift left", 1, 0, 0, 1, 0, 0, shift); \ - } \ - const Operator* MachineOperatorBuilder::Int##format##ShiftRightByScalar( \ - int32_t shift) { \ - DCHECK(0 < shift && shift <= bits); \ - return new (zone_) Operator1<int32_t>( \ - IrOpcode::kInt##format##ShiftRightByScalar, Operator::kPure, \ - "Arithmetic shift right", 1, 0, 0, 1, 0, 0, shift); \ - } \ - const Operator* MachineOperatorBuilder::Uint##format##ShiftRightByScalar( \ - int32_t shift) { \ - DCHECK(0 <= shift && shift < bits); \ - return new (zone_) Operator1<int32_t>( \ - IrOpcode::kUint##format##ShiftRightByScalar, Operator::kPure, \ - "Shift right", 1, 0, 0, 1, 0, 0, shift); \ +#define SIMD_SHIFT_OPS(format, bits) \ + const Operator* MachineOperatorBuilder::I##format##Shl(int32_t shift) { \ + DCHECK(0 <= shift && shift < bits); \ + return new (zone_) \ + Operator1<int32_t>(IrOpcode::kI##format##Shl, Operator::kPure, \ + "Shift left", 1, 0, 0, 1, 0, 0, shift); \ + } \ + const Operator* MachineOperatorBuilder::I##format##ShrS(int32_t shift) { \ + DCHECK(0 < shift && shift <= bits); \ + return new (zone_) \ + Operator1<int32_t>(IrOpcode::kI##format##ShrS, Operator::kPure, \ + "Arithmetic shift right", 1, 0, 0, 1, 0, 0, shift); \ + } \ + const Operator* MachineOperatorBuilder::I##format##ShrU(int32_t shift) { \ + DCHECK(0 <= shift && shift < bits); \ + return new (zone_) \ + Operator1<int32_t>(IrOpcode::kI##format##ShrU, Operator::kPure, \ + "Shift right", 1, 0, 0, 1, 0, 0, shift); \ } SIMD_FORMAT_LIST(SIMD_SHIFT_OPS) #undef SIMD_SHIFT_OPS // TODO(bbudge) Add Shuffle, DCHECKs based on format. -#define SIMD_PERMUTE_OPS(format, bits) \ - const Operator* MachineOperatorBuilder::Simd##format##Swizzle( \ - uint32_t swizzle) { \ - return new (zone_) \ - Operator1<uint32_t>(IrOpcode::kSimd##format##Swizzle, Operator::kPure, \ - "Swizzle", 2, 0, 0, 1, 0, 0, swizzle); \ +#define SIMD_PERMUTE_OPS(format, bits) \ + const Operator* MachineOperatorBuilder::S##format##Swizzle( \ + uint32_t swizzle) { \ + return new (zone_) \ + Operator1<uint32_t>(IrOpcode::kS##format##Swizzle, Operator::kPure, \ + "Swizzle", 2, 0, 0, 1, 0, 0, swizzle); \ } SIMD_FORMAT_LIST(SIMD_PERMUTE_OPS) #undef SIMD_PERMUTE_OPS |