arith.c: Change conditional test for inclusion of arctangent().

2006-09-28  Steven G. Kargl <kargl@gcc.gnu.org>

	* arith.c: Change conditional test for inclusion of arctangent().
	(gfc_check_real_range): Change conditional test for use of
	mpfr_subnormalize.
	* simplify.c (gfc_simplify_atan2): Fix conditional for use of
	mpfr_atan2() instead of arctangent().
	(gfc_simplify_exponent): Fix conditional for use of mpfr_get_exp().
 	(gfc_simplify_log): Fix conditional for use of mpfr_atan2() instead
	 of arctangent().
	(gfc_simplify_nearest): Fix conditional for use of mpfr_nextafter().

From-SVN: r117289
This commit is contained in:
Steven G. Kargl 2006-09-28 19:31:37 +00:00
parent 0461b801bf
commit 48c7b142f9
3 changed files with 20 additions and 8 deletions

View File

@ -1,3 +1,15 @@
2006-09-28 Steven G. Kargl <kargl@gcc.gnu.org>
* arith.c: Change conditional test for inclusion of arctangent().
(gfc_check_real_range): Change conditional test for use of
mpfr_subnormalize.
* simplify.c (gfc_simplify_atan2): Fix conditional for use of
mpfr_atan2() instead of arctangent().
(gfc_simplify_exponent): Fix conditional for use of mpfr_get_exp().
(gfc_simplify_log): Fix conditional for use of mpfr_atan2() instead
of arctangent().
(gfc_simplify_nearest): Fix conditional for use of mpfr_nextafter().
2006-09-27 Steven G. Kargl <kargl@gcc.gnu.org> 2006-09-27 Steven G. Kargl <kargl@gcc.gnu.org>
* arith.c: Conditionally include arctangent2(). * arith.c: Conditionally include arctangent2().

View File

@ -75,7 +75,7 @@ gfc_set_model (mpfr_t x)
mpfr_set_default_prec (mpfr_get_prec (x)); mpfr_set_default_prec (mpfr_get_prec (x));
} }
#if !defined(MPFR_VERSION_MAJOR) #if MPFR_VERSION_MAJOR < 2 || (MPFR_VERSION_MAJOR == 2 && MPFR_VERSION_MINOR < 2)
/* Calculate atan2 (y, x) /* Calculate atan2 (y, x)
atan2(y, x) = atan(y/x) if x > 0, atan2(y, x) = atan(y/x) if x > 0,
@ -408,7 +408,7 @@ gfc_check_real_range (mpfr_t p, int kind)
} }
else if (mpfr_cmp (q, gfc_real_kinds[i].tiny) < 0) else if (mpfr_cmp (q, gfc_real_kinds[i].tiny) < 0)
{ {
#if !defined(MPFR_VERSION_MAJOR) #if MPFR_VERSION_MAJOR < 2 || (MPFR_VERSION_MAJOR == 2 && MPFR_VERSION_MINOR < 2)
/* MPFR operates on a number with a given precision and enormous /* MPFR operates on a number with a given precision and enormous
exponential range. To represent subnormal numbers, the exponent is exponential range. To represent subnormal numbers, the exponent is
allowed to become smaller than emin, but always retains the full allowed to become smaller than emin, but always retains the full

View File

@ -607,7 +607,7 @@ gfc_simplify_atan2 (gfc_expr * y, gfc_expr * x)
return &gfc_bad_expr; return &gfc_bad_expr;
} }
#if !defined(MPFR_VERSION_MAJOR) #if MPFR_VERSION_MAJOR < 2 || (MPFR_VERSION_MAJOR == 2 && MPFR_VERSION_MINOR < 2)
arctangent2 (y->value.real, x->value.real, result->value.real); arctangent2 (y->value.real, x->value.real, result->value.real);
#else #else
mpfr_atan2 (result->value.real, y->value.real, x->value.real, GFC_RND_MODE); mpfr_atan2 (result->value.real, y->value.real, x->value.real, GFC_RND_MODE);
@ -1060,7 +1060,7 @@ gfc_simplify_exponent (gfc_expr * x)
int i; int i;
gfc_expr *result; gfc_expr *result;
#if !defined(MPFR_VERSION_MAJOR) #if MPFR_VERSION_MAJOR < 2 || (MPFR_VERSION_MAJOR == 2 && MPFR_VERSION_MINOR < 2)
mpfr_t tmp; mpfr_t tmp;
#endif #endif
@ -1078,7 +1078,7 @@ gfc_simplify_exponent (gfc_expr * x)
return result; return result;
} }
#if !defined(MPFR_VERSION_MAJOR) #if MPFR_VERSION_MAJOR < 2 || (MPFR_VERSION_MAJOR == 2 && MPFR_VERSION_MINOR < 2)
/* PR fortran/28276 suffers from a buggy MPFR, and this block of code /* PR fortran/28276 suffers from a buggy MPFR, and this block of code
does not function correctly. */ does not function correctly. */
mpfr_init (tmp); mpfr_init (tmp);
@ -2161,7 +2161,7 @@ gfc_simplify_log (gfc_expr * x)
mpfr_init (xr); mpfr_init (xr);
mpfr_init (xi); mpfr_init (xi);
#if !defined(MPFR_VERSION_MAJOR) #if MPFR_VERSION_MAJOR < 2 || (MPFR_VERSION_MAJOR == 2 && MPFR_VERSION_MINOR < 2)
arctangent2 (x->value.complex.i, x->value.complex.r, result->value.complex.i); arctangent2 (x->value.complex.i, x->value.complex.r, result->value.complex.i);
#else #else
mpfr_atan2 (result->value.complex.i, x->value.complex.i, x->value.complex.r, mpfr_atan2 (result->value.complex.i, x->value.complex.i, x->value.complex.r,
@ -2495,7 +2495,7 @@ gfc_simplify_nearest (gfc_expr * x, gfc_expr * s)
gfc_expr *result; gfc_expr *result;
mpfr_t tmp; mpfr_t tmp;
int sgn; int sgn;
#if !defined(MPFR_VERSION_MAJOR) #if MPFR_VERSION_MAJOR < 2 || (MPFR_VERSION_MAJOR == 2 && MPFR_VERSION_MINOR < 2)
int direction; int direction;
#else #else
mp_exp_t emin, emax; mp_exp_t emin, emax;
@ -2513,7 +2513,7 @@ gfc_simplify_nearest (gfc_expr * x, gfc_expr * s)
gfc_set_model_kind (x->ts.kind); gfc_set_model_kind (x->ts.kind);
result = gfc_copy_expr (x); result = gfc_copy_expr (x);
#if !defined(MPFR_VERSION_MAJOR) #if MPFR_VERSION_MAJOR < 2 || (MPFR_VERSION_MAJOR == 2 && MPFR_VERSION_MINOR < 2)
direction = mpfr_sgn (s->value.real); direction = mpfr_sgn (s->value.real);
sgn = mpfr_sgn (x->value.real); sgn = mpfr_sgn (x->value.real);