From: Chris Metcalf Date: Thu, 17 May 2012 15:27:36 +0000 (-0400) Subject: tile: use ieee754/dbl-64 version of fma() and fmaf() X-Git-Tag: glibc-2.16-ports-merge^2~107 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ac9182e7532b7a903afa1b86545dd9f1cc308a74;p=platform%2Fupstream%2Fglibc.git tile: use ieee754/dbl-64 version of fma() and fmaf() It turns out that even if you stub out the rounding and exception support and use the ieee754 version, it's still much better than the generic version that just uses normal multiply and add. The resulting functions have only 1 ULP of error according to the tests. --- diff --git a/ChangeLog.tile b/ChangeLog.tile index b800112..7d3c7bd 100644 --- a/ChangeLog.tile +++ b/ChangeLog.tile @@ -1,3 +1,8 @@ +2012-05-17 Chris Metcalf + + * sysdeps/tile/s_fma.c: Use ieee754/dbl-64 without rounding or + exception support; it's still much better than the generic version. + 2012-05-16 Chris Metcalf * sysdeps/unix/sysv/linux/tile/ucontext_i: Fix tilegx32 offset bug. diff --git a/sysdeps/tile/s_fma.c b/sysdeps/tile/s_fma.c index 355b4ed..5be5865 100644 --- a/sysdeps/tile/s_fma.c +++ b/sysdeps/tile/s_fma.c @@ -1,3 +1,8 @@ -/* Although tile uses ieee754/dbl-64, it does not support the - rounding modes required to use the standard dbl-64 s_fma.c. */ -#include +/* tile does not support the rounding modes required by the ieee754/dbl-64 + implementation, but it's still better than the generic implementation. */ + +#define libc_feholdexcept_setround(e, x) do { (void) (e); } while (0) +#define libc_feupdateenv_test(e, x) ((void) (e), 0) +#define libc_fetestexcept(x) 0 + +#include diff --git a/sysdeps/tile/s_fmaf.c b/sysdeps/tile/s_fmaf.c index caa8e40..92d66b2 100644 --- a/sysdeps/tile/s_fmaf.c +++ b/sysdeps/tile/s_fmaf.c @@ -1,3 +1,8 @@ -/* Although tile uses ieee754/dbl-64, it does not support the - rounding modes required to use the standard dbl-64 s_fmaf.c. */ -#include +/* tile does not support the rounding modes required by the ieee754/dbl-64 + implementation, but it's still better than the generic implementation. */ + +#define libc_feholdexcept_setround(e, x) do { (void) (e); } while (0) +#define libc_feupdateenv_test(e, x) ((void) (e), 0) +#define libc_fetestexcept(x) 0 + +#include