OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 #ifndef V8_DIY_FP_H_ | 5 #ifndef V8_DIY_FP_H_ |
6 #define V8_DIY_FP_H_ | 6 #define V8_DIY_FP_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 10 #include "src/base/logging.h" |
| 11 |
8 namespace v8 { | 12 namespace v8 { |
9 namespace internal { | 13 namespace internal { |
10 | 14 |
11 // This "Do It Yourself Floating Point" class implements a floating-point number | 15 // This "Do It Yourself Floating Point" class implements a floating-point number |
12 // with a uint64 significand and an int exponent. Normalized DiyFp numbers will | 16 // with a uint64 significand and an int exponent. Normalized DiyFp numbers will |
13 // have the most significant bit of the significand set. | 17 // have the most significant bit of the significand set. |
14 // Multiplication and Subtraction do not normalize their results. | 18 // Multiplication and Subtraction do not normalize their results. |
15 // DiyFp are not designed to contain special doubles (NaN and Infinity). | 19 // DiyFp are not designed to contain special doubles (NaN and Infinity). |
16 class DiyFp { | 20 class DiyFp { |
17 public: | 21 public: |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 private: | 89 private: |
86 static const uint64_t kUint64MSB = static_cast<uint64_t>(1) << 63; | 90 static const uint64_t kUint64MSB = static_cast<uint64_t>(1) << 63; |
87 | 91 |
88 uint64_t f_; | 92 uint64_t f_; |
89 int e_; | 93 int e_; |
90 }; | 94 }; |
91 | 95 |
92 } } // namespace v8::internal | 96 } } // namespace v8::internal |
93 | 97 |
94 #endif // V8_DIY_FP_H_ | 98 #endif // V8_DIY_FP_H_ |
OLD | NEW |