public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v3 1/3] Miscellaneous Makefile.in regenerated
  2019-08-06 19:13 [PATCH v3 0/3] fenv stubs and documentation series Joel Sherrill
  2019-08-06 19:13 ` [PATCH v3 2/3] Add default implementation of fenv.h and all methods Joel Sherrill
@ 2019-08-06 19:13 ` Joel Sherrill
  2019-08-06 19:13 ` [PATCH v3 3/3] Regenerated files from fenv.h addition Joel Sherrill
  2 siblings, 0 replies; 9+ messages in thread
From: Joel Sherrill @ 2019-08-06 19:13 UTC (permalink / raw)
  To: newlib; +Cc: Joel Sherrill

---
 newlib/libc/machine/msp430/Makefile.in  |  1 -
 newlib/libc/machine/riscv/Makefile.in   | 21 +++++++-------
 newlib/libc/search/Makefile.in          | 50 ++++++++++++---------------------
 newlib/libm/machine/aarch64/Makefile.in |  7 +++--
 4 files changed, 33 insertions(+), 46 deletions(-)

diff --git a/newlib/libc/machine/msp430/Makefile.in b/newlib/libc/machine/msp430/Makefile.in
index 6f837c9..efbdf7c 100644
--- a/newlib/libc/machine/msp430/Makefile.in
+++ b/newlib/libc/machine/msp430/Makefile.in
@@ -198,7 +198,6 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
-runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/newlib/libc/machine/riscv/Makefile.in b/newlib/libc/machine/riscv/Makefile.in
index 304dd35..e6dee87 100644
--- a/newlib/libc/machine/riscv/Makefile.in
+++ b/newlib/libc/machine/riscv/Makefile.in
@@ -69,9 +69,9 @@ LIBRARIES = $(noinst_LIBRARIES)
 ARFLAGS = cru
 lib_a_AR = $(AR) $(ARFLAGS)
 lib_a_LIBADD =
-am_lib_a_OBJECTS = lib_a-memset.$(OBJEXT) lib_a-memcpy.$(OBJEXT) \
-	lib_a-memcpy-asm.$(OBJEXT) \
-	lib_a-memmove.$(OBJEXT) lib_a-memmove-stub.$(OBJEXT) \
+am_lib_a_OBJECTS = lib_a-memmove.$(OBJEXT) \
+	lib_a-memmove-stub.$(OBJEXT) lib_a-memset.$(OBJEXT) \
+	lib_a-memcpy-asm.$(OBJEXT) lib_a-memcpy.$(OBJEXT) \
 	lib_a-strlen.$(OBJEXT) lib_a-strcpy.$(OBJEXT) \
 	lib_a-strcmp.$(OBJEXT) lib_a-setjmp.$(OBJEXT) \
 	lib_a-ieeefp.$(OBJEXT) lib_a-ffs.$(OBJEXT)
@@ -200,8 +200,9 @@ AUTOMAKE_OPTIONS = cygnus
 INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
 AM_CCASFLAGS = $(INCLUDES)
 noinst_LIBRARIES = lib.a
-lib_a_SOURCES = memcpy-asm.S memmove.S memmove-stub.c memset.S memcpy.c strlen.c \
+lib_a_SOURCES = memmove.S memmove-stub.c memset.S memcpy-asm.S memcpy.c strlen.c \
 	strcpy.c strcmp.S setjmp.S ieeefp.c ffs.c
+
 lib_a_CCASFLAGS = $(AM_CCASFLAGS)
 lib_a_CFLAGS = $(AM_CFLAGS)
 ACLOCAL_AMFLAGS = -I ../../.. -I ../../../..
@@ -270,18 +271,18 @@ lib_a-memmove.o: memmove.S
 lib_a-memmove.obj: memmove.S
 	$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-memmove.obj `if test -f 'memmove.S'; then $(CYGPATH_W) 'memmove.S'; else $(CYGPATH_W) '$(srcdir)/memmove.S'; fi`
 
-lib_a-memcpy-asm.o: memcpy-asm.S
-	$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-memcpy-asm.o `test -f 'memcpy-asm.S' || echo '$(srcdir)/'`memcpy-asm.S
-
-lib_a-memcpy-asm.obj: memcpy-asm.S
-	$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-memcpy-asm.obj `if test -f 'memcpy-asm.S'; then $(CYGPATH_W) 'memcpy-asm.S'; else $(CYGPATH_W) '$(srcdir)/memcpy-asm.S'; fi`
-
 lib_a-memset.o: memset.S
 	$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-memset.o `test -f 'memset.S' || echo '$(srcdir)/'`memset.S
 
 lib_a-memset.obj: memset.S
 	$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-memset.obj `if test -f 'memset.S'; then $(CYGPATH_W) 'memset.S'; else $(CYGPATH_W) '$(srcdir)/memset.S'; fi`
 
+lib_a-memcpy-asm.o: memcpy-asm.S
+	$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-memcpy-asm.o `test -f 'memcpy-asm.S' || echo '$(srcdir)/'`memcpy-asm.S
+
+lib_a-memcpy-asm.obj: memcpy-asm.S
+	$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-memcpy-asm.obj `if test -f 'memcpy-asm.S'; then $(CYGPATH_W) 'memcpy-asm.S'; else $(CYGPATH_W) '$(srcdir)/memcpy-asm.S'; fi`
+
 lib_a-strcmp.o: strcmp.S
 	$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-strcmp.o `test -f 'strcmp.S' || echo '$(srcdir)/'`strcmp.S
 
diff --git a/newlib/libc/search/Makefile.in b/newlib/libc/search/Makefile.in
index 8077a5f..4330472 100644
--- a/newlib/libc/search/Makefile.in
+++ b/newlib/libc/search/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.6 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
-
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -53,11 +54,15 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 DIST_COMMON = $(srcdir)/../../Makefile.shared $(srcdir)/Makefile.in \
-	$(srcdir)/Makefile.am $(top_srcdir)/../../mkinstalldirs
+	$(srcdir)/Makefile.am
 subdir = search
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/../acinclude.m4 \
-	$(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \
+	$(top_srcdir)/../../ltoptions.m4 \
+	$(top_srcdir)/../../ltsugar.m4 \
+	$(top_srcdir)/../../ltversion.m4 \
+	$(top_srcdir)/../../lt~obsolete.m4 \
+	$(top_srcdir)/../acinclude.m4 $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs
@@ -182,10 +187,8 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
-LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NEWLIB_CFLAGS = @NEWLIB_CFLAGS@
 NM = @NM@
@@ -214,7 +217,6 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 aext = @aext@
@@ -374,14 +376,12 @@ lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) $(EXTRA_lib_a_DEPENDENCIES)
 
 clean-noinstLTLIBRARIES:
 	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
-	@list='$(noinst_LTLIBRARIES)'; \
-	locs=`for p in $$list; do echo $$p; done | \
-	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
-	      sort -u`; \
-	test -z "$$locs" || { \
-	  echo rm -f $${locs}; \
-	  rm -f $${locs}; \
-	}
+	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
 libsearch.la: $(libsearch_la_OBJECTS) $(libsearch_la_DEPENDENCIES) $(EXTRA_libsearch_la_DEPENDENCIES) 
 	$(libsearch_la_LINK) $(am_libsearch_la_rpath) $(libsearch_la_OBJECTS) $(libsearch_la_LIBADD) $(LIBS)
 
@@ -563,20 +563,6 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
-cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
-	list='$(SOURCES) $(HEADERS) $(LISP)'; \
-	case "$(srcdir)" in \
-	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
-	  *) sdir=$(subdir)/$(srcdir) ;; \
-	esac; \
-	for i in $$list; do \
-	  if test -f "$$i"; then \
-	    echo "$(subdir)/$$i"; \
-	  else \
-	    echo "$$sdir/$$i"; \
-	  fi; \
-	done >> $(top_builddir)/cscope.files
-
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 check-am:
@@ -687,7 +673,7 @@ uninstall-am:
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
 	clean-libtool clean-noinstLIBRARIES clean-noinstLTLIBRARIES \
-	cscopelist ctags distclean distclean-compile distclean-generic \
+	ctags distclean distclean-compile distclean-generic \
 	distclean-libtool distclean-tags dvi dvi-am html html-am info \
 	info-am install install-am install-data install-data-am \
 	install-dvi install-dvi-am install-exec install-exec-am \
diff --git a/newlib/libm/machine/aarch64/Makefile.in b/newlib/libm/machine/aarch64/Makefile.in
index d31237e..ac85b3f 100644
--- a/newlib/libm/machine/aarch64/Makefile.in
+++ b/newlib/libm/machine/aarch64/Makefile.in
@@ -52,9 +52,10 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
-DIST_COMMON = $(srcdir)/../../../Makefile.shared $(srcdir)/Makefile.in \
-	$(srcdir)/Makefile.am $(top_srcdir)/configure \
-	$(am__configure_deps) $(srcdir)/../../../../mkinstalldirs
+DIST_COMMON = $(srcdir)/../../../Makefile.shared INSTALL \
+	$(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(top_srcdir)/configure $(am__configure_deps) \
+	$(srcdir)/../../../../mkinstalldirs
 subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/../../../acinclude.m4 \
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v3 3/3] Regenerated files from fenv.h addition
  2019-08-06 19:13 [PATCH v3 0/3] fenv stubs and documentation series Joel Sherrill
  2019-08-06 19:13 ` [PATCH v3 2/3] Add default implementation of fenv.h and all methods Joel Sherrill
  2019-08-06 19:13 ` [PATCH v3 1/3] Miscellaneous Makefile.in regenerated Joel Sherrill
@ 2019-08-06 19:13 ` Joel Sherrill
  2 siblings, 0 replies; 9+ messages in thread
From: Joel Sherrill @ 2019-08-06 19:13 UTC (permalink / raw)
  To: newlib; +Cc: Joel Sherrill

---
 newlib/libm/Makefile.in      |  12 +-
 newlib/libm/configure        |   3 +-
 newlib/libm/fenv/Makefile.in | 628 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 636 insertions(+), 7 deletions(-)
 create mode 100644 newlib/libm/fenv/Makefile.in

