[prev in list] [next in list] [prev in thread] [next in thread] 

List:       glibc-alpha
Subject:    [PATCH][BZ #3268] Additional fma tests
From:       Steven Munroe <munroesj () us ! ibm ! com>
Date:       2007-04-03 19:50:10
Message-ID: 4612B474.1010605 () us ! ibm ! com
[Download RAW message or body]

Previous soft-fp work exposed a general lack of correct Fused Multiply Add (fma) \
implemetations for platforms that don't implement fma in hardware (soft-fp or hard-fp \
that doesn't implement fma).

This patch updates libm-test.inc to actually test for the full percision of fma. \
IEEE-754r states:

2 Definitions

"fused multiply-add: The operation fma(x,y,z) computes (x � )+z as if with \
unbounded range and precision, rounding only once to the destination format; see \
subclause 5.1. "

5.1 Arithmetic

"The operation fma(x,y,z) computes (x�)+z as if with unbounded range and precision, \
rounding only once to the destination format. No underflow, overflow, or inexact \
exception (subclause 7) can arise due to the multiply, but only due to the add; and \
so fused multiply-add differs from a multiply operation followed by an add \
operation."

This patch has been updated and verified on powerpc32 with todays CVS.


["soft-fp-fma-test-20070320.txt" (text/plain)]

2007-04-03  Steven Munroe  <sjmunroe@us.ibm.com>

	[BZ #3268]
	* math/libm-test.inc (fma_test): New tests.

diff -urN libc25-cvstip-20070320/math/libm-test.inc libc25/math/libm-test.inc
--- libc25-cvstip-20070320/math/libm-test.inc	2007-03-15 15:10:16.000000000 -0500
+++ libc25/math/libm-test.inc	2007-03-30 15:30:26.000000000 -0500
@@ -2766,6 +2766,12 @@
 
   TEST_fff_f (fma, 1.25L, 0.75L, 0.0625L, 1.0L);
 
+  TEST_fff_f (fma, 8388609.0L, 8388609.0L, -70368752566272.0L, 8388609.0L);
+
+#ifdef TEST_DOUBLE
+  TEST_fff_f (fma, 0x1.0000000000001p+52, 0x1.0000000000001p+52, \
-0x1.0000000000001p+104, 0x1.0000000000001p+52); +#endif
+
   END (fma);
 }
 



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic