From 6555743a4bba74913f8df26482bbd9ed4f8adddf Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Wed, 24 Oct 2012 21:01:39 +0000 Subject: [PATCH] 2012-10-24 Jeff Johnston * configure.in: Comment out the --enable-newlib-fp-hw option as the mathfp library is inaccurate and should not be used. * Makefile.am: Add comment regarding the mathfp directory. * configure: Regenerated. * Makefile.in: Ditto. * libm/mathfp/README: New file that details why the mathfp directory is not used. --- newlib/ChangeLog | 10 ++++++++++ newlib/Makefile.am | 4 ++++ newlib/Makefile.in | 5 +++++ newlib/configure | 25 ++++++++++--------------- newlib/configure.in | 20 +++++++++++++------- newlib/libm/mathfp/README | 11 +++++++++++ 6 files changed, 53 insertions(+), 22 deletions(-) create mode 100644 newlib/libm/mathfp/README diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 1f175b0c9..8f8ed212e 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,13 @@ +2012-10-24 Jeff Johnston + + * configure.in: Comment out the --enable-newlib-fp-hw option + as the mathfp library is inaccurate and should not be used. + * Makefile.am: Add comment regarding the mathfp directory. + * configure: Regenerated. + * Makefile.in: Ditto. + * libm/mathfp/README: New file that details why the mathfp + directory is not used. + 2012-10-22 Jon TURNEY * libc/include/string.h (strdup, strndup): Declare if not diff --git a/newlib/Makefile.am b/newlib/Makefile.am index 41de26f25..5ecce4c10 100644 --- a/newlib/Makefile.am +++ b/newlib/Makefile.am @@ -13,6 +13,10 @@ MULTICLEAN = true LIBTOOL_VERSION_INFO = 0:0:0 +# The newlib hardware floating-point routines have been disabled due to +# inaccuracy. If you wish to work on them, you will need to edit the +# configure.in file to re-enable the configuration option. By default, +# the NEWLIB_HW_FP variable will always be false. if NEWLIB_HW_FP MATHDIR = mathfp else diff --git a/newlib/Makefile.in b/newlib/Makefile.in index 9b013e624..f7dbe82fe 100644 --- a/newlib/Makefile.in +++ b/newlib/Makefile.in @@ -297,6 +297,11 @@ MULTIDO = true MULTICLEAN = true LIBTOOL_VERSION_INFO = 0:0:0 @NEWLIB_HW_FP_FALSE@MATHDIR = math + +# The newlib hardware floating-point routines have been disabled due to +# inaccuracy. If you wish to work on them, you will need to edit the +# configure.in file to re-enable the configuration option. By default, +# the NEWLIB_HW_FP variable will always be false. @NEWLIB_HW_FP_TRUE@MATHDIR = mathfp # Work around what appears to be a GNU make bug handling MAKEFLAGS diff --git a/newlib/configure b/newlib/configure index 9e1906555..7d37f296f 100755 --- a/newlib/configure +++ b/newlib/configure @@ -804,7 +804,6 @@ with_pic enable_fast_install with_gnu_ld enable_libtool_lock -enable_newlib_hw_fp ' ac_precious_vars='build_alias host_alias @@ -1469,7 +1468,6 @@ Optional Features: --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) - --enable-newlib-hw-fp Turn on hardware floating point math Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -11641,7 +11639,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11644 "configure" +#line 11642 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11747,7 +11745,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11750 "configure" +#line 11748 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11986,17 +11984,14 @@ CC="$lt_save_CC" fi -# Check whether --enable-newlib_hw_fp was given. -if test "${enable_newlib_hw_fp+set}" = set; then : - enableval=$enable_newlib_hw_fp; case "${enableval}" in - yes) newlib_hw_fp=true ;; - no) newlib_hw_fp=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-newlib-hw-fp" "$LINENO" 5 ;; - esac -else - newlib_hw_fp=false -fi - +newlib_hw_fp=false +#AC_ARG_ENABLE(newlib_hw_fp, +#[ --enable-newlib-hw-fp Turn on hardware floating point math], +#[case "${enableval}" in +# yes) newlib_hw_fp=true ;; +# no) newlib_hw_fp=false ;; +# *) AC_MSG_ERROR(bad value ${enableval} for --enable-newlib-hw-fp) ;; +# esac],[newlib_hw_fp=false]) if test x$newlib_hw_fp = xtrue; then NEWLIB_HW_FP_TRUE= NEWLIB_HW_FP_FALSE='#' diff --git a/newlib/configure.in b/newlib/configure.in index b6e5dee3c..35a5d070b 100644 --- a/newlib/configure.in +++ b/newlib/configure.in @@ -137,13 +137,19 @@ AC_LIBTOOL_WIN32_DLL AM_PROG_LIBTOOL fi -AC_ARG_ENABLE(newlib_hw_fp, -[ --enable-newlib-hw-fp Turn on hardware floating point math], -[case "${enableval}" in - yes) newlib_hw_fp=true ;; - no) newlib_hw_fp=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-newlib-hw-fp) ;; - esac],[newlib_hw_fp=false]) +dnl The following is being disabled because the mathfp library is +dnl not up to standard due to inaccuracies caused by some of the +dnl floating-point algorithms used. If you wish to work on this, +dnl comment out the following line and uncomment out the lines +dnl following it to re-enable the feature. +newlib_hw_fp=false +#AC_ARG_ENABLE(newlib_hw_fp, +#[ --enable-newlib-hw-fp Turn on hardware floating point math], +#[case "${enableval}" in +# yes) newlib_hw_fp=true ;; +# no) newlib_hw_fp=false ;; +# *) AC_MSG_ERROR(bad value ${enableval} for --enable-newlib-hw-fp) ;; +# esac],[newlib_hw_fp=false]) AM_CONDITIONAL(NEWLIB_HW_FP, test x$newlib_hw_fp = xtrue) # These get added in the top-level configure.in, except in the case where diff --git a/newlib/libm/mathfp/README b/newlib/libm/mathfp/README new file mode 100644 index 000000000..7eba79cb7 --- /dev/null +++ b/newlib/libm/mathfp/README @@ -0,0 +1,11 @@ +This directory was an experiment to use floating-point operations to implement +the math library when a processor had a floating-point instruction set. The +experiment was a failure in that some of the algorithms chosen (e.g. recursive +algorithms for sin/cos, etc..) are too simple and do not provide proper accuracy +nor handle very large or very small inputs adequately. + +The code is considered moth-balled. The stable math library routines can be +found in libm/math and the configuration option to use this has been removed. + +If you wish to experiment with the concept, please feel free and report back if +you have major improvements.