From 0cbc101798c8a3cfc612eaf40bbbd353a9a0ff81 Mon Sep 17 00:00:00 2001 From: Thomas Frieden Date: Mon, 27 Sep 2004 15:06:19 +0000 Subject: [PATCH] Some adjustments so that the function is available even in non-FPU code git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14731 87f5fb63-7c3d-0410-a384-fd976d0f7a62 --- library/math_fabs.c | 13 ++++++++++++- library/math_log.c | 4 ++-- library/math_modf.c | 4 ++-- library/math_pow.c | 4 ++-- library/math_sqrt.c | 6 +++--- 5 files changed, 21 insertions(+), 10 deletions(-) diff --git a/library/math_fabs.c b/library/math_fabs.c index ce10d23..c73bedc 100644 --- a/library/math_fabs.c +++ b/library/math_fabs.c @@ -1,5 +1,5 @@ /* - * $Id: math_fabs.c,v 1.1.1.1 2004-07-26 16:30:42 obarthel Exp $ + * $Id: math_fabs.c,v 1.2 2004-09-27 15:06:16 tfrieden Exp $ * * :ts=4 * @@ -141,6 +141,17 @@ __fabs(double x) } +#else + +INLINE static const double +__fabs(double x) +{ + if (x > 0) + return x; + else + return -x; +} + #endif /* PPC_FLOATING_POINT_SUPPORT */ /****************************************************************************/ diff --git a/library/math_log.c b/library/math_log.c index ae3f700..2000218 100644 --- a/library/math_log.c +++ b/library/math_log.c @@ -1,5 +1,5 @@ /* - * $Id: math_log.c,v 1.1.1.1 2004-07-26 16:30:49 obarthel Exp $ + * $Id: math_log.c,v 1.2 2004-09-27 15:06:19 tfrieden Exp $ * * :ts=4 * @@ -135,7 +135,7 @@ __log(double x) /****************************************************************************/ -#if defined(PPC_FLOATING_POINT_SUPPORT) +#if defined(__PPC__) static const double ln2_hi = 6.93147180369123816490e-01, /* 3fe62e42 fee00000 */ diff --git a/library/math_modf.c b/library/math_modf.c index a5fba12..573eea4 100644 --- a/library/math_modf.c +++ b/library/math_modf.c @@ -1,5 +1,5 @@ /* - * $Id: math_modf.c,v 1.1.1.1 2004-07-26 16:30:50 obarthel Exp $ + * $Id: math_modf.c,v 1.2 2004-09-27 15:06:19 tfrieden Exp $ * * :ts=4 * @@ -109,7 +109,7 @@ __modf(double x,double *nptr) /****************************************************************************/ -#if defined(PPC_FLOATING_POINT_SUPPORT) +#if defined(__PPC__) INLINE static const double __modf(double x,double *nptr) diff --git a/library/math_pow.c b/library/math_pow.c index 5459d8a..1b91d1a 100644 --- a/library/math_pow.c +++ b/library/math_pow.c @@ -1,5 +1,5 @@ /* - * $Id: math_pow.c,v 1.2 2004-08-27 11:40:49 obarthel Exp $ + * $Id: math_pow.c,v 1.3 2004-09-27 15:06:19 tfrieden Exp $ * * :ts=4 * @@ -171,7 +171,7 @@ __pow(double x,double y) /****************************************************************************/ -#if defined(PPC_FLOATING_POINT_SUPPORT) +#if defined(__PPC__) /****************************************************************************/ diff --git a/library/math_sqrt.c b/library/math_sqrt.c index a898606..d5fdaf5 100644 --- a/library/math_sqrt.c +++ b/library/math_sqrt.c @@ -1,5 +1,5 @@ /* - * $Id: math_sqrt.c,v 1.2 2004-08-21 18:57:40 obarthel Exp $ + * $Id: math_sqrt.c,v 1.3 2004-09-27 15:06:19 tfrieden Exp $ * * :ts=4 * @@ -135,7 +135,7 @@ __sqrt(double x) /****************************************************************************/ -#if defined(PPC_FLOATING_POINT_SUPPORT) +#ifdef __PPC__ static const double one = 1.0, tiny=1.0e-300; @@ -236,7 +236,7 @@ __sqrt(double x) return z; } -#endif /* PPC_FLOATING_POINT_SUPPORT */ +#endif /****************************************************************************/