Chromium Code Reviews| Index: src/objects-inl.h |
| diff --git a/src/objects-inl.h b/src/objects-inl.h |
| index 4a4b896381066414008ebf673f2672a0abcdd00e..cf42552e28539177f26d372393341847f4089607 100644 |
| --- a/src/objects-inl.h |
| +++ b/src/objects-inl.h |
| @@ -170,6 +170,7 @@ bool Object::IsHeapObject() const { |
| TYPE_CHECKER(HeapNumber, HEAP_NUMBER_TYPE) |
| TYPE_CHECKER(MutableHeapNumber, MUTABLE_HEAP_NUMBER_TYPE) |
| +TYPE_CHECKER(Float32x4, FLOAT32X4_TYPE) |
| TYPE_CHECKER(Symbol, SYMBOL_TYPE) |
| @@ -1320,6 +1321,12 @@ MaybeHandle<Object> JSProxy::SetElementWithHandler(Handle<JSProxy> proxy, |
| #define WRITE_INT32_FIELD(p, offset, value) \ |
| (*reinterpret_cast<int32_t*>(FIELD_ADDR(p, offset)) = value) |
| +#define READ_FLOAT_FIELD(p, offset) \ |
| + (*reinterpret_cast<const float*>(FIELD_ADDR_CONST(p, offset))) |
| + |
| +#define WRITE_FLOAT_FIELD(p, offset, value) \ |
| + (*reinterpret_cast<float*>(FIELD_ADDR(p, offset)) = value) |
| + |
| #define READ_UINT64_FIELD(p, offset) \ |
| (*reinterpret_cast<const uint64_t*>(FIELD_ADDR_CONST(p, offset))) |
| @@ -1576,6 +1583,18 @@ int HeapNumber::get_sign() { |
| } |
| +double Float32x4::get_lane(int lane) const { |
| + DCHECK(lane < 4 && lane >= 0); |
|
titzer
2015/06/03 13:27:15
Looks like we are only supporting little endian fo
bbudge
2015/06/03 20:31:48
I guess there aren't any big-endian media instruct
|
| + return READ_FLOAT_FIELD(this, kValueOffset + lane * 4); |
| +} |
| + |
| + |
| +void Float32x4::set_lane(int lane, double value) { |
| + DCHECK(lane < 4 && lane >= 0); |
| + WRITE_FLOAT_FIELD(this, kValueOffset + lane * 4, DoubleToFloat32(value)); |
| +} |
| + |
| + |
| ACCESSORS(JSObject, properties, FixedArray, kPropertiesOffset) |
| @@ -2433,6 +2452,7 @@ AllocationAlignment HeapObject::RequiredAlignment() { |
| return kDoubleAligned; |
| } |
| if (IsHeapNumber()) return kDoubleUnaligned; |
| + if (IsFloat32x4()) return kSimd128Unaligned; |
| #endif // V8_HOST_ARCH_32_BIT |
| return kWordAligned; |
| } |
| @@ -2973,6 +2993,7 @@ CAST_ACCESSOR(FixedArray) |
| CAST_ACCESSOR(FixedArrayBase) |
| CAST_ACCESSOR(FixedDoubleArray) |
| CAST_ACCESSOR(FixedTypedArrayBase) |
| +CAST_ACCESSOR(Float32x4) |
| CAST_ACCESSOR(Foreign) |
| CAST_ACCESSOR(GlobalDictionary) |
| CAST_ACCESSOR(GlobalObject) |