about summary refs log tree commit diff
path: root/sysdeps/generic
diff options
context:
space:
mode:
authorGabriel F. T. Gomes <gftg@linux.vnet.ibm.com>2017-05-16 13:34:34 -0300
committerGabriel F. T. Gomes <gftg@linux.vnet.ibm.com>2017-05-17 14:44:08 -0300
commit7620dc123570e2c8080a4dcc51d220a9d92c8841 (patch)
treeb6494a7a8a234c5d74af6e40a12e770185bd1c2d /sysdeps/generic
parentad2f35cb396d24391150675fb55311c98d1e1592 (diff)
downloadglibc-7620dc123570e2c8080a4dcc51d220a9d92c8841.tar.gz
glibc-7620dc123570e2c8080a4dcc51d220a9d92c8841.tar.xz
glibc-7620dc123570e2c8080a4dcc51d220a9d92c8841.zip
Convert e_exp2l.c into a template
This patch converts the implementation of exp2l in math/e_exp2l.c into
a template in math/e_exp2_template.c, then adjusts Makefile to use
this template for long double (the implementations for float and
double in sysdeps have higher precedence and are not used).  This
template can also be used for float128, thus reducing the amount of
duplicated code that gets added when adding support the new type.

Tested for powerpc64le and s390x.

	* math/Makefile (libm-calls): Move e_exp2F to gen-libm-calls.
	(gen-libm-calls): Add e_exp2F to use the template.
	* math/e_exp2l.c: Rename to math/e_exp2_template.c.
	* math/e_exp2_template.c: New file, renamed from
	math/e_exp2l.c, and made into a template.
	* sysdeps/generic/math-type-macros.h (M_MIN_EXP): New macro.
Diffstat (limited to 'sysdeps/generic')
-rw-r--r--sysdeps/generic/math-type-macros.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sysdeps/generic/math-type-macros.h b/sysdeps/generic/math-type-macros.h
index 1b462b11ff..b4c2aee6aa 100644
--- a/sysdeps/generic/math-type-macros.h
+++ b/sysdeps/generic/math-type-macros.h
@@ -78,6 +78,7 @@
 #define __M_CONCATX(a,b) __M_CONCAT(a,b)
 
 #define M_NAN M_SUF (__builtin_nan) ("")
+#define M_MIN_EXP __M_CONCATX (M_PFX, _MIN_EXP)
 #define M_MAX_EXP __M_CONCATX (M_PFX, _MAX_EXP)
 #define M_MIN __M_CONCATX (M_PFX, _MIN)
 #define M_MAX __M_CONCATX (M_PFX, _MAX)