From 393a1cb4eaeadbc67587a009328715bbc42e56b7 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Thu, 5 Jul 2018 12:37:25 +0100 Subject: Move __HAVE_FAST_FMA to math_config.h Define it consistently with other HAVE_* macros that only affect code using math_config.h. This is also closer to the Arm Optimized Routines code. --- newlib/libm/common/math_config.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'newlib/libm/common/math_config.h') diff --git a/newlib/libm/common/math_config.h b/newlib/libm/common/math_config.h index aec9cd0d6..1f83756ab 100644 --- a/newlib/libm/common/math_config.h +++ b/newlib/libm/common/math_config.h @@ -61,6 +61,15 @@ # endif #endif +/* Compiler can inline fma as a single instruction. */ +#ifndef HAVE_FAST_FMA +# if __aarch64__ || __ARM_FEATURE_FMA +# define HAVE_FAST_FMA 1 +# else +# define HAVE_FAST_FMA 0 +# endif +#endif + #if HAVE_FAST_ROUND # define TOINT_INTRINSICS 1 @@ -366,7 +375,7 @@ extern const struct log_data double poly[LOG_POLY_ORDER - 1]; /* First coefficient is 1. */ double poly1[LOG_POLY1_ORDER - 1]; struct {double invc, logc;} tab[1 << LOG_TABLE_BITS]; -#if !__HAVE_FAST_FMA +#if !HAVE_FAST_FMA struct {double chi, clo;} tab2[1 << LOG_TABLE_BITS]; #endif } __log_data HIDDEN; @@ -381,7 +390,7 @@ extern const struct log2_data double poly[LOG2_POLY_ORDER - 1]; double poly1[LOG2_POLY1_ORDER - 1]; struct {double invc, logc;} tab[1 << LOG2_TABLE_BITS]; -#if !__HAVE_FAST_FMA +#if !HAVE_FAST_FMA struct {double chi, clo;} tab2[1 << LOG2_TABLE_BITS]; #endif } __log2_data HIDDEN; -- cgit v1.2.3