summaryrefslogtreecommitdiff
path: root/src/mpfr-impl.h
Commit message (Collapse)AuthorAgeFilesLines
* [src/mpfr-impl.h] Resolved the problem under Linux.win-thread-safe-dllvlefevre2015-09-101-1/+1
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/win-thread-safe-dll@9683 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Detect some possible inconsistencies under Unix,vlefevre2015-09-101-0/+13
| | | | | | when some macro should imply a MS-Windows platform. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/win-thread-safe-dll@9682 280ebfd0-de03-0410-8827-d642c229c3f4
* Merged the latest changes from the trunk since this wasn't the causevlefevre2015-09-101-6/+5
| | | | | | of the problem. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/win-thread-safe-dll@9681 280ebfd0-de03-0410-8827-d642c229c3f4
* Applied changes from Stephan Tolksdorf:vlefevre2015-09-101-17/+62
| | | | | | | | | | | https://gforge.inria.fr/tracker/download.php/136/619/19537/4980/changes.zip The MPFR build fails on my Linux machine with CFLAGS=-Werror=missing-prototypes because MPFR_WIN_THREAD_SAFE_DLL gets defined (this CFLAGS just allowed me to detect the problem with MPFR_WIN_THREAD_SAFE_DLL, which could have otherwise remained unnoticed). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/win-thread-safe-dll@9680 280ebfd0-de03-0410-8827-d642c229c3f4
* [src] Fixed allocation issue for multithreaded applications:vlefevre2015-05-281-5/+5
| | | | | | | | | | | | https://sympa.inria.fr/sympa/arc/mpfr/2015-05/msg00001.html * mpfr-gmp.{c,h}: made mpfr_allocate_func, mpfr_reallocate_func and mpfr_free_func thread-local; updated MPFR_GET_MEMFUNC to execute mp_get_memory_functions only when these pointers have not been set to the actual function pointers yet. * mpfr-impl.h: #include "mpfr-thread.h" earlier (before mpfr-gmp.h, where MPFR_THREAD_ATTR is now used). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9466 280ebfd0-de03-0410-8827-d642c229c3f4
* Updated value coverage checking for mpfr_sum.vlefevre2015-02-251-1/+1
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/new-sum@9317 280ebfd0-de03-0410-8827-d642c229c3f4
* Value coverage checking when MPFR_COV_CHECK is defined, initiallyvlefevre2015-02-251-0/+27
| | | | | | for mpfr_sum. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/new-sum@9315 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Added SAFE_DIFF macro (safe difference).vlefevre2015-02-241-1/+2
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9306 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Fixed and improved some sign-related macrosvlefevre2015-02-211-18/+22
| | | | | | (some parentheses were missing). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9295 280ebfd0-de03-0410-8827-d642c229c3f4
* Logging: the log stream is flushed after each log output whenvlefevre2015-02-181-2/+9
| | | | | | the MPFR_LOG_FLUSH environment variable is set. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9287 280ebfd0-de03-0410-8827-d642c229c3f4
* Factorized the logging macros by moving tests inside LOG_PRINT.vlefevre2015-02-181-44/+25
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9286 280ebfd0-de03-0410-8827-d642c229c3f4
* Copyright notice update: added 2015 withvlefevre2015-02-131-1/+1
| | | | | | | | | perl -pi -e 's/ (\d{4}-)?(2014)(?= Free Software)/ " ".($1||"$2-").($2+1)/e' **/*(^/) under zsh, reverting the tools/mbench directory (not distributed with MPFR). Removed 2014 from the example in the doc/README.dev file. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9278 280ebfd0-de03-0410-8827-d642c229c3f4
* improve mpfr_atan for small precision (patch from Patrick Pelissier)zimmerma2014-11-091-0/+27
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9232 280ebfd0-de03-0410-8827-d642c229c3f4
* Do not test include guards before a #include: the test must be done onlyvlefevre2014-07-101-15/+5
| | | | | | | | in the included file itself. Note that some files such as mpfr.h may have multiple parts that could be enabled depending on the context, so that testing a guard before a #include may yield incorrect behavior. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9150 280ebfd0-de03-0410-8827-d642c229c3f4
* [src] MPFR_WANT_ASSERT clean-up.vlefevre2014-07-071-20/+27
| | | | | | | | Note: the mul.c test for MPFR_WANT_ASSERT >= 3 is now enabled for MPFR_WANT_ASSERT = 2 (since setting MPFR_WANT_ASSERT to 3 was not possible with configure options), and fixed. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9142 280ebfd0-de03-0410-8827-d642c229c3f4
* Added debug of branch prediction / --enable-debug-prediction configurevlefevre2014-07-071-3/+45
| | | | | | option (patch from Patrick Pélissier, with some changes). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9141 280ebfd0-de03-0410-8827-d642c229c3f4
* Renamed WANT_MINI_GMP to MPFR_USE_MINI_GMP as it is used in mpfr.hvlefevre2014-07-021-1/+1
| | | | | | | (all MPFR macros that appear there should start with MPFR_ to avoid conflicts with other software). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9129 280ebfd0-de03-0410-8827-d642c229c3f4
* Use MPFR_IS_NEG and MPFR_IS_POS instead of comparing the sign with 0.vlefevre2014-06-251-2/+2
| | | | | | | | | | | Done with perl -pi -e ' s/MPFR_SIGN *\(([^)]+)\) *<=? *0/MPFR_IS_NEG ($1)/g; s/MPFR_SIGN *\(([^)]+)\) *>=? *0/MPFR_IS_POS ($1)/g; ' {src,tests}/*.{c,h} and some manual changes. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9092 280ebfd0-de03-0410-8827-d642c229c3f4
* More code clean-up (for both consistency and readability):vlefevre2014-06-251-3/+5
| | | | | | | | | | | | | | | * Use the simple mp_limb_t constants when possible. * New internal macro MPFR_IS_NORMALIZED. Note: this was done with perl -pi -e ' s/~ *\(mp_limb_t\) *0/MPFR_LIMB_MAX/g; s/\(mp_limb_t\) *-1/MPFR_LIMB_MAX/g; s/\(mp_limb_t\) *0/MPFR_LIMB_ZERO/g; s/\(mp_limb_t\) *1L?/MPFR_LIMB_ONE/g' {src,tests}/*.{c,h} svn revert src/mpfr-impl.h and some manual changes. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9091 280ebfd0-de03-0410-8827-d642c229c3f4
* Code clean-up:vlefevre2014-06-251-19/+7
| | | | | | | | | | * Simplified the definition of simple mp_limb_t constants: it is better to avoid GMP internals when there is a standard way. * Replaced the use of MP_LIMB_T_MAX by the new macro MPFR_LIMB_MAX. * So, removed the now useless MP_LIMB_T_MAX and GMP_LIMB_HIGHBIT definitions from "mpfr-gmp.h". git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9090 280ebfd0-de03-0410-8827-d642c229c3f4
* Updated URL's.vlefevre2014-06-221-3/+3
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9081 280ebfd0-de03-0410-8827-d642c229c3f4
* BYTES_PER_MP_LIMB -> MPFR_BYTES_PER_MP_LIMB for GMP 6 compatibilityzimmerma2014-04-151-3/+3
| | | | | | | when --with-gmp-build is used. See mailing-list discussion: https://sympa.inria.fr/sympa/arc/mpfr/2014-04/msg00000.html git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9029 280ebfd0-de03-0410-8827-d642c229c3f4
* Added MPFR_PREC_COND, MPFR_PREC_IN_RANGE and MPFR_GET_PREC internalvlefevre2014-03-251-1/+7
| | | | | | | | macros (to mpfr-impl.h). Use these macros at some places in the code (replacing some MPFR_PREC instances, as suggested by a patch from Patrick Pélissier). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9016 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Added an MPFR_ASSERTD in MPFR_MPZ_SIZEINBASE2vlefevre2014-03-251-1/+2
| | | | | | (from a patch by Patrick Pélissier). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9015 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Fixed the mpfr_get_default_rounding_mode() macro forvlefevre2014-03-021-5/+9
| | | | | | C++ (it didn't have the correct type), and improved the similar ones. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8997 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Removed obsolete mpfr_bernoulli_internal prototype,vlefevre2014-02-171-2/+0
| | | | | | which makes the compilation of bernoulli.c fail. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8983 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/bernoulli.c] GNU style.vlefevre2014-02-131-2/+2
| | | | | | [src/mpfr-impl.h] Corrected prototypes. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8964 280ebfd0-de03-0410-8827-d642c229c3f4
* implement cache for Bernoulli numbers (patch from Patrick Pélisser)zimmerma2014-02-131-1/+3
| | | | | | | tuned parameters for [ln]gamma now that we cache Bernoulli numbers git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8963 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Added a comment about MPFR_SET_EXP: exp is requiredvlefevre2014-02-111-1/+7
| | | | | | to have a signed type. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/set_exp@8937 280ebfd0-de03-0410-8827-d642c229c3f4
* Start of mpfr_set_exp behavior clean-up.vlefevre2014-02-111-1/+3
| | | | | | | | | | | | | | | | | | | | * src/mpfr-impl.h: updated the MPFR_SET_EXP(x, exp) definition for the MPFR_EXP_CHECK case. There are 2 consequences: 1. The exp expression is evaluated several times (this should be OK with the MPFR code and optimizations). 2. The real value of exp is tested for the assertion, instead of the value converted to mpfr_exp_t. Thus new bugs can be found (e.g. when an unsigned type is used instead of signed). * src/set_exp.c: set the exponent only if x is a non-zero ordinary number, i.e. already has a valid significand and a valid exponent (thus it is no longer a low-level function, and it can no longer generate an invalid value from a valid one). * doc/mpfr.texi: updated mpfr_set_exp description and added an item in the "API Compatibility / Changed Functions" section. Currently 73 tests pass and 96 fail on Linux/x86_64, either due to bugs or due to code not yet updated for this change. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/set_exp@8924 280ebfd0-de03-0410-8827-d642c229c3f4
* [src] Add constants:vlefevre2014-01-291-0/+3
| | | | | | | | | * __gmpfr_mone = -1 * mpfr_const_log2_RNDD = log(2) rounded down in precision 64 bits * mpfr_const_log2_RNDU = log(2) rounded up in precision 64 bits (modified patch from Patrick Pélissier). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8913 280ebfd0-de03-0410-8827-d642c229c3f4
* [src] mpz_t caching (modified patch by Patrick Pélissier).vlefevre2014-01-291-0/+15
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8911 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Corrections for the case _MPFR_EXP_FORMAT == 4:vlefevre2014-01-241-4/+4
| | | | | | | | | | | | | | * No longer use MPFR_EXP_MIN and MPFR_EXP_MAX unconditionally in a #if directive, since if MPFR_HAVE_INTMAX_MAX is not defined, the compilation fails. The test was not really useful anyway: if one really wants mpfr_eexp_t to be long int if mpfr_exp_t has the same range as long int, then _MPFR_EXP_FORMAT == 3 is sufficient (and this is the default). * Removed a test that should be always true due to the previous inclusion of mpfr.h (intmax_t has already been used there in the case _MPFR_EXP_FORMAT == 4). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8899 280ebfd0-de03-0410-8827-d642c229c3f4
* [src] Added support for MPFR_PURE_FUNCTION_ATTR, MPFR_HOT_FUNCTION_ATTR,vlefevre2014-01-211-3/+28
| | | | | | | and MPFR_COLD_FUNCTION_ATTR, and fixed some LIKELY/UNLIKELY conditions (modified patch by Patrick Pélissier). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8834 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/*.c] Replaced mpfr_set_divby0 by the faster MPFR_SET_DIVBY0,vlefevre2014-01-211-2/+2
| | | | | | | | | | | and so on (except for src/exceptions.c). [tools/mpfrlint] Update for flags related functions: check that the macros are used in src (except for exceptions.c and mpfr.h) instead of the functions. [src/mpfr-impl.h] Removed some useless parentheses in comments, for mpfrlint. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8833 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Added MPFR_SET_* macros to set flags efficiently.vlefevre2014-01-211-2/+12
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8831 280ebfd0-de03-0410-8827-d642c229c3f4
* Added __builtin_unreachable / MPFR_ASSUME support (modified patchvlefevre2014-01-201-3/+30
| | | | | | from Patrick Pélissier). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8814 280ebfd0-de03-0410-8827-d642c229c3f4
* MPFR now depends on GMP 4.2+ instead of 4.1+.vlefevre2014-01-201-69/+14
| | | | | | | | GMP 4.2 compatibility fixed. Code clean-up. (Modified patch from Patrick Pélissier) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8813 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Updated comment of the MPFR_RET_NEVER_GO_HERE macro.vlefevre2014-01-201-3/+5
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8798 280ebfd0-de03-0410-8827-d642c229c3f4
* Spelling consistency:vlefevre2014-01-181-1/+1
| | | | | | | non-negative → nonnegative non-positive → nonpositive git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8796 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Indentation.vlefevre2014-01-171-3/+3
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8757 280ebfd0-de03-0410-8827-d642c229c3f4
* first step towards making MPFR compile with --enable-mini-gmp, so far makezimmerma2014-01-161-0/+4
| | | | | | | succeeds and all tests compile, but many tests fail, will investigate later git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8753 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Fixed the MPFR_ASSERTN macro as suggested byvlefevre2014-01-141-1/+1
| | | | | | | Wolf Lammen: https://sympa.inria.fr/sympa/arc/mpfr/2014-01/msg00002.html Note: the semantics doesn't change, it should just be more efficient. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8746 280ebfd0-de03-0410-8827-d642c229c3f4
* When static assertions are not supported by the C implementationvlefevre2014-01-091-44/+7
| | | | | | | | | | | | | | | | natively (new C11 feature), their MPFR implementation got broken by changeset r8625, as the __MPFR_GNUC macro in mpfr-sassert.h was not defined in the configure test (since mpfr-impl.h wasn't included) and generated an error, disabling the static assertions support. This is fixed by the following changes, avoiding code duplication and thus risk of inconsistencies in future modification: * copied some of the version detection macros from mpfr-impl.h to a standalone file mpfr-cvers.h, and updated the macros; * in mpfr-impl.h, replaced these macros by a #include "mpfr-cvers.h" and updated a comment; * in mpfr-sassert.h, added a #include "mpfr-cvers.h". git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8739 280ebfd0-de03-0410-8827-d642c229c3f4
* Fixed warnings from GCC's -Wold-style-declaration option:vlefevre2014-01-031-1/+1
| | | | | | MPFR_THREAD_ATTR must be at beginning of declaration. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8725 280ebfd0-de03-0410-8827-d642c229c3f4
* Copyright notice update: added 2014 withvlefevre2014-01-031-1/+1
| | | | | | | | | perl -pi -e 's/ (\d{4}-)?(2013)(?= Free Software)/ " ".($1||"$2-").($2+1)/e' **/*(^/) under zsh (the tools/mbench directory was not modified). Removed 2013 from the example in the doc/README.dev file. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8723 280ebfd0-de03-0410-8827-d642c229c3f4
* [sum.c] mpfr_sum should consider the maximal precision of its inputs/outputzimmerma2013-11-041-1/+2
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8699 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Document that DOUBLE_ISNAN(x) is valid on long double.vlefevre2013-09-271-0/+2
| | | | | | | | | [tests/tset_ld.c] In Isnan_ld, do not convert the long double argument to double, as this can give an overflow and unexpected behavior without default IEEE 754 behavior. With this change, this tset_ld test no longer fails with "clang -O2 -fsanitize=undefined -fno-sanitize-recover". git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8690 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] With clang, disable division by zero using constantsvlefevre2013-09-271-2/+10
| | | | | | | | | due to a bug in its sanitizer and because IEEE 754 division by zero is currently not properly supported. With this change, the tget_d test no longer fails with: clang -O2 -fsanitize=undefined -fno-sanitize-recover git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8686 280ebfd0-de03-0410-8827-d642c229c3f4
* Applied patch 3 by Ondřej Bílka with some manual corrections,vlefevre2013-07-221-2/+2
| | | | | | | fixing typos: https://sympa.inria.fr/sympa/arc/mpfr/2013-07/msg00016.html git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8621 280ebfd0-de03-0410-8827-d642c229c3f4