[Gmp-commit] /home/hgfiles/gmp: Purge BSD mp compatible functions.

mercurial at gmplib.org mercurial at gmplib.org
Fri Nov 12 22:06:37 CET 2010


details:   /home/hgfiles/gmp/rev/e7d283e360c8
changeset: 13685:e7d283e360c8
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Fri Nov 12 22:06:32 2010 +0100
description:
Purge BSD mp compatible functions.

diffstat:

 ChangeLog               |   11 +++
 Makefile.am             |   35 +----------
 configure.in            |   29 +--------
 doc/configuration       |    9 --
 doc/gmp.texi            |  147 +-----------------------------------------------
 libmp.sym               |   18 -----
 mpbsd/Makefile.am       |   37 ------------
 mpbsd/itom.c            |   47 ---------------
 mpbsd/mfree.c           |   29 ---------
 mpbsd/min.c             |   88 ----------------------------
 mpbsd/mout.c            |   92 ------------------------------
 mpbsd/mtox.c            |   61 -------------------
 mpbsd/rpow.c            |   32 ----------
 mpbsd/sdiv.c            |   67 ---------------------
 mpbsd/xtom.c            |   87 ----------------------------
 tests/Makefile.am       |    2 +-
 tests/mpbsd/Makefile.am |   35 -----------
 tests/mpbsd/allfuns.c   |   56 ------------------
 tests/mpbsd/t-itom.c    |   74 ------------------------
 tests/mpbsd/t-mtox.c    |   86 ----------------------------
 20 files changed, 20 insertions(+), 1022 deletions(-)

diffs (truncated from 1241 to 300 lines):

diff -r 73a8519a1935 -r e7d283e360c8 ChangeLog
--- a/ChangeLog	Thu Nov 11 14:03:38 2010 +0100
+++ b/ChangeLog	Fri Nov 12 22:06:32 2010 +0100
@@ -1,3 +1,14 @@
+2010-11-12  Torbjorn Granlund  <tege at gmplib.org>
+
+	* Makefile.am: Remove mpbsd.
+	* configure.in: Remove mpbsd.
+	* doc/configuration: Remove mpbsd mentions.
+	* doc/gmp.texi: Remove mpbsd docs.
+	* tests/Makefile.am: Remove mpbsd.
+	* libmp.sym: Remove.
+	* mpbsd: Remove directory and files.
+	* tests/mpbsd: Remove directory and files.
+
 2010-11-11  Torbjorn Granlund  <tege at gmplib.org>
 
 	* mpn/x86_64/atom/aors_n.asm: Don't rely on ZF after 'bt' insn.
diff -r 73a8519a1935 -r e7d283e360c8 Makefile.am
--- a/Makefile.am	Thu Nov 11 14:03:38 2010 +0100
+++ b/Makefile.am	Fri Nov 12 22:06:32 2010 +0100
@@ -92,7 +92,7 @@
 LIBMP_LT_AGE =      1
 
 
-SUBDIRS = tests mpn mpz mpq mpf printf scanf rand cxx mpbsd demos tune doc
+SUBDIRS = tests mpn mpz mpq mpf printf scanf rand cxx demos tune doc
 
 EXTRA_DIST = configfsf.guess configfsf.sub .gdbinit INSTALL.autoconf
 
@@ -112,8 +112,8 @@
 #
 includeexecdir = $(exec_prefix)/include
 include_HEADERS = $(GMPXX_HEADERS_OPTION)
-nodist_includeexec_HEADERS = gmp.h $(MPBSD_HEADERS_OPTION)
-lib_LTLIBRARIES = libgmp.la $(GMPXX_LTLIBRARIES_OPTION) $(MPBSD_LTLIBRARIES_OPTION)
+nodist_includeexec_HEADERS = gmp.h
+lib_LTLIBRARIES = libgmp.la $(GMPXX_LTLIBRARIES_OPTION)
 
 BUILT_SOURCES = gmp.h
 
@@ -233,13 +233,6 @@
   cxx/osdoprnti.lo cxx/osfuns.lo					\
   cxx/osmpf.lo cxx/osmpq.lo cxx/osmpz.lo
 
