diff options
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | sysdeps/ieee754/dbl-64/slowexp.c | 12 | ||||
-rw-r--r-- | sysdeps/powerpc/powerpc32/power4/fpu/Makefile | 1 | ||||
-rw-r--r-- | sysdeps/powerpc/powerpc32/power4/fpu/slowexp.c | 65 | ||||
-rw-r--r-- | sysdeps/powerpc/powerpc64/power4/fpu/Makefile | 1 | ||||
-rw-r--r-- | sysdeps/powerpc/powerpc64/power4/fpu/slowexp.c | 65 |
6 files changed, 21 insertions, 133 deletions
@@ -1,5 +1,15 @@ 2013-03-07 Siddhesh Poyarekar <siddhesh@redhat.com> + * sysdeps/ieee754/dbl-64/slowexp.c [!USE_LONG_DOUBLE_FOR_MP]: + Include mpa.h and declare __MPEXP. + [USE_LONG_DOUBLE_FOR_MP] (__slowexp): Call __IEEE754_EXPL. + * sysdeps/powerpc/powerpc32/power4/fpu/Makefile + (CPPFLAGS-slowexp.c): Define USE_LONG_DOUBLE_FOR_MP. + * sysdeps/powerpc/powerpc32/power4/fpu/slowexp.c: Remove. + * sysdeps/powerpc/powerpc64/power4/fpu/Makefile + (CPPFLAGS-slowexp.c): Define USE_LONG_DOUBLE_FOR_MP. + * sysdeps/powerpc/powerpc64/power4/fpu/slowexp.c: Remove. + * sysdeps/ieee754/dbl-64/slowpow.c [USE_LONG_DOUBLE_FOR_MP] (__slowpow): Use long double EXPL and LOGL functions to compute POW. diff --git a/sysdeps/ieee754/dbl-64/slowexp.c b/sysdeps/ieee754/dbl-64/slowexp.c index c423fc3..8f353f6 100644 --- a/sysdeps/ieee754/dbl-64/slowexp.c +++ b/sysdeps/ieee754/dbl-64/slowexp.c @@ -27,20 +27,23 @@ /*Converting from double precision to Multi-precision and calculating */ /* e^x */ /**************************************************************************/ -#include "mpa.h" #include <math_private.h> +#ifndef USE_LONG_DOUBLE_FOR_MP +# include "mpa.h" +void __mpexp (mp_no *x, mp_no *y, int p); +#endif + #ifndef SECTION # define SECTION #endif -void __mpexp (mp_no *x, mp_no *y, int p); - /*Converting from double precision to Multi-precision and calculating e^x */ double SECTION __slowexp (double x) { +#ifndef USE_LONG_DOUBLE_FOR_MP double w, z, res, eps = 3.0e-26; int p; mp_no mpx, mpy, mpz, mpw, mpeps, mpcor; @@ -66,4 +69,7 @@ __slowexp (double x) __mp_dbl (&mpy, &res, p); return res; } +#else + return (double) __ieee754_expl((long double)x); +#endif } diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/Makefile b/sysdeps/powerpc/powerpc32/power4/fpu/Makefile index ded9976..e17d32f 100644 --- a/sysdeps/powerpc/powerpc32/power4/fpu/Makefile +++ b/sysdeps/powerpc/powerpc32/power4/fpu/Makefile @@ -3,4 +3,5 @@ ifeq ($(subdir),math) CFLAGS-mpa.c += --param max-unroll-times=4 -funroll-loops -fpeel-loops CPPFLAGS-slowpow.c += -DUSE_LONG_DOUBLE_FOR_MP=1 +CPPFLAGS-slowexp.c += -DUSE_LONG_DOUBLE_FOR_MP=1 endif diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/slowexp.c b/sysdeps/powerpc/powerpc32/power4/fpu/slowexp.c deleted file mode 100644 index d93f505..0000000 --- a/sysdeps/powerpc/powerpc32/power4/fpu/slowexp.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * IBM Accurate Mathematical Library - * written by International Business Machines Corp. - * Copyright (C) 2001-2013 Free Software Foundation, Inc. - * - * This program 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. - * - * This program 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 this program; if not, see <http://www.gnu.org/licenses/>. - */ -/**************************************************************************/ -/* MODULE_NAME:slowexp.c */ -/* */ -/* FUNCTION:slowexp */ -/* */ -/* FILES NEEDED:mpa.h */ -/* mpa.c mpexp.c */ -/* */ -/*Converting from double precision to Multi-precision and calculating */ -/* e^x */ -/**************************************************************************/ -#include <math_private.h> - -#ifdef NO_LONG_DOUBLE -#include "mpa.h" -void __mpexp(mp_no *x, mp_no *y, int p); -#endif - -/*Converting from double precision to Multi-precision and calculating e^x */ -double __slowexp(double x) { -#ifdef NO_LONG_DOUBLE - double w,z,res,eps=3.0e-26; - int p; - mp_no mpx, mpy, mpz,mpw,mpeps,mpcor; - - p=6; - __dbl_mp(x,&mpx,p); /* Convert a double precision number x */ - /* into a multiple precision number mpx with prec. p. */ - __mpexp(&mpx, &mpy, p); /* Multi-Precision exponential function */ - __dbl_mp(eps,&mpeps,p); - __mul(&mpeps,&mpy,&mpcor,p); - __add(&mpy,&mpcor,&mpw,p); - __sub(&mpy,&mpcor,&mpz,p); - __mp_dbl(&mpw, &w, p); - __mp_dbl(&mpz, &z, p); - if (w == z) return w; - else { /* if calculating is not exactly */ - p = 32; - __dbl_mp(x,&mpx,p); - __mpexp(&mpx, &mpy, p); - __mp_dbl(&mpy, &res, p); - return res; - } -#else - return (double) __ieee754_expl((long double)x); -#endif -} diff --git a/sysdeps/powerpc/powerpc64/power4/fpu/Makefile b/sysdeps/powerpc/powerpc64/power4/fpu/Makefile index 41f2553..2d44f72 100644 --- a/sysdeps/powerpc/powerpc64/power4/fpu/Makefile +++ b/sysdeps/powerpc/powerpc64/power4/fpu/Makefile @@ -3,4 +3,5 @@ ifeq ($(subdir),math) CFLAGS-mpa.c += --param max-unroll-times=4 -funroll-loops -fpeel-loops CPPFLAGS-slowpow.c += -DUSE_LONG_DOUBLE_FOR_MP=1 +CPPFLAGS-slowexp.c += -DUSE_LONG_DOUBLE_FOR_MP=1 endif diff --git a/sysdeps/powerpc/powerpc64/power4/fpu/slowexp.c b/sysdeps/powerpc/powerpc64/power4/fpu/slowexp.c deleted file mode 100644 index d93f505..0000000 --- a/sysdeps/powerpc/powerpc64/power4/fpu/slowexp.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * IBM Accurate Mathematical Library - * written by International Business Machines Corp. - * Copyright (C) 2001-2013 Free Software Foundation, Inc. - * - * This program 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. - * - * This program 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 this program; if not, see <http://www.gnu.org/licenses/>. - */ -/**************************************************************************/ -/* MODULE_NAME:slowexp.c */ -/* */ -/* FUNCTION:slowexp */ -/* */ -/* FILES NEEDED:mpa.h */ -/* mpa.c mpexp.c */ -/* */ -/*Converting from double precision to Multi-precision and calculating */ -/* e^x */ -/**************************************************************************/ -#include <math_private.h> - -#ifdef NO_LONG_DOUBLE -#include "mpa.h" -void __mpexp(mp_no *x, mp_no *y, int p); -#endif - -/*Converting from double precision to Multi-precision and calculating e^x */ -double __slowexp(double x) { -#ifdef NO_LONG_DOUBLE - double w,z,res,eps=3.0e-26; - int p; - mp_no mpx, mpy, mpz,mpw,mpeps,mpcor; - - p=6; - __dbl_mp(x,&mpx,p); /* Convert a double precision number x */ - /* into a multiple precision number mpx with prec. p. */ - __mpexp(&mpx, &mpy, p); /* Multi-Precision exponential function */ - __dbl_mp(eps,&mpeps,p); - __mul(&mpeps,&mpy,&mpcor,p); - __add(&mpy,&mpcor,&mpw,p); - __sub(&mpy,&mpcor,&mpz,p); - __mp_dbl(&mpw, &w, p); - __mp_dbl(&mpz, &z, p); - if (w == z) return w; - else { /* if calculating is not exactly */ - p = 32; - __dbl_mp(x,&mpx,p); - __mpexp(&mpx, &mpy, p); - __mp_dbl(&mpy, &res, p); - return res; - } -#else - return (double) __ieee754_expl((long double)x); -#endif -} |