Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F131911314
D29076.id85188.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D29076.id85188.diff
View Options
Index: lib/msun/tests/csqrt_test.c
===================================================================
--- lib/msun/tests/csqrt_test.c
+++ lib/msun/tests/csqrt_test.c
@@ -257,17 +257,22 @@
{
long double b, x;
long double complex result;
- uint64_t mantbits, sq_mantbits;
+#if LDBL_MANT_DIG > 64
+ typedef __uint128_t ldbl_mant_type;
+#else
+ typedef uint64_t ldbl_mant_type;
+#endif
+ ldbl_mant_type mantbits, sq_mantbits;
int exp, i;
- ATF_CHECK(maxexp > 0 && maxexp % 2 == 0);
- ATF_CHECK(mantdig <= 64);
+ ATF_REQUIRE(maxexp > 0 && maxexp % 2 == 0);
+ ATF_REQUIRE(mantdig <= 128);
mantdig = rounddown(mantdig, 2);
for (exp = 0; exp <= maxexp; exp += 2) {
- mantbits = ((uint64_t)1 << (mantdig / 2 )) - 1;
- for (i = 0;
- i < 100 && mantbits > ((uint64_t)1 << (mantdig / 2 - 1));
+ mantbits = ((ldbl_mant_type)1 << (mantdig / 2)) - 1;
+ for (i = 0; i < 100 &&
+ mantbits > ((ldbl_mant_type)1 << (mantdig / 2 - 1));
i++, mantbits--) {
sq_mantbits = mantbits * mantbits;
/*
@@ -283,10 +288,10 @@
b = ldexpl((long double)sq_mantbits,
exp - 1 - mantdig);
x = ldexpl(mantbits, (exp - 2 - mantdig) / 2);
- ATF_CHECK_EQ(b, x * x * 2);
+ CHECK_FPEQUAL(b, x * x * 2);
result = t_csqrt(CMPLXL(0, b));
- ATF_CHECK_EQ(x, creall(result));
- ATF_CHECK_EQ(x, cimagl(result));
+ CHECK_FPEQUAL(x, creall(result));
+ CHECK_FPEQUAL(x, cimagl(result));
}
}
}
@@ -345,14 +350,7 @@
test_overflow(LDBL_MAX_EXP);
- test_precision(LDBL_MAX_EXP,
- /* FIXME: this seems wrong for non-x86? */
-#ifndef __i386__
- LDBL_MANT_DIG
-#else
- DBL_MANT_DIG
-#endif
- );
+ test_precision(LDBL_MAX_EXP, LDBL_MANT_DIG);
}
ATF_TP_ADD_TCS(tp)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Oct 13, 4:04 AM (11 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
23656313
Default Alt Text
D29076.id85188.diff (1 KB)
Attached To
Mode
D29076: Fix lib/msun/tests/csqrt_test on platforms with 128-bit long double
Attached
Detach File
Event Timeline
Log In to Comment