-MPBSD_OBJECTS = mpbsd/add$U.lo mpbsd/tdiv_qr$U.lo mpbsd/set$U.lo	\
-  mpbsd/powm$U.lo mpbsd/sub$U.lo mpbsd/cmp$U.lo mpbsd/mfree$U.lo	\
-  mpbsd/mtox$U.lo mpbsd/realloc$U.lo mpbsd/gcd$U.lo mpbsd/itom$U.lo	\
-  mpbsd/min$U.lo mpbsd/mul$U.lo mpbsd/mout$U.lo mpbsd/rpow$U.lo		\
-  mpbsd/sdiv$U.lo mpbsd/sqrtrem$U.lo mpbsd/xtom$U.lo
-
-
 # In libtool 1.5 it doesn't work to build libgmp.la from the convenience
 # libraries like mpz/libmpz.la.  Or rather it works, but it ends up putting
 # PIC objects into libgmp.a if shared and static are both built.  (The PIC
@@ -282,28 +275,6 @@
   -version-info $(LIBGMPXX_LT_CURRENT):$(LIBGMPXX_LT_REVISION):$(LIBGMPXX_LT_AGE)
 
 
-# The selected mpz objects here support mpz/powm.c (built as mpbsd/powm.lo)
-# and can probably be removed when that switches to an mpn implementation.
-# (Apart from mpz/n_pow_ui$U.lo, which supports mpbsd/rpow.c)
-
-if WANT_MPBSD
-MPBSD_HEADERS_OPTION = mp.h
-MPBSD_LTLIBRARIES_OPTION = libmp.la
-endif
-BUILT_SOURCES += mp.h
-libmp_la_SOURCES = assert.c errno.c memory.c mp_bpl.c mp_clz_tab.c	\
-  mp_dv_tab.c mp_minv_tab.c mp_get_fns.c mp_set_fns.c nextprime.c
-libmp_la_DEPENDENCIES = $(srcdir)/libmp.sym				\
-  @TAL_OBJECT@ $(MPBSD_OBJECTS) $(MPN_OBJECTS) @mpn_objs_in_libmp@	\
-  mpz/add$U.lo mpz/gcdext$U.lo mpz/invert$U.lo mpz/mul$U.lo		\
-  mpz/n_pow_ui$U.lo mpz/realloc$U.lo mpz/set$U.lo mpz/sub$U.lo		\
-  mpz/tdiv_q$U.lo
-libmp_la_LIBADD = $(libmp_la_DEPENDENCIES)
-libmp_la_LDFLAGS = $(GMP_LDFLAGS) \
-  -version-info $(LIBMP_LT_CURRENT):$(LIBMP_LT_REVISION):$(LIBMP_LT_AGE) \
-  -export-symbols $(srcdir)/libmp.sym
-EXTRA_DIST += libmp.sym
-
 
 install-data-hook:
 	@echo ''
diff -r 73a8519a1935 -r e7d283e360c8 configure.in
--- a/configure.in	Thu Nov 11 14:03:38 2010 +0100
+++ b/configure.in	Fri Nov 12 22:06:32 2010 +0100
@@ -150,17 +150,6 @@
 fi
 
 
-AC_ARG_ENABLE(mpbsd,
-AC_HELP_STRING([--enable-mpbsd],
-               [build Berkeley MP compatibility library [[default=no]]]),
-[case $enableval in
-yes|no) ;;
-*) AC_MSG_ERROR([bad value $enableval for --enable-mpbsd, need yes or no]) ;;
-esac],
-[enable_mpbsd=no])
-AM_CONDITIONAL(WANT_MPBSD, test "$enable_mpbsd" = "yes")
-
-
 AC_ARG_ENABLE(nails,
 AC_HELP_STRING([--enable-nails],[use nails on limbs [[default=no]]]),
 [case $enableval in
@@ -3270,20 +3259,6 @@
 GMP_DEFINE_RAW(["define(<GMP_NUMB_BITS>,eval(GMP_LIMB_BITS-GMP_NAIL_BITS))"])
 
 
-# Exclude the mpn random functions from mpbsd since that would drag in the
-# top-level rand things, all of which are unnecessary for libmp.  There's
-# other unnecessary objects too actually, if we could be bothered figuring
-# out exactly which they are.
-#
-mpn_objs_in_libmp=
-for i in $mpn_objs_in_libgmp; do
-  case $i in
-  *random*) ;;
-  *) mpn_objs_in_libmp="$mpn_objs_in_libmp $i" ;;
-  esac
-done
-AC_SUBST(mpn_objs_in_libmp)
-
 AC_SUBST(mpn_objects)
 AC_SUBST(mpn_objs_in_libgmp)
 AC_SUBST(gmp_srclinks)
