summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2009-06-26 15:19:14 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2009-06-26 15:19:14 +0000
commit0a7b8e19cf4789f503f55b4e046327c38ab786b3 (patch)
tree991b78c9e2f3820a4c5c85c5ed78c6ba4b5fb168
parent650a1c2467e6c10d24eba4428fd6784c5e7a6131 (diff)
downloadmpfr-0a7b8e19cf4789f503f55b4e046327c38ab786b3.tar.gz
Suppressed MPFR_CLEAR_FLAGS (no longer did anything).
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@6294 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r--add.c1
-rw-r--r--agm.c1
-rw-r--r--div.c1
-rw-r--r--div_ui.c2
-rw-r--r--exceptions.c1
-rw-r--r--exp.c2
-rw-r--r--frac.c2
-rw-r--r--hypot.c1
-rw-r--r--inp_str.c1
-rw-r--r--mpfr-impl.h2
-rw-r--r--mul.c2
-rw-r--r--next.c1
-rw-r--r--pow_si.c1
-rw-r--r--rec_sqrt.c1
-rw-r--r--set_d.c2
-rw-r--r--set_f.c3
-rw-r--r--set_si_2exp.c1
-rw-r--r--set_ui_2exp.c1
-rw-r--r--sqr.c1
-rw-r--r--sqrt.c1
-rw-r--r--sub.c1
-rw-r--r--tests/random2.c2
-rw-r--r--tests/tadd.c1
-rw-r--r--tests/tdiv.c4
-rw-r--r--tests/tsqrt.c3
-rw-r--r--tests/tui_div.c2
-rw-r--r--urandomb.c2
27 files changed, 0 insertions, 43 deletions
diff --git a/add.c b/add.c
index a5729b6fa..f2bfe0c66 100644
--- a/add.c
+++ b/add.c
@@ -81,7 +81,6 @@ mpfr_add (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode)
}
MPFR_ASSERTD(MPFR_IS_PURE_FP(b) && MPFR_IS_PURE_FP(c));
- MPFR_CLEAR_FLAGS(a); /* clear flags */
if (MPFR_UNLIKELY(MPFR_SIGN(b) != MPFR_SIGN(c)))
{ /* signs differ, it's a subtraction */
diff --git a/agm.c b/agm.c
index fb5ac3d26..0ee935cf4 100644
--- a/agm.c
+++ b/agm.c
@@ -74,7 +74,6 @@ mpfr_agm (mpfr_ptr r, mpfr_srcptr op2, mpfr_srcptr op1, mp_rnd_t rnd_mode)
MPFR_RET (0); /* exact */
}
}
- MPFR_CLEAR_FLAGS (r);
/* If a or b is negative (excluding -Infinity), the result is NaN */
if (MPFR_UNLIKELY(MPFR_IS_NEG(op1) || MPFR_IS_NEG(op2)))
diff --git a/div.c b/div.c
index f7dd1d323..b10ec8e90 100644
--- a/div.c
+++ b/div.c
@@ -213,7 +213,6 @@ mpfr_div (mpfr_ptr q, mpfr_srcptr u, mpfr_srcptr v, mp_rnd_t rnd_mode)
MPFR_RET (0);
}
}
- MPFR_CLEAR_FLAGS (q);
/**************************************************************************
* *
diff --git a/div_ui.c b/div_ui.c
index 001ffdf0c..2116d57f9 100644
--- a/div_ui.c
+++ b/div_ui.c
@@ -79,8 +79,6 @@ mpfr_div_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mp_rnd_t rnd_mode)
else if (MPFR_UNLIKELY (IS_POW2 (u)))
return mpfr_div_2si (y, x, MPFR_INT_CEIL_LOG2 (u), rnd_mode);
- MPFR_CLEAR_FLAGS (y);
-
MPFR_SET_SAME_SIGN (y, x);
MPFR_TMP_MARK (marker);
diff --git a/exceptions.c b/exceptions.c
index a98ca3c29..2fd8f6406 100644
--- a/exceptions.c
+++ b/exceptions.c
@@ -317,7 +317,6 @@ mpfr_overflow (mpfr_ptr x, mp_rnd_t rnd_mode, int sign)
int inex;
MPFR_ASSERT_SIGN(sign);
- MPFR_CLEAR_FLAGS(x);
if (MPFR_IS_LIKE_RNDZ(rnd_mode, sign < 0))
{
mpfr_setmax (x, __gmpfr_emax);
diff --git a/exp.c b/exp.c
index e23899535..fbc812995 100644
--- a/exp.c
+++ b/exp.c
@@ -101,8 +101,6 @@ mpfr_exp (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode)
MPFR_SAVE_EXPO_FREE (expo);
}
- MPFR_CLEAR_FLAGS (y);
-
expx = MPFR_GET_EXP (x);
precy = MPFR_PREC (y);
diff --git a/frac.c b/frac.c
index 37dcab6a4..bb3c1b08c 100644
--- a/frac.c
+++ b/frac.c
@@ -46,7 +46,6 @@ mpfr_frac (mpfr_ptr r, mpfr_srcptr u, mp_rnd_t rnd_mode)
}
else if (MPFR_UNLIKELY(MPFR_IS_INF(u) || mpfr_integer_p (u)))
{
- MPFR_CLEAR_FLAGS(r);
MPFR_SET_SAME_SIGN(r, u);
MPFR_SET_ZERO(r);
MPFR_RET(0); /* zero is exact */
@@ -97,7 +96,6 @@ mpfr_frac (mpfr_ptr r, mpfr_srcptr u, mp_rnd_t rnd_mode)
/* t has enough precision to contain the fractional part of u */
/* If we use a temporary variable, we take the non-significant bits
of u into account, because of the mpn_lshift below. */
- MPFR_CLEAR_FLAGS(t);
MPFR_SET_SAME_SIGN(t, u);
MPFR_SET_EXP (t, re);
diff --git a/hypot.c b/hypot.c
index 31d15986d..2d35c740a 100644
--- a/hypot.c
+++ b/hypot.c
@@ -61,7 +61,6 @@ mpfr_hypot (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y, mp_rnd_t rnd_mode)
else /* y is necessarily 0 */
return mpfr_abs (z, x, rnd_mode);
}
- MPFR_CLEAR_FLAGS(z);
if (mpfr_cmpabs (x, y) < 0)
{
diff --git a/inp_str.c b/inp_str.c
index 52dcb9f7c..c27c949d1 100644
--- a/inp_str.c
+++ b/inp_str.c
@@ -35,7 +35,6 @@ mpfr_inp_str (mpfr_ptr rop, FILE *stream, int base, mp_rnd_t rnd_mode)
int retval;
size_t nread;
- MPFR_CLEAR_FLAGS(rop);
if (stream == NULL)
stream = stdin;
diff --git a/mpfr-impl.h b/mpfr-impl.h
index b3832e436..03403c543 100644
--- a/mpfr-impl.h
+++ b/mpfr-impl.h
@@ -648,8 +648,6 @@ typedef intmax_t mpfr_eexp_t;
# define MPFR_EXP_NAN (MPFR_EXP_MIN+2)
# define MPFR_EXP_INF (MPFR_EXP_MIN+3)
-#define MPFR_CLEAR_FLAGS(x)
-
#define MPFR_IS_NAN(x) (MPFR_EXP(x) == MPFR_EXP_NAN)
#define MPFR_SET_NAN(x) (MPFR_EXP(x) = MPFR_EXP_NAN)
#define MPFR_IS_INF(x) (MPFR_EXP(x) == MPFR_EXP_INF)
diff --git a/mul.c b/mul.c
index 05d279d6e..63c097cc9 100644
--- a/mul.c
+++ b/mul.c
@@ -89,7 +89,6 @@ mpfr_mul3 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode)
MPFR_RET(0); /* 0 * 0 is exact */
}
}
- MPFR_CLEAR_FLAGS(a);
sign_product = MPFR_MULT_SIGN( MPFR_SIGN(b) , MPFR_SIGN(c) );
ax = MPFR_GET_EXP (b) + MPFR_GET_EXP (c);
@@ -262,7 +261,6 @@ mpfr_mul (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode)
MPFR_RET (0);
}
}
- MPFR_CLEAR_FLAGS (a);
sign = MPFR_MULT_SIGN (MPFR_SIGN (b), MPFR_SIGN (c));
ax = MPFR_GET_EXP (b) + MPFR_GET_EXP (c);
diff --git a/next.c b/next.c
index eb156274a..532d6e70f 100644
--- a/next.c
+++ b/next.c
@@ -28,7 +28,6 @@ mpfr_nexttozero (mpfr_ptr x)
{
if (MPFR_UNLIKELY(MPFR_IS_INF(x)))
{
- MPFR_CLEAR_FLAGS(x);
mpfr_setmax (x, __gmpfr_emax);
return;
}
diff --git a/pow_si.c b/pow_si.c
index b8034a446..97d168790 100644
--- a/pow_si.c
+++ b/pow_si.c
@@ -65,7 +65,6 @@ mpfr_pow_si (mpfr_ptr y, mpfr_srcptr x, long int n, mp_rnd_t rnd)
MPFR_RET(0);
}
}
- MPFR_CLEAR_FLAGS (y);
/* detect exact powers: x^(-n) is exact iff x is a power of 2 */
if (mpfr_cmp_si_2exp (x, MPFR_SIGN(x), MPFR_EXP(x) - 1) == 0)
diff --git a/rec_sqrt.c b/rec_sqrt.c
index 3dc6c5f3b..130f5d63c 100644
--- a/rec_sqrt.c
+++ b/rec_sqrt.c
@@ -466,7 +466,6 @@ mpfr_rec_sqrt (mpfr_ptr r, mpfr_srcptr u, mp_rnd_t rnd_mode)
MPFR_RET_NAN;
}
- MPFR_CLEAR_FLAGS(r);
MPFR_SET_POS(r);
rp = MPFR_PREC(r); /* output precision */
diff --git a/set_d.c b/set_d.c
index 14da7fe32..82fd5661f 100644
--- a/set_d.c
+++ b/set_d.c
@@ -149,8 +149,6 @@ mpfr_set_d (mpfr_ptr r, double d, mp_rnd_t rnd_mode)
mp_limb_t tmpmant[MPFR_LIMBS_PER_DOUBLE];
MPFR_SAVE_EXPO_DECL (expo);
- MPFR_CLEAR_FLAGS(r);
-
if (MPFR_UNLIKELY(DOUBLE_ISNAN(d)))
{
MPFR_SET_NAN(r);
diff --git a/set_f.c b/set_f.c
index 74dbc1b51..92a47d13a 100644
--- a/set_f.c
+++ b/set_f.c
@@ -35,7 +35,6 @@ mpfr_set_f (mpfr_ptr y, mpf_srcptr x, mp_rnd_t rnd_mode)
if (sx == 0) /* x is zero */
{
- MPFR_CLEAR_FLAGS (y);
MPFR_SET_ZERO(y);
MPFR_SET_POS(y);
return 0; /* 0 is exact */
@@ -44,8 +43,6 @@ mpfr_set_f (mpfr_ptr y, mpf_srcptr x, mp_rnd_t rnd_mode)
if (SIZ(x) * MPFR_FROM_SIGN_TO_INT(MPFR_SIGN(y)) < 0)
MPFR_CHANGE_SIGN (y);
- MPFR_CLEAR_FLAGS (y);
-
sy = 1 + (MPFR_PREC(y) - 1) / BITS_PER_MP_LIMB;
my = MPFR_MANT(y);
mx = PTR(x);
diff --git a/set_si_2exp.c b/set_si_2exp.c
index 0a083bea3..acfc48655 100644
--- a/set_si_2exp.c
+++ b/set_si_2exp.c
@@ -67,7 +67,6 @@ mpfr_set_si_2exp (mpfr_ptr x, long i, mp_exp_t e, mp_rnd_t rnd_mode)
xp[xn] = MPFR_LIMB_HIGHBIT;
}
- MPFR_CLEAR_FLAGS (x);
MPFR_EXP (x) = e;
return mpfr_check_range (x, inex, rnd_mode);
}
diff --git a/set_ui_2exp.c b/set_ui_2exp.c
index b3da70d3b..4bec85423 100644
--- a/set_ui_2exp.c
+++ b/set_ui_2exp.c
@@ -66,7 +66,6 @@ mpfr_set_ui_2exp (mpfr_ptr x, unsigned long i, mp_exp_t e, mp_rnd_t rnd_mode)
xp[xn] = MPFR_LIMB_HIGHBIT;
}
- MPFR_CLEAR_FLAGS (x);
MPFR_EXP (x) = e;
return mpfr_check_range (x, inex, rnd_mode);
}
diff --git a/sqr.c b/sqr.c
index 2a5a46c1f..e459f6e63 100644
--- a/sqr.c
+++ b/sqr.c
@@ -51,7 +51,6 @@ mpfr_sqr (mpfr_ptr a, mpfr_srcptr b, mp_rnd_t rnd_mode)
( MPFR_ASSERTD(MPFR_IS_ZERO(b)), MPFR_SET_ZERO(a) );
MPFR_RET(0);
}
- MPFR_CLEAR_FLAGS(a);
ax = 2 * MPFR_GET_EXP (b);
bq = MPFR_PREC(b);
diff --git a/sqrt.c b/sqrt.c
index aa4a31fec..bb606bb35 100644
--- a/sqrt.c
+++ b/sqrt.c
@@ -80,7 +80,6 @@ mpfr_sqrt (mpfr_ptr r, mpfr_srcptr u, mp_rnd_t rnd_mode)
MPFR_SET_NAN(r);
MPFR_RET_NAN;
}
- MPFR_CLEAR_FLAGS(r);
MPFR_SET_POS(r);
rsize = MPFR_LIMB_SIZE(r); /* number of limbs of r */
diff --git a/sub.c b/sub.c
index 07c12dd62..ed0ad570f 100644
--- a/sub.c
+++ b/sub.c
@@ -75,7 +75,6 @@ mpfr_sub (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode)
return mpfr_set (a, b, rnd_mode);
}
}
- MPFR_CLEAR_FLAGS (a);
MPFR_ASSERTD (MPFR_IS_PURE_FP (b) && MPFR_IS_PURE_FP (c));
if (MPFR_LIKELY (MPFR_SIGN (b) == MPFR_SIGN (c)))
diff --git a/tests/random2.c b/tests/random2.c
index 2815ad5b3..2426ae463 100644
--- a/tests/random2.c
+++ b/tests/random2.c
@@ -40,8 +40,6 @@ mpfr_random2 (mpfr_ptr x, mp_size_t size, mp_exp_t exp,
mp_limb_t elimb, ran, acc;
int ran_nbits, bit_pos, nb;
- MPFR_CLEAR_FLAGS (x);
-
if (MPFR_UNLIKELY(size == 0))
{
MPFR_SET_ZERO (x);
diff --git a/tests/tadd.c b/tests/tadd.c
index 306f20aa4..9523b0695 100644
--- a/tests/tadd.c
+++ b/tests/tadd.c
@@ -50,7 +50,6 @@ test_add (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mp_rnd_t rnd_mode)
res = mpfr_add (a, b, c, rnd_mode);
else
{
- MPFR_CLEAR_FLAGS(a); /* clear flags */
if (MPFR_GET_EXP(b) < MPFR_GET_EXP(c))
res = mpfr_add1(a, c, b, rnd_mode);
else
diff --git a/tests/tdiv.c b/tests/tdiv.c
index 5d201345d..9bfd1e440 100644
--- a/tests/tdiv.c
+++ b/tests/tdiv.c
@@ -650,7 +650,6 @@ check_nan (void)
MPFR_ASSERTN (mpfr_nan_p (q));
/* +inf/1 == +inf */
- MPFR_CLEAR_FLAGS (a);
MPFR_SET_INF (a);
MPFR_SET_POS (a);
mpfr_set_ui (d, 1L, MPFR_RNDN);
@@ -660,7 +659,6 @@ check_nan (void)
/* 1/+inf == 0 */
mpfr_set_ui (a, 1L, MPFR_RNDN);
- MPFR_CLEAR_FLAGS (d);
MPFR_SET_INF (d);
MPFR_SET_POS (d);
MPFR_ASSERTN (test_div (q, a, d, MPFR_RNDZ) == 0); /* exact */
@@ -674,10 +672,8 @@ check_nan (void)
MPFR_ASSERTN (mpfr_nan_p (q));
/* +inf/+inf == nan */
- MPFR_CLEAR_FLAGS (a);
MPFR_SET_INF (a);
MPFR_SET_POS (a);
- MPFR_CLEAR_FLAGS (d);
MPFR_SET_INF (d);
MPFR_SET_POS (d);
MPFR_ASSERTN (test_div (q, a, d, MPFR_RNDZ) == 0); /* exact */
diff --git a/tests/tsqrt.c b/tests/tsqrt.c
index fccfac057..3c0823b19 100644
--- a/tests/tsqrt.c
+++ b/tests/tsqrt.c
@@ -464,7 +464,6 @@ check_nan (void)
mpfr_init2 (got, 100L);
/* sqrt(NaN) == NaN */
- MPFR_CLEAR_FLAGS (x);
MPFR_SET_NAN (x);
MPFR_ASSERTN (test_sqrt (got, x, MPFR_RNDZ) == 0); /* exact */
MPFR_ASSERTN (mpfr_nan_p (got));
@@ -475,14 +474,12 @@ check_nan (void)
MPFR_ASSERTN (mpfr_nan_p (got));
/* sqrt(+inf) == +inf */
- MPFR_CLEAR_FLAGS (x);
MPFR_SET_INF (x);
MPFR_SET_POS (x);
MPFR_ASSERTN (test_sqrt (got, x, MPFR_RNDZ) == 0); /* exact */
MPFR_ASSERTN (mpfr_inf_p (got));
/* sqrt(-inf) == NaN */
- MPFR_CLEAR_FLAGS (x);
MPFR_SET_INF (x);
MPFR_SET_NEG (x);
MPFR_ASSERTN (test_sqrt (got, x, MPFR_RNDZ) == 0); /* exact */
diff --git a/tests/tui_div.c b/tests/tui_div.c
index ec5acdcfd..30f1ac31b 100644
--- a/tests/tui_div.c
+++ b/tests/tui_div.c
@@ -110,7 +110,6 @@ check_nan (void)
mpfr_init2 (q, 100L);
/* 1/+inf == 0 */
- MPFR_CLEAR_FLAGS (d);
MPFR_SET_INF (d);
MPFR_SET_POS (d);
MPFR_ASSERTN (mpfr_ui_div (q, 1L, d, MPFR_RNDZ) == 0); /* exact */
@@ -118,7 +117,6 @@ check_nan (void)
MPFR_ASSERTN (mpfr_sgn (q) == 0);
/* 1/-inf == -0 */
- MPFR_CLEAR_FLAGS (d);
MPFR_SET_INF (d);
MPFR_SET_NEG (d);
MPFR_ASSERTN (mpfr_ui_div (q, 1L, d, MPFR_RNDZ) == 0); /* exact */
diff --git a/urandomb.c b/urandomb.c
index ed6dd95db..89d889197 100644
--- a/urandomb.c
+++ b/urandomb.c
@@ -48,8 +48,6 @@ mpfr_urandomb (mpfr_ptr rop, gmp_randstate_t rstate)
mp_exp_t exp;
int cnt;
- MPFR_CLEAR_FLAGS (rop);
-
rp = MPFR_MANT (rop);
nbits = MPFR_PREC (rop);
nlimbs = MPFR_LIMB_SIZE (rop);