diff --git a/newlib/libm/Makefile.in b/newlib/libm/Makefile.in
index 59a53b5..64e4994 100644
--- a/newlib/libm/Makefile.in
+++ b/newlib/libm/Makefile.in
@@ -80,12 +80,12 @@ LTLIBRARIES = $(noinst_LTLIBRARIES)
 am__DEPENDENCIES_1 =
 @USE_LIBTOOL_FALSE@am__DEPENDENCIES_2 = $(MATHDIR)/lib.$(aext) \
 @USE_LIBTOOL_FALSE@	common/lib.$(aext) complex/lib.$(aext) \
-@USE_LIBTOOL_FALSE@	$(am__DEPENDENCIES_1)
+@USE_LIBTOOL_FALSE@	fenv/lib.$(aext) $(am__DEPENDENCIES_1)
 @USE_LIBTOOL_TRUE@am__DEPENDENCIES_2 =  \
 @USE_LIBTOOL_TRUE@	$(MATHDIR)/lib$(MATHDIR).$(aext) \
 @USE_LIBTOOL_TRUE@	common/libcommon.$(aext) \
 @USE_LIBTOOL_TRUE@	complex/libcomplex.$(aext) \
-@USE_LIBTOOL_TRUE@	$(am__DEPENDENCIES_1)
+@USE_LIBTOOL_TRUE@	fenv/libfenv.$(aext) $(am__DEPENDENCIES_1)
 @USE_LIBTOOL_TRUE@libm_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
 am_libm_la_OBJECTS =
 libm_la_OBJECTS = $(am_libm_la_OBJECTS)
@@ -168,7 +168,7 @@ AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
 	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS
 ETAGS = etags
 CTAGS = ctags
-DIST_SUBDIRS = math mathfp common complex machine
+DIST_SUBDIRS = math mathfp common complex fenv machine
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AR = @AR@
@@ -299,10 +299,10 @@ top_srcdir = @top_srcdir@
 AUTOMAKE_OPTIONS = cygnus
 @NEWLIB_HW_FP_FALSE@MATHDIR = math
 @NEWLIB_HW_FP_TRUE@MATHDIR = mathfp
-SUBDIRS = $(MATHDIR) common complex machine 
+SUBDIRS = $(MATHDIR) common complex fenv machine 
 libm_la_LDFLAGS = -Xcompiler -nostdlib
-@USE_LIBTOOL_FALSE@SUBLIBS = $(MATHDIR)/lib.$(aext) common/lib.$(aext) complex/lib.$(aext) $(LIBM_MACHINE_LIB)
-@USE_LIBTOOL_TRUE@SUBLIBS = $(MATHDIR)/lib$(MATHDIR).$(aext) common/libcommon.$(aext) complex/libcomplex.$(aext)  $(LIBM_MACHINE_LIB)
+@USE_LIBTOOL_FALSE@SUBLIBS = $(MATHDIR)/lib.$(aext) common/lib.$(aext) complex/lib.$(aext) fenv/lib.$(aext) $(LIBM_MACHINE_LIB)
+@USE_LIBTOOL_TRUE@SUBLIBS = $(MATHDIR)/lib$(MATHDIR).$(aext) common/libcommon.$(aext) complex/libcomplex.$(aext) fenv/libfenv.$(aext) $(LIBM_MACHINE_LIB)
 @USE_LIBTOOL_TRUE@noinst_LTLIBRARIES = libm.la
 @USE_LIBTOOL_TRUE@libm_la_SOURCES = 
 @USE_LIBTOOL_TRUE@libm_la_LIBADD = $(SUBLIBS)
diff --git a/newlib/libm/configure b/newlib/libm/configure
index e8a0a99..309a668 100755
--- a/newlib/libm/configure
+++ b/newlib/libm/configure
@@ -11868,7 +11868,7 @@ fi
 
 
 
-ac_config_files="$ac_config_files Makefile math/Makefile mathfp/Makefile common/Makefile complex/Makefile"
+ac_config_files="$ac_config_files Makefile math/Makefile mathfp/Makefile common/Makefile complex/Makefile fenv/Makefile"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -12930,6 +12930,7 @@ do
     "mathfp/Makefile") CONFIG_FILES="$CONFIG_FILES mathfp/Makefile" ;;
     "common/Makefile") CONFIG_FILES="$CONFIG_FILES common/Makefile" ;;
     "complex/Makefile") CONFIG_FILES="$CONFIG_FILES complex/Makefile" ;;
