1
0

0006-libvixl-cxx-macro-isnan.patch 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. --- a/disas/libvixl/vixl/utils.h.orig 2016-11-22 22:36:20.691253883 +0800
  2. +++ b/disas/libvixl/vixl/utils.h 2016-11-22 22:55:44.639618185 +0800
  3. @@ -118,11 +118,17 @@ double double_pack(uint64_t sign, uint64
  4. // An fpclassify() function for 16-bit half-precision floats.
  5. int float16classify(float16 value);
  6. +#ifdef isnan
  7. +#define isnan_ isnan
  8. +#else
  9. +#define isnan_ std::isnan
  10. +#endif
  11. +
  12. // NaN tests.
  13. inline bool IsSignallingNaN(double num) {
  14. const uint64_t kFP64QuietNaNMask = UINT64_C(0x0008000000000000);
  15. uint64_t raw = double_to_rawbits(num);
  16. - if (std::isnan(num) && ((raw & kFP64QuietNaNMask) == 0)) {
  17. + if (isnan_(num) && ((raw & kFP64QuietNaNMask) == 0)) {
  18. return true;
  19. }
  20. return false;
  21. @@ -132,7 +138,7 @@ inline bool IsSignallingNaN(double num)
  22. inline bool IsSignallingNaN(float num) {
  23. const uint32_t kFP32QuietNaNMask = 0x00400000;
  24. uint32_t raw = float_to_rawbits(num);
  25. - if (std::isnan(num) && ((raw & kFP32QuietNaNMask) == 0)) {
  26. + if (isnan_(num) && ((raw & kFP32QuietNaNMask) == 0)) {
  27. return true;
  28. }
  29. return false;
  30. @@ -148,21 +154,21 @@ inline bool IsSignallingNaN(float16 num)
  31. template <typename T>
  32. inline bool IsQuietNaN(T num) {
  33. - return std::isnan(num) && !IsSignallingNaN(num);
  34. + return isnan_(num) && !IsSignallingNaN(num);
  35. }
  36. // Convert the NaN in 'num' to a quiet NaN.
  37. inline double ToQuietNaN(double num) {
  38. const uint64_t kFP64QuietNaNMask = UINT64_C(0x0008000000000000);
  39. - VIXL_ASSERT(std::isnan(num));
  40. + VIXL_ASSERT(isnan_(num));
  41. return rawbits_to_double(double_to_rawbits(num) | kFP64QuietNaNMask);
  42. }
  43. inline float ToQuietNaN(float num) {
  44. const uint32_t kFP32QuietNaNMask = 0x00400000;
  45. - VIXL_ASSERT(std::isnan(num));
  46. + VIXL_ASSERT(isnan_(num));
  47. return rawbits_to_float(float_to_rawbits(num) | kFP32QuietNaNMask);
  48. }