This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Add another fma test


When I reviewed some MIPS test results after my math-tests.h addition,
I was suspicious that in one respect they looked too good: the
math/test-ldouble results showed no fma failures, despite the existing
implementations of fma requiring FE_TOWARDZERO and FE_INEXACT support
to work for the relevant types (and math-tests.h only being about
tests using particular features directly, not about what's internally
used in the implementation of a function).

This patch adds an fma test for ldbl-128 to libm-test.inc that fails
if the code needing FE_TOWARDZERO gets run in round-to-nearest instead
(such tests already are present for float and double, and I'm not
aware of any ldbl-96 systems for which such lack of exception /
rounding mode support is an issue).  Tested on MIPS64 that this does
show the desired failure in test-ldouble.out.

(Bug 13304 is the bug for defective fma functions in the absence of
FE_TOWARDZERO / FE_INEXACT support for the relevant types, and for
ldbl-128ibm.)

2013-06-14  Joseph Myers  <joseph@codesourcery.com>

	* math/libm-test.inc (fma_test_data): Add another test.

diff --git a/math/libm-test.inc b/math/libm-test.inc
index 088bf51..2e5237b 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -8482,6 +8482,7 @@ static const struct test_fff_f_data fma_test_data[] =
     TEST_fff_f (fma, 0x1.00000000000007ffffffffffffffp-9045L, -0x1.ffffffffffff80000001ffffffffp+4773L, -0x1.f8p-4316L, -0x1.00000000000f88000000fffffdffp-4271L),
     TEST_fff_f (fma, 0x1.4e922764c90701d4a2f21d01893dp-8683L, -0x1.955a12e2d7c9447c27fa022fc865p+212L, -0x1.e9634462eaef96528b90b6944578p-8521L, -0x1.08e1783184a371943d3598e10865p-8470L),
     TEST_fff_f (fma, 0x1.801181509c03bdbef10d6165588cp-15131L, 0x1.ad86f8e57d3d40bfa8007780af63p-368L, -0x1.6e9df0dab1c9f1d7a6043c390741p-15507L, 0x1.417c9b2b15e2ad57dc9e0e920844p-15498L),
+    TEST_fff_f (fma, 0x1.ffffffffffffffp0L, 0x1.000000000000008p0L, -0x1p-1000L, 0x1.ffffffffffffffffffffffffffffp0L),
     TEST_fff_f (fma, 0x1.4p-16382L, 0x1.0000000000000000000000000002p-1L, 0x1p-16384L, 0x1.c000000000000000000000000002p-16383L, UNDERFLOW_EXCEPTION),
     TEST_fff_f (fma, -0x1.4p-16382L, 0x1.0000000000000000000000000002p-1L, -0x1p-16384L, -0x1.c000000000000000000000000002p-16383L, UNDERFLOW_EXCEPTION),
     TEST_fff_f (fma, 0x1.fffffffffffffffffffffffffffcp-16382L, 0x1.0000000000000000000000000001p-1L, 0x1p-16494L, 0x1p-16382L, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING),

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]