+    "fenv/Makefile") CONFIG_FILES="$CONFIG_FILES fenv/Makefile" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
diff --git a/newlib/libm/fenv/Makefile.in b/newlib/libm/fenv/Makefile.in
new file mode 100644
index 0000000..b9a2db9
--- /dev/null
+++ b/newlib/libm/fenv/Makefile.in
@@ -0,0 +1,628 @@
+# Makefile.in generated by automake 1.11.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+@USE_LIBTOOL_FALSE@am__append_1 = $(AM_CFLAGS)
+DIST_COMMON = $(srcdir)/../../Makefile.shared $(srcdir)/Makefile.in \
+	$(srcdir)/Makefile.am
+subdir = fenv
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \
+	$(top_srcdir)/../../ltoptions.m4 \
+	$(top_srcdir)/../../ltsugar.m4 \
+	$(top_srcdir)/../../ltversion.m4 \
+	$(top_srcdir)/../../lt~obsolete.m4 \
+	$(top_srcdir)/../acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+ARFLAGS = cru
+lib_a_AR = $(AR) $(ARFLAGS)
+lib_a_LIBADD =
+am__objects_1 = lib_a-feclearexcept.$(OBJEXT) \
+	lib_a-fe_dfl_env.$(OBJEXT) lib_a-fegetenv.$(OBJEXT) \
+	lib_a-fegetexceptflag.$(OBJEXT) lib_a-fegetround.$(OBJEXT) \
+	lib_a-feholdexcept.$(OBJEXT) lib_a-feraiseexcept.$(OBJEXT) \
+	lib_a-fesetenv.$(OBJEXT) lib_a-fesetexceptflag.$(OBJEXT) \
+	lib_a-fesetround.$(OBJEXT) lib_a-fetestexcept.$(OBJEXT) \
+	lib_a-feupdateenv.$(OBJEXT)
+@USE_LIBTOOL_FALSE@am_lib_a_OBJECTS = $(am__objects_1)
+lib_a_OBJECTS = $(am_lib_a_OBJECTS)
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libcommon_la_LIBADD =
+am__objects_2 = feclearexcept.lo fe_dfl_env.lo fegetenv.lo \
+	fegetexceptflag.lo fegetround.lo feholdexcept.lo \
+	feraiseexcept.lo fesetenv.lo fesetexceptflag.lo fesetround.lo \
+	fetestexcept.lo feupdateenv.lo
+@USE_LIBTOOL_TRUE@am_libcommon_la_OBJECTS = $(am__objects_2)
+libcommon_la_OBJECTS = $(am_libcommon_la_OBJECTS)
+libcommon_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(libcommon_la_LDFLAGS) $(LDFLAGS) -o $@
+@USE_LIBTOOL_TRUE@am_libcommon_la_rpath =
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp =
+am__depfiles_maybe =
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(lib_a_SOURCES) $(libcommon_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+DATA = $(noinst_DATA)
+ETAGS = etags
+CTAGS = ctags
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCAS = @CCAS@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBM_MACHINE_LIB = @LIBM_MACHINE_LIB@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NEWLIB_CFLAGS = @NEWLIB_CFLAGS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NO_INCLUDE_LIST = @NO_INCLUDE_LIST@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+READELF = @READELF@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+aext = @aext@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+libm_machine_dir = @libm_machine_dir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lpfx = @lpfx@
+machine_dir = @machine_dir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+newlib_basedir = @newlib_basedir@
+oext = @oext@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+subdirs = @subdirs@
+sys_dir = @sys_dir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AUTOMAKE_OPTIONS = cygnus
+INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
+src = feclearexcept.c fe_dfl_env.c fegetenv.c fegetexceptflag.c \
+	fegetround.c feholdexcept.c feraiseexcept.c fesetenv.c \
+	fesetexceptflag.c fesetround.c fetestexcept.c feupdateenv.c
+
+libcommon_la_LDFLAGS = -Xcompiler -nostdlib
+lib_a_CFLAGS = -fbuiltin -fno-math-errno $(am__append_1)
+@USE_LIBTOOL_TRUE@noinst_LTLIBRARIES = libcommon.la
+@USE_LIBTOOL_TRUE@libcommon_la_SOURCES = $(src)
+@USE_LIBTOOL_FALSE@noinst_DATA = 
+@USE_LIBTOOL_TRUE@noinst_DATA = objectlist.awk.in
+@USE_LIBTOOL_FALSE@noinst_LIBRARIES = lib.a
+@USE_LIBTOOL_FALSE@lib_a_SOURCES = $(src)
+
+#
+# documentation rules
+#
+SUFFIXES = .def .xml
+CHEW = ${top_builddir}/../doc/makedoc -f $(top_srcdir)/../doc/doc.str
+DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py
+DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml)
+DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml)
+CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES)
+CHEWOUT_FILES = feclearexcept.def fe_dfl_env.def fegetenv.def \
+	fegetexceptflag.def fegetround.def feholdexcept.def \
+	feraiseexcept.def fesetenv.def fesetexceptflag.def fesetround.def \
+	fetestexcept.def feupdateenv.def
+
+CHAPTERS = 
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .def .xml .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus fenv/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --cygnus fenv/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+$(srcdir)/../../Makefile.shared:
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstLIBRARIES:
+	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) $(EXTRA_lib_a_DEPENDENCIES) 
+	-rm -f lib.a
+	$(lib_a_AR) lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD)
+	$(RANLIB) lib.a
+
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libcommon.la: $(libcommon_la_OBJECTS) $(libcommon_la_DEPENDENCIES) $(EXTRA_libcommon_la_DEPENDENCIES) 
+	$(libcommon_la_LINK) $(am_libcommon_la_rpath) $(libcommon_la_OBJECTS) $(libcommon_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+.c.o:
+	$(COMPILE) -c $<
+
+.c.obj:
+	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+	$(LTCOMPILE) -c -o $@ $<
+
+lib_a-feclearexcept.o: feclearexcept.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-feclearexcept.o `test -f 'feclearexcept.c' || echo '$(srcdir)/'`feclearexcept.c
+
+lib_a-feclearexcept.obj: feclearexcept.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-feclearexcept.obj `if test -f 'feclearexcept.c'; then $(CYGPATH_W) 'feclearexcept.c'; else $(CYGPATH_W) '$(srcdir)/feclearexcept.c'; fi`
+
+lib_a-fe_dfl_env.o: fe_dfl_env.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fe_dfl_env.o `test -f 'fe_dfl_env.c' || echo '$(srcdir)/'`fe_dfl_env.c
+
+lib_a-fe_dfl_env.obj: fe_dfl_env.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fe_dfl_env.obj `if test -f 'fe_dfl_env.c'; then $(CYGPATH_W) 'fe_dfl_env.c'; else $(CYGPATH_W) '$(srcdir)/fe_dfl_env.c'; fi`
+
+lib_a-fegetenv.o: fegetenv.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fegetenv.o `test -f 'fegetenv.c' || echo '$(srcdir)/'`fegetenv.c
+
+lib_a-fegetenv.obj: fegetenv.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fegetenv.obj `if test -f 'fegetenv.c'; then $(CYGPATH_W) 'fegetenv.c'; else $(CYGPATH_W) '$(srcdir)/fegetenv.c'; fi`
+
+lib_a-fegetexceptflag.o: fegetexceptflag.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fegetexceptflag.o `test -f 'fegetexceptflag.c' || echo '$(srcdir)/'`fegetexceptflag.c
+
+lib_a-fegetexceptflag.obj: fegetexceptflag.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fegetexceptflag.obj `if test -f 'fegetexceptflag.c'; then $(CYGPATH_W) 'fegetexceptflag.c'; else $(CYGPATH_W) '$(srcdir)/fegetexceptflag.c'; fi`
+
+lib_a-fegetround.o: fegetround.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fegetround.o `test -f 'fegetround.c' || echo '$(srcdir)/'`fegetround.c
+
+lib_a-fegetround.obj: fegetround.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fegetround.obj `if test -f 'fegetround.c'; then $(CYGPATH_W) 'fegetround.c'; else $(CYGPATH_W) '$(srcdir)/fegetround.c'; fi`
+
+lib_a-feholdexcept.o: feholdexcept.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-feholdexcept.o `test -f 'feholdexcept.c' || echo '$(srcdir)/'`feholdexcept.c
+
+lib_a-feholdexcept.obj: feholdexcept.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-feholdexcept.obj `if test -f 'feholdexcept.c'; then $(CYGPATH_W) 'feholdexcept.c'; else $(CYGPATH_W) '$(srcdir)/feholdexcept.c'; fi`
+
+lib_a-feraiseexcept.o: feraiseexcept.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-feraiseexcept.o `test -f 'feraiseexcept.c' || echo '$(srcdir)/'`feraiseexcept.c
+
+lib_a-feraiseexcept.obj: feraiseexcept.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-feraiseexcept.obj `if test -f 'feraiseexcept.c'; then $(CYGPATH_W) 'feraiseexcept.c'; else $(CYGPATH_W) '$(srcdir)/feraiseexcept.c'; fi`
+
+lib_a-fesetenv.o: fesetenv.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fesetenv.o `test -f 'fesetenv.c' || echo '$(srcdir)/'`fesetenv.c
+
+lib_a-fesetenv.obj: fesetenv.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fesetenv.obj `if test -f 'fesetenv.c'; then $(CYGPATH_W) 'fesetenv.c'; else $(CYGPATH_W) '$(srcdir)/fesetenv.c'; fi`
+
+lib_a-fesetexceptflag.o: fesetexceptflag.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fesetexceptflag.o `test -f 'fesetexceptflag.c' || echo '$(srcdir)/'`fesetexceptflag.c
+
+lib_a-fesetexceptflag.obj: fesetexceptflag.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fesetexceptflag.obj `if test -f 'fesetexceptflag.c'; then $(CYGPATH_W) 'fesetexceptflag.c'; else $(CYGPATH_W) '$(srcdir)/fesetexceptflag.c'; fi`
+
+lib_a-fesetround.o: fesetround.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fesetround.o `test -f 'fesetround.c' || echo '$(srcdir)/'`fesetround.c
+
+lib_a-fesetround.obj: fesetround.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fesetround.obj `if test -f 'fesetround.c'; then $(CYGPATH_W) 'fesetround.c'; else $(CYGPATH_W) '$(srcdir)/fesetround.c'; fi`
+
+lib_a-fetestexcept.o: fetestexcept.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fetestexcept.o `test -f 'fetestexcept.c' || echo '$(srcdir)/'`fetestexcept.c
+
+lib_a-fetestexcept.obj: fetestexcept.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fetestexcept.obj `if test -f 'fetestexcept.c'; then $(CYGPATH_W) 'fetestexcept.c'; else $(CYGPATH_W) '$(srcdir)/fetestexcept.c'; fi`
+
+lib_a-feupdateenv.o: feupdateenv.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-feupdateenv.o `test -f 'feupdateenv.c' || echo '$(srcdir)/'`feupdateenv.c
+
+lib_a-feupdateenv.obj: feupdateenv.c
+	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-feupdateenv.obj `if test -f 'feupdateenv.c'; then $(CYGPATH_W) 'feupdateenv.c'; else $(CYGPATH_W) '$(srcdir)/feupdateenv.c'; fi`
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+check-am:
+check: check-am
+all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(DATA)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
+	clean-noinstLTLIBRARIES mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstLIBRARIES clean-noinstLTLIBRARIES \
+	ctags distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags dvi dvi-am html html-am info \
+	info-am install install-am install-data install-data-am \
+	install-dvi install-dvi-am install-exec install-exec-am \
+	install-html install-html-am install-info install-info-am \
+	install-man install-pdf install-pdf-am install-ps \
+	install-ps-am install-strip installcheck installcheck-am \
+	installdirs maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am
+
+objectlist.awk.in: $(noinst_LTLIBRARIES)
+	-rm -f objectlist.awk.in
+	for i in `ls *.lo` ; \
+	do \
+	  echo $$i `pwd`/$$i >> objectlist.awk.in ; \
+	done
+
+.c.def:
+	$(CHEW) < $< > $*.def || ( rm $*.def && false )
+	@touch stmp-def
+
+TARGETDOC ?= ../tmp.texi
+
+doc: $(CHEWOUT_FILES)
+	for chapter in $(CHAPTERS) ; \
+	do \
+	  cat $(srcdir)/$$chapter >> $(TARGETDOC) ; \
+	done
+
+.c.xml:
+	$(DOCBOOK_CHEW) < $< > $*.xml || ( rm $*.xml && false )
+	@touch stmp-xml
+
+docbook: $(DOCBOOK_OUT_FILES)
+	for chapter in $(DOCBOOK_CHAPTERS) ; \
+	do \
+	  ${top_srcdir}/../doc/chapter-texi2docbook.py <$(srcdir)/$${chapter%.xml}.tex >../$$chapter ; \
+	done
+
+# A partial dependency list.
+
+$(lib_a_OBJECTS): $(srcdir)/../../libc/include/fenv.h
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v3 2/3] Add default implementation of fenv.h and all methods
  2019-08-06 19:13 [PATCH v3 0/3] fenv stubs and documentation series Joel Sherrill
@ 2019-08-06 19:13 ` Joel Sherrill
  2019-08-07  8:36   ` Corinna Vinschen
  2019-08-06 19:13 ` [PATCH v3 1/3] Miscellaneous Makefile.in regenerated Joel Sherrill
  2019-08-06 19:13 ` [PATCH v3 3/3] Regenerated files from fenv.h addition Joel Sherrill
  2 siblings, 1 reply; 9+ messages in thread
From: Joel Sherrill @ 2019-08-06 19:13 UTC (permalink / raw)
  To: newlib; +Cc: Joel Sherrill

	The default implementation of the fenv.h methods return
	-EOPNOTSUPP.

	The intention of the new fenv.h is that it be portable
	and that architectures provide their own implementation
	of sys/fenv.h.
---
 newlib/libc/include/fenv.h         |  42 ++++++++++++++
 newlib/libc/include/sys/fenv.h     | 115 +++++++++++++++++++++++++++++++++++++
 newlib/libm/Makefile.am            |  10 ++--
 newlib/libm/configure.in           |   2 +-
 newlib/libm/fenv/Makefile.am       |  36 ++++++++++++
 newlib/libm/fenv/fe_dfl_env.c      |  39 +++++++++++++
 newlib/libm/fenv/feclearexcept.c   |  67 +++++++++++++++++++++
 newlib/libm/fenv/fegetenv.c        |  67 +++++++++++++++++++++
 newlib/libm/fenv/fegetexceptflag.c |  70 ++++++++++++++++++++++
 newlib/libm/fenv/fegetround.c      |  67 +++++++++++++++++++++
 newlib/libm/fenv/feholdexcept.c    |  72 +++++++++++++++++++++++
 newlib/libm/fenv/feraiseexcept.c   |  69 ++++++++++++++++++++++
 newlib/libm/fenv/fesetenv.c        |  70 ++++++++++++++++++++++
 newlib/libm/fenv/fesetexceptflag.c |  74 ++++++++++++++++++++++++
 newlib/libm/fenv/fesetround.c      |  68 ++++++++++++++++++++++
 newlib/libm/fenv/fetestexcept.c    |  69 ++++++++++++++++++++++
 newlib/libm/fenv/feupdateenv.c     |  73 +++++++++++++++++++++++
 17 files changed, 1005 insertions(+), 5 deletions(-)
 create mode 100644 newlib/libc/include/fenv.h
 create mode 100644 newlib/libc/include/sys/fenv.h
 create mode 100644 newlib/libm/fenv/Makefile.am
 create mode 100644 newlib/libm/fenv/fe_dfl_env.c
 create mode 100644 newlib/libm/fenv/feclearexcept.c
 create mode 100644 newlib/libm/fenv/fegetenv.c
 create mode 100644 newlib/libm/fenv/fegetexceptflag.c
 create mode 100644 newlib/libm/fenv/fegetround.c
 create mode 100644 newlib/libm/fenv/feholdexcept.c
 create mode 100644 newlib/libm/fenv/feraiseexcept.c
 create mode 100644 newlib/libm/fenv/fesetenv.c
 create mode 100644 newlib/libm/fenv/fesetexceptflag.c
 create mode 100644 newlib/libm/fenv/fesetround.c
 create mode 100644 newlib/libm/fenv/fetestexcept.c
 create mode 100644 newlib/libm/fenv/feupdateenv.c

