aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorPaul E. Murphy <murphyp@linux.vnet.ibm.com>2016-09-12 17:32:07 -0500
committerPaul E. Murphy <murphyp@linux.vnet.ibm.com>2016-09-20 14:37:42 -0500
commit2c46d1148650edf5d02051c3794227d52618db0c (patch)
tree1471eeb1a0b3100b2167f151db57a2b0140bc028 /sysdeps
parentfc7f4691d331acb206c9be2643fc2572eabac0e1 (diff)
downloadglibc-2c46d1148650edf5d02051c3794227d52618db0c.tar
glibc-2c46d1148650edf5d02051c3794227d52618db0c.tar.gz
glibc-2c46d1148650edf5d02051c3794227d52618db0c.tar.bz2
glibc-2c46d1148650edf5d02051c3794227d52618db0c.zip
Build s_nan* objects from a generic template
This requires adding a macro to synthesize the call to __strto*_nan. Since this is likely to be the only usage ever for strto* functions in generated libm calls, a dedicated macro is defined for it.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/math-type-macros-double.h1
-rw-r--r--sysdeps/generic/math-type-macros-float.h1
-rw-r--r--sysdeps/generic/math-type-macros-ldouble.h1
-rw-r--r--sysdeps/generic/math-type-macros.h3
-rw-r--r--sysdeps/ieee754/ldbl-opt/math-type-macros-double.h1
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_nan.c5
-rw-r--r--sysdeps/ieee754/ldbl-opt/s_nanl.c5
7 files changed, 7 insertions, 10 deletions
diff --git a/sysdeps/generic/math-type-macros-double.h b/sysdeps/generic/math-type-macros-double.h
index 284a6a48db..6d0f20635a 100644
--- a/sysdeps/generic/math-type-macros-double.h
+++ b/sysdeps/generic/math-type-macros-double.h
@@ -25,6 +25,7 @@
#define M_SUF(c) c
#define FLOAT double
#define CFLOAT _Complex double
+#define M_STRTO_NAN __strtod_nan
/* Machines without a distinct long double type
alias long double functions to their double
diff --git a/sysdeps/generic/math-type-macros-float.h b/sysdeps/generic/math-type-macros-float.h
index aab88fdfa5..33f51304a1 100644
--- a/sysdeps/generic/math-type-macros-float.h
+++ b/sysdeps/generic/math-type-macros-float.h
@@ -24,6 +24,7 @@
#define M_SUF(c) c ## f
#define FLOAT float
#define CFLOAT _Complex float
+#define M_STRTO_NAN __strtof_nan
/* Standard/GNU macro literals do not exist for the float type. Use
the double macro constants. */
diff --git a/sysdeps/generic/math-type-macros-ldouble.h b/sysdeps/generic/math-type-macros-ldouble.h
index 90773fa578..4f959da05f 100644
--- a/sysdeps/generic/math-type-macros-ldouble.h
+++ b/sysdeps/generic/math-type-macros-ldouble.h
@@ -25,6 +25,7 @@
#define M_SUF(c) c ## l
#define FLOAT long double
#define CFLOAT _Complex long double
+#define M_STRTO_NAN __strtold_nan
/* Supply the generic macros. */
#include <math-type-macros.h>
diff --git a/sysdeps/generic/math-type-macros.h b/sysdeps/generic/math-type-macros.h
index 78b883c877..c2488ec600 100644
--- a/sysdeps/generic/math-type-macros.h
+++ b/sysdeps/generic/math-type-macros.h
@@ -30,6 +30,9 @@
i.e expf expl exp.
FLOAT - Resolves to the C typename of M_TYPE.
CFLOAT - Resolves to the complex typename of M_TYPE.
+ M_STRTO_NAN - Resolves to the internal libc function which
+ converts a string into the appropriate FLOAT nan
+ value.
Optionally, these headers may inject a non-standard
definition for the following:
diff --git a/sysdeps/ieee754/ldbl-opt/math-type-macros-double.h b/sysdeps/ieee754/ldbl-opt/math-type-macros-double.h
index f627264c18..2569607283 100644
--- a/sysdeps/ieee754/ldbl-opt/math-type-macros-double.h
+++ b/sysdeps/ieee754/ldbl-opt/math-type-macros-double.h
@@ -47,6 +47,7 @@
#define LDOUBLE_fdiml_libm_version GLIBC_2_1
#define LDOUBLE_fmaxl_libm_version GLIBC_2_1
#define LDOUBLE_fminl_libm_version GLIBC_2_1
+#define LDOUBLE_nanl_libm_version GLIBC_2_1
/* Define compat symbols for long double on platforms
where it was not always a distinct type. */
diff --git a/sysdeps/ieee754/ldbl-opt/s_nan.c b/sysdeps/ieee754/ldbl-opt/s_nan.c
deleted file mode 100644
index 418aad2076..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_nan.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#include <math/s_nan.c>
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __nan, nanl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/ieee754/ldbl-opt/s_nanl.c b/sysdeps/ieee754/ldbl-opt/s_nanl.c
deleted file mode 100644
index 9496e0b5ce..0000000000
--- a/sysdeps/ieee754/ldbl-opt/s_nanl.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <math/s_nanl.c>
-long_double_symbol (libm, __nanl, nanl);