[libcxx-commits] [PATCH] D116338: Set std::numeric_limits<>::tinyness_before to true for floating point types on ARM platforms.

Owen Anderson via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Dec 28 11:51:51 PST 2021


resistor created this revision.
Herald added a subscriber: kristof.beyls.
resistor requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

Section E1.3.5 in the ARMv8 Architecture Reference Manual specifies:

  Underflow. The bit is set to 1 if the absolute value of the result
  of an operation, produced before rounding, is less than the minimum
  positive normalized number for the destination precision, and the
  rounded result is inexact.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D116338

Files:
  libcxx/include/limits


Index: libcxx/include/limits
===================================================================
--- libcxx/include/limits
+++ libcxx/include/limits
@@ -339,7 +339,11 @@
     static _LIBCPP_CONSTEXPR const bool is_modulo = false;
 
     static _LIBCPP_CONSTEXPR const bool traps = false;
+#ifdef __arm__
+    static _LIBCPP_CONSTEXPR const bool tinyness_before = true;
+#else
     static _LIBCPP_CONSTEXPR const bool tinyness_before = false;
+#endif
     static _LIBCPP_CONSTEXPR const float_round_style round_style = round_to_nearest;
 };
 
@@ -385,7 +389,11 @@
     static _LIBCPP_CONSTEXPR const bool is_modulo = false;
 
     static _LIBCPP_CONSTEXPR const bool traps = false;
+#ifdef __arm__
+    static _LIBCPP_CONSTEXPR const bool tinyness_before = true;
+#else
     static _LIBCPP_CONSTEXPR const bool tinyness_before = false;
+#endif
     static _LIBCPP_CONSTEXPR const float_round_style round_style = round_to_nearest;
 };
 
@@ -435,7 +443,11 @@
     static _LIBCPP_CONSTEXPR const bool is_modulo = false;
 
     static _LIBCPP_CONSTEXPR const bool traps = false;
+#ifdef __arm__
+    static _LIBCPP_CONSTEXPR const bool tinyness_before = true;
+#else
     static _LIBCPP_CONSTEXPR const bool tinyness_before = false;
+#endif
     static _LIBCPP_CONSTEXPR const float_round_style round_style = round_to_nearest;
 };
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116338.396418.patch
Type: text/x-patch
Size: 1328 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20211228/b27205ef/attachment-0001.bin>


More information about the libcxx-commits mailing list