diff --git a/newlib/libc/include/fenv.h b/newlib/libc/include/fenv.h
new file mode 100644
index 0000000..4795cc9
--- /dev/null
+++ b/newlib/libc/include/fenv.h
@@ -0,0 +1,42 @@
+/* Copyright (c) 2017  SiFive Inc. All rights reserved.
+
+   This copyrighted material is made available to anyone wishing to use,
+   modify, copy, or redistribute it subject to the terms and conditions
+   of the FreeBSD License.   This program is distributed in the hope that
+   it will be useful, but WITHOUT ANY WARRANTY expressed or implied,
+   including the implied warranties of MERCHANTABILITY or FITNESS FOR
+   A PARTICULAR PURPOSE.  A copy of this license is available at
+   http://www.opensource.org/licenses.
+*/
+
+#ifndef _FENV_H
+#define _FENV_H
+
+#include <sys/fenv.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Exception */
+int feclearexcept(int excepts);
+int fegetexceptflag(fexcept_t *flagp, int excepts);
+int feraiseexcept(int excepts);
+int fesetexceptflag(const fexcept_t *flagp, int excepts);
+int fetestexcept(int excepts);
+
+/* Rounding mode */
+int fegetround(void);
+int fesetround(int rounding_mode);
+
+/* Float environment */
+int fegetenv(fenv_t *envp);
+int feholdexcept(fenv_t *envp);
+int fesetenv(const fenv_t *envp);
+int feupdateenv(const fenv_t *envp);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/newlib/libc/include/sys/fenv.h b/newlib/libc/include/sys/fenv.h
new file mode 100644
index 0000000..20f918d
--- /dev/null
+++ b/newlib/libc/include/sys/fenv.h
@@ -0,0 +1,115 @@
+/*
+  (c) Copyright 2019 Joel Sherrill <joel@rtems.org
+  (c) Copyright 2019 Craig Howlang <craig.howland@caci.com>
+  All rights reserved.
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the
+     documentation and/or other materials provided with the distribution.
+
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+  HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef _SYS_FENV_H_
+#define _SYS_FENV_H_
+
+#include <stddef.h>
+
+/*******************************************************************************
+ * THIS FILE IS A TEMPLATE, INTENDED TO BE USED AS A STARTING POINT FOR
+ * TARGET-SPECIFIC FLOATING-POINT IMPLEMENTATIONS.  NOTES BELOW HIGHLIGHT THE
+ * BASICS OF WHAT NEEDS TO BE DEFINED.  THE DEFAULT IMPLEMTATION IS
+ * DEGENERATE, WITH ALL FUNCTIONS RETURNING ERROR AND NO EXCEPTIONS AND NO
+ * ROUNDING MODES DEFINED (SINCE NONE ARE SUPPORTED).
+ * THE MACRO VALUES ARE EXAMPLES ONLY, ALTHOUGH TAKEN FROM A WORKING
+ * IMPLEMENTATION.
+ * REMOVE THIS NOTICE WHEN COPYING TO A REAL IMPLEMENTATION, REPLACING IT WITH
+ * ANY TARGET-SPECIFIC NOTES OF INTEREST.  THE FENV FUNCTION MAN PAGES POINT TO
+ * THIS FILE AS A MEANS OF DETERMINING A FUNCTIONAL VS. NON-FUNCTIONAL
+ * IMPLEMENTATION.
+ ******************************************************************************/
+/*
+ * The following macros are to be defined if the respective exception is
+ * supported by the implementation, each with a unique bit mask:
+ *
+ *	FE_DIVBYZERO
+ *	FE_INEXACT
+ *	FE_INVALID
+ *	FE_OVERFLOW
+ *	FE_UNDERFLOW
+ *
+ * Other implementation-specific exceptions may be defined, and must start
+ * with FE_ followed by a capital letter.
+ *
+ * FE_ALL_EXCEPT must be defined as the logical OR of all exceptions.
+ */
+//#define FE_DIVBYZERO 0x00000001
+//#define FE_INEXACT   0x00000002
+//#define FE_INVALID   0x00000004
+//#define FE_OVERFLOW  0x00000008
+//#define FE_UNDERFLOW 0x00000010
+
+//#define FE_ALL_EXCEPT \
+          //(FE_DIVBYZERO|FE_INEXACT|FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW)
+#define FE_ALL_EXCEPT 0	/* NONE SUPPORTED IN PLACEHOLDER TEMPLATE */
+
+/*
+ * The following macros are to be defined if the respective rounding
+ * direction is supported by the implementation via the fegetround() and
+ * fesetround() functions, each with a unique positive value.
+ *
+ *	FE_DOWNWARD
+ *	FE_TONEAREST
+ *	FE_TOWARDZERO
+ *	FE_UPWARD
+ *
+ * Other implementation-specific rounding modes may be defined, and must start
+ * with FE_ followed by a capital letter.
+ */
+//#define FE_DOWNWARD   	1
+//#define FE_TONEAREST  	2
+//#define FE_TOWARDZERO 	3
+//#define FE_UPWARD     	4
+
+/*
+ * The following typedefs are required. See the C and POSIX standards for
+ * details:
+ *
+ *	fenv_t
+ *	fexcept_t
+ */
+typedef size_t fenv_t;
+typedef size_t fexcept_t;
+
+/*
+ * Lastly, a FE_DFL_ENV macro must be defined, representing a pointer
+ * to const fenv_t that contains the value of the default floating point
+ * environment.
+ *
+ * NOTE: The extern'ed variable fe_default_env_p is an implementation
+ *       detail of this stub.  FE_DFL_ENV must point to an instance of
+ *       fenv_t with the default fenv_t. The format of fenv_t and where
+ *       FE_DFL_ENV is are implementation specific.
+ */
+extern const fenv_t *fe_dfl_env_p;
+#define FE_DFL_ENV fe_dfl_env_p
+
+#endif /* _SYS_FENV_H_ */
+
diff --git a/newlib/libm/Makefile.am b/newlib/libm/Makefile.am
index 8bc2c2c..3f8beed 100644
--- a/newlib/libm/Makefile.am
+++ b/newlib/libm/Makefile.am
@@ -8,17 +8,17 @@ else
 MATHDIR = math
 endif
 
-SUBDIRS = $(MATHDIR) common complex machine 
+SUBDIRS = $(MATHDIR) common complex fenv machine 
 
 libm_la_LDFLAGS = -Xcompiler -nostdlib
 
 if USE_LIBTOOL
-SUBLIBS = $(MATHDIR)/lib$(MATHDIR).$(aext) common/libcommon.$(aext) complex/libcomplex.$(aext)  $(LIBM_MACHINE_LIB)
+SUBLIBS = $(MATHDIR)/lib$(MATHDIR).$(aext) common/libcommon.$(aext) complex/libcomplex.$(aext) fenv/libfenv.$(aext) $(LIBM_MACHINE_LIB)
 noinst_LTLIBRARIES = libm.la
 libm_la_SOURCES =
 libm_la_LIBADD = $(SUBLIBS)
 else
-SUBLIBS = $(MATHDIR)/lib.$(aext) common/lib.$(aext) complex/lib.$(aext) $(LIBM_MACHINE_LIB)
+SUBLIBS = $(MATHDIR)/lib.$(aext) common/lib.$(aext) complex/lib.$(aext) fenv/lib.$(aext) $(LIBM_MACHINE_LIB)
 noinst_LIBRARIES = libm.a
 libm.a: $(SUBLIBS)
 	rm -f $@
@@ -39,7 +39,7 @@ info_TEXINFOS = libm.texinfo
 
 libm_TEXINFOS = targetdep.tex
 
-libm.dvi: targetdep.tex math/stmp-def complex/stmp-def
+libm.dvi: targetdep.tex math/stmp-def complex/stmp-def fenv/stmp-def
 
 stmp-targetdep: force
 	rm -f tmp.texi
@@ -58,6 +58,8 @@ math/stmp-def: stmp-targetdep ; @true
 
 complex/stmp-def: stmp-targetdep ; @true
 
+fenv/stmp-def: stmp-targetdep ; @true
+
 docbook-recursive: force
 	for d in $(SUBDIRS); do \
 	  if test "$$d" != "."; then \
diff --git a/newlib/libm/configure.in b/newlib/libm/configure.in
index 9bd107c..aec22bd 100644
--- a/newlib/libm/configure.in
+++ b/newlib/libm/configure.in
@@ -62,5 +62,5 @@ fi
 
 AC_SUBST(LIBM_MACHINE_LIB)
 
-AC_CONFIG_FILES([Makefile math/Makefile mathfp/Makefile common/Makefile complex/Makefile])
+AC_CONFIG_FILES([Makefile math/Makefile mathfp/Makefile common/Makefile complex/Makefile fenv/Makefile])
 AC_OUTPUT
