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); | |
61 int MaskToBit(uint64_t mask); | 60 int MaskToBit(uint64_t mask); |
62 | 61 |
63 | 62 |
64 // NaN tests. | 63 // NaN tests. |
65 inline bool IsSignallingNaN(double num) { | 64 inline bool IsSignallingNaN(double num) { |
66 uint64_t raw = double_to_rawbits(num); | 65 uint64_t raw = double_to_rawbits(num); |
67 if (std::isnan(num) && ((raw & kDQuietNanMask) == 0)) { | 66 if (std::isnan(num) && ((raw & kDQuietNanMask) == 0)) { |
68 return true; | 67 return true; |
69 } | 68 } |
70 return false; | 69 return false; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 } | 104 } |
106 | 105 |
107 | 106 |
108 inline float FusedMultiplyAdd(float op1, float op2, float a) { | 107 inline float FusedMultiplyAdd(float op1, float op2, float a) { |
109 return fmaf(op1, op2, a); | 108 return fmaf(op1, op2, a); |
110 } | 109 } |
111 | 110 |
112 } } // namespace v8::internal | 111 } } // namespace v8::internal |
113 | 112 |
114 #endif // V8_ARM64_UTILS_ARM64_H_ | 113 #endif // V8_ARM64_UTILS_ARM64_H_ |
OLD | NEW |