<div dir="ltr">This looks ready to submit to newlib for review and incorporation.<div><br></div><div>Good work.</div><div><br><div>--joel</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 29, 2020 at 6:08 PM Eshan dhawan <<a href="mailto:eshandhawan51@gmail.com">eshandhawan51@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">PowerPc Fenv support<br>
<br>
Signed-off-by: Eshan dhawan <<a href="mailto:eshandhawan51@gmail.com" target="_blank">eshandhawan51@gmail.com</a>><br>
---<br>
newlib/configure.host | 1 +<br>
newlib/libc/machine/powerpc/machine/fenv-fp.h | 198 ++++++++++++++++++<br>
newlib/libc/machine/powerpc/sys/fenv.h | 132 ++++++++++++<br>
newlib/libm/machine/<a href="http://configure.in" rel="noreferrer" target="_blank">configure.in</a> | 1 +<br>
newlib/libm/machine/powerpc/Makefile.am | 20 ++<br>
newlib/libm/machine/powerpc/<a href="http://configure.in" rel="noreferrer" target="_blank">configure.in</a> | 11 +<br>
newlib/libm/machine/powerpc/feclearexcept.c | 7 +<br>
newlib/libm/machine/powerpc/fegetenv.c | 7 +<br>
newlib/libm/machine/powerpc/fegetexceptflag.c | 7 +<br>
newlib/libm/machine/powerpc/fegetround.c | 7 +<br>
newlib/libm/machine/powerpc/feholdexcept.c | 7 +<br>
newlib/libm/machine/powerpc/fenv.c | 51 +++++<br>
newlib/libm/machine/powerpc/feraiseexcept.c | 7 +<br>
newlib/libm/machine/powerpc/fesetenv.c | 7 +<br>
newlib/libm/machine/powerpc/fesetexceptflag.c | 7 +<br>
newlib/libm/machine/powerpc/fesetround.c | 7 +<br>
newlib/libm/machine/powerpc/fetestexcept.c | 7 +<br>
newlib/libm/machine/powerpc/feupdateenv.c | 7 +<br>
18 files changed, 491 insertions(+)<br>
create mode 100644 newlib/libc/machine/powerpc/machine/fenv-fp.h<br>
create mode 100644 newlib/libc/machine/powerpc/sys/fenv.h<br>
create mode 100644 newlib/libm/machine/powerpc/Makefile.am<br>
create mode 100644 newlib/libm/machine/powerpc/<a href="http://configure.in" rel="noreferrer" target="_blank">configure.in</a><br>
create mode 100644 newlib/libm/machine/powerpc/feclearexcept.c<br>
create mode 100644 newlib/libm/machine/powerpc/fegetenv.c<br>
create mode 100644 newlib/libm/machine/powerpc/fegetexceptflag.c<br>
create mode 100644 newlib/libm/machine/powerpc/fegetround.c<br>
create mode 100644 newlib/libm/machine/powerpc/feholdexcept.c<br>
create mode 100644 newlib/libm/machine/powerpc/fenv.c<br>
create mode 100644 newlib/libm/machine/powerpc/feraiseexcept.c<br>
create mode 100644 newlib/libm/machine/powerpc/fesetenv.c<br>
create mode 100644 newlib/libm/machine/powerpc/fesetexceptflag.c<br>
create mode 100644 newlib/libm/machine/powerpc/fesetround.c<br>
create mode 100644 newlib/libm/machine/powerpc/fetestexcept.c<br>
create mode 100644 newlib/libm/machine/powerpc/feupdateenv.c<br>
<br>
diff --git a/newlib/configure.host b/newlib/configure.host<br>
index a84c0c80a..9d2166f3d 100644<br>
--- a/newlib/configure.host<br>
+++ b/newlib/configure.host<br>
@@ -290,6 +290,7 @@ case "${host_cpu}" in<br>
;;<br>
powerpc*)<br>
machine_dir=powerpc<br>
+ libm_machine_dir=powerpc<br>
;;<br>
pru*)<br>
newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED"<br>
diff --git a/newlib/libc/machine/powerpc/machine/fenv-fp.h b/newlib/libc/machine/powerpc/machine/fenv-fp.h<br>
new file mode 100644<br>
index 000000000..7cf20218e<br>
--- /dev/null<br>
+++ b/newlib/libc/machine/powerpc/machine/fenv-fp.h<br>
@@ -0,0 +1,198 @@<br>
+/*-<br>
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD<br>
+ *<br>
+ * Copyright (c) 2004-2005 David Schultz <das@FreeBSD.ORG><br>
+ * All rights reserved.<br>
+ *<br>
+ * Redistribution and use in source and binary forms, with or without<br>
+ * modification, are permitted provided that the following conditions<br>
+ * are met:<br>
+ * 1. Redistributions of source code must retain the above copyright<br>
+ * notice, this list of conditions and the following disclaimer.<br>
+ * 2. Redistributions in binary form must reproduce the above copyright<br>
+ * notice, this list of conditions and the following disclaimer in the<br>
+ * documentation and/or other materials provided with the distribution.<br>
+ *<br>
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND<br>
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE<br>
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE<br>
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE<br>
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL<br>
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS<br>
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)<br>
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT<br>
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY<br>
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF<br>
+ * SUCH DAMAGE.<br>
+ *<br>
+ * $FreeBSD$<br>
+ */<br>
+<br>
+__fenv_static inline int<br>
+feclearexcept(int excepts)<br>
+{<br>
+ union __fpscr __r;<br>
+<br>
+ if (excepts & FE_INVALID)<br>
+ excepts |= FE_ALL_INVALID;<br>
+ __mffs(&__r);<br>
+ __r.__bits.__reg &= ~excepts;<br>
+ __mtfsf(__r);<br>
+ return (0);<br>
+}<br>
+<br>
+<br>
+__fenv_static inline int<br>
+fegetexceptflag(fexcept_t *flagp, int excepts)<br>
+{<br>
+ union __fpscr __r;<br>
+<br>
+ __mffs(&__r);<br>
+ *flagp = __r.__bits.__reg & excepts;<br>
+ return (0);<br>
+}<br>
+<br>
+__fenv_static inline int<br>
+fesetexceptflag(const fexcept_t *flagp, int excepts)<br>
+{<br>
+ union __fpscr __r;<br>
+<br>
+ if (excepts & FE_INVALID)<br>
+ excepts |= FE_ALL_EXCEPT;<br>
+ __mffs(&__r);<br>
+ __r.__bits.__reg &= ~excepts;<br>
+ __r.__bits.__reg |= *flagp & excepts;<br>
+ __mtfsf(__r);<br>
+ return (0);<br>
+}<br>
+<br>
+__fenv_static inline int<br>
+feraiseexcept(int excepts)<br>
+{<br>
+ union __fpscr __r;<br>
+<br>
+ if (excepts & FE_INVALID)<br>
+ excepts |= FE_VXSOFT;<br>
+ __mffs(&__r);<br>
+ __r.__bits.__reg |= excepts;<br>
+ __mtfsf(__r);<br>
+ return (0);<br>
+}<br>
+<br>
+__fenv_static inline int<br>
+fetestexcept(int excepts)<br>
+{<br>
+ union __fpscr __r;<br>
+<br>
+ __mffs(&__r);<br>
+ return (__r.__bits.__reg & excepts);<br>
+}<br>
+<br>
+__fenv_static inline int<br>
+fegetround(void)<br>
+{<br>
+ union __fpscr __r;<br>
+<br>
+ __mffs(&__r);<br>
+ return (__r.__bits.__reg & _ROUND_MASK);<br>
+}<br>
+<br>
+__fenv_static inline int<br>
+fesetround(int rounding_mode)<br>
+{<br>
+ union __fpscr __r;<br>
+<br>
+ if (rounding_mode & ~_ROUND_MASK)<br>
+ return (-1);<br>
+ __mffs(&__r);<br>
+ __r.__bits.__reg &= ~_ROUND_MASK;<br>
+ __r.__bits.__reg |= rounding_mode;<br>
+ __mtfsf(__r);<br>
+ return (0);<br>
+}<br>
+<br>
+__fenv_static inline int<br>
+fegetenv(fenv_t *envp)<br>
+{<br>
+ union __fpscr __r;<br>
+<br>
+ __mffs(&__r);<br>
+ *envp = __r.__bits.__reg;<br>
+ return (0);<br>
+}<br>
+<br>
+__fenv_static inline int<br>
+feholdexcept(fenv_t *envp)<br>
+{<br>
+ union __fpscr __r;<br>
+<br>
+ __mffs(&__r);<br>
+ *envp = __r.__bits.__reg;<br>
+ __r.__bits.__reg &= ~(FE_ALL_EXCEPT | _ENABLE_MASK);<br>
+ __mtfsf(__r);<br>
+ return (0);<br>
+}<br>
+<br>
+__fenv_static inline int<br>
+fesetenv(const fenv_t *envp)<br>
+{<br>
+ union __fpscr __r;<br>
+<br>
+ __r.__bits.__reg = *envp;<br>
+ __mtfsf(__r);<br>
+ return (0);<br>
+}<br>
+<br>
+__fenv_static inline int<br>
+feupdateenv(const fenv_t *envp)<br>
+{<br>
+ union __fpscr __r;<br>
+<br>
+ __mffs(&__r);<br>
+ __r.__bits.__reg &= FE_ALL_EXCEPT;<br>
+ __r.__bits.__reg |= *envp;<br>
+ __mtfsf(__r);<br>
+ return (0);<br>
+}<br>
+<br>
+#if __BSD_VISIBLE<br>
+<br>
+/* We currently provide no external definitions of the functions below. */<br>
+<br>
+static inline int<br>
+feenableexcept(int __mask)<br>
+{<br>
+ union __fpscr __r;<br>
+ fenv_t __oldmask;<br>
+<br>
+ __mffs(&__r);<br>
+ __oldmask = __r.__bits.__reg;<br>
+ __r.__bits.__reg |= (__mask & FE_ALL_EXCEPT) >> _FPUSW_SHIFT;<br>
+ __mtfsf(__r);<br>
+ return ((__oldmask & _ENABLE_MASK) << _FPUSW_SHIFT);<br>
+}<br>
+<br>
+static inline int<br>
+fedisableexcept(int __mask)<br>
+{<br>
+ union __fpscr __r;<br>
+ fenv_t __oldmask;<br>
+<br>
+ __mffs(&__r);<br>
+ __oldmask = __r.__bits.__reg;<br>
+ __r.__bits.__reg &= ~((__mask & FE_ALL_EXCEPT) >> _FPUSW_SHIFT);<br>
+ __mtfsf(__r);<br>
+ return ((__oldmask & _ENABLE_MASK) << _FPUSW_SHIFT);<br>
+}<br>
+<br>
+static inline int<br>
+fegetexcept(void)<br>
+{<br>
+ union __fpscr __r;<br>
+<br>
+ __mffs(&__r);<br>
+ return ((__r.__bits.__reg & _ENABLE_MASK) << _FPUSW_SHIFT);<br>
+}<br>
+<br>
+#endif /* __BSD_VISIBLE */<br>
+<br>
diff --git a/newlib/libc/machine/powerpc/sys/fenv.h b/newlib/libc/machine/powerpc/sys/fenv.h<br>
new file mode 100644<br>
index 000000000..39f12bf5e<br>
--- /dev/null<br>
+++ b/newlib/libc/machine/powerpc/sys/fenv.h<br>
@@ -0,0 +1,132 @@<br>
+/*-<br>
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD<br>
+ *<br>
+ * Copyright (c) 2004-2005 David Schultz <das@FreeBSD.ORG><br>
+ * All rights reserved.<br>
+ *<br>
+ * Redistribution and use in source and binary forms, with or without<br>
+ * modification, are permitted provided that the following conditions<br>
+ * are met:<br>
+ * 1. Redistributions of source code must retain the above copyright<br>
+ * notice, this list of conditions and the following disclaimer.<br>
+ * 2. Redistributions in binary form must reproduce the above copyright<br>
+ * notice, this list of conditions and the following disclaimer in the<br>
+ * documentation and/or other materials provided with the distribution.<br>
+ *<br>
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND<br>
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE<br>
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE<br>
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE<br>
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL<br>
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS<br>
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)<br>
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT<br>
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY<br>
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF<br>
+ * SUCH DAMAGE.<br>
+ *<br>
+ * $FreeBSD$<br>
+ */<br>
+<br>
+#ifndef _SYS_FENV_H_<br>
+#define _SYS_FENV_H_<br>
+<br>
+#include <sys/_types.h><br>
+#include <machine/endian.h><br>
+<br>
+#ifndef __fenv_static<br>
+#define __fenv_static static<br>
+#endif<br>
+<br>
+#ifdef __cplusplus<br>
+extern "C" {<br>
+#endif<br>
+<br>
+typedef int fenv_t;<br>
+typedef int fexcept_t;<br>
+<br>
+/* Exception flags */<br>
+#define FE_INEXACT 0x02000000<br>
+#define FE_DIVBYZERO 0x04000000<br>
+#define FE_UNDERFLOW 0x08000000<br>
+#define FE_OVERFLOW 0x10000000<br>
+#define FE_INVALID 0x20000000 /* all types of invalid FP ops */<br>
+<br>
+/*<br>
+ * The PowerPC architecture has extra invalid flags that indicate the<br>
+ * specific type of invalid operation occurred. These flags may be<br>
+ * tested, set, and cleared---but not masked---separately. All of<br>
+ * these bits are cleared when FE_INVALID is cleared, but only<br>
+ * FE_VXSOFT is set when FE_INVALID is explicitly set in software.<br>
+ */<br>
+#define FE_VXCVI 0x00000100 /* invalid integer convert */<br>
+#define FE_VXSQRT 0x00000200 /* square root of a negative */<br>
+#define FE_VXSOFT 0x00000400 /* software-requested exception */<br>
+#define FE_VXVC 0x00080000 /* ordered comparison involving NaN */<br>
+#define FE_VXIMZ 0x00100000 /* inf * 0 */<br>
+#define FE_VXZDZ 0x00200000 /* 0 / 0 */<br>
+#define FE_VXIDI 0x00400000 /* inf / inf */<br>
+#define FE_VXISI 0x00800000 /* inf - inf */<br>
+#define FE_VXSNAN 0x01000000 /* operation on a signalling NaN */<br>
+#define FE_ALL_INVALID (FE_VXCVI | FE_VXSQRT | FE_VXSOFT | FE_VXVC | \<br>
+ FE_VXIMZ | FE_VXZDZ | FE_VXIDI | FE_VXISI | \<br>
+ FE_VXSNAN | FE_INVALID)<br>
+#define FE_ALL_EXCEPT (FE_DIVBYZERO | FE_INEXACT | \<br>
+ FE_ALL_INVALID | FE_OVERFLOW | FE_UNDERFLOW)<br>
+<br>
+/* Rounding modes */<br>
+#define FE_TONEAREST 0x0000<br>
+#define FE_TOWARDZERO 0x0001<br>
+#define FE_UPWARD 0x0002<br>
+#define FE_DOWNWARD 0x0003<br>
+#define _ROUND_MASK (FE_TONEAREST | FE_DOWNWARD | \<br>
+ FE_UPWARD | FE_TOWARDZERO)<br>
+<br>
+<br>
+<br>
+/* Default floating-point environment */<br>
+extern const fenv_t *_fe_dfl_env;<br>
+#define FE_DFL_ENV (_fe_dfl_env)<br>
+<br>
+/* We need to be able to map status flag positions to mask flag positions */<br>
+#define _FPUSW_SHIFT 22<br>
+#define _ENABLE_MASK ((FE_DIVBYZERO | FE_INEXACT | FE_INVALID | \<br>
+ FE_OVERFLOW | FE_UNDERFLOW) >> _FPUSW_SHIFT)<br>
+<br>
+#ifndef _SOFT_FLOAT<br>
+#ifdef __SPE__<br>
+#define __mffs(__env) \<br>
+ __asm __volatile("mfspr %0, 512" : "=r" ((__env)->__bits.__reg))<br>
+#define __mtfsf(__env) \<br>
+ __asm __volatile("mtspr 512,%0;isync" :: "r" ((__env).__bits.__reg))<br>
+#else<br>
+#define __mffs(__env) \<br>
+ __asm __volatile("mffs %0" : "=f" ((__env)->__d))<br>
+#define __mtfsf(__env) \<br>
+ __asm __volatile("mtfsf 255,%0" :: "f" ((__env).__d))<br>
+#endif<br>
+#else<br>
+#define __mffs(__env)<br>
+#define __mtfsf(__env)<br>
+#endif<br>
+<br>
+union __fpscr {<br>
+ double __d;<br>
+ struct {<br>
+#if _BYTE_ORDER == _LITTLE_ENDIAN<br>
+ fenv_t __reg;<br>
+ __uint32_t __junk;<br>
+#else<br>
+ __uint32_t __junk;<br>
+ fenv_t __reg;<br>
+#endif<br>
+ } __bits;<br>
+};<br>
+<br>
+<br>
+#ifdef __cplusplus<br>
+}<br>
+#endif<br>
+<br>
+<br>
+#endif /* !_SYS_FENV_H_ */<br>
diff --git a/newlib/libm/machine/<a href="http://configure.in" rel="noreferrer" target="_blank">configure.in</a> b/newlib/libm/machine/<a href="http://configure.in" rel="noreferrer" target="_blank">configure.in</a><br>
index d4635214a..01d3d9f66 100644<br>
--- a/newlib/libm/machine/<a href="http://configure.in" rel="noreferrer" target="_blank">configure.in</a><br>
+++ b/newlib/libm/machine/<a href="http://configure.in" rel="noreferrer" target="_blank">configure.in</a><br>
@@ -33,6 +33,7 @@ if test -n "${libm_machine_dir}"; then<br>
spu) AC_CONFIG_SUBDIRS(spu) ;;<br>
riscv) AC_CONFIG_SUBDIRS(riscv) ;;<br>
x86_64) AC_CONFIG_SUBDIRS(x86_64) ;;<br>
+ powerpc) AC_CONFIG_SUBDIRS(powerpc) ;;<br>
esac;<br>
if test "${use_libtool}" = "yes"; then<br>
machlib=${libm_machine_dir}/lib${libm_machine_dir}.${aext}<br>
diff --git a/newlib/libm/machine/powerpc/Makefile.am b/newlib/libm/machine/powerpc/Makefile.am<br>
new file mode 100644<br>
index 000000000..3d8dd250a<br>
--- /dev/null<br>
+++ b/newlib/libm/machine/powerpc/Makefile.am<br>
@@ -0,0 +1,20 @@<br>
+## Process this file with automake to generate Makefile.in<br>
+<br>
+INCLUDES = -I $(newlib_basedir)/../newlib/libm/common $(NEWLIB_CFLAGS) \<br>
+ $(CROSS_CFLAGS) $(TARGET_CFLAGS)<br>
+<br>
+LIB_SOURCES = \<br>
+ feclearexcept.c fegetenv.c fegetexceptflag.c \<br>
+ fegetround.c feholdexcept.c fenv.c feraiseexcept.c fesetenv.c \<br>
+ fesetexceptflag.c fesetround.c fetestexcept.c feupdateenv.c<br>
+<br>
+noinst_LIBRARIES = lib.a<br>
+lib_a_SOURCES = $(LIB_SOURCES)<br>
+lib_a_CFLAGS = $(AM_CFLAGS)<br>
+lib_a_CCASFLAGS = $(AM_CCASFLAGS)<br>
+noinst_DATA =<br>
+<br>
+include $(srcdir)/../../../Makefile.shared<br>
+<br>
+ACLOCAL_AMFLAGS = -I ../../.. -I ../../../..<br>
+CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host<br>
diff --git a/newlib/libm/machine/powerpc/<a href="http://configure.in" rel="noreferrer" target="_blank">configure.in</a> b/newlib/libm/machine/powerpc/<a href="http://configure.in" rel="noreferrer" target="_blank">configure.in</a><br>
new file mode 100644<br>
index 000000000..7a22fa31c<br>
--- /dev/null<br>
+++ b/newlib/libm/machine/powerpc/<a href="http://configure.in" rel="noreferrer" target="_blank">configure.in</a><br>
@@ -0,0 +1,11 @@<br>
+<br>
+AC_PREREQ(2.59)<br>
+AC_INIT([newlib],[NEWLIB_VERSION])<br>
+AC_CONFIG_SRCDIR([Makefile.am])<br>
+<br>
+AC_CONFIG_AUX_DIR(../../../..)<br>
+<br>
+NEWLIB_CONFIGURE(../../..)<br>
+<br>
+AC_CONFIG_FILES([Makefile])<br>
+AC_OUTPUT<br>
diff --git a/newlib/libm/machine/powerpc/feclearexcept.c b/newlib/libm/machine/powerpc/feclearexcept.c<br>
new file mode 100644<br>
index 000000000..8cbee7771<br>
--- /dev/null<br>
+++ b/newlib/libm/machine/powerpc/feclearexcept.c<br>
@@ -0,0 +1,7 @@<br>
+/*<br>
+ * SPDX-License-Identifier: BSD-2-Clause<br>
+ *<br>
+ * (c) Copyright 2019 Joel Sherrill <<a href="mailto:joel@rtems.org" target="_blank">joel@rtems.org</a>><br>
+ */<br>
+<br>
+#include "../../fenv/fenv_stub.c"<br>
diff --git a/newlib/libm/machine/powerpc/fegetenv.c b/newlib/libm/machine/powerpc/fegetenv.c<br>
new file mode 100644<br>
index 000000000..8cbee7771<br>
--- /dev/null<br>
+++ b/newlib/libm/machine/powerpc/fegetenv.c<br>
@@ -0,0 +1,7 @@<br>
+/*<br>
+ * SPDX-License-Identifier: BSD-2-Clause<br>
+ *<br>
+ * (c) Copyright 2019 Joel Sherrill <<a href="mailto:joel@rtems.org" target="_blank">joel@rtems.org</a>><br>
+ */<br>
+<br>
+#include "../../fenv/fenv_stub.c"<br>
diff --git a/newlib/libm/machine/powerpc/fegetexceptflag.c b/newlib/libm/machine/powerpc/fegetexceptflag.c<br>
new file mode 100644<br>
index 000000000..8cbee7771<br>
--- /dev/null<br>
+++ b/newlib/libm/machine/powerpc/fegetexceptflag.c<br>
@@ -0,0 +1,7 @@<br>
+/*<br>
+ * SPDX-License-Identifier: BSD-2-Clause<br>
+ *<br>
+ * (c) Copyright 2019 Joel Sherrill <<a href="mailto:joel@rtems.org" target="_blank">joel@rtems.org</a>><br>
+ */<br>
+<br>
+#include "../../fenv/fenv_stub.c"<br>
diff --git a/newlib/libm/machine/powerpc/fegetround.c b/newlib/libm/machine/powerpc/fegetround.c<br>
new file mode 100644<br>
index 000000000..8cbee7771<br>
--- /dev/null<br>
+++ b/newlib/libm/machine/powerpc/fegetround.c<br>
@@ -0,0 +1,7 @@<br>
+/*<br>
+ * SPDX-License-Identifier: BSD-2-Clause<br>
+ *<br>
+ * (c) Copyright 2019 Joel Sherrill <<a href="mailto:joel@rtems.org" target="_blank">joel@rtems.org</a>><br>
+ */<br>
+<br>
+#include "../../fenv/fenv_stub.c"<br>
diff --git a/newlib/libm/machine/powerpc/feholdexcept.c b/newlib/libm/machine/powerpc/feholdexcept.c<br>
new file mode 100644<br>
index 000000000..8cbee7771<br>
--- /dev/null<br>
+++ b/newlib/libm/machine/powerpc/feholdexcept.c<br>
@@ -0,0 +1,7 @@<br>
+/*<br>
+ * SPDX-License-Identifier: BSD-2-Clause<br>
+ *<br>
+ * (c) Copyright 2019 Joel Sherrill <<a href="mailto:joel@rtems.org" target="_blank">joel@rtems.org</a>><br>
+ */<br>
+<br>
+#include "../../fenv/fenv_stub.c"<br>
diff --git a/newlib/libm/machine/powerpc/fenv.c b/newlib/libm/machine/powerpc/fenv.c<br>
new file mode 100644<br>
index 000000000..003727d05<br>
--- /dev/null<br>
+++ b/newlib/libm/machine/powerpc/fenv.c<br>
@@ -0,0 +1,51 @@<br>
+/*-<br>
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD<br>
+ *<br>
+ * Copyright (c) 2004 David Schultz <das@FreeBSD.ORG><br>
+ * All rights reserved.<br>
+ *<br>
+ * Redistribution and use in source and binary forms, with or without<br>
+ * modification, are permitted provided that the following conditions<br>
+ * are met:<br>
+ * 1. Redistributions of source code must retain the above copyright<br>
+ * notice, this list of conditions and the following disclaimer.<br>
+ * 2. Redistributions in binary form must reproduce the above copyright<br>
+ * notice, this list of conditions and the following disclaimer in the<br>
+ * documentation and/or other materials provided with the distribution.<br>
+ *<br>
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND<br>
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE<br>
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE<br>
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE<br>
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL<br>
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS<br>
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)<br>
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT<br>
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY<br>
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF<br>
+ * SUCH DAMAGE.<br>
+ *<br>
+ * $FreeBSD$<br>
+ */<br>
+<br>
+#define __fenv_static<br>
+#include <fenv.h><br>
+#include <machine/fenv-fp.h><br>
+<br>
+#ifdef __GNUC_GNU_INLINE__<br>
+#error "This file must be compiled with C99 'inline' semantics"<br>
+#endif<br>
+<br>
+<br>
+<br>
+extern inline int feclearexcept(int excepts);<br>
+extern inline int fegetexceptflag(fexcept_t *flagp, int excepts);<br>
+extern inline int fesetexceptflag(const fexcept_t *flagp, int excepts);<br>
+extern inline int feraiseexcept(int excepts);<br>
+extern inline int fetestexcept(int excepts);<br>
+extern inline int fegetround(void);<br>
+extern inline int fesetround(int rounding_mode);<br>
+extern inline int fegetenv(fenv_t *envp);<br>
+extern inline int feholdexcept(fenv_t *envp);<br>
+extern inline int fesetenv(const fenv_t *envp);<br>
+extern inline int feupdateenv(const fenv_t *envp);<br>
diff --git a/newlib/libm/machine/powerpc/feraiseexcept.c b/newlib/libm/machine/powerpc/feraiseexcept.c<br>
new file mode 100644<br>
index 000000000..8cbee7771<br>
--- /dev/null<br>
+++ b/newlib/libm/machine/powerpc/feraiseexcept.c<br>
@@ -0,0 +1,7 @@<br>
+/*<br>
+ * SPDX-License-Identifier: BSD-2-Clause<br>
+ *<br>
+ * (c) Copyright 2019 Joel Sherrill <<a href="mailto:joel@rtems.org" target="_blank">joel@rtems.org</a>><br>
+ */<br>
+<br>
+#include "../../fenv/fenv_stub.c"<br>
diff --git a/newlib/libm/machine/powerpc/fesetenv.c b/newlib/libm/machine/powerpc/fesetenv.c<br>
new file mode 100644<br>
index 000000000..8cbee7771<br>
--- /dev/null<br>
+++ b/newlib/libm/machine/powerpc/fesetenv.c<br>
@@ -0,0 +1,7 @@<br>
+/*<br>
+ * SPDX-License-Identifier: BSD-2-Clause<br>
+ *<br>
+ * (c) Copyright 2019 Joel Sherrill <<a href="mailto:joel@rtems.org" target="_blank">joel@rtems.org</a>><br>
+ */<br>
+<br>
+#include "../../fenv/fenv_stub.c"<br>
diff --git a/newlib/libm/machine/powerpc/fesetexceptflag.c b/newlib/libm/machine/powerpc/fesetexceptflag.c<br>
new file mode 100644<br>
index 000000000..8cbee7771<br>
--- /dev/null<br>
+++ b/newlib/libm/machine/powerpc/fesetexceptflag.c<br>
@@ -0,0 +1,7 @@<br>
+/*<br>
+ * SPDX-License-Identifier: BSD-2-Clause<br>
+ *<br>
+ * (c) Copyright 2019 Joel Sherrill <<a href="mailto:joel@rtems.org" target="_blank">joel@rtems.org</a>><br>
+ */<br>
+<br>
+#include "../../fenv/fenv_stub.c"<br>
diff --git a/newlib/libm/machine/powerpc/fesetround.c b/newlib/libm/machine/powerpc/fesetround.c<br>
new file mode 100644<br>
index 000000000..8cbee7771<br>
--- /dev/null<br>
+++ b/newlib/libm/machine/powerpc/fesetround.c<br>
@@ -0,0 +1,7 @@<br>
+/*<br>
+ * SPDX-License-Identifier: BSD-2-Clause<br>
+ *<br>
+ * (c) Copyright 2019 Joel Sherrill <<a href="mailto:joel@rtems.org" target="_blank">joel@rtems.org</a>><br>
+ */<br>
+<br>
+#include "../../fenv/fenv_stub.c"<br>
diff --git a/newlib/libm/machine/powerpc/fetestexcept.c b/newlib/libm/machine/powerpc/fetestexcept.c<br>
new file mode 100644<br>
index 000000000..8cbee7771<br>
--- /dev/null<br>
+++ b/newlib/libm/machine/powerpc/fetestexcept.c<br>
@@ -0,0 +1,7 @@<br>
+/*<br>
+ * SPDX-License-Identifier: BSD-2-Clause<br>
+ *<br>
+ * (c) Copyright 2019 Joel Sherrill <<a href="mailto:joel@rtems.org" target="_blank">joel@rtems.org</a>><br>
+ */<br>
+<br>
+#include "../../fenv/fenv_stub.c"<br>
diff --git a/newlib/libm/machine/powerpc/feupdateenv.c b/newlib/libm/machine/powerpc/feupdateenv.c<br>
new file mode 100644<br>
index 000000000..8cbee7771<br>
--- /dev/null<br>
+++ b/newlib/libm/machine/powerpc/feupdateenv.c<br>
@@ -0,0 +1,7 @@<br>
+/*<br>
+ * SPDX-License-Identifier: BSD-2-Clause<br>
+ *<br>
+ * (c) Copyright 2019 Joel Sherrill <<a href="mailto:joel@rtems.org" target="_blank">joel@rtems.org</a>><br>
+ */<br>
+<br>
+#include "../../fenv/fenv_stub.c"<br>
-- <br>
2.17.1<br>
<br>
</blockquote></div>