diff --git a/newlib/libm/fenv/Makefile.am b/newlib/libm/fenv/Makefile.am
new file mode 100644
index 0000000..fef5c36
--- /dev/null
+++ b/newlib/libm/fenv/Makefile.am
@@ -0,0 +1,36 @@
+## Process this file with automake to generate Makefile.in
+
+AUTOMAKE_OPTIONS = cygnus
+
+INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
+
+src =	feclearexcept.c fe_dfl_env.c fegetenv.c fegetexceptflag.c \
+	fegetround.c feholdexcept.c feraiseexcept.c fesetenv.c \
+	fesetexceptflag.c fesetround.c fetestexcept.c feupdateenv.c
+
+libcommon_la_LDFLAGS = -Xcompiler -nostdlib
+lib_a_CFLAGS = -fbuiltin -fno-math-errno
+
+if USE_LIBTOOL
+noinst_LTLIBRARIES = libcommon.la
+libcommon_la_SOURCES = $(src)
+noinst_DATA = objectlist.awk.in
+else
+noinst_LIBRARIES = lib.a
+lib_a_SOURCES = $(src)
+lib_a_CFLAGS += $(AM_CFLAGS)
+noinst_DATA =
+endif # USE_LIBTOOL
+
+include $(srcdir)/../../Makefile.shared
+
+CHEWOUT_FILES =	feclearexcept.def fe_dfl_env.def fegetenv.def \
+	fegetexceptflag.def fegetround.def feholdexcept.def \
+	feraiseexcept.def fesetenv.def fesetexceptflag.def fesetround.def \
+	fetestexcept.def feupdateenv.def
+
+CHAPTERS =
+
+# A partial dependency list.
+
+$(lib_a_OBJECTS): $(srcdir)/../../libc/include/fenv.h
diff --git a/newlib/libm/fenv/fe_dfl_env.c b/newlib/libm/fenv/fe_dfl_env.c
new file mode 100644
index 0000000..103908d
--- /dev/null
+++ b/newlib/libm/fenv/fe_dfl_env.c
@@ -0,0 +1,39 @@
+/*
+  (c) Copyright 2019 Joel Sherrill <joel@rtems.org
+  All rights reserved.
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the
+     documentation and/or other materials provided with the distribution.
+
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+  HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <fenv.h>
+
+/*
+ * This is a non-functional implementation that should be overridden
+ * by an architecture specific implementation in newlib/libm/machine/ARCH.
+ *
+ * The implmentation must defined FE_DFL_ENV to point to a default
+ * environment of type fenv_t.
+ */
+const fenv_t fe_dfl_env = { 0 };
+const fenv_t *fe_dfl_env_p = &fe_dfl_env;
diff --git a/newlib/libm/fenv/feclearexcept.c b/newlib/libm/fenv/feclearexcept.c
new file mode 100644
index 0000000..f6ca306
--- /dev/null
+++ b/newlib/libm/fenv/feclearexcept.c
@@ -0,0 +1,67 @@
+/*
+  (c) Copyright 2019 Joel Sherrill <joel@rtems.org
+  All rights reserved.
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the
+     documentation and/or other materials provided with the distribution.
+
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+  HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/*
+FUNCTION
+<<feclearexcept>>---clear floating-point exception
+
+INDEX
+	feclearexcept
+SYNOPSIS
+	#include <fenv.h>
+	int feclearexcept(int <[except]>);
+
+	Link with -lm.
+
+DESCRIPTION
+This method attempts to clear the floating-point exceptions specified
+in <[except]>.
+
+RETURNS
+If the <[except]> argument is zero or all requested exceptions were
+successfully cleared, this method returns zero. Otherwise, a non-zero
+value is returned.
+
+PORTABILITY
+ANSI C requires <<feclearexcept>>.
+
+Not all Newlib targets have a working implementation.  Refer to
+the file <<sys/fenv.h>> to see the status for your target.
+*/
+
+#include <fenv.h>
+#include <errno.h>
+
+/*
+ * This is a non-functional implementation that should be overridden
+ * by an architecture specific implementation in newlib/libm/machine/ARCH.
+ */
+int feclearexcept(int excepts)
+{
+  return -ENOTSUP;
+}
diff --git a/newlib/libm/fenv/fegetenv.c b/newlib/libm/fenv/fegetenv.c
new file mode 100644
index 0000000..489cca6
--- /dev/null
+++ b/newlib/libm/fenv/fegetenv.c
@@ -0,0 +1,67 @@
+/*
+  (c) Copyright 2019 Joel Sherrill <joel@rtems.org
+  All rights reserved.
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the
+     documentation and/or other materials provided with the distribution.
+
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+  HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <fenv.h>
+#include <errno.h>
+
+/*
+FUNCTION
+<<fegetenv>>---get current floating-point environment
+
+INDEX
+	fegetenv
+
+SYNOPSIS
+	#include <fenv.h>
+	int fegetenv(fenv_t *<[envp]>);
+
+	Link with -lm.
+
+DESCRIPTION
+This method attempts to return the floating-point environment
+in the area specified by <[envp]>.
+
+RETURNS
+If floating-point environment was successfully returned, then 
+this method returns zero. Otherwise, a non-zero value is returned.
+
+PORTABILITY
+ANSI C requires <<fegetenv>>.
+
+Not all Newlib targets have a working implementation.  Refer to
+the file <<sys/fenv.h>> to see the status for your target.
+*/
+
+/*
+ * This is a non-functional implementation that should be overridden
+ * by an architecture specific implementation in newlib/libm/machine/ARCH.
+ */
+int fegetenv(fenv_t *envp)
+{
+  return -ENOTSUP;
+}
diff --git a/newlib/libm/fenv/fegetexceptflag.c b/newlib/libm/fenv/fegetexceptflag.c
new file mode 100644
index 0000000..668f30f
--- /dev/null
+++ b/newlib/libm/fenv/fegetexceptflag.c
@@ -0,0 +1,70 @@
+/*
+  (c) Copyright 2019 Joel Sherrill <joel@rtems.org
+  All rights reserved.
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the
+     documentation and/or other materials provided with the distribution.
+
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+  HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <fenv.h>
+#include <errno.h>
+
+/*
+FUNCTION
+<<fegetexceptflag>>---get floating-point status flags
+
+INDEX
+	fegetexceptflag
+
+SYNOPSIS
+	#include <fenv.h>
+	int fegetexceptflag(fexcept_t *<[flagp]>, int <[excepts]>);
+
+	Link with -lm.
+
+DESCRIPTION
+This method attempts to store an implementation-defined representation
+of the states of the floating-point status flags specified by <[excepts]>
+in the memory pointed to by <[flagp>].
+
+RETURNS
+If the information was successfully returned, this method returns
+zero. Otherwise, a non-zero value is returned.
+
+PORTABILITY
+ANSI C requires <<fegetexceptflag>>.
+
+Not all Newlib targets have a working implementation.  Refer to
+the file <<sys/fenv.h>> to see the status for your target.
+*/
+
+/*
+/*
+ * This is a non-functional implementation that should be overridden
+ * by an architecture specific implementation in newlib/libm/machine/ARCH.
+ */
+int fegetexceptflag(fexcept_t *flagp, int excepts)
+{
+  return -ENOTSUP;
+}
+
diff --git a/newlib/libm/fenv/fegetround.c b/newlib/libm/fenv/fegetround.c
new file mode 100644
index 0000000..541dd6d
--- /dev/null
+++ b/newlib/libm/fenv/fegetround.c
@@ -0,0 +1,67 @@
+/*
+  (c) Copyright 2019 Joel Sherrill <joel@rtems.org
+  All rights reserved.
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the
+     documentation and/or other materials provided with the distribution.
+
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+  HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <fenv.h>
+#include <errno.h>
+
+/*
+FUNCTION
+<<fegetround>>---get current rounding direction
+
+INDEX
+	feclearexcept
+SYNOPSIS
+	#include <fenv.h>
+	int fegetround(void);
+
+	Link with -lm.
+
+DESCRIPTION
+This method returns the current rounding direction.
+
+RETURNS
+This method returns the rounding direction. If the current rounding
+direction cannot be determined, then a negative value is returned.
+
+PORTABILITY
+ANSI C requires <<fegetround>>.
+
+Not all Newlib targets have a working implementation.  Refer to
+the file <<sys/fenv.h>> to see the status for your target.
+*/
+
+/*
+/*
+ * This is a non-functional implementation that should be overridden
+ * by an architecture specific implementation in newlib/libm/machine/ARCH.
+ */
+int fegetround(void)
+{
+  return -ENOTSUP;
+}
+
diff --git a/newlib/libm/fenv/feholdexcept.c b/newlib/libm/fenv/feholdexcept.c
new file mode 100644
index 0000000..a673121
--- /dev/null
+++ b/newlib/libm/fenv/feholdexcept.c
@@ -0,0 +1,72 @@
+/*
+  (c) Copyright 2019 Joel Sherrill <joel@rtems.org
+  All rights reserved.
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the
+     documentation and/or other materials provided with the distribution.
+
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+  HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <fenv.h>
+#include <errno.h>
+
+/*
+FUNCTION
+<<feholdexcept>>---save current floating-point environment
+
+INDEX
+	feholdexcept
+
+SYNOPSIS
+	#include <fenv.h>
+	int feholdexcept(fenv_t *<[envp]>);
+
+	Link with -lm.
+
+DESCRIPTION
+This method attempts to save the current floating-point environment
+in the fenv_t instance pointed to by <[envp]>, clear the floating 
+point status flags, and then, if supported by the target architecture,
+install a "non-stop" (e.g. continue on floating point exceptions) mode
+for all floating-point exceptions.
+
+RETURNS
+This method will return zero if the non-stop floating-point exception
+handler was installed. Otherwise, a non-zero value is returned.
+
+PORTABILITY
+ANSI C requires <<feholdexcept>>.
+
+Not all Newlib targets have a working implementation.  Refer to
+the file <<sys/fenv.h>> to see the status for your target.
+*/
+
+/*
+/*
+ * This is a non-functional implementation that should be overridden
+ * by an architecture specific implementation in newlib/libm/machine/ARCH.
+ */
+int feholdexcept(fenv_t *envp)
+{
+  return -ENOTSUP;
+}
+
diff --git a/newlib/libm/fenv/feraiseexcept.c b/newlib/libm/fenv/feraiseexcept.c
new file mode 100644
index 0000000..8a372dd
--- /dev/null
+++ b/newlib/libm/fenv/feraiseexcept.c
@@ -0,0 +1,69 @@
+/*
+  (c) Copyright 2019 Joel Sherrill <joel@rtems.org
+  All rights reserved.
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the
+     documentation and/or other materials provided with the distribution.
+
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+  HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <fenv.h>
+#include <errno.h>
+
+/*
+FUNCTION
+<<feraiseexcept>>---raise floating-point exception
+
+INDEX
+	feraiseexcept
+SYNOPSIS
+	#include <fenv.h>
+	int feraiseexcept(int <[excepts]>);
+
+	Link with -lm.
+
+DESCRIPTION
+This method attempts to raise the floating-point exceptions specified
+in <[except]>.
+
+RETURNS
+If the <[excepts]> argument is zero or all requested exceptions were
+successfully raised, this method returns zero. Otherwise, a non-zero
+value is returned.
+
+PORTABILITY
+ANSI C requires <<feraiseexcept>>.
+
+Not all Newlib targets have a working implementation.  Refer to
+the file <<sys/fenv.h>> to see the status for your target.
+*/
+
+/*
+/*
+ * This is a non-functional implementation that should be overridden
+ * by an architecture specific implementation in newlib/libm/machine/ARCH.
+ */
+int feraiseexcept(int excepts)
+{
+  return -ENOTSUP;
+}
+
diff --git a/newlib/libm/fenv/fesetenv.c b/newlib/libm/fenv/fesetenv.c
new file mode 100644
index 0000000..a1e8cdc
--- /dev/null
+++ b/newlib/libm/fenv/fesetenv.c
@@ -0,0 +1,70 @@
+/*
+  (c) Copyright 2019 Joel Sherrill <joel@rtems.org
+  All rights reserved.
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the
+     documentation and/or other materials provided with the distribution.
+
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+  HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <fenv.h>
+#include <errno.h>
+
+/*
+FUNCTION
+<<fesetenv>>---set current floating-point environment
+
+INDEX
+	fesetenv
+
+SYNOPSIS
+	#include <fenv.h>
+	int fesetenv(const fenv_t *[<envp>]);
+
+	Link with -lm.
+
+DESCRIPTION
+This method attempts to establish the floating-point environment
+pointed to by <[envp]>. The argument [<envp>] must point to a
+floating-point environment obtained via <<fegetenv>> or <<feholdexcept>>
+or a floating-point environment macro such as <<FE_DFL_ENV>>.
+
+RETURNS
+If floating-point environment was successfully established, then 
+this method returns zero. Otherwise, a non-zero value is returned.
+
+PORTABILITY
+ANSI C requires <<fesetenv>>.
+
+Not all Newlib targets have a working implementation.  Refer to
+the file <<sys/fenv.h>> to see the status for your target.
+*/
+
+/*
+ * This is a non-functional implementation that should be overridden
+ * by an architecture specific implementation in newlib/libm/machine/ARCH.
+ */
+int fesetenv(const fenv_t *envp)
+{
+  return -ENOTSUP;
+}
+
diff --git a/newlib/libm/fenv/fesetexceptflag.c b/newlib/libm/fenv/fesetexceptflag.c
new file mode 100644
index 0000000..491d48f
--- /dev/null
+++ b/newlib/libm/fenv/fesetexceptflag.c
@@ -0,0 +1,74 @@
+/*
+  (c) Copyright 2019 Joel Sherrill <joel@rtems.org
+  All rights reserved.
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the
+     documentation and/or other materials provided with the distribution.
+
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+  HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <fenv.h>
+#include <errno.h>
+
+/*
+FUNCTION
+<<fesetexceptflag>>---set floating-point status flags
+
+INDEX
+	fesetexceptflag
+
+SYNOPSIS
+	#include <fenv.h>
+	int fesetexceptflag(const fexcept_t *<[flagp]>, int <[excepts]>);
+
+	Link with -lm.
+
+DESCRIPTION
+This method attempts to set the floating-point status flags specified
+by <[excepts]> to the states indicated by <[flagp>].  The argument
+[<flagp>] must point to an fexcept_t instance obtained via calling
+<<fegetexceptflag>> with at least the floating-point exceptions specified
+by the argument <[excepts]>.
+
+This method does not raise any floating-point exceptions. It only
+sets the state of the flags.
+
+RETURNS
+If the information was successfully returned, this method returns
+zero. Otherwise, a non-zero value is returned.
+
+PORTABILITY
+ANSI C requires <<fesetexceptflag>>.
+
+Not all Newlib targets have a working implementation.  Refer to
+the file <<sys/fenv.h>> to see the status for your target.
+*/
+
+/*
+ * This is a non-functional implementation that should be overridden
+ * by an architecture specific implementation in newlib/libm/machine/ARCH.
+ */
+int fesetexceptflag(const fexcept_t *flagp, int excepts)
+{
+  return -ENOTSUP;
+}
+
diff --git a/newlib/libm/fenv/fesetround.c b/newlib/libm/fenv/fesetround.c
new file mode 100644
index 0000000..d6ab163
--- /dev/null
+++ b/newlib/libm/fenv/fesetround.c
@@ -0,0 +1,68 @@
+/*
+  (c) Copyright 2019 Joel Sherrill <joel@rtems.org
+  All rights reserved.
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the
+     documentation and/or other materials provided with the distribution.
+
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+  HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <fenv.h>
+#include <errno.h>
+
+/*
+FUNCTION
+<<fesetround>>---set current rounding direction
+
+INDEX
+	fesetround
+SYNOPSIS
+	#include <fenv.h>
+	int fesetround(int <[round]>);
+
+	Link with -lm.
+
+DESCRIPTION
+This method attempts to set the current rounding direction represented
+by <[round]>.
+
+RETURNS
+If the rounding mode was successfully established, this method returns
+zero. Otherwise, a non-zero value is returned.
+
+PORTABILITY
+ANSI C requires <<fesetround>>.
+
+Not all Newlib targets have a working implementation.  Refer to
+the file <<sys/fenv.h>> to see the status for your target.
+*/
+
+/*
+/*
+ * This is a non-functional implementation that should be overridden
+ * by an architecture specific implementation in newlib/libm/machine/ARCH.
+ */
+int fesetround(int round)
+{
+  return -ENOTSUP;
+}
+
diff --git a/newlib/libm/fenv/fetestexcept.c b/newlib/libm/fenv/fetestexcept.c
new file mode 100644
index 0000000..3bc76fa
--- /dev/null
+++ b/newlib/libm/fenv/fetestexcept.c
@@ -0,0 +1,69 @@
+
+/*
+  (c) Copyright 2019 Joel Sherrill <joel@rtems.org
+  All rights reserved.
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the
+     documentation and/or other materials provided with the distribution.
+
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+  HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <fenv.h>
+#include <errno.h>
+
+/*
+FUNCTION
+<<fetestexcept>>---test floating-point exception flags
+
+INDEX
+	fetestexcept
+SYNOPSIS
+	#include <fenv.h>
+	int fetestexcept(int <[except]>);
+
+	Link with -lm.
+
+DESCRIPTION
+This method test the current floating-point exceptions to determine
+which of those specified in <[except]> are currently set.
+
+RETURNS
+This method returns the bitwise-inclusive OR of the floating point
+exception macros which correspond to the currently set floating point
+exceptions.
+
+PORTABILITY
+ANSI C requires <<fetestexcept>>.
+
+Not all Newlib targets have a working implementation.  Refer to
+the file <<sys/fenv.h>> to see the status for your target.
+*/
+
+/*
+/*
+ * This is a non-functional implementation that should be overridden
+ * by an architecture specific implementation in newlib/libm/machine/ARCH.
+ */
+int fetestexcept(int excepts)
+{
+  return -ENOTSUP;
+}
diff --git a/newlib/libm/fenv/feupdateenv.c b/newlib/libm/fenv/feupdateenv.c
new file mode 100644
index 0000000..a5cf872
--- /dev/null
+++ b/newlib/libm/fenv/feupdateenv.c
@@ -0,0 +1,73 @@
+/*
+  (c) Copyright 2019 Joel Sherrill <joel@rtems.org
+  All rights reserved.
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the
+     documentation and/or other materials provided with the distribution.
+
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+  HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <fenv.h>
+#include <errno.h>
+
+/*
+FUNCTION
+<<feupdateenv>>---update current floating-point environment
+
+INDEX
+	feupdateenv
+
+SYNOPSIS
+	#include <fenv.h>
+	int feupdateenv(const fenv_t *[<envp>]);
+
+	Link with -lm.
+
+DESCRIPTION
+This method attempts to save the currently raised floating point
+exceptions in its automatic storage, install the floating point
+environment specified by [<envp]>, and raise the saved floating
+point exceptions.
+
+The argument [<envp>] must point to a floating-point environment
+obtained via <<fegetenv>> or <<feholdexcept>>.
+
+RETURNS
+If all actions are completed successfully, then this method returns zero.
+Otherwise, a non-zero value is returned.
+
+PORTABILITY
+ANSI C requires <<feupdateenv>>.
+
+Not all Newlib targets have a working implementation.  Refer to
+the file <<sys/fenv.h>> to see the status for your target.
+*/
+
+/*
+ * This is a non-functional implementation that should be overridden
+ * by an architecture specific implementation in newlib/libm/machine/ARCH.
+ */
+int feupdateenv(const fenv_t *envp)
+{
+  return -ENOTSUP;
+}
+
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v3 0/3] fenv stubs and documentation series
@ 2019-08-06 19:13 Joel Sherrill
  2019-08-06 19:13 ` [PATCH v3 2/3] Add default implementation of fenv.h and all methods Joel Sherrill
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Joel Sherrill @ 2019-08-06 19:13 UTC (permalink / raw)
  To: newlib; +Cc: Joel Sherrill


0001 - Miscellaneous changes from regenerating that I can't explain.
       These are under libc.
0002 - Add fenv.h, template sys/fenv.h, and default non-functional
       implementations of fenv.h methods with documentation.
0003 - Regeenerated under libm from my changes.

Joel Sherrill (3):
  Miscellaneous Makefile.in regenerated
  Add default implementation of fenv.h and all methods
  Regenerated files from fenv.h addition

 newlib/libc/include/fenv.h              |  42 +++
 newlib/libc/include/sys/fenv.h          | 115 ++++++
 newlib/libc/machine/msp430/Makefile.in  |   1 -
 newlib/libc/machine/riscv/Makefile.in   |  21 +-
 newlib/libc/search/Makefile.in          |  50 +--
 newlib/libm/Makefile.am                 |  10 +-
 newlib/libm/Makefile.in                 |  12 +-
 newlib/libm/configure                   |   3 +-
 newlib/libm/configure.in                |   2 +-
 newlib/libm/fenv/Makefile.am            |  36 ++
 newlib/libm/fenv/Makefile.in            | 628 ++++++++++++++++++++++++++++++++
 newlib/libm/fenv/fe_dfl_env.c           |  39 ++
 newlib/libm/fenv/feclearexcept.c        |  67 ++++
 newlib/libm/fenv/fegetenv.c             |  67 ++++
 newlib/libm/fenv/fegetexceptflag.c      |  70 ++++
 newlib/libm/fenv/fegetround.c           |  67 ++++
 newlib/libm/fenv/feholdexcept.c         |  72 ++++
 newlib/libm/fenv/feraiseexcept.c        |  69 ++++
 newlib/libm/fenv/fesetenv.c             |  70 ++++
 newlib/libm/fenv/fesetexceptflag.c      |  74 ++++
 newlib/libm/fenv/fesetround.c           |  68 ++++
 newlib/libm/fenv/fetestexcept.c         |  69 ++++
 newlib/libm/fenv/feupdateenv.c          |  73 ++++
 newlib/libm/machine/aarch64/Makefile.in |   7 +-
 24 files changed, 1674 insertions(+), 58 deletions(-)
 create mode 100644 newlib/libc/include/fenv.h
 create mode 100644 newlib/libc/include/sys/fenv.h
 create mode 100644 newlib/libm/fenv/Makefile.am
 create mode 100644 newlib/libm/fenv/Makefile.in
 create mode 100644 newlib/libm/fenv/fe_dfl_env.c
 create mode 100644 newlib/libm/fenv/feclearexcept.c
 create mode 100644 newlib/libm/fenv/fegetenv.c
 create mode 100644 newlib/libm/fenv/fegetexceptflag.c
 create mode 100644 newlib/libm/fenv/fegetround.c
 create mode 100644 newlib/libm/fenv/feholdexcept.c
 create mode 100644 newlib/libm/fenv/feraiseexcept.c
 create mode 100644 newlib/libm/fenv/fesetenv.c
 create mode 100644 newlib/libm/fenv/fesetexceptflag.c
 create mode 100644 newlib/libm/fenv/fesetround.c
 create mode 100644 newlib/libm/fenv/fetestexcept.c
 create mode 100644 newlib/libm/fenv/feupdateenv.c

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v3 2/3] Add default implementation of fenv.h and all methods
  2019-08-06 19:13 ` [PATCH v3 2/3] Add default implementation of fenv.h and all methods Joel Sherrill
