|
--- a/disas/libvixl/vixl/utils.h.orig 2016-11-22 22:36:20.691253883 +0800
|
|
+++ b/disas/libvixl/vixl/utils.h 2016-11-22 22:55:44.639618185 +0800
|
|
@@ -118,11 +118,17 @@ double double_pack(uint64_t sign, uint64
|
|
// An fpclassify() function for 16-bit half-precision floats.
|
|
int float16classify(float16 value);
|
|
|
|
+#ifdef isnan
|
|
+#define isnan_ isnan
|
|
+#else
|
|
+#define isnan_ std::isnan
|
|
+#endif
|
|
+
|
|
// NaN tests.
|
|
inline bool IsSignallingNaN(double num) {
|
|
const uint64_t kFP64QuietNaNMask = UINT64_C(0x0008000000000000);
|
|
uint64_t raw = double_to_rawbits(num);
|
|
- if (std::isnan(num) && ((raw & kFP64QuietNaNMask) == 0)) {
|
|
+ if (isnan_(num) && ((raw & kFP64QuietNaNMask) == 0)) {
|
|
return true;
|
|
}
|
|
return false;
|
|
@@ -132,7 +138,7 @@ inline bool IsSignallingNaN(double num)
|
|
inline bool IsSignallingNaN(float num) {
|
|
const uint32_t kFP32QuietNaNMask = 0x00400000;
|
|
uint32_t raw = float_to_rawbits(num);
|
|
- if (std::isnan(num) && ((raw & kFP32QuietNaNMask) == 0)) {
|
|
+ if (isnan_(num) && ((raw & kFP32QuietNaNMask) == 0)) {
|
|
return true;
|
|
}
|
|
return false;
|
|
@@ -148,21 +154,21 @@ inline bool IsSignallingNaN(float16 num)
|
|
|
|
template <typename T>
|
|
inline bool IsQuietNaN(T num) {
|
|
- return std::isnan(num) && !IsSignallingNaN(num);
|
|
+ return isnan_(num) && !IsSignallingNaN(num);
|
|
}
|
|
|
|
|
|
// Convert the NaN in 'num' to a quiet NaN.
|
|
inline double ToQuietNaN(double num) {
|
|
const uint64_t kFP64QuietNaNMask = UINT64_C(0x0008000000000000);
|
|
- VIXL_ASSERT(std::isnan(num));
|
|
+ VIXL_ASSERT(isnan_(num));
|
|
return rawbits_to_double(double_to_rawbits(num) | kFP64QuietNaNMask);
|
|
}
|
|
|
|
|
|
inline float ToQuietNaN(float num) {
|
|
const uint32_t kFP32QuietNaNMask = 0x00400000;
|
|
- VIXL_ASSERT(std::isnan(num));
|
|
+ VIXL_ASSERT(isnan_(num));
|
|
return rawbits_to_float(float_to_rawbits(num) | kFP32QuietNaNMask);
|
|
}
|
|
|