[libc-commits] [PATCH] D82330: [libc] Match x86 long double NaN classification with that of the compiler.
Anthony Steinhauser via Phabricator via libc-commits
libc-commits at lists.llvm.org
Mon Jun 22 16:40:24 PDT 2020
asteinhauser added a comment.
Sorry, I kept there the old comment.
================
Comment at: libc/test/utils/FPUtil/x86_long_double_test.cpp:53
+ ASSERT_TRUE(bits.isNaN());
+ }
+}
----------------
asteinhauser wrote:
> I would add one or two tests also for the false case - e.g.:
>
> bits.exponent = 1;
> bits.implicit = 1;
> for (unsigned int i = 0; i < 1000000; ++i) {
> // If exponent is non-zero and also not max, and the implicit bit is 0,
> // then the number is a NaN for all values of mantissa.
> bits.mantissa = i;
> long double nan = bits;
> ASSERT_EQ(isnan(nan), 0);
> ASSERT_FALSE(bits.isNaN());
> }
Sorry, I left there an old comment from copy-pasting. There should be something like:
// If the implicit bit is true and the exponent is not the max value,
// the number is not a NaN for any mantissa.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82330/new/
https://reviews.llvm.org/D82330
More information about the libc-commits
mailing list