@ 2019-08-07  8:36   ` Corinna Vinschen
  2019-08-07 13:27     ` Howland, Craig D. - US via newlib
  0 siblings, 1 reply; 9+ messages in thread
From: Corinna Vinschen @ 2019-08-07  8:36 UTC (permalink / raw)
  To: Joel Sherrill; +Cc: newlib

[-- Attachment #1: Type: text/plain, Size: 1721 bytes --]

Hi Joel,

On Aug  6 14:13, Joel Sherrill wrote:
> [...]
> +//#define FE_DIVBYZERO 0x00000001
> +//#define FE_INEXACT   0x00000002
> +//#define FE_INVALID   0x00000004
> +//#define FE_OVERFLOW  0x00000008
> +//#define FE_UNDERFLOW 0x00000010
> +
> +//#define FE_ALL_EXCEPT \
> +          //(FE_DIVBYZERO|FE_INEXACT|FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW)
> +#define FE_ALL_EXCEPT 0	/* NONE SUPPORTED IN PLACEHOLDER TEMPLATE */
> +
> +/*
> + * The following macros are to be defined if the respective rounding
> + * direction is supported by the implementation via the fegetround() and
> + * fesetround() functions, each with a unique positive value.
> + *
> + *	FE_DOWNWARD
> + *	FE_TONEAREST
> + *	FE_TOWARDZERO
> + *	FE_UPWARD
> + *
> + * Other implementation-specific rounding modes may be defined, and must start
> + * with FE_ followed by a capital letter.
> + */
> +//#define FE_DOWNWARD   	1
> +//#define FE_TONEAREST  	2
> +//#define FE_TOWARDZERO 	3
> +//#define FE_UPWARD     	4
> +
> +/*
> + * The following typedefs are required. See the C and POSIX standards for
> + * details:
> + *
> + *	fenv_t
> + *	fexcept_t
> + */
> +typedef size_t fenv_t;
> +typedef size_t fexcept_t;

While these types are defined, the above macros are not.  Wouldn't
it make sense to define all or nothing by default?

Additionally, the default type here should better be one of the
predefined types like 'int' or 'unsigned int'.  The target has to
overwrite them anyway.  Using a derived type like size_t could puzzle
the developer into thinking there are minimum size requirements.

The rest looks ok to me.


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v3 2/3] Add default implementation of fenv.h and all methods
  2019-08-07  8:36   ` Corinna Vinschen
@ 2019-08-07 13:27     ` Howland, Craig D. - US via newlib
  2019-08-07 13:29       ` Joel Sherrill
  0 siblings, 1 reply; 9+ messages in thread
From: Howland, Craig D. - US via newlib @ 2019-08-07 13:27 UTC (permalink / raw)
  To: newlib


> From: newlib-owner@sourceware.org <newlib-owner@sourceware.org> on behalf of Corinna Vinschen <vinschen@redhat.com>
> Sent: Wednesday, August 7, 2019 4:36 AM
> To: Joel Sherrill
> Cc: newlib@sourceware.org
> Subject: Re: [PATCH v3 2/3] Add default implementation of fenv.h and all methods
>
> Hi Joel,
>
> On Aug  6 14:13, Joel Sherrill wrote:
> > [...]
> > +//#define FE_DIVBYZERO 0x00000001
> > +//#define FE_INEXACT   0x00000002
> > +//#define FE_INVALID   0x00000004
> > +//#define FE_OVERFLOW  0x00000008
> > +//#define FE_UNDERFLOW 0x00000010
> > +
> > +//#define FE_ALL_EXCEPT \
> > +          //(FE_DIVBYZERO|FE_INEXACT|FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW)
> > +#define FE_ALL_EXCEPT 0      /* NONE SUPPORTED IN PLACEHOLDER TEMPLATE */
> > +
> > +/*
> > + * The following macros are to be defined if the respective rounding
> > + * direction is supported by the implementation via the fegetround() and
> > + * fesetround() functions, each with a unique positive value.
> > + *
> > + *   FE_DOWNWARD
> > + *   FE_TONEAREST
> > + *   FE_TOWARDZERO
> > + *   FE_UPWARD
> > + *
> > + * Other implementation-specific rounding modes may be defined, and must start
> > + * with FE_ followed by a capital letter.
> > + */
> > +//#define FE_DOWNWARD        1
> > +//#define FE_TONEAREST       2
> > +//#define FE_TOWARDZERO      3
> > +//#define FE_UPWARD          4
> > +   
> > +/* 
> > + * The following typedefs are required. See the C and POSIX standards for
> > + * details:
> > + *
> > + *   fenv_t
> > + *   fexcept_t
> > + */
> > +typedef size_t fenv_t;     
> > +typedef size_t fexcept_t;
> 
> While these types are defined, the above macros are not.  Wouldn't
> it make sense to define all or nothing by default? 
> 
The standards require the types to be defined, but the individual macros
are to be defined only if supported by the implementation.  The
default implementation being provided supports nothing, only
returning error, so it is proper for them to not be defined.  But having
them there commented out to serve as a template seems to be a good thing.
>
>
> Thanks,
> Corinna
Craig    

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v3 2/3] Add default implementation of fenv.h and all methods
  2019-08-07 13:27     ` Howland, Craig D. - US via newlib
