about summary refs log tree commit diff
path: root/sysdeps/powerpc
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/powerpc')
-rw-r--r--sysdeps/powerpc/bits/fenvinline.h13
-rw-r--r--sysdeps/powerpc/fpu/fenv_libc.h9
-rw-r--r--sysdeps/powerpc/nofpu/fenv_libc.h31
-rw-r--r--sysdeps/powerpc/powerpc32/e500/nofpu/fenv_libc.h3
4 files changed, 8 insertions, 48 deletions
diff --git a/sysdeps/powerpc/bits/fenvinline.h b/sysdeps/powerpc/bits/fenvinline.h
index 00336f3b0d..e914928eaa 100644
--- a/sysdeps/powerpc/bits/fenvinline.h
+++ b/sysdeps/powerpc/bits/fenvinline.h
@@ -16,23 +16,24 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#if (defined __GNUC__ && !defined _SOFT_FLOAT && !defined __NO_FPRS__	\
-     && !defined __NO_MATH_INLINES)
+#if defined __GNUC__ && !defined _SOFT_FLOAT && !defined __NO_FPRS__
 
 /* Inline definition for fegetround.  */
-# define fegetround() \
+# define __fegetround() \
   (__extension__  ({ int __fegetround_result;				      \
 		     __asm__ __volatile__				      \
 		       ("mcrfs 7,7 ; mfcr %0"				      \
 			: "=r"(__fegetround_result) : : "cr7");		      \
 		     __fegetround_result & 3; }))
+# define fegetround() __fegetround ()
 
+# ifndef __NO_MATH_INLINES
 /* The weird 'i#*X' constraints on the following suppress a gcc
    warning when __excepts is not a constant.  Otherwise, they mean the
    same as just plain 'i'.  */
 
 /* Inline definition for feraiseexcept.  */
-# define feraiseexcept(__excepts) \
+#  define feraiseexcept(__excepts) \
   ((__builtin_constant_p (__excepts)					      \
     && ((__excepts) & ((__excepts)-1)) == 0				      \
     && (__excepts) != FE_INVALID)					      \
@@ -45,7 +46,7 @@
    : (feraiseexcept) (__excepts))
 
 /* Inline definition for feclearexcept.  */
-# define feclearexcept(__excepts) \
+#  define feclearexcept(__excepts) \
   ((__builtin_constant_p (__excepts)					      \
     && ((__excepts) & ((__excepts)-1)) == 0				      \
     && (__excepts) != FE_INVALID)					      \
@@ -57,4 +58,6 @@
       : 0)								      \
    : (feclearexcept) (__excepts))
 
+# endif /* !__NO_MATH_INLINES.  */
+
 #endif /* __GNUC__ && !_SOFT_FLOAT && !__NO_FPRS__ */
diff --git a/sysdeps/powerpc/fpu/fenv_libc.h b/sysdeps/powerpc/fpu/fenv_libc.h
index c1df5ce091..125745e04b 100644
--- a/sysdeps/powerpc/fpu/fenv_libc.h
+++ b/sysdeps/powerpc/fpu/fenv_libc.h
@@ -76,15 +76,6 @@ typedef union
 
 
 static inline int
-__fegetround (void)
-{
-  int result;
-  asm volatile ("mcrfs 7,7\n\t"
-		"mfcr  %0" : "=r"(result) : : "cr7");
-  return result & 3;
-}
-
-static inline int
 __fesetround (int round)
 {
   if ((unsigned int) round < 2)
diff --git a/sysdeps/powerpc/nofpu/fenv_libc.h b/sysdeps/powerpc/nofpu/fenv_libc.h
deleted file mode 100644
index dce1524e3f..0000000000
--- a/sysdeps/powerpc/nofpu/fenv_libc.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Internal libc stuff for floating point environment routines.
-   Copyright (C) 2007-2014 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library.  If not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _FENV_LIBC_H
-#define _FENV_LIBC_H	1
-
-/* fenv_libc.h is used in libm implementations of ldbl-128ibm.  So we
-   need this version in the soft-fp to at minimum include fenv.h to
-   get the fegetround definition.  */
-
-#include <fenv.h>
-
-/* ldbl-128ibm code uses __fegetround.  */
-#define __fegetround()	fegetround ()
-
-#endif /* fenv_libc.h */
diff --git a/sysdeps/powerpc/powerpc32/e500/nofpu/fenv_libc.h b/sysdeps/powerpc/powerpc32/e500/nofpu/fenv_libc.h
index d8225e7064..07eb675fe1 100644
--- a/sysdeps/powerpc/powerpc32/e500/nofpu/fenv_libc.h
+++ b/sysdeps/powerpc/powerpc32/e500/nofpu/fenv_libc.h
@@ -21,9 +21,6 @@
 
 #include <fenv.h>
 
-/* ldbl-128ibm code uses __fegetround.  */
-#define __fegetround()	fegetround ()
-
 int __feraiseexcept_spe (int);
 libm_hidden_proto (__feraiseexcept_spe)