@@ -17,6 +17,7 @@
<https://www.gnu.org/licenses/>. */
#include <math.h>
+#include <math_private.h>
int
M_DECL_FUNC (__canonicalize) (FLOAT *cx, const FLOAT *x)
@@ -18,6 +18,7 @@
<https://www.gnu.org/licenses/>. */
#include <math.h>
+#include <math_private.h>
FLOAT
M_DECL_FUNC (__fmax) (FLOAT x, FLOAT y)
@@ -17,6 +17,7 @@
<https://www.gnu.org/licenses/>. */
#include <math.h>
+#include <math_private.h>
FLOAT
M_DECL_FUNC (__fmaxmag) (FLOAT x, FLOAT y)
@@ -18,7 +18,7 @@
<https://www.gnu.org/licenses/>. */
#include <math.h>
-
+#include <math_private.h>
FLOAT
M_DECL_FUNC (__fmin) (FLOAT x, FLOAT y)
@@ -17,6 +17,7 @@
<https://www.gnu.org/licenses/>. */
#include <math.h>
+#include <math_private.h>
FLOAT
M_DECL_FUNC (__fminmag) (FLOAT x, FLOAT y)
@@ -20,24 +20,11 @@
#include <math_private.h>
#include <nan-high-order-bit.h>
+#undef __issignalingf
+
int
__issignalingf (float x)
{
- uint32_t xi;
- GET_FLOAT_WORD (xi, x);
-#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
- /* We only have to care about the high-order bit of x's significand, because
- having it set (sNaN) already makes the significand different from that
- used to designate infinity. */
- return (xi & 0x7fc00000) == 0x7fc00000;
-#else
- /* To keep the following comparison simple, toggle the quiet/signaling bit,
- so that it is set for sNaNs. This is inverse to IEEE 754-2008 (as well as
- common practice for IEEE 754-1985). */
- xi ^= 0x00400000;
- /* We have to compare for greater (instead of greater or equal), because x's
- significand being all-zero designates infinity not NaN. */
- return (xi & 0x7fffffff) > 0x7fc00000;
-#endif
+ return __issignalingf_inline (x);
}
libm_hidden_def (__issignalingf)
new file mode 100644
@@ -0,0 +1,47 @@
+/* Test for signaling NaN.
+ Copyright (C) 2013-2019 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
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _S_ISSIGNALING_INLINE_H
+#define _S_ISSIGNALING_INLINE_H
+
+#include <math.h>
+#include <math_private.h>
+#include <nan-high-order-bit.h>
+
+extern __always_inline int
+__issignalingf_inline (float x)
+{
+ uint32_t xi;
+ GET_FLOAT_WORD (xi, x);
+#if HIGH_ORDER_BIT_IS_SET_FOR_SNAN
+ /* We only have to care about the high-order bit of x's significand, because
+ having it set (sNaN) already makes the significand different from that
+ used to designate infinity. */
+ return (xi & 0x7fc00000) == 0x7fc00000;
+#else
+ /* To keep the following comparison simple, toggle the quiet/signaling bit,
+ so that it is set for sNaNs. This is inverse to IEEE 754-2008 (as well as
+ common practice for IEEE 754-1985). */
+ xi ^= 0x00400000;
+ /* We have to compare for greater (instead of greater or equal), because x's
+ significand being all-zero designates infinity not NaN. */
+ return (xi & 0x7fffffff) > 0x7fc00000;
+#endif
+}
+
+#endif
@@ -35,4 +35,7 @@ __ieee754_sqrtf128 (_Float128 __x)
}
#endif
+#define __issignalingf __issignalingf_inline
+#include <s_issignalingf_inline.h>
+
#endif /* _PPC_MATH_PRIVATE_H_ */
From: "Paul A. Clarke" <pc@us.ibm.com> issignalingf is a very small function used in some areas where better performance (and smaller code) might be helpful. Establish a means to inline issignalingf, and use that for powerpc. 2019-09-25 Paul A. Clarke <pc@us.ibm.com> * math/s_canonicalize_template.c: Include math_private.h * math/s_fmin_template.c: Likewise. * math/s_fmax_template.c: Likewise. * math/s_fmaxmag_template.c: Likewise. * math/s_fminmag_template.c: Likewise. * sysdeps/ieee754/flt-32/s_issignalingf.c: Move code body to __issignalingf_inline. Undefine __issignalingf. * sysdeps/ieee754/flt-32/s_issignalingf_inline.h: New. * sysdeps/powerpc/fpu/math_private.h: (__issignalingf): New. Include s_issignalingf_inline.h. --- math/s_canonicalize_template.c | 1 + math/s_fmax_template.c | 1 + math/s_fmaxmag_template.c | 1 + math/s_fmin_template.c | 2 +- math/s_fminmag_template.c | 1 + sysdeps/ieee754/flt-32/s_issignalingf.c | 19 ++--------- sysdeps/ieee754/flt-32/s_issignalingf_inline.h | 47 ++++++++++++++++++++++++++ sysdeps/powerpc/fpu/math_private.h | 3 ++ 8 files changed, 58 insertions(+), 17 deletions(-) create mode 100644 sysdeps/ieee754/flt-32/s_issignalingf_inline.h