OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_DOUBLE_INTERNALS_H_ | 5 #ifndef RUNTIME_VM_DOUBLE_INTERNALS_H_ |
6 #define VM_DOUBLE_INTERNALS_H_ | 6 #define RUNTIME_VM_DOUBLE_INTERNALS_H_ |
7 | 7 |
8 #include "platform/utils.h" | 8 #include "platform/utils.h" |
9 | 9 |
10 namespace dart { | 10 namespace dart { |
11 | 11 |
12 // We assume that doubles and uint64_t have the same endianness. | 12 // We assume that doubles and uint64_t have the same endianness. |
13 static uint64_t double_to_uint64(double d) { return bit_cast<uint64_t>(d); } | 13 static uint64_t double_to_uint64(double d) { return bit_cast<uint64_t>(d); } |
14 | 14 |
15 // Helper functions for doubles. | 15 // Helper functions for doubles. |
16 class DoubleInternals { | 16 class DoubleInternals { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 static const uint64_t kHiddenBit = DART_2PART_UINT64_C(0x00100000, 00000000); | 70 static const uint64_t kHiddenBit = DART_2PART_UINT64_C(0x00100000, 00000000); |
71 static const int kPhysicalSignificandSize = 52; // Excludes the hidden bit. | 71 static const int kPhysicalSignificandSize = 52; // Excludes the hidden bit. |
72 static const int kExponentBias = 0x3FF + kPhysicalSignificandSize; | 72 static const int kExponentBias = 0x3FF + kPhysicalSignificandSize; |
73 static const int kDenormalExponent = -kExponentBias + 1; | 73 static const int kDenormalExponent = -kExponentBias + 1; |
74 | 74 |
75 const uint64_t d64_; | 75 const uint64_t d64_; |
76 }; | 76 }; |
77 | 77 |
78 } // namespace dart | 78 } // namespace dart |
79 | 79 |
80 #endif // VM_DOUBLE_INTERNALS_H_ | 80 #endif // RUNTIME_VM_DOUBLE_INTERNALS_H_ |
OLD | NEW |