|
|
190885 |
From 9682778522977444546c061170912da902635a4e Mon Sep 17 00:00:00 2001
|
|
|
190885 |
From: Shen-Ta Hsieh <ibmibmibm.tw@gmail.com>
|
|
|
190885 |
Date: Mon, 24 May 2021 09:43:10 +0800
|
|
|
190885 |
Subject: [PATCH] math: redirect roundeven function
|
|
|
190885 |
|
|
|
190885 |
This patch redirect roundeven function for futhermore changes.
|
|
|
190885 |
|
|
|
190885 |
Signed-off-by: Shen-Ta Hsieh <ibmibmibm.tw@gmail.com>
|
|
|
190885 |
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
|
|
|
190885 |
(cherry picked from commit 447954a206837b5f153869cfeeeab44631c3fac9)
|
|
|
190885 |
---
|
|
|
190885 |
include/math.h | 3 ++-
|
|
|
190885 |
sysdeps/ieee754/dbl-64/s_roundeven.c | 4 +++-
|
|
|
190885 |
sysdeps/ieee754/float128/s_roundevenf128.c | 1 +
|
|
|
190885 |
sysdeps/ieee754/flt-32/s_roundevenf.c | 3 +++
|
|
|
190885 |
sysdeps/ieee754/ldbl-128/s_roundevenl.c | 1 +
|
|
|
190885 |
sysdeps/ieee754/ldbl-96/s_roundevenl.c | 1 +
|
|
|
190885 |
6 files changed, 11 insertions(+), 2 deletions(-)
|
|
|
190885 |
|
|
|
190885 |
diff --git a/include/math.h b/include/math.h
|
|
|
190885 |
index e21d34b8..1f9f9a54 100644
|
|
|
190885 |
--- a/include/math.h
|
|
|
190885 |
+++ b/include/math.h
|
|
|
190885 |
@@ -38,7 +38,6 @@ libm_hidden_proto (__issignaling)
|
|
|
190885 |
libm_hidden_proto (__issignalingf)
|
|
|
190885 |
libm_hidden_proto (__exp)
|
|
|
190885 |
libm_hidden_proto (__expf)
|
|
|
190885 |
-libm_hidden_proto (__roundeven)
|
|
|
190885 |
|
|
|
190885 |
# ifndef __NO_LONG_DOUBLE_MATH
|
|
|
190885 |
libm_hidden_proto (__fpclassifyl)
|
|
|
190885 |
@@ -56,6 +55,8 @@ libm_hidden_proto (__expm1f128)
|
|
|
190885 |
|
|
|
190885 |
# if !(defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0)
|
|
|
190885 |
# ifndef NO_MATH_REDIRECT
|
|
|
190885 |
+float (roundevenf) (float) asm ("__roundevenf");
|
|
|
190885 |
+double (roundeven) (double) asm ("__roundeven");
|
|
|
190885 |
/* Declare sqrt for use within GLIBC. Compilers typically inline sqrt as a
|
|
|
190885 |
single instruction. Use an asm to avoid use of PLTs if it doesn't. */
|
|
|
190885 |
float (sqrtf) (float) asm ("__ieee754_sqrtf");
|
|
|
190885 |
diff --git a/sysdeps/ieee754/dbl-64/s_roundeven.c b/sysdeps/ieee754/dbl-64/s_roundeven.c
|
|
|
190885 |
index 1438e81d..61962184 100644
|
|
|
190885 |
--- a/sysdeps/ieee754/dbl-64/s_roundeven.c
|
|
|
190885 |
+++ b/sysdeps/ieee754/dbl-64/s_roundeven.c
|
|
|
190885 |
@@ -17,6 +17,7 @@
|
|
|
190885 |
License along with the GNU C Library; if not, see
|
|
|
190885 |
<http://www.gnu.org/licenses/>. */
|
|
|
190885 |
|
|
|
190885 |
+#define NO_MATH_REDIRECT
|
|
|
190885 |
#include <math.h>
|
|
|
190885 |
#include <math_private.h>
|
|
|
190885 |
#include <libm-alias-double.h>
|
|
|
190885 |
@@ -101,5 +102,6 @@ __roundeven (double x)
|
|
|
190885 |
INSERT_WORDS (x, hx, lx);
|
|
|
190885 |
return x;
|
|
|
190885 |
}
|
|
|
190885 |
-hidden_def (__roundeven)
|
|
|
190885 |
+#ifndef __roundeven
|
|
|
190885 |
libm_alias_double (__roundeven, roundeven)
|
|
|
190885 |
+#endif
|
|
|
190885 |
diff --git a/sysdeps/ieee754/float128/s_roundevenf128.c b/sysdeps/ieee754/float128/s_roundevenf128.c
|
|
|
190885 |
index 5a9b3f39..e0faf727 100644
|
|
|
190885 |
--- a/sysdeps/ieee754/float128/s_roundevenf128.c
|
|
|
190885 |
+++ b/sysdeps/ieee754/float128/s_roundevenf128.c
|
|
|
190885 |
@@ -1,2 +1,3 @@
|
|
|
190885 |
+#define NO_MATH_REDIRECT
|
|
|
190885 |
#include <float128_private.h>
|
|
|
190885 |
#include "../ldbl-128/s_roundevenl.c"
|
|
|
190885 |
diff --git a/sysdeps/ieee754/flt-32/s_roundevenf.c b/sysdeps/ieee754/flt-32/s_roundevenf.c
|
|
|
190885 |
index 90f991d5..a661875e 100644
|
|
|
190885 |
--- a/sysdeps/ieee754/flt-32/s_roundevenf.c
|
|
|
190885 |
+++ b/sysdeps/ieee754/flt-32/s_roundevenf.c
|
|
|
190885 |
@@ -17,6 +17,7 @@
|
|
|
190885 |
License along with the GNU C Library; if not, see
|
|
|
190885 |
<http://www.gnu.org/licenses/>. */
|
|
|
190885 |
|
|
|
190885 |
+#define NO_MATH_REDIRECT
|
|
|
190885 |
#include <math.h>
|
|
|
190885 |
#include <math_private.h>
|
|
|
190885 |
#include <libm-alias-float.h>
|
|
|
190885 |
@@ -67,4 +68,6 @@ __roundevenf (float x)
|
|
|
190885 |
SET_FLOAT_WORD (x, ix);
|
|
|
190885 |
return x;
|
|
|
190885 |
}
|
|
|
190885 |
+#ifndef __roundevenf
|
|
|
190885 |
libm_alias_float (__roundeven, roundeven)
|
|
|
190885 |
+#endif
|
|
|
190885 |
diff --git a/sysdeps/ieee754/ldbl-128/s_roundevenl.c b/sysdeps/ieee754/ldbl-128/s_roundevenl.c
|
|
|
190885 |
index 5fc59af4..b9375b6c 100644
|
|
|
190885 |
--- a/sysdeps/ieee754/ldbl-128/s_roundevenl.c
|
|
|
190885 |
+++ b/sysdeps/ieee754/ldbl-128/s_roundevenl.c
|
|
|
190885 |
@@ -17,6 +17,7 @@
|
|
|
190885 |
License along with the GNU C Library; if not, see
|
|
|
190885 |
<http://www.gnu.org/licenses/>. */
|
|
|
190885 |
|
|
|
190885 |
+#define NO_MATH_REDIRECT
|
|
|
190885 |
#include <math.h>
|
|
|
190885 |
#include <math_private.h>
|
|
|
190885 |
#include <libm-alias-ldouble.h>
|
|
|
190885 |
diff --git a/sysdeps/ieee754/ldbl-96/s_roundevenl.c b/sysdeps/ieee754/ldbl-96/s_roundevenl.c
|
|
|
190885 |
index be2e4fa4..65031ab7 100644
|
|
|
190885 |
--- a/sysdeps/ieee754/ldbl-96/s_roundevenl.c
|
|
|
190885 |
+++ b/sysdeps/ieee754/ldbl-96/s_roundevenl.c
|
|
|
190885 |
@@ -17,6 +17,7 @@
|
|
|
190885 |
License along with the GNU C Library; if not, see
|
|
|
190885 |
<http://www.gnu.org/licenses/>. */
|
|
|
190885 |
|
|
|
190885 |
+#define NO_MATH_REDIRECT
|
|
|
190885 |
#include <math.h>
|
|
|
190885 |
#include <math_private.h>
|
|
|
190885 |
#include <libm-alias-ldouble.h>
|
|
|
190885 |
--
|
|
|
190885 |
GitLab
|
|
|
190885 |
|