| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 81 |
| 82 | 82 |
| 83 template <typename T> | 83 template <typename T> |
| 84 inline bool IsQuietNaN(T num) { | 84 inline bool IsQuietNaN(T num) { |
| 85 return std::isnan(num) && !IsSignallingNaN(num); | 85 return std::isnan(num) && !IsSignallingNaN(num); |
| 86 } | 86 } |
| 87 | 87 |
| 88 | 88 |
| 89 // Convert the NaN in 'num' to a quiet NaN. | 89 // Convert the NaN in 'num' to a quiet NaN. |
| 90 inline double ToQuietNaN(double num) { | 90 inline double ToQuietNaN(double num) { |
| 91 ASSERT(isnan(num)); | 91 ASSERT(std::isnan(num)); |
| 92 return rawbits_to_double(double_to_rawbits(num) | kDQuietNanMask); | 92 return rawbits_to_double(double_to_rawbits(num) | kDQuietNanMask); |
| 93 } | 93 } |
| 94 | 94 |
| 95 | 95 |
| 96 inline float ToQuietNaN(float num) { | 96 inline float ToQuietNaN(float num) { |
| 97 ASSERT(isnan(num)); | 97 ASSERT(std::isnan(num)); |
| 98 return rawbits_to_float(float_to_rawbits(num) | kSQuietNanMask); | 98 return rawbits_to_float(float_to_rawbits(num) | kSQuietNanMask); |
| 99 } | 99 } |
| 100 | 100 |
| 101 | 101 |
| 102 // Fused multiply-add. | 102 // Fused multiply-add. |
| 103 inline double FusedMultiplyAdd(double op1, double op2, double a) { | 103 inline double FusedMultiplyAdd(double op1, double op2, double a) { |
| 104 return fma(op1, op2, a); | 104 return fma(op1, op2, a); |
| 105 } | 105 } |
| 106 | 106 |
| 107 | 107 |
| 108 inline float FusedMultiplyAdd(float op1, float op2, float a) { | 108 inline float FusedMultiplyAdd(float op1, float op2, float a) { |
| 109 return fmaf(op1, op2, a); | 109 return fmaf(op1, op2, a); |
| 110 } | 110 } |
| 111 | 111 |
| 112 } } // namespace v8::internal | 112 } } // namespace v8::internal |
| 113 | 113 |
| 114 #endif // V8_ARM64_UTILS_ARM64_H_ | 114 #endif // V8_ARM64_UTILS_ARM64_H_ |
| OLD | NEW |