Like libgmp, libmpfr has the ability to tune itself to the cpu used, e.g.
core2, k8, etc. Currently we are not taking advantage of this situation,
but in the future the CPU_TYPE variable should be examined for tuning
purposes.
libmpfr is a requirement to build gcc-4.4 and later versions.
ChangeLog
-FAQ.html
INSTALL
+Makefile.am
+Makefile.in
NEWS
PATCHES
TODO
compile
config.guess
config.sub
-configure.in
+configure
+configure.ac
depcomp
+doc/FAQ.html
+doc/Makefile.am
+doc/Makefile.in
+doc/fdl.texi
+doc/mpfr.texi
+doc/texinfo.tex
examples/
-get_patches.sh
install-sh
ltmain.sh
m4/
missing
+src/Makefile.am
+src/Makefile.in
+src/arm/
+src/hppa/
+src/ia64/
+src/mparam_h.in
+src/powerpc32/
+src/powerpc64/
+src/sparc64/
tests/
+tools/
+tune/
+MULTIPLE PRECISION FLOATING POINT LIBRARY (MPFR)
+================================================
+
Original Source can be downloaded from:
http://www.mpfr.org
-file = mpfr-2.4.2.tar
-date = 30 Nov 2009
-size = 7137280
-sha1 = a927628065345b0706a71bfc1f08c23f036061a8
-
-file = mpfr-2.4.2-allpatches
-date = 11 Jan 2010
-size = 12218
-sha1 = c1a576a8279c705dbba3b33822ee615b009a1ac2
+file = mpfr-3.1.0.tar.bz2
+date = 3 October 2011
+size = 1203891
+sha1 = 9ba6dfe62dad298f0570daf182db31660f7f016c
A list of files and directories removed is in README.DELETED
-These sources are used only by the build of gcc-4.4+.
CFLAGS+= -I${GCCDIR}/libdecnumber -I${GCCDIR}/libdecnumber/dpd
CFLAGS+= -I${OTOPDIR}/libdecnumber
CFLAGS+= -I${STOPDIR}/gmp
-CFLAGS+= -I${.CURDIR}/${TOP_PREFIX}/../../../../contrib/mpfr -I${STOPDIR}/mpfr
+CFLAGS+= -I${.CURDIR}/${TOP_PREFIX}/../../../../contrib/mpfr/src -I${STOPDIR}/mpfr
CFLAGS+= -I${GCCDIR}/gcc/config/${GCC_CPU} -I${TOOLDIR}
CFLAGS+= -DIN_GCC -DHAVE_CONFIG_H
-CONTRIBDIR= ${.CURDIR}/../../../../contrib/mpfr
+CONTRIBDIR= ${.CURDIR}/../../../../contrib/mpfr/src
.PATH: ${CONTRIBDIR}
LIB= mpfr
-DMPFR_HAVE_FESETROUND=1 -DHAVE_DENORMS=1 -DHAVE_ROUND=1 \
-DHAVE_TRUNC=1 -DHAVE_FLOOR=1 -DHAVE_CEIL=1 \
-DHAVE_LDOUBLE_IEEE_EXT_LITTLE=1 -DHAVE_ATTRIBUTE_MODE=1
+CFLAGS+=-DHAVE_VA_COPY=1 -DMPFR_HAVE_INTMAX_MAX=1 -DHAVE_NEARBYINT=1 \
+ -DMPFR_USE_THREAD_SAFE=1 -DHAVE___GMPN_ROOTREM=1 \
+ -DHAVE___GMPN_SBPI1_DIVAPPR_Q=1
# almost verbatim copy from Makefile
-SRCS = mpfr.h mpfr-gmp.h mpfr-impl.h \
- mpfr-longlong.h mpfr-thread.h exceptions.c extract.c \
- uceil_exp2.c uceil_log2.c ufloor_log2.c add.c add1.c add_ui.c \
- agm.c clear.c cmp.c cmp_abs.c cmp_si.c cmp_ui.c comparisons.c \
- div_2exp.c div_2si.c div_2ui.c div.c div_ui.c dump.c eq.c \
- exp10.c exp2.c exp3.c exp.c frac.c get_d.c get_exp.c get_str.c \
- init.c inp_str.c isinteger.c isinf.c isnan.c isnum.c \
- const_log2.c log.c modf.c mul_2exp.c mul_2si.c mul_2ui.c mul.c \
- mul_ui.c neg.c next.c out_str.c printf.c vasprintf.c \
- const_pi.c pow.c pow_si.c pow_ui.c print_raw.c \
- print_rnd_mode.c random2.c random.c reldiff.c round_prec.c \
- set.c setmax.c setmin.c set_d.c set_dfl_prec.c set_exp.c \
- set_rnd.c set_f.c set_prc_raw.c set_prec.c set_q.c set_si.c \
- set_str.c set_str_raw.c set_ui.c set_z.c sqrt.c sqrt_ui.c \
- sub.c sub1.c sub_ui.c rint.c ui_div.c ui_sub.c urandomb.c \
- get_z_exp.c swap.c factorial.c cosh.c sinh.c tanh.c \
- sinh_cosh.c acosh.c asinh.c atanh.c atan.c cmp2.c exp_2.c \
- asin.c const_euler.c cos.c sin.c tan.c fma.c fms.c hypot.c \
- log1p.c expm1.c log2.c log10.c ui_pow.c ui_pow_ui.c minmax.c \
- dim.c signbit.c copysign.c setsign.c gmp_op.c init2.c acos.c \
- sin_cos.c set_nan.c set_inf.c powerof2.c gamma.c set_ld.c \
- get_ld.c cbrt.c volatile.c fits_s.h fits_sshort.c fits_sint.c \
- fits_slong.c fits_u.h fits_ushort.c fits_uint.c fits_ulong.c \
- fits_uintmax.c fits_intmax.c get_si.c get_ui.c zeta.c cmp_d.c \
- erf.c inits.c inits2.c clears.c sgn.c check.c sub1sp.c \
- version.c mpn_exp.c mpfr-gmp.c mp_clz_tab.c sum.c add1sp.c \
- free_cache.c si_op.c cmp_ld.c set_ui_2exp.c set_si_2exp.c \
- set_uj.c set_sj.c get_sj.c get_uj.c get_z.c iszero.c cache.c \
- sqr.c int_ceil_log2.c isqrt.c strtofr.c pow_z.c logging.c \
+SRCS = mpfr.h mpf2mpfr.h mpfr-gmp.h mpfr-impl.h mpfr-intmax.h \
+ mpfr-longlong.h mpfr-thread.h exceptions.c extract.c uceil_exp2.c \
+ uceil_log2.c ufloor_log2.c add.c add1.c add_ui.c agm.c clear.c cmp.c \
+ cmp_abs.c cmp_si.c cmp_ui.c comparisons.c div_2exp.c div_2si.c \
+ div_2ui.c div.c div_ui.c dump.c eq.c exp10.c exp2.c exp3.c exp.c \
+ frac.c frexp.c get_d.c get_exp.c get_str.c init.c inp_str.c \
+ isinteger.c isinf.c isnan.c isnum.c const_log2.c log.c modf.c \
+ mul_2exp.c mul_2si.c mul_2ui.c mul.c mul_ui.c neg.c next.c out_str.c \
+ printf.c vasprintf.c const_pi.c pow.c pow_si.c pow_ui.c print_raw.c \
+ print_rnd_mode.c reldiff.c round_prec.c set.c setmax.c setmin.c \
+ set_d.c set_dfl_prec.c set_exp.c set_rnd.c set_f.c set_prc_raw.c \
+ set_prec.c set_q.c set_si.c set_str.c set_str_raw.c set_ui.c set_z.c \
+ sqrt.c sqrt_ui.c sub.c sub1.c sub_ui.c rint.c ui_div.c ui_sub.c \
+ urandom.c urandomb.c get_z_exp.c swap.c factorial.c cosh.c sinh.c \
+ tanh.c sinh_cosh.c acosh.c asinh.c atanh.c atan.c cmp2.c exp_2.c \
+ asin.c const_euler.c cos.c sin.c tan.c fma.c fms.c hypot.c log1p.c \
+ expm1.c log2.c log10.c ui_pow.c ui_pow_ui.c minmax.c dim.c signbit.c \
+ copysign.c setsign.c gmp_op.c init2.c acos.c sin_cos.c set_nan.c \
+ set_inf.c set_zero.c powerof2.c gamma.c set_ld.c get_ld.c cbrt.c \
+ volatile.c fits_s.h fits_sshort.c fits_sint.c fits_slong.c fits_u.h \
+ fits_ushort.c fits_uint.c fits_ulong.c fits_uintmax.c fits_intmax.c \
+ get_si.c get_ui.c zeta.c cmp_d.c erf.c inits.c inits2.c clears.c \
+ sgn.c check.c sub1sp.c version.c mpn_exp.c mpfr-gmp.c mp_clz_tab.c \
+ sum.c add1sp.c free_cache.c si_op.c cmp_ld.c set_ui_2exp.c \
+ set_si_2exp.c set_uj.c set_sj.c get_sj.c get_uj.c get_z.c iszero.c \
+ cache.c sqr.c int_ceil_log2.c isqrt.c strtofr.c pow_z.c logging.c \
mulders.c get_f.c round_p.c erfc.c atan2.c subnormal.c \
- const_catalan.c root.c gen_inverse.h sec.c csc.c cot.c eint.c \
- sech.c csch.c coth.c round_near_x.c constant.c \
- abort_prec_max.c stack_interface.c lngamma.c zeta_ui.c \
- set_d64.c get_d64.c jn.c yn.c rem1.c get_patches.c add_d.c \
- sub_d.c d_sub.c mul_d.c div_d.c d_div.c li2.c rec_sqrt.c
-
-SRCS+= mparam.h
-
-mparam.h: mparam_h.in
- cp ${.ALLSRC} ${.TARGET}
-CLEANFILES+= mparam.h
+ const_catalan.c root.c gen_inverse.h sec.c csc.c cot.c eint.c sech.c \
+ csch.c coth.c round_near_x.c constant.c abort_prec_max.c \
+ stack_interface.c lngamma.c zeta_ui.c set_d64.c get_d64.c jn.c yn.c \
+ rem1.c get_patches.c add_d.c sub_d.c d_sub.c mul_d.c div_d.c d_div.c \
+ li2.c rec_sqrt.c min_prec.c buildopt.c digamma.c bernoulli.c \
+ isregular.c set_flt.c get_flt.c scale2.c set_z_exp.c ai.c \
+ gammaonethird.c ieee_floats.h grandom.c
.include <bsd.lib.mk>
--- /dev/null
+/* Various Thresholds of MPFR, not exported. -*- mode: C -*-
+
+Copyright 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+
+This file is part of the GNU MPFR Library.
+
+The GNU MPFR Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+The GNU MPFR Library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
+http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
+51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#ifndef __MPFR_IMPL_H__
+# error "MPFR Internal not included"
+#endif
+
+/* Note: the different macros used here are those defined by gcc,
+ for example with gcc -dM -E -xc /dev/null
+ As of gcc 4.2, you can also use: -march=native or -mtune=native */
+
+#if defined (__tune_pentium4__) /* Threshold for Pentium 4 */
+#define MPFR_TUNE_CASE "src/x86_64/pentium4/mparam.h"
+#include "x86_64/pentium4/mparam.h"
+
+#elif defined (__tune_core2__) && defined (__x86_64) /* 64-bit Core 2 */
+#define MPFR_TUNE_CASE "src/x86_64/core2/mparam.h"
+#include "x86_64/core2/mparam.h"
+
+#elif defined (__tune_core2__) && defined (__i386) /* 32-bit Core 2,
+ for example a 64-bit machine with gmp/mpfr compiled with ABI=32 */
+#define MPFR_TUNE_CASE "src/x86/core2/mparam.h"
+#include "x86/core2/mparam.h"
+
+#elif defined (__tune_k8__) /* Threshold for AMD 64 */
+#define MPFR_TUNE_CASE "src/amd/k8/mparam.h"
+#include "amd/k8/mparam.h"
+
+#elif defined (__tune_athlon__) /* Threshold for Athlon */
+#define MPFR_TUNE_CASE "src/amd/athlon/mparam.h"
+#include "amd/athlon/mparam.h"
+
+#elif defined (__tune_pentiumpro__) || defined (__tune_i686__) || defined (__i386) /* we consider all other 386's here */
+#define MPFR_TUNE_CASE "src/x86/mparam.h"
+#include "x86/mparam.h"
+
+#elif defined (__ia64) || defined (__itanium__) || defined (__tune_ia64__)
+/* Threshold for IA64 */
+#define MPFR_TUNE_CASE "src/ia64/mparam.h"
+#include "ia64/mparam.h"
+
+#elif defined (__arm__) /* Threshold for ARM */
+#define MPFR_TUNE_CASE "src/arm/mparam.h"
+#include "arm/mparam.h"
+
+#elif defined (_ARCH_PPC) /* Threshold for 32-bit PowerPC */
+#define MPFR_TUNE_CASE "src/powerpc32/mparam.h"
+#include "powerpc32/mparam.h"
+
+#elif defined (__PPC64__) /* Threshold for 64-bit PowerPC */
+#define MPFR_TUNE_CASE "src/powerpc64/mparam.h"
+#include "powerpc64/mparam.h"
+
+#elif defined (__sparc_v9__) /* Threshold for 64-bits Sparc */
+#define MPFR_TUNE_CASE "src/sparc64/mparam.h"
+#include "sparc64/mparam.h"
+
+#elif defined (__hppa__) /* Threshold for HPPA */
+#define MPFR_TUNE_CASE "src/hppa/mparam.h"
+#include "hppa/mparam.h"
+
+#else
+#define MPFR_TUNE_CASE "default"
+#endif
+
+/****************************************************************
+ * Default values of Threshold. *
+ * Must be included in any case: it checks, for every constant, *
+ * if it has been defined, and it sets it to a default value if *
+ * it was not previously defined. *
+ ****************************************************************/
+#include "generic/mparam.h"