@@ -3390,9 +3365,9 @@
 #        Right now automake isn't accepting the new AC_CONFIG_FILES scheme.
 
 AC_OUTPUT(Makefile							\
-  mpbsd/Makefile mpf/Makefile mpn/Makefile mpq/Makefile			\
+  mpf/Makefile mpn/Makefile mpq/Makefile				\
   mpz/Makefile printf/Makefile scanf/Makefile rand/Makefile cxx/Makefile \
-  tests/Makefile tests/devel/Makefile tests/mpbsd/Makefile		\
+  tests/Makefile tests/devel/Makefile					\
   tests/mpf/Makefile tests/mpn/Makefile tests/mpq/Makefile		\
   tests/mpz/Makefile tests/rand/Makefile tests/misc/Makefile		\
   tests/cxx/Makefile							\
diff -r 73a8519a1935 -r e7d283e360c8 doc/configuration
--- a/doc/configuration	Thu Nov 11 14:03:38 2010 +0100
+++ b/doc/configuration	Fri Nov 12 22:06:32 2010 +0100
@@ -323,10 +323,6 @@
 --disable-shared will make builds go much faster, though of course
 shared or shared+static should be tested too.
 
---enable-mpbsd grabs various bits of mpz, which might need to be
-adjusted if things in those routines are changed.  Building mpbsd all
-the time doesn't cost much.
-
 --prefix to a dummy directory followed by "make install" will show
 what's installed.
 
@@ -370,12 +366,6 @@
     will get this in the mangled name because C++ "sees though" the
     typedef mpz_t to the underlying struct.
 
-    Incidentally, this probably means for C++ that our mp.h is not
-    compatible with an original BSD mp.h, since we use struct
-    __mpz_struct for MINT in ours.  Maybe we could change to whatever
-    the original did, but it seems unlikely anyone would be using C++
-    with mp.h.
-
 __gmpn - note that glibc defines some __mpn symbols, old versions of
     some mpn routines, which it uses for floating point printfs.
 
diff -r 73a8519a1935 -r e7d283e360c8 doc/gmp.texi
--- a/doc/gmp.texi	Thu Nov 11 14:03:38 2010 +0100
+++ b/doc/gmp.texi	Fri Nov 12 22:06:32 2010 +0100
@@ -136,7 +136,6 @@
 * Formatted Output::           @code{printf} style output.
 * Formatted Input::            @code{scanf} style input.
 * C++ Class Interface::        Class wrappers around GMP types.
-* BSD Compatible Functions::   All functions found in BSD MP.
 * Custom Allocation::          How to customize the internal allocation.
 * Language Bindings::          Using GMP from other languages.
 * Algorithms::                 What happens behind the scenes.
@@ -1042,14 +1041,6 @@
 Fermat FFT at .  The FFT is only used on large to very large operands and can be
 disabled to save code size if desired.
 
- at item Berkeley MP, @option{--enable-mpbsd}
- at cindex Berkeley MP compatible functions
- at cindex BSD MP compatible functions
- at cindex @code{--enable-mpbsd}
-The Berkeley MP compatibility library (@file{libmp}) and header file
-(@file{mp.h}) are built and installed only if @option{--enable-mpbsd} is used.
- at xref{BSD Compatible Functions}.
-
 @item Assertion Checking, @option{--enable-assert}
 @cindex Assertion checking
 @cindex @code{--enable-assert}
@@ -1981,8 +1972,7 @@
 
 @item
 Functions compatible with Berkeley MP, such as @code{itom}, @code{madd}, and
- at code{mult}.  The associated type is @code{MINT}.  (@pxref{BSD Compatible
-Functions})
+ at code{mult}.  The associated type is @code{MINT}.
 
 @item
 Fast low-level functions that operate on natural numbers.  These are used by
@@ -2241,10 +2231,6 @@
 course also apply when porting applications from GMP 1 to GMP 4.  Please
 see the GMP 2 manual for details.
 
-The Berkeley MP compatibility library (@pxref{BSD Compatible Functions}) is
-source and binary compatible with the standard @file{libmp}.
-
- at c @enumerate
 @c @item Integer division functions round the result differently.  The obsolete
 @c functions (@code{mpz_div}, @code{mpz_divmod}, @code{mpz_mdiv},
 @c @code{mpz_mdivmod}, etc) now all use floor rounding (i.e., they round the
@@ -6367,7 +6353,7 @@
 
 
 
- at node C++ Class Interface, BSD Compatible Functions, Formatted Input, Top
+ at node C++ Class Interface, Custom Allocation, Formatted Input, Top
 @chapter C++ Class Interface
 @cindex C++ interface
 
@@ -6938,131 +6924,7 @@
 @end table
 
 
- at node BSD Compatible Functions, Custom Allocation, C++ Class Interface, Top
- at comment  node-name,  next,  previous,  up
- at chapter Berkeley MP Compatible Functions
- at cindex Berkeley MP compatible functions
- at cindex BSD MP compatible functions
-
-These functions are intended to be fully compatible with the Berkeley MP
-library which is available on many BSD derived U*ix systems.  The
- at samp{--enable-mpbsd} option must be used when building GNU MP to make these
-available (@pxref{Installing GMP}).
-
-The original Berkeley MP library has a usage restriction: you cannot use the
-same variable as both source and destination in a single function call.  The
-compatible functions in GNU MP do not share this restriction---inputs and
-outputs may overlap.
-
-It is not recommended that new programs are written using these functions.
-Apart from the incomplete set of functions, the interface for initializing
- at code{MINT} objects is more error prone, and the @code{pow} function collides
-with @code{pow} in @file{libm.a}.
-
- at cindex @code{mp.h}
- at tindex MINT
-Include the header @file{mp.h} to get the definition of the necessary types and
-functions.  If you are on a BSD derived system, make sure to include GNU
- at file{mp.h} if you are going to link the GNU @file{libmp.a} to your program.
-This means that you probably need to give the @samp{-I<dir>} option to the
-compiler, where @samp{<dir>} is the directory where you have GNU @file{mp.h}.
-
- at deftypefun {MINT *} itom (signed short int @var{initial_value})
-Allocate an integer consisting of a @code{MINT} object and dynamic limb space.
-Initialize the integer to @var{initial_value}.  Return a pointer to the
- at code{MINT} object.
- at end deftypefun
-
- at deftypefun {MINT *} xtom (char *@var{initial_value})
-Allocate an integer consisting of a @code{MINT} object and dynamic limb space.
-Initialize the integer from @var{initial_value}, a hexadecimal,
-null-terminated C string.  Return a pointer to the @code{MINT} object.
- at end deftypefun
-
- at deftypefun void move (MINT *@var{src}, MINT *@var{dest})
-Set @var{dest} to @var{src} by copying.  Both variables must be previously
-initialized.
- at end deftypefun
-
- at deftypefun void madd (MINT *@var{src_1}, MINT *@var{src_2}, MINT *@var{destination})
-Add @var{src_1} and @var{src_2} and put the sum in @var{destination}.
- at end deftypefun
-
- at deftypefun void msub (MINT *@var{src_1}, MINT *@var{src_2}, MINT *@var{destination})
-Subtract @var{src_2} from @var{src_1} and put the difference in
- at var{destination}.
- at end deftypefun
-
- at deftypefun void mult (MINT *@var{src_1}, MINT *@var{src_2}, MINT *@var{destination})
-Multiply @var{src_1} and @var{src_2} and put the product in @var{destination}.
- at end deftypefun
-
- at deftypefun void mdiv (MINT *@var{dividend}, MINT *@var{divisor}, MINT *@var{quotient}, MINT *@var{remainder})
- at deftypefunx void sdiv (MINT *@var{dividend}, signed short int @var{divisor}, MINT *@var{quotient}, signed short int *@var{remainder})
-Set @var{quotient} to @var{dividend}/@var{divisor}, and @var{remainder} to
- at var{dividend} mod @var{divisor}.  The quotient is rounded towards zero; the
-remainder has the same sign as the dividend unless it is zero.
-
-Some implementations of these functions work differently---or not at all---for
-negative arguments.
- at end deftypefun
-
- at deftypefun void msqrt (MINT *@var{op}, MINT *@var{root}, MINT *@var{remainder})
-Set @var{root} to @m{\lfloor\sqrt{@var{op}}\rfloor, the truncated integer part
-of the square root of @var{op}}, like @code{mpz_sqrt}.  Set @var{remainder} to
- at m{(@var{op} - @var{root}^2), @var{op}@minus{}@var{root}*@var{root}}, i.e.
-zero if @var{op} is a perfect square.
-


More information about the gmp-commit mailing list