[GIT] ppl/ppl(ppl-0_10-branch): Only use fmaf(), fma() and fmal() if they are fast.

Module: ppl/ppl Branch: ppl-0_10-branch Commit: 753671e93149e0d82aef0afcd6279e78711f2cfe URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=753671e93149e...
Author: Roberto Bagnara bagnara@cs.unipr.it Date: Fri Apr 10 22:24:18 2009 +0200
Only use fmaf(), fma() and fmal() if they are fast.
---
src/checked_float.inlines.hh | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/checked_float.inlines.hh b/src/checked_float.inlines.hh index 828ef0e..6783260 100644 --- a/src/checked_float.inlines.hh +++ b/src/checked_float.inlines.hh @@ -34,7 +34,8 @@ namespace Checked {
inline float fma(float x, float y, float z) { -#if PPL_HAVE_DECL_FMAF && !defined(__alpha) && !defined(__FreeBSD__) +#if PPL_HAVE_DECL_FMAF && defined(FP_FAST_FMAF) \ + && !defined(__alpha) && !defined(__FreeBSD__) return ::fmaf(x, y, z); #else return x*y + z; @@ -43,7 +44,8 @@ fma(float x, float y, float z) {
inline double fma(double x, double y, double z) { -#if PPL_HAVE_DECL_FMA && !defined(__alpha) && !defined(__FreeBSD__) +#if PPL_HAVE_DECL_FMA && defined(FP_FAST_FMA) \ + && !defined(__alpha) && !defined(__FreeBSD__) return ::fma(x, y, z); #else return x*y + z; @@ -52,7 +54,8 @@ fma(double x, double y, double z) {
inline long double fma(long double x, long double y, long double z) { -#if PPL_HAVE_DECL_FMAL && !defined(__alpha) && !defined(__FreeBSD__) +#if PPL_HAVE_DECL_FMAL && defined(FP_FAST_FMAL) \ + && !defined(__alpha) && !defined(__FreeBSD__) return ::fmal(x, y, z); #else return x*y + z;
participants (1)
-
Roberto Bagnara