@ 2019-08-07 13:29       ` Joel Sherrill
  2019-08-08  0:01         ` Brian Inglis
  0 siblings, 1 reply; 9+ messages in thread
From: Joel Sherrill @ 2019-08-07 13:29 UTC (permalink / raw)
  To: Howland, Craig D. - US; +Cc: newlib

On Wed, Aug 7, 2019 at 8:27 AM Howland, Craig D. - US via newlib <
newlib@sourceware.org> wrote:

>
> > From: newlib-owner@sourceware.org <newlib-owner@sourceware.org> on
> behalf of Corinna Vinschen <vinschen@redhat.com>
> > Sent: Wednesday, August 7, 2019 4:36 AM
> > To: Joel Sherrill
> > Cc: newlib@sourceware.org
> > Subject: Re: [PATCH v3 2/3] Add default implementation of fenv.h and all
> methods
> >
> > Hi Joel,
> >
> > On Aug  6 14:13, Joel Sherrill wrote:
> > > [...]
> > > +//#define FE_DIVBYZERO 0x00000001
> > > +//#define FE_INEXACT   0x00000002
> > > +//#define FE_INVALID   0x00000004
> > > +//#define FE_OVERFLOW  0x00000008
> > > +//#define FE_UNDERFLOW 0x00000010
> > > +
> > > +//#define FE_ALL_EXCEPT \
> > > +
> //(FE_DIVBYZERO|FE_INEXACT|FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW)
> > > +#define FE_ALL_EXCEPT 0      /* NONE SUPPORTED IN PLACEHOLDER
> TEMPLATE */
> > > +
> > > +/*
> > > + * The following macros are to be defined if the respective rounding
> > > + * direction is supported by the implementation via the fegetround()
> and
> > > + * fesetround() functions, each with a unique positive value.
> > > + *
> > > + *   FE_DOWNWARD
> > > + *   FE_TONEAREST
> > > + *   FE_TOWARDZERO
> > > + *   FE_UPWARD
> > > + *
> > > + * Other implementation-specific rounding modes may be defined, and
> must start
> > > + * with FE_ followed by a capital letter.
> > > + */
> > > +//#define FE_DOWNWARD        1
> > > +//#define FE_TONEAREST       2
> > > +//#define FE_TOWARDZERO      3
> > > +//#define FE_UPWARD          4
> > > +
> > > +/*
> > > + * The following typedefs are required. See the C and POSIX standards
> for
> > > + * details:
> > > + *
> > > + *   fenv_t
> > > + *   fexcept_t
> > > + */
> > > +typedef size_t fenv_t;
> > > +typedef size_t fexcept_t;
> >
> > While these types are defined, the above macros are not.  Wouldn't
> > it make sense to define all or nothing by default?
> >
> The standards require the types to be defined, but the individual macros
> are to be defined only if supported by the implementation.  The
> default implementation being provided supports nothing, only
> returning error, so it is proper for them to not be defined.  But having
> them there commented out to serve as a template seems to be a good thing.
>

Quick reply. :)

This is the POSIX language:

"The *<fenv.h>* header shall define the following constants if and only if
the implementation supports the floating-point exception by means of the
floating-point functions *feclearexcept*()
<https://pubs.opengroup.org/onlinepubs/009695399/functions/feclearexcept.html>
, *fegetexceptflag*()
<https://pubs.opengroup.org/onlinepubs/009695399/functions/fegetexceptflag.html>
, *feraiseexcept*()
<https://pubs.opengroup.org/onlinepubs/009695399/functions/feraiseexcept.html>
, *fesetexceptflag*()
<https://pubs.opengroup.org/onlinepubs/009695399/functions/fesetexceptflag.html>,
and *fetestexcept*()
<https://pubs.opengroup.org/onlinepubs/009695399/functions/fetestexcept.html>.
Each expands to an integer constant expression with values such that
bitwise-inclusive ORs of all combinations of the constants result in
distinct values."

