summaryrefslogtreecommitdiff
path: root/sysdeps/powerpc/bits/fenvinline.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/powerpc/bits/fenvinline.h')
-rw-r--r--sysdeps/powerpc/bits/fenvinline.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/sysdeps/powerpc/bits/fenvinline.h b/sysdeps/powerpc/bits/fenvinline.h
index 4a7b2af6aa..41316386ba 100644
--- a/sysdeps/powerpc/bits/fenvinline.h
+++ b/sysdeps/powerpc/bits/fenvinline.h
@@ -1,5 +1,5 @@
/* Inline floating-point environment handling functions for powerpc.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 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
@@ -32,8 +32,10 @@
warning when __excepts is not a constant. Otherwise, they mean the
same as just plain 'i'. */
+# if __GNUC_PREREQ(3, 4)
+
/* Inline definition for feraiseexcept. */
-# define feraiseexcept(__excepts) \
+# define feraiseexcept(__excepts) \
(__extension__ ({ \
int __e = __excepts; \
int __ret; \
@@ -42,8 +44,8 @@
&& __e != FE_INVALID) \
{ \
if (__e != 0) \
- __asm__ __volatile__ ("mtfsb1 %s0" \
- : : "i#*X" (__builtin_ffs (__e))); \
+ __asm__ __volatile__ ("mtfsb1 %0" \
+ : : "i#*X" (__builtin_clz (__e))); \
__ret = 0; \
} \
else \
@@ -52,7 +54,7 @@
}))
/* Inline definition for feclearexcept. */
-# define feclearexcept(__excepts) \
+# define feclearexcept(__excepts) \
(__extension__ ({ \
int __e = __excepts; \
int __ret; \
@@ -61,8 +63,8 @@
&& __e != FE_INVALID) \
{ \
if (__e != 0) \
- __asm__ __volatile__ ("mtfsb0 %s0" \
- : : "i#*X" (__builtin_ffs (__e))); \
+ __asm__ __volatile__ ("mtfsb0 %0" \
+ : : "i#*X" (__builtin_clz (__e))); \
__ret = 0; \
} \
else \
@@ -70,6 +72,8 @@
__ret; \
}))
+# endif /* __GNUC_PREREQ(3, 4). */
+
# endif /* !__NO_MATH_INLINES. */
#endif /* __GNUC__ && !_SOFT_FLOAT && !__NO_FPRS__ */