Index: src/objects.h |
diff --git a/src/objects.h b/src/objects.h |
index a4b3e4f3da762aa9a08f4e377a54cad6e505c85e..02104bfea0b7065461e755e4b1d4cdeff7f9bc88 100644 |
--- a/src/objects.h |
+++ b/src/objects.h |
@@ -113,7 +113,14 @@ |
// - ExternalTwoByteInternalizedString |
// - Symbol |
// - HeapNumber |
-// - Float32x4 |
+// - Simd128Value |
+// - Float32x4 |
+// - Int32x4 |
+// - Bool32x4 |
+// - Int16x8 |
+// - Bool16x8 |
+// - Int8x16 |
+// - Bool8x16 |
// - Cell |
// - PropertyCell |
// - Code |
@@ -370,6 +377,12 @@ const int kStubMinorKeyBits = kSmiValueSize - kStubMajorKeyBits - 1; |
\ |
V(SYMBOL_TYPE) \ |
V(FLOAT32X4_TYPE) \ |
+ V(INT32X4_TYPE) \ |
+ V(BOOL32X4_TYPE) \ |
+ V(INT16X8_TYPE) \ |
+ V(BOOL16X8_TYPE) \ |
+ V(INT8X16_TYPE) \ |
+ V(BOOL8X16_TYPE) \ |
\ |
V(MAP_TYPE) \ |
V(CODE_TYPE) \ |
@@ -663,12 +676,18 @@ enum InstanceType { |
// objects. |
HEAP_NUMBER_TYPE, |
MUTABLE_HEAP_NUMBER_TYPE, |
- FLOAT32X4_TYPE, // FIRST_SIMD_TYPE, LAST_SIMD_TYPE |
+ FLOAT32X4_TYPE, // FIRST_SIMD128_VALUE_TYPE |
+ INT32X4_TYPE, |
+ BOOL32X4_TYPE, |
+ INT16X8_TYPE, |
+ BOOL16X8_TYPE, |
+ INT8X16_TYPE, |
+ BOOL8X16_TYPE, // LAST_SIMD128_VALUE_TYPE |
FOREIGN_TYPE, |
BYTE_ARRAY_TYPE, |
BYTECODE_ARRAY_TYPE, |
FREE_SPACE_TYPE, |
- FIXED_INT8_ARRAY_TYPE, // FIRST_FIXED_TYPED_ARRAY_TYPE |
+ FIXED_INT8_ARRAY_TYPE, // FIRST_FIXED_TYPED_ARRAY_TYPE |
FIXED_UINT8_ARRAY_TYPE, |
FIXED_INT16_ARRAY_TYPE, |
FIXED_UINT16_ARRAY_TYPE, |
@@ -747,9 +766,9 @@ enum InstanceType { |
FIRST_UNIQUE_NAME_TYPE = INTERNALIZED_STRING_TYPE, |
LAST_UNIQUE_NAME_TYPE = SYMBOL_TYPE, |
FIRST_NONSTRING_TYPE = SYMBOL_TYPE, |
- // Boundaries for testing for a SIMD type. |
- FIRST_SIMD_TYPE = FLOAT32X4_TYPE, |
- LAST_SIMD_TYPE = FLOAT32X4_TYPE, |
+ // Boundaries for testing for a SIMD128Value type. |
+ FIRST_SIMD128_VALUE_TYPE = FLOAT32X4_TYPE, |
+ LAST_SIMD128_VALUE_TYPE = BOOL8X16_TYPE, |
// Boundaries for testing for a fixed typed array. |
FIRST_FIXED_TYPED_ARRAY_TYPE = FIXED_INT8_ARRAY_TYPE, |
LAST_FIXED_TYPED_ARRAY_TYPE = FIXED_UINT8_CLAMPED_ARRAY_TYPE, |
@@ -882,7 +901,14 @@ template <class C> inline bool Is(Object* obj); |
#define HEAP_OBJECT_TYPE_LIST(V) \ |
V(HeapNumber) \ |
V(MutableHeapNumber) \ |
+ V(Simd128Value) \ |
V(Float32x4) \ |
+ V(Int32x4) \ |
+ V(Bool32x4) \ |
+ V(Int16x8) \ |
+ V(Bool16x8) \ |
+ V(Int8x16) \ |
+ V(Bool8x16) \ |
V(Name) \ |
V(UniqueName) \ |
V(String) \ |
@@ -1578,28 +1604,72 @@ class HeapNumber: public HeapObject { |
}; |
+// The SimdValue128 class describes heap allocated 128 bit SIMD values. |
+class Simd128Value : public HeapObject { |
+ public: |
+ DECLARE_CAST(Simd128Value) |
+ |
+ // Checks that another instance is bit-wise identical. |
+ bool BitwiseEquals(const Simd128Value* other) const; |
+ |
+ uint32_t Hash() const; |
+ |
+ // Layout description. |
+ static const int kValueOffset = HeapObject::kHeaderSize; |
+ static const int kSize = kValueOffset + kSimd128Size; |
+ |
+ private: |
+ DISALLOW_IMPLICIT_CONSTRUCTORS(Simd128Value); |
+}; |
+ |
+ |
// The Float32x4 class describes heap allocated SIMD values holding 4 32-bit |
// IEEE floats. |
-class Float32x4 : public HeapObject { |
+class Float32x4 : public Simd128Value { |
public: |
inline float get_lane(int lane) const; |
inline void set_lane(int lane, float value); |
+ // Checks that for another instance, SameValue is true for each lane. |
+ bool SameValue(const Float32x4* other) const; |
+ // Checks that for another instance, SameValueZero is true for each lane. |
+ bool SameValueZero(const Float32x4* other) const; |
+ |
DECLARE_CAST(Float32x4) |
// Dispatched behavior. |
- void Float32x4Print(std::ostream& os); // NOLINT |
+ DECLARE_PRINTER(Float32x4) |
DECLARE_VERIFIER(Float32x4) |
- // Layout description. |
- static const int kValueOffset = HeapObject::kHeaderSize; |
- static const int kSize = kValueOffset + kSimd128Size; |
- |
private: |
DISALLOW_IMPLICIT_CONSTRUCTORS(Float32x4); |
}; |
+#define SIMD128_VALUE_CLASS(name, type) \ |
+ class name : public Simd128Value { \ |
+ public: \ |
+ inline type get_lane(int lane) const; \ |
+ inline void set_lane(int lane, type value); \ |
+ \ |
+ DECLARE_CAST(name) \ |
+ \ |
+ DECLARE_PRINTER(name) \ |
+ DECLARE_VERIFIER(name) \ |
+ \ |
+ private: \ |
+ DISALLOW_IMPLICIT_CONSTRUCTORS(name); \ |
+ }; |
+ |
+ |
+SIMD128_VALUE_CLASS(Int32x4, int32_t) |
+SIMD128_VALUE_CLASS(Bool32x4, bool) |
+SIMD128_VALUE_CLASS(Int16x8, int16_t) |
+SIMD128_VALUE_CLASS(Bool16x8, bool) |
+SIMD128_VALUE_CLASS(Int8x16, int8_t) |
+SIMD128_VALUE_CLASS(Bool8x16, bool) |
+ |
+ |
enum EnsureElementsMode { |
DONT_ALLOW_DOUBLE_ELEMENTS, |
ALLOW_COPIED_DOUBLE_ELEMENTS, |