diff options
author | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-11-18 14:52:59 +0000 |
---|---|---|
committer | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-11-18 14:52:59 +0000 |
commit | 054cdf7c885c574e6c111003c8767575a2a44666 (patch) | |
tree | 49713e889d7f8ccbdad01a07e92ff3cdf8f9c27e /sub_ui.c | |
parent | ef4cc77a66014090216445e952b0ccb9fc461e46 (diff) | |
download | mpfr-054cdf7c885c574e6c111003c8767575a2a44666.tar.gz |
Replace use of mpfr_save_emin_emax () / mpfr_restore_emin_emax()
by MPFR_SAVE_EXPO macros (DECL, MARK and FREE) which are faster
and thread safe.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@3100 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'sub_ui.c')
-rw-r--r-- | sub_ui.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -32,6 +32,7 @@ mpfr_sub_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mp_rnd_t rnd_mode) mp_limb_t up[1]; unsigned long cnt; int inex; + MPFR_SAVE_EXPO_DECL (expo); MPFR_TMP_INIT1(up, uu, BITS_PER_MP_LIMB); MPFR_ASSERTN(u == (mp_limb_t) u); @@ -40,10 +41,10 @@ mpfr_sub_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mp_rnd_t rnd_mode) /* Optimization note: Exponent save/restore operations may be removed if mpfr_sub works even when uu is out-of-range. */ - mpfr_save_emin_emax(); + MPFR_SAVE_EXPO_MARK (expo); MPFR_SET_EXP (uu, BITS_PER_MP_LIMB - cnt); inex = mpfr_sub(y, x, uu, rnd_mode); - mpfr_restore_emin_emax(); + MPFR_SAVE_EXPO_FREE (expo); return mpfr_check_range(y, inex, rnd_mode); } else |