[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:22 PDT 2020
asteinhauser accepted this revision.
asteinhauser added inline comments.
This revision is now accepted and ready to land.
================
Comment at: libc/test/utils/FPUtil/x86_long_double_test.cpp:29
+ long double nan = bits;
+ ASSERT_TRUE(isnan(nan) != 0);
+ ASSERT_TRUE(bits.isNaN());
----------------
There is some ASSERT_NE(a, b) macro which might be useful. It asserts directly the inequality.
================
Comment at: libc/test/utils/FPUtil/x86_long_double_test.cpp:53
+ ASSERT_TRUE(bits.isNaN());
+ }
+}
----------------
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());
}
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