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

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Aug 20 00:51:48 PDT 2020


sivachandra 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);
----------------
lntue wrote:
> Are you going to add tests for frexp with subnormal inputs since this changes its behavior?
There are tests already covering the subnormal range in the `InFloatRange` etc kind of tests. It would be nice to compare with MPFR results, which we don't do currently because our `MPFRMatcher` does not yet support multiple-input-multiple-output functions. But, I agree with your point that we should add separate tests for subnormal range. I have not done it here as it doesn't make much sense to just add here if we are not comparing with MPFR results. I am working on a patch to extend MPFRMatcher for multiple-input-multiple-output. Once that is lands, and we can use it to compare `frexp` results with MPFR results, then I will add a separate test class for all math tests to test subnormal range exclusively.


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