aboutsummaryrefslogtreecommitdiff
path: root/newlib/libm/math/Makefile.in
diff options
context:
space:
mode:
authorSzabolcs Nagy <szabolcs.nagy@arm.com>2017-05-25 16:41:38 +0100
committerCorinna Vinschen <corinna@vinschen.de>2017-10-13 10:58:00 +0200
commitc1560982710bed1065f9313d6548a8193030bcb9 (patch)
tree773ec88fc50fe227254ff4b456f22ced188dbbd0 /newlib/libm/math/Makefile.in
parentc165a27c0147471977377acd8918ab3b446f947a (diff)
downloadnewlib-c1560982710bed1065f9313d6548a8193030bcb9.zip
newlib-c1560982710bed1065f9313d6548a8193030bcb9.tar.gz
newlib-c1560982710bed1065f9313d6548a8193030bcb9.tar.bz2
New expf, exp2f, logf, log2f and powf implementations
Based on code from https://github.com/ARM-software/optimized-routines/ This patch adds a highly optimized generic implementation of expf, exp2f, logf, log2f and powf. The new functions are not only faster (6x for powf!), but are also smaller and more accurate. In order to achieve this, the algorithm uses double precision arithmetic for accuracy, avoids divisions and uses small table lookups to minimize the polynomials. Special cases are handled inline to avoid the unnecessary overhead of wrapper functions and set errno to POSIX requirements. The new functions are added under newlib/libm/common, but the old implementations are kept (in newlib/libm/math) for non-IEEE or pre-C99 systems. Targets can enable the new math code by defining __OBSOLETE_MATH_DEFAULT to 0 in newlib/libc/include/machine/ieeefp.h, users can override the default by defining __OBSOLETE_MATH. Currently the new code is enabled for AArch64 and AArch32 with VFP. Targets with a single precision FPU may still prefer the old implementation. libm.a size changes: arm: -1692 arm/thumb/v7-a/nofp: -878 arm/thumb/v7-a+fp/hard: -864 arm/thumb/v7-a+fp/softfp: -908 aarch64: -1476
Diffstat (limited to 'newlib/libm/math/Makefile.in')
-rw-r--r--newlib/libm/math/Makefile.in14
1 files changed, 11 insertions, 3 deletions
diff --git a/newlib/libm/math/Makefile.in b/newlib/libm/math/Makefile.in
index 8f76aad..1f5a694 100644
--- a/newlib/libm/math/Makefile.in
+++ b/newlib/libm/math/Makefile.in
@@ -137,7 +137,8 @@ am__objects_2 = lib_a-kf_rem_pio2.$(OBJEXT) lib_a-kf_cos.$(OBJEXT) \
lib_a-sf_frexp.$(OBJEXT) lib_a-sf_ldexp.$(OBJEXT) \
lib_a-sf_signif.$(OBJEXT) lib_a-sf_sin.$(OBJEXT) \
lib_a-sf_tan.$(OBJEXT) lib_a-sf_tanh.$(OBJEXT) \
- lib_a-wf_exp2.$(OBJEXT) lib_a-wf_tgamma.$(OBJEXT)
+ lib_a-wf_exp2.$(OBJEXT) lib_a-wf_tgamma.$(OBJEXT) \
+ lib_a-wf_log2.$(OBJEXT)
am__objects_3 = lib_a-el_hypot.$(OBJEXT)
@USE_LIBTOOL_FALSE@am_lib_a_OBJECTS = $(am__objects_1) \
@USE_LIBTOOL_FALSE@ $(am__objects_2) $(am__objects_3)
@@ -169,7 +170,7 @@ am__objects_5 = kf_rem_pio2.lo kf_cos.lo kf_sin.lo kf_tan.lo \
wf_sincos.lo wf_drem.lo sf_asinh.lo sf_atan.lo sf_ceil.lo \
sf_cos.lo sf_erf.lo sf_fabs.lo sf_floor.lo sf_frexp.lo \
sf_ldexp.lo sf_signif.lo sf_sin.lo sf_tan.lo sf_tanh.lo \
- wf_exp2.lo wf_tgamma.lo
+ wf_exp2.lo wf_tgamma.lo wf_log2.lo
am__objects_6 = el_hypot.lo
@USE_LIBTOOL_TRUE@am_libmath_la_OBJECTS = $(am__objects_4) \
@USE_LIBTOOL_TRUE@ $(am__objects_5) $(am__objects_6)
@@ -372,7 +373,8 @@ fsrc = kf_rem_pio2.c \
sf_frexp.c sf_ldexp.c \
sf_signif.c sf_sin.c \
sf_tan.c sf_tanh.c \
- wf_exp2.c wf_tgamma.c
+ wf_exp2.c wf_tgamma.c \
+ wf_log2.c
lsrc = el_hypot.c
libmath_la_LDFLAGS = -Xcompiler -nostdlib
@@ -1270,6 +1272,12 @@ lib_a-wf_tgamma.o: wf_tgamma.c
lib_a-wf_tgamma.obj: wf_tgamma.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wf_tgamma.obj `if test -f 'wf_tgamma.c'; then $(CYGPATH_W) 'wf_tgamma.c'; else $(CYGPATH_W) '$(srcdir)/wf_tgamma.c'; fi`
+lib_a-wf_log2.o: wf_log2.c
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wf_log2.o `test -f 'wf_log2.c' || echo '$(srcdir)/'`wf_log2.c
+
+lib_a-wf_log2.obj: wf_log2.c
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wf_log2.obj `if test -f 'wf_log2.c'; then $(CYGPATH_W) 'wf_log2.c'; else $(CYGPATH_W) '$(srcdir)/wf_log2.c'; fi`
+
lib_a-el_hypot.o: el_hypot.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-el_hypot.o `test -f 'el_hypot.c' || echo '$(srcdir)/'`el_hypot.c