I don't mind changing size_t to int. That seems reasonable

--joel

>
> >
> > Thanks,
> > Corinna
> Craig

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v3 2/3] Add default implementation of fenv.h and all methods
  2019-08-07 13:29       ` Joel Sherrill
@ 2019-08-08  0:01         ` Brian Inglis
  2019-08-08  3:24           ` Howland, Craig D. - US via newlib
  0 siblings, 1 reply; 9+ messages in thread
From: Brian Inglis @ 2019-08-08  0:01 UTC (permalink / raw)
  To: newlib

On 2019-08-07 07:28, Joel Sherrill wrote:
> On Wed, Aug 7, 2019 at 8:27 AM Howland, Craig D. via newlib wrote:
>> On Wednesday, August 7, 2019 4:36 AM Corinna Vinschen wrote:
>>> On Aug  6 14:13, Joel Sherrill wrote:

Wouldn't it be clearer to conditionally define those constants based on some
obviously fictional symbol e.g.

#if FLOATING_POINT_EXCEPTIONS_SUPPORTED	// replace by implementation symbol
/*
 * The following macros are to be defined if the respective exception is
 * supported by the implementation, each with a unique bit mask:
 *
 *	FE_DIVBYZERO
 *	FE_INEXACT
 *	FE_INVALID
 *	FE_OVERFLOW
 *	FE_UNDERFLOW
 *
 * Other implementation-specific exceptions may be defined, and must start
 * with FE_ followed by a capital letter.
 *
 * FE_ALL_EXCEPT must be defined as the logical OR of all exceptions.
 */
#define FE_DIVBYZERO 0x00000001
#define FE_INEXACT   0x00000002
#define FE_INVALID   0x00000004
#define FE_OVERFLOW  0x00000008
#define FE_UNDERFLOW 0x00000010

#define FE_ALL_EXCEPT \
	(FE_DIVBYZERO|FE_INEXACT|FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW)

/*
 * The following macros are to be defined if the respective rounding direction
 * is supported by the implementation via the fegetround() and fesetround()
 * functions, each with a unique positive value.
 *
 *   FE_DOWNWARD
 *   FE_TONEAREST
 *   FE_TOWARDZERO
 *   FE_UPWARD
 *
 * Other implementation-specific rounding modes may be defined, and must start
 * with FE_ followed by a capital letter.
 */
#define FE_DOWNWARD        1
#define FE_TONEAREST       2
#define FE_TOWARDZERO      3
#define FE_UPWARD          4

#endif // FLOATING_POINT_EXCEPTIONS_SUPPORTED - replace by implementation symbol

#define FE_ALL_EXCEPT 0      /* NONE SUPPORTED IN PLACEHOLDER TEMPLATE */

>>>> +/*
>>>> + * The following typedefs are required. See the C and POSIX standards
>> for
>>>> + * details:
>>>> + *
>>>> + *   fenv_t
>>>> + *   fexcept_t
>>>> + */
>>>> +typedef size_t fenv_t;
>>>> +typedef size_t fexcept_t;

>>> While these types are defined, the above macros are not.  Wouldn't
>>> it make sense to define all or nothing by default?

>> The standards require the types to be defined, but the individual macros
>> are to be defined only if supported by the implementation.  The
>> default implementation being provided supports nothing, only
>> returning error, so it is proper for them to not be defined.  But having
>> them there commented out to serve as a template seems to be a good thing.

> Quick reply. :)
> This is the POSIX language:
> "The *<fenv.h>* header shall define the following constants if and only if
> the implementation supports the floating-point exception by means of the
> floating-point functions *feclearexcept*(), *fegetexceptflag*(),
> *feraiseexcept*(), *fesetexceptflag*() and *fetestexcept*().
> Each expands to an integer constant expression with values such that
> bitwise-inclusive ORs of all combinations of the constants result in
> distinct values."

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v3 2/3] Add default implementation of fenv.h and all methods
  2019-08-08  0:01         ` Brian Inglis
@ 2019-08-08  3:24           ` Howland, Craig D. - US via newlib
  0 siblings, 0 replies; 9+ messages in thread
From: Howland, Craig D. - US via newlib @ 2019-08-08  3:24 UTC (permalink / raw)
  To: newlib


> From: newlib-owner@sourceware.org <newlib-owner@sourceware.org> on behalf of Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
> Sent: Wednesday, August 7, 2019 8:00 PM
> To: newlib@sourceware.org
> Subject: Re: [PATCH v3 2/3] Add default implementation of fenv.h and all methods
>
> On 2019-08-07 07:28, Joel Sherrill wrote:
> > On Wed, Aug 7, 2019 at 8:27 AM Howland, Craig D. via newlib wrote:
> >> On Wednesday, August 7, 2019 4:36 AM Corinna Vinschen wrote:
> >>> On Aug  6 14:13, Joel Sherrill wrote:
>
> Wouldn't it be clearer to conditionally define those constants based on some
> obviously fictional symbol e.g.
>
> #if FLOATING_POINT_EXCEPTIONS_SUPPORTED // replace by implementation symbol
> /*
>  * The following macros are to be defined if the respective exception is
>  * supported by the implementation, each with a unique bit mask:
>  *
>  *      FE_DIVBYZERO
>  *      FE_INEXACT
>  *      FE_INVALID
>  *      FE_OVERFLOW
>  *      FE_UNDERFLOW
>  *
>  * Other implementation-specific exceptions may be defined, and must start
>  * with FE_ followed by a capital letter.
>  *
>  * FE_ALL_EXCEPT must be defined as the logical OR of all exceptions.
>  */
> #define FE_DIVBYZERO 0x00000001
> #define FE_INEXACT   0x00000002
> #define FE_INVALID   0x00000004
> #define FE_OVERFLOW  0x00000008
> #define FE_UNDERFLOW 0x00000010
>
> #define FE_ALL_EXCEPT \
>         (FE_DIVBYZERO|FE_INEXACT|FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW)
>
> /*
>  * The following macros are to be defined if the respective rounding direction
>  * is supported by the implementation via the fegetround() and fesetround()
>  * functions, each with a unique positive value.
>  *
>  *   FE_DOWNWARD
>  *   FE_TONEAREST
>  *   FE_TOWARDZERO
>  *   FE_UPWARD
>  *
>  * Other implementation-specific rounding modes may be defined, and must start
>  * with FE_ followed by a capital letter.
>  */
> #define FE_DOWNWARD        1
> #define FE_TONEAREST       2
> #define FE_TOWARDZERO      3
> #define FE_UPWARD          4
>
> #endif // FLOATING_POINT_EXCEPTIONS_SUPPORTED - replace by implementation symbol
>
> #define FE_ALL_EXCEPT 0      /* NONE SUPPORTED IN PLACEHOLDER TEMPLATE */
>
> >>>> +/*
> >>>> + * The following typedefs are required. See the C and POSIX standards
> >> for
> >>>> + * details:
> >>>> + *
> >>>> + *   fenv_t
> >>>> + *   fexcept_t
> >>>> + */
> >>>> +typedef size_t fenv_t;
> >>>> +typedef size_t fexcept_t;
>
> >>> While these types are defined, the above macros are not.  Wouldn't
> >>> it make sense to define all or nothing by default?
>
> >> The standards require the types to be defined, but the individual macros
> >> are to be defined only if supported by the implementation.  The
> >> default implementation being provided supports nothing, only
> >> returning error, so it is proper for them to not be defined.  But having
> >> them there commented out to serve as a template seems to be a good thing.
>
> > Quick reply. :)
> > This is the POSIX language:
> > "The *<fenv.h>* header shall define the following constants if and only if
> > the implementation supports the floating-point exception by means of the
> > floating-point functions *feclearexcept*(), *fegetexceptflag*(),
> > *feraiseexcept*(), *fesetexceptflag*() and *fetestexcept*().
> > Each expands to an integer constant expression with values such that
> > bitwise-inclusive ORs of all combinations of the constants result in
> > distinct values."
>
> --
> Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada
>
Each of the 5 shown exceptions and each of the 4 showns rounding methods are
individually optional, so implementations can define any or none of them.  So
someone making an implementation has to go and decide for each one, anyway--an
overall gate does not help there, and would be even one more thing that the
implementer needed to add at no apparent gain.  Notice also that for
exceptions, the standard-required FE_ALL_EXCEPT is basically the same as
FLOATING_POINT_EXCEPTIONS_SUPPORTED, except that it is created from the
individual defines--the reverse of a an overall exceptions gate.
(The standards are inconsistent in not providing a similar summary
for the rounding modes, although with the individual defines it is less a
requirement than a convenience.  And it is easily understood why they
did not, as the exception defines are required to be unique bits, while
the rounding defines only distinct values--ORing doesn't allow
individual identification of rounding mode defines.)

Additionally, the individual definitions are intended to be the gate in user
code, as they are only defined when supported.

#include <fenv.h>
...
#if FE_ALL_EXCEPT
  feclearexcept(FE_ALL_EXCEPT);
  #if DEBUG
    puts("Floating point exceptions exist");
  #endif
#endif
sin(arg);
#if defined(FE_INVALID)
  if(fetestexcept(FE_INVALID) == FE_INVALID)  printf("sin(%g) raised invalid exception", arg);
#endif

Notice also that there are two categories of things, so the single
FLOATING_POINT_EXCEPTIONS_SUPPORTED in the question is only half of it.
So even if there were to be an overall gate, there'd need to be two, one for
exceptions and one for rounding directions.

Craig

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-08-08  3:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-06 19:13 [PATCH v3 0/3] fenv stubs and documentation series Joel Sherrill
2019-08-06 19:13 ` [PATCH v3 2/3] Add default implementation of fenv.h and all methods Joel Sherrill
2019-08-07  8:36   ` Corinna Vinschen
2019-08-07 13:27     ` Howland, Craig D. - US via newlib
2019-08-07 13:29       ` Joel Sherrill
2019-08-08  0:01         ` Brian Inglis
2019-08-08  3:24           ` Howland, Craig D. - US via newlib
2019-08-06 19:13 ` [PATCH v3 1/3] Miscellaneous Makefile.in regenerated Joel Sherrill
2019-08-06 19:13 ` [PATCH v3 3/3] Regenerated files from fenv.h addition Joel Sherrill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).