OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64_UTILS_ARM64_H_ | 5 #ifndef V8_ARM64_UTILS_ARM64_H_ |
6 #define V8_ARM64_UTILS_ARM64_H_ | 6 #define V8_ARM64_UTILS_ARM64_H_ |
7 | 7 |
8 #include <cmath> | 8 #include <cmath> |
9 #include "src/v8.h" | 9 #include "src/v8.h" |
10 | 10 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 memcpy(&value, &bits, 8); | 50 memcpy(&value, &bits, 8); |
51 return value; | 51 return value; |
52 } | 52 } |
53 | 53 |
54 | 54 |
55 // Bit counting. | 55 // Bit counting. |
56 int CountLeadingZeros(uint64_t value, int width); | 56 int CountLeadingZeros(uint64_t value, int width); |
57 int CountLeadingSignBits(int64_t value, int width); | 57 int CountLeadingSignBits(int64_t value, int width); |
58 int CountTrailingZeros(uint64_t value, int width); | 58 int CountTrailingZeros(uint64_t value, int width); |
59 int CountSetBits(uint64_t value, int width); | 59 int CountSetBits(uint64_t value, int width); |
| 60 uint64_t LargestPowerOf2Divisor(uint64_t value); |
60 int MaskToBit(uint64_t mask); | 61 int MaskToBit(uint64_t mask); |
61 | 62 |
62 | 63 |
63 // NaN tests. | 64 // NaN tests. |
64 inline bool IsSignallingNaN(double num) { | 65 inline bool IsSignallingNaN(double num) { |
65 uint64_t raw = double_to_rawbits(num); | 66 uint64_t raw = double_to_rawbits(num); |
66 if (std::isnan(num) && ((raw & kDQuietNanMask) == 0)) { | 67 if (std::isnan(num) && ((raw & kDQuietNanMask) == 0)) { |
67 return true; | 68 return true; |
68 } | 69 } |
69 return false; | 70 return false; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 } | 105 } |
105 | 106 |
106 | 107 |
107 inline float FusedMultiplyAdd(float op1, float op2, float a) { | 108 inline float FusedMultiplyAdd(float op1, float op2, float a) { |
108 return fmaf(op1, op2, a); | 109 return fmaf(op1, op2, a); |
109 } | 110 } |
110 | 111 |
111 } } // namespace v8::internal | 112 } } // namespace v8::internal |
112 | 113 |
113 #endif // V8_ARM64_UTILS_ARM64_H_ | 114 #endif // V8_ARM64_UTILS_ARM64_H_ |
OLD | NEW |