[libc-commits] [PATCH] D86241: [libc] Add a class called NormalFloat which represents normalized floats.

Tue Ly via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Aug 19 23:08:04 PDT 2020


lntue added inline comments.


================
Comment at: libc/utils/FPUtil/ManipulationFunctions.h:23
+          cpp::EnableIfType<cpp::IsFloatingPointType<T>::Value, int> = 0>
 static inline T frexp(T x, int &exp) {
   FPBits<T> bits(x);
----------------
Are you going to add tests for frexp with subnormal inputs since this changes its behavior?


================
Comment at: libc/utils/FPUtil/NormalFloat.h:49
+      : exponent(e), mantissa(m), sign(s) {
+    if (mantissa >= (one << 1) || (mantissa & one))
+      return;
----------------
This can be combined to (mantissa >= one)


================
Comment at: libc/utils/FPUtil/NormalFloat.h:142
+      exponent = 1 - FPBits<T>::exponentBias - shift;
+      ;
+    } else {
----------------
extra ;


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86241/new/

https://reviews.llvm.org/D86241



More information about the libc-commits mailing list