OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // Review notes: | 5 // Review notes: |
6 // | 6 // |
7 // - The use of macros in these inline functions may seem superfluous | 7 // - The use of macros in these inline functions may seem superfluous |
8 // but it is absolutely needed to make sure gcc generates optimal | 8 // but it is absolutely needed to make sure gcc generates optimal |
9 // code. gcc is not happy when attempting to inline too deep. | 9 // code. gcc is not happy when attempting to inline too deep. |
10 // | 10 // |
(...skipping 1503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1514 return ((READ_INT_FIELD(this, kExponentOffset) & kExponentMask) >> | 1514 return ((READ_INT_FIELD(this, kExponentOffset) & kExponentMask) >> |
1515 kExponentShift) - kExponentBias; | 1515 kExponentShift) - kExponentBias; |
1516 } | 1516 } |
1517 | 1517 |
1518 | 1518 |
1519 int HeapNumber::get_sign() { | 1519 int HeapNumber::get_sign() { |
1520 return READ_INT_FIELD(this, kExponentOffset) & kSignMask; | 1520 return READ_INT_FIELD(this, kExponentOffset) & kSignMask; |
1521 } | 1521 } |
1522 | 1522 |
1523 | 1523 |
| 1524 bool Simd128Value::Equals(Simd128Value* that) { |
| 1525 #define SIMD128_VALUE(TYPE, Type, type, lane_count, lane_type) \ |
| 1526 if (this->Is##Type()) { \ |
| 1527 if (!that->Is##Type()) return false; \ |
| 1528 return Type::cast(this)->Equals(Type::cast(that)); \ |
| 1529 } |
| 1530 SIMD128_TYPES(SIMD128_VALUE) |
| 1531 #undef SIMD128_VALUE |
| 1532 return false; |
| 1533 } |
| 1534 |
| 1535 |
| 1536 #define SIMD128_VALUE_EQUALS(TYPE, Type, type, lane_count, lane_type) \ |
| 1537 bool Type::Equals(Type* that) { \ |
| 1538 for (int lane = 0; lane < lane_count; ++lane) { \ |
| 1539 if (this->get_lane(lane) != that->get_lane(lane)) return false; \ |
| 1540 } \ |
| 1541 return true; \ |
| 1542 } |
| 1543 SIMD128_TYPES(SIMD128_VALUE_EQUALS) |
| 1544 #undef SIMD128_VALUE_EQUALS |
| 1545 |
| 1546 |
1524 float Float32x4::get_lane(int lane) const { | 1547 float Float32x4::get_lane(int lane) const { |
1525 DCHECK(lane < 4 && lane >= 0); | 1548 DCHECK(lane < 4 && lane >= 0); |
1526 #if defined(V8_TARGET_LITTLE_ENDIAN) | 1549 #if defined(V8_TARGET_LITTLE_ENDIAN) |
1527 return READ_FLOAT_FIELD(this, kValueOffset + lane * kFloatSize); | 1550 return READ_FLOAT_FIELD(this, kValueOffset + lane * kFloatSize); |
1528 #elif defined(V8_TARGET_BIG_ENDIAN) | 1551 #elif defined(V8_TARGET_BIG_ENDIAN) |
1529 return READ_FLOAT_FIELD(this, kValueOffset + (3 - lane) * kFloatSize); | 1552 return READ_FLOAT_FIELD(this, kValueOffset + (3 - lane) * kFloatSize); |
1530 #else | 1553 #else |
1531 #error Unknown byte ordering | 1554 #error Unknown byte ordering |
1532 #endif | 1555 #endif |
1533 } | 1556 } |
(...skipping 6358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7892 #undef READ_INT64_FIELD | 7915 #undef READ_INT64_FIELD |
7893 #undef WRITE_INT64_FIELD | 7916 #undef WRITE_INT64_FIELD |
7894 #undef READ_BYTE_FIELD | 7917 #undef READ_BYTE_FIELD |
7895 #undef WRITE_BYTE_FIELD | 7918 #undef WRITE_BYTE_FIELD |
7896 #undef NOBARRIER_READ_BYTE_FIELD | 7919 #undef NOBARRIER_READ_BYTE_FIELD |
7897 #undef NOBARRIER_WRITE_BYTE_FIELD | 7920 #undef NOBARRIER_WRITE_BYTE_FIELD |
7898 | 7921 |
7899 } } // namespace v8::internal | 7922 } } // namespace v8::internal |
7900 | 7923 |
7901 #endif // V8_OBJECTS_INL_H_ | 7924 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |