[project @ 2000-08-21 15:12:04 by simonmar]
authorsimonmar <unknown>
Mon, 21 Aug 2000 15:12:07 +0000 (15:12 +0000)
committersimonmar <unknown>
Mon, 21 Aug 2000 15:12:07 +0000 (15:12 +0000)
merge conflicts (I hope)

99 files changed:
ghc/rts/gmp/ChangeLog [deleted file]
ghc/rts/gmp/Makefile.in
ghc/rts/gmp/PROJECTS [deleted file]
ghc/rts/gmp/SPEED [deleted file]
ghc/rts/gmp/config.guess
ghc/rts/gmp/config.sub
ghc/rts/gmp/config/mt-linux [deleted file]
ghc/rts/gmp/config/mt-m88110 [deleted file]
ghc/rts/gmp/config/mt-sprc8-gcc [deleted file]
ghc/rts/gmp/config/mt-supspc-gcc [deleted file]
ghc/rts/gmp/configure [new file with mode: 0644]
ghc/rts/gmp/configure.in
ghc/rts/gmp/cre-mparam.c [deleted file]
ghc/rts/gmp/demos/factorize.c [deleted file]
ghc/rts/gmp/extract-double.c [deleted file]
ghc/rts/gmp/gmp-impl.h
ghc/rts/gmp/gmp.h
ghc/rts/gmp/insert-double.c [deleted file]
ghc/rts/gmp/install.sh [deleted file]
ghc/rts/gmp/make.bat [deleted file]
ghc/rts/gmp/move-if-change [deleted file]
ghc/rts/gmp/mpn/alpha/add_n.s [deleted file]
ghc/rts/gmp/mpn/alpha/addmul_1.s [deleted file]
ghc/rts/gmp/mpn/alpha/ev5/add_n.s [deleted file]
ghc/rts/gmp/mpn/alpha/ev5/lshift.s [deleted file]
ghc/rts/gmp/mpn/alpha/ev5/rshift.s [deleted file]
ghc/rts/gmp/mpn/alpha/ev5/sub_n.s [deleted file]
ghc/rts/gmp/mpn/alpha/lshift.s [deleted file]
ghc/rts/gmp/mpn/alpha/mul_1.s [deleted file]
ghc/rts/gmp/mpn/alpha/rshift.s [deleted file]
ghc/rts/gmp/mpn/alpha/sub_n.s [deleted file]
ghc/rts/gmp/mpn/alpha/submul_1.s [deleted file]
ghc/rts/gmp/mpn/bsd.h [deleted file]
ghc/rts/gmp/mpn/config/t-oldgas [deleted file]
ghc/rts/gmp/mpn/config/t-ppc-aix [deleted file]
ghc/rts/gmp/mpn/config/t-pwr-aix [deleted file]
ghc/rts/gmp/mpn/configure.in [deleted file]
ghc/rts/gmp/mpn/generic/divmod_1.c [deleted file]
ghc/rts/gmp/mpn/generic/random2.c
ghc/rts/gmp/mpn/hppa/hppa1_1/udiv_qrnnd.s [deleted file]
ghc/rts/gmp/mpn/msdos/asm-syntax.h [deleted file]
ghc/rts/gmp/mpn/powerpc32/add_n.s [deleted file]
ghc/rts/gmp/mpn/powerpc32/addmul_1.s [deleted file]
ghc/rts/gmp/mpn/powerpc32/lshift.s [deleted file]
ghc/rts/gmp/mpn/powerpc32/mul_1.s [deleted file]
ghc/rts/gmp/mpn/powerpc32/rshift.s [deleted file]
ghc/rts/gmp/mpn/powerpc32/sub_n.s [deleted file]
ghc/rts/gmp/mpn/powerpc32/submul_1.s [deleted file]
ghc/rts/gmp/mpn/sparc32/add_n.S [deleted file]
ghc/rts/gmp/mpn/sparc32/addmul_1.S [deleted file]
ghc/rts/gmp/mpn/sparc32/lshift.S [deleted file]
ghc/rts/gmp/mpn/sparc32/mul_1.S [deleted file]
ghc/rts/gmp/mpn/sparc32/rshift.S [deleted file]
ghc/rts/gmp/mpn/sparc32/sub_n.S [deleted file]
ghc/rts/gmp/mpn/sparc32/submul_1.S [deleted file]
ghc/rts/gmp/mpn/sparc32/udiv_fp.S [deleted file]
ghc/rts/gmp/mpn/sparc32/udiv_nfp.S [deleted file]
ghc/rts/gmp/mpn/sparc32/v8/addmul_1.S [deleted file]
ghc/rts/gmp/mpn/sparc32/v8/mul_1.S [deleted file]
ghc/rts/gmp/mpn/sparc32/v8/submul_1.S [deleted file]
ghc/rts/gmp/mpn/sparc32/v8/supersparc/udiv.S [deleted file]
ghc/rts/gmp/mpn/sparc64/add_n.s [deleted file]
ghc/rts/gmp/mpn/sparc64/addmul_1.s [deleted file]
ghc/rts/gmp/mpn/sparc64/lshift.s [deleted file]
ghc/rts/gmp/mpn/sparc64/mul_1.s [deleted file]
ghc/rts/gmp/mpn/sparc64/rshift.s [deleted file]
ghc/rts/gmp/mpn/sparc64/sub_n.s [deleted file]
ghc/rts/gmp/mpn/sparc64/submul_1.s [deleted file]
ghc/rts/gmp/mpn/sysv.h [deleted file]
ghc/rts/gmp/mpn/tests/add_n.c [deleted file]
ghc/rts/gmp/mpn/tests/addmul_1.c [deleted file]
ghc/rts/gmp/mpn/tests/divmod_1.c [deleted file]
ghc/rts/gmp/mpn/tests/divrem.c [deleted file]
ghc/rts/gmp/mpn/tests/lshift.c [deleted file]
ghc/rts/gmp/mpn/tests/mul_1.c [deleted file]
ghc/rts/gmp/mpn/tests/rshift.c [deleted file]
ghc/rts/gmp/mpn/tests/sub_n.c [deleted file]
ghc/rts/gmp/mpn/tests/submul_1.c [deleted file]
ghc/rts/gmp/mpn/tests/tst-addsub.c [deleted file]
ghc/rts/gmp/mpn/x86/add_n.S [deleted file]
ghc/rts/gmp/mpn/x86/addmul_1.S [deleted file]
ghc/rts/gmp/mpn/x86/lshift.S [deleted file]
ghc/rts/gmp/mpn/x86/mul_1.S [deleted file]
ghc/rts/gmp/mpn/x86/pentium/add_n.S [deleted file]
ghc/rts/gmp/mpn/x86/pentium/addmul_1.S [deleted file]
ghc/rts/gmp/mpn/x86/pentium/lshift.S [deleted file]
ghc/rts/gmp/mpn/x86/pentium/mul_1.S [deleted file]
ghc/rts/gmp/mpn/x86/pentium/rshift.S [deleted file]
ghc/rts/gmp/mpn/x86/pentium/sub_n.S [deleted file]
ghc/rts/gmp/mpn/x86/pentium/submul_1.S [deleted file]
ghc/rts/gmp/mpn/x86/rshift.S [deleted file]
ghc/rts/gmp/mpn/x86/sub_n.S [deleted file]
ghc/rts/gmp/mpn/x86/submul_1.S [deleted file]
ghc/rts/gmp/mpn/x86/syntax.h [deleted file]
ghc/rts/gmp/mpz/Makefile.in
ghc/rts/gmp/mpz/configure.in [deleted file]
ghc/rts/gmp/mpz/dmincl.c [deleted file]
ghc/rts/gmp/mpz/mul_ui.c [deleted file]
ghc/rts/gmp/urandom.h

diff --git a/ghc/rts/gmp/ChangeLog b/ghc/rts/gmp/ChangeLog
deleted file mode 100644 (file)
index 1c29f1e..0000000
+++ /dev/null
@@ -1,3193 +0,0 @@
-Thu Jun  6 19:00:53 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * Version 2.0.2 released.
-
-       * install.sh: New file.
-       * Makefile.in (INSTALL): Use install.sh.
-       (install-normal): New name for target `install'.
-       (install): New dummy target.
-
-       * mpz/pow_ui.c: Swap tests for (e == 0) and (bsize == 0).
-       * mpz/ui_pow_ui.c: Swap tests for (e == 0) and (blimb == 0).
-
-       * config/mt-linux (AR_FLAGS): New file.
-       * configure.in: Use config/mt-linux for all linux systems.
-
-Tue Jun  4 03:42:18 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * Version 2.0.1 released.
-
-       * mpf/tests/ref.c: Cast result of TMP_ALLOC to the right pointer type.
-
-       * extract-double.c: Test _GMP_IEEE_FLOATS with #if, not plain if.
-
-       * insert-double.c: Don't #include stdlib.h.
-
-       * gmp-impl.h (union ieee_double_extract): Test sparc and __sparc.
-       Do not test __sparc__.
-
-       * mpf/reldiff.c: Change declaration to work around irix5 compiler bug.
-       * mpq/equal.c: Likewise.
-
-       * mpn/generic/gcd.c: Delete spurious comma at end of enumeration.
-
-       * mpn/generic/gcdext.c: Add K&R declaration syntax.
-       * stack-alloc.h: Likewise.
-       * insert-double.c: Likewise.
-       * extract-double.c: Likewise.
-       * mpf/tests/reuse.c: Likewise.
-       * mpz/tests/reuse.c: Likewise.
-       * mpf/tests/t-sub.c: Likewise.
-       * mpf/tests/t-add.c: Likewise.
-       * mpf/tests/t-muldiv.c: Likewise.
-       * mpf/tests/t-conv.c: Likewise.
-       * mpf/tests/ref.c: Likewise.
-
-       * mpn/config/t-oldgas: Renamed from t-freebsd.
-       * mpn/configure.in: Use t-oldgas for freebsd, netbsd, and some linux
-       configurations.
-
-       * mpn/powerpc32/mul_1.s: Really clear cy before entering loop.
-       * mpn/powerpc32/*.s: Fix power/powerpc syntax issues.
-
-       * mpn/config/t-ppc-aix: New file.
-       * mpn/configure.in: Use t-ppc-aix for powerpc like t-pwr-aix for power.
-
-Wed May 29 02:07:31 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * gmp.h (mp_bits_per_limb): Change qualifier from `const' to
-       __gmp_const.
-
-       * gmp.h (mpf_init_set_str): Add `const' qualifier for 2nd parameter.
-       * mpf/iset_str.c: Likewise.
-
-Mon May 27 00:15:58 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * gmp-impl.h: Declare __gmp_extract_double.
-
-       * mpz/set_q.c: Delete unused variables.
-
-       * gmp.h (mpq_equal): Declare.
-
-       * mpf/eq.c: mpf_cmp2 -> mpf_eq.
-
-Fri May 24 03:20:44 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * mpz/iset_d.c: Don't include <math.h>.
-
-       * insert-double.c (__gmp_scale2): New name for scal2.
-       * mpz/get_d.c: Corresponding change.
-       * mpf/get_d.c: Likewise.
-       * mpq/get_d.c: Likewise.
-       * gmp-impl.h: Declare __gmp_scale2.
-
-       * mpn/generic/scan0.c: Clarify comment.
-
-       * mpz/set_q.c: New file.
-       * Makefile.in: Compile it.
-       * make.bat: Likewise.
-       * gmp.h: Declare mpz_set_q.
-
-       * insert-double.c: New file.
-       * Makefile.in: Compile it.
-       * make.bat: Likewise.
-
-       * mpz/get_d.c: New file.
-       * mpz/Makefile.in: Compile it.
-       * make.bat: Likewise.
-       * gmp.h: Declare mpz_get_d.
-
-       * mpf/get_d.c: New file.
-       * mpf/Makefile.in: Compile it.
-       * make.bat: Likewise.
-       * gmp.h: Declare mpf_get_d.
-
-       * make.bat: Compile things in alphabetical order.
-
-       * gmp-impl.h (MP_BASE_AS_DOUBLE): New #define.
-       (LIMBS_PER_DOUBLE): New #define.
-
-       * extract-double.c: New file.
-       * Makefile.in: Compile it.
-       * make.bat: Likewise.
-       * mpz/set_d.c: Rewrite to use __gmp_extract_double.
-       * mpf/set_d.c: Likewise.
-
-       * mpn/configure.in: Use t-pwr-aix also for aix 3.2.4 and up.
-
-Wed May 22 02:48:35 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * gmp-impl.h: Rework code for defining ieee_double_extract.
-       (IEEE_DOUBLE_BIG_ENDIAN): Macro removed.
-       (_GMP_IEEE_FLOATS): New macro.
-       * mpn/vax/gmp-mparam.h: Delete.
-
-       * mpn/config/t-pwr-aix: New file.
-       * mpn/configure.in: Use t-pwr-aix for aix 4 and later.
-
-Mon May 20 16:30:31 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * gmp.h: In code for setting _GMP_H_HAVE_FILE, test more symbols.
-
-       * mpf/tests/t-add.c (oo): Add some `l' printf modifiers.
-       * mpf/tests/t-sub.c (oo): Likewise.
-       * mpf/tests/t-conv.c (oo): Likewise.
-       * mpf/tests/t-sqrt.c (oo): Likewise.
-
-       * mpz/tests/t-mul.c (_mpn_mul_classic): Remove unused variables.
-
-       * mpn/{pyr,i960,clipper}/*.s: Add missing copyright headers.
-
-Fri May 17 02:24:43 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * mpz/set_d.c: Call _mpz_realloc.
-
-       * mpq/set_z.c: New file.
-       * mpq/Makefile.in: Compile it.
-       * make.bat: Likewise.
-       * gmp.h: Declare mpq_set_z.
-
-       * mp?/Makefile.in (libmp?.a): Depend on Makefile, not Makefile.in.
-       * mpf/Makefile.in (test): Delete spurious target.
-       * mpq/Makefile.in (test): Likewise.
-
-       * mpf/out_str.c: Use `e' to separate exponent when base <= 10.
-
-       * mpn/configure.in: Treat ultrasparc just like sparc v8,
-       until 64-bit compilers are ready.
-
-       * mpf/set_d.c: Make it work for 64-bit machines.
-
-Thu May 16 20:53:57 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * gmp-impl.h: Set IEEE_DOUBLE_BIG_ENDIAN to 0 for little-endian
-       machines.
-       * mpn/x86/gmp-mparam.h: Delete file.
-
-       * configure.in: Treat microsparc like sparc8.
-
-       * urandom.h: Test __alpha instead of __alpha__, since the former
-       is the standard symbol.
-       * mpn/generic/random2.c: Likewise.
-       * mpf/random2.c: Likewise.
-
-Tue May 14 13:42:39 1996  Torbjorn Granlund  (tege@tiny.tmg.se)
-
-       * mpz/set_f.c: New file.
-       * mpz/Makefile.in: Compile it.
-       * gmp.h: Declare mpz_set_f.
-
-       * mpf/set_q.c: Simplify expression in rsize == nsize if-then-else arms.
-
-Tue May 14 13:03:07 1996  Torbjorn Granlund  (tege@tiny.tmg.se)
-
-       * make.bat: Add all new files.
-
-Sun May 12 22:24:36 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * mpf/set_z.c: New file.
-       * mpf/Makefile.in: Compile it.
-       * gmp.h: Declare mpf_set_z.
-
-Sat May 11 19:26:25 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * gmp.h: Declare mpf_set_q.
-
-       * mpf/set_q.c: Compute prec-1 limbs in mpn_divrem call.
-
-Fri May 10 17:37:38 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * mpf/set_q.c: New file.
-       * mpf/Makefile.in: Compile it.
-
-       * config.sub: Recognize sparc8.
-
-Wed May  8 09:19:11 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * mpf/tests/t-dm2exp.c: New file.
-
-       * mpf/tests/t-add.c: Correct header comment.
-       * mpf/tests/t-sub.c: Likewise.
-       * mpf/tests/t-sqrt.c: Likewise.
-
-       * mpf/div.c: Misc variable name cleanups.
-       * mpf/div_ui.c: Base more closely on mpf/div.c.
-       * mpf/ui_div.c: Likewise.
-
-       * mpz/tests/Makefile.in (check): Depend on Makefile.
-       * mpq/tests/Makefile.in (check): Likewise.
-       * mpf/tests/Makefile.in (check): Likewise.
-
-       * mpf/tests/t-muldiv.c: New file.
-       * mpf/tests/Makefile.in: Compile and run `t-muldiv'.
-       (t-ref.o): Delete spurious rule.
-
-       * mpf/sqrt.c: Properly detect negative input operand.
-
-       * mpf/sqrt_ui.c: Delete spurious header comment.
-       * mpf/sqrt.c: Likewise.
-       * mpz/sqrt.c: Likewise.
-
-       * mpz/tests/reuse.c (main): Read `reps' from command line.
-
-       * mpf/tests/reuse.c: New file.
-       * mpf/tests/Makefile.in: Compile and run `reuse'.
-
-       * mpf/mul_ui.c: Disable code for removing low zero limbs.
-
-       * mpf/div.c: Fix condition for when vp and qp overlaps.
-
-       * mpf/add_ui.c: When sum equals u, copy up to prec+1 limbs.
-
-       * mpf/out_str.c: Don't output '\n' after exponent.
-
-       * mpf/add_ui.c: New special case for when U is completely cancelled.
-
-Wed Apr 24 05:33:28 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * Version 2.0 released.
-
-       * All files: Upfate FSF's address.
-
-       * Makefile.in (gmp_toc.html): New name for gmp.html.
-       (TAGS): Depend on force.
-
-       * mpf/tests/t-conv.c: Pass -base to mpf_set_str.
-
-Sat Apr 20 03:54:06 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * Makefile.in (ps): New target, depend on gmp.ps.
-
-Fri Apr 19 14:03:15 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * mpf/out_str.c: Print `@' before exponent, not `e'.
-
-       * make.bat: Update from Makefiles.
-
-Thu Apr 18 01:22:05 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * mpf/set_str.c: If parameter `base' is negative, expect exponent
-       to be decimal, otherwise in the same base as the mantissa.
-
-Wed Apr 17 17:28:36 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * mpf/set_dfl_prec.c: Don't return anything.
-       * gmp.h: Corresponding changes.
-
-       * mpf/set_dfl_prec.c: Use `unsigned long int' for bit counts.
-       * mpf/init2.c: Likewise.
-       * mpf/get_prc.c: Likewise.
-       * mpf/set_prc.c: Likewise.
-       * mpf/set_prc_raw.c: Likewise.
-       * mpz/popcount.c: Likewise.
-       * mpz/hamdist.c: Likewise.
-       * mpz/scan1.c: Likewise.
-       * mpz/scan0.c: Likewise.
-       * mpn/generic/popcount.c: Likewise.
-       * mpn/generic/hamdist.c: Likewise.
-       * mpn/generic/scan1.c: Likewise.
-       * mpn/generic/scan0.c: Likewise.
-       * gmp.h: Likewise.
-
-       * mpf/eq.c: New file, based on mpf/diff.c.
-       * mpf/diff.c: Delete.
-       * mpf/Makefile.in: Corresponding changes.
-       * gmp.h: Likewise.
-
-       * mpf/reldiff.c: New file.
-       * mpf/Makefile.in: Compile it.
-       * gmp.h: Declare mpf_reldiff.
-
-       * mpz/iset_d.c: New file.
-       * mpz/Makefile.in: Compile it.
-       * gmp.h: Declare mpz_init_set_d.
-
-Tue Apr 16 16:28:31 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * Makefile.in (gmp.html): Pass -acc to texi2html.
-
-Mon Apr 15 16:20:24 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * mpf/set_str.c: Switch off code for defaulting the base from the
-       leading characters.
-
-       * gmp.h (mp?_sign): Delete.
-       (mp?_sgn): New macros.
-
-Fri Apr 12 17:23:33 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * Makefile.in (gmp.dvi): Delete tmp.* at end of rule.
-
-Wed Apr 10 22:52:02 1996  Torbjorn Granlund  (tege@tiny.tmg.se)
-
-       * mpf/random2.c: Change of `exp' param, mp_size_t => mp_exp_t.
-       * gmp.h: Corresponding change.
-
-       * gmp.h (mp_bits_per_limb): Make it const.
-
-Sat Mar 30 01:20:23 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * configure.in: Re-enable recognition of with_gcc.
-
-       * mpf/Makefile.in (.c.o): Pass XCFLAGS.
-       * mpn/Makefile.in (.c.o): Likewise.
-       * mpz/Makefile.in (.c.o): Likewise.
-       * mpq/Makefile.in (.c.o): Likewise.
-       * mpbsd/Makefile.in (.c.o): Likewise.
-       * mpf/tests/Makefile.in (.c.o): Likewise.
-       * mpz/tests/Makefile.in (.c.o): Likewise.
-       * mpq/tests/Makefile.in (.c.o): Likewise.
-
-       * Makefile.in (XCFLAGS): Default to empty.
-       (FLAGS_TO_PASS): Pass on XCFLAGS.
-       (.c.o): Pass XCFLAGS.
-
-       * config/mt-m88110 (XCFLAGS): Define instead of CC.
-       * config/mt-sprc8-gcc (XCFLAGS): Likewise.
-       * config/mt-supspc-gcc (XCFLAGS): Likewise.
-
-       * configure: Don't default CC to "gcc -O2" is -with-gcc=no was
-       specified.
-
-Mon Mar 25 01:07:54 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * urandom.h: Test for __SVR4 in addition to __svr4__.
-
-       * mp_bpl.c (mp_bits_per_limb): Declare as `const'.
-
-       * Makefile.in (CFLAGS): `-O2' => `-O'.
-       * mpn/Makefile.in (CFLAGS): Likewise.
-
-       * gmp-impl.h: Get rid of obsolete field access macros.
-
-       * mpn/mp_bases.c (__mp_bases): 1e39 => 1e38 to work around Solaris
-       cc compiler bug.
-
-       * gmp.h (__MPN): Make it work also for non-ANSI compilers.
-
-Thu Mar 21 01:07:54 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * mpf/sub.c: New special case for ediff <= 1 before generic code.
-       Simplify generic code for ediff == 0.
-       Rename uexp => exp.
-
-Mon Mar 11 18:24:57 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * mpf/tests/*.c: Use ref_mpf_sub for error calculation.
-       * mpf/tests/Makefile.in: Link ref.o to all executables.
-
-       * mpf/tests/t-sub.c: Make u = v + 1 with 50% probability.
-
-Sun Mar 10 21:03:17 1996  Torbjorn Granlund  (tege@tiny.tmg.se)
-
-       * mpf/get_str.c: In digit development loop for fractions, change
-       loop condition from `<' to `<='.
-
-Thu Mar  7 04:58:11 1996  Torbjorn Granlund  <tege@tiny.tmg.se>
-
-       * mpn/mp_bases.c (__mp_bases): 1e100 => 1e39 to avoid overflow warning.
-
-Wed Mar  6 01:10:42 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * mpf/tests/t-sqrt.c: New file.
-       * mpf/tests/Makefile.in: Corresponding changes.
-
-       * mpf/sqrt.c: Special case for square root of zero.
-
-       * mpq/add.c: Clean up variable names.
-       * mpq/sub.c: Update from mpq/add.c.
-
-       * mpz/divexact.c: abs => ABS.
-       * mpz/gcd.c: Likewise.  Rewrite final fixup code, to decrease
-       allocation.  Misc cleanups.
-
-Tue Mar  5 22:24:56 1996  Torbjorn Granlund  <tege@tmg.se>
-
-       * mpn/configure.in: Recognize linuxoldld as a synonym for linuxaout.
-
-       * gmp.h (mpn_add, mpn_add_1, mpn_sub, mpn_sub_1): Add prototypes.
-
-       * mpn/configure.in: Use t-freebsd also for netbsd.
-
-Mon Mar  4 15:13:28 1996  Torbjorn Granlund  <tege@tmg.se>
-
-       * mpq/Makefile.in (cmp.o): Depend on longlong.h.
-
-       * mpq/equal.c: New file.
-       * mpq/Makefile.in: Corresponding changes.
-
-       * mpf/tests/t-add.c: New file.
-       * mpf/tests/t-sub.c: Renamed from t-addsub.c.
-       * mpf/tests/ref.c: New file.
-       * mpf/tests/Makefile.in: Corresponding changes.
-
-       * gmp-impl.h (SIZ, ABSIZ, PTR, EXP, PREC, ALLOC): New #defines.
-
-Sun Mar  3 07:45:46 1996  Torbjorn Granlund  <tege@tmg.se>
-
-       * mpf/set_str.c: In exponentialization code, allocate 3 extra
-       limbs, not just 2.
-
-       * mpf/get_str.c: Allocate sufficient space for tstr.
-       When calculating exp_in_base, round result down.
-
-       * mpf/tests/t-conv.c: New file.
-       * mpf/tests/Makefile.in: Corresponding changes.
-
-       * mp_bpl.c: New file.
-       * gmp.h: Declare it.
-       * Makefile.in: Corresponding changes.
-
-Sat Mar  2 06:27:56 1996  Torbjorn Granlund  <tege@tmg.se>
-
-       * mpf/set_prc_raw.c: New file.
-       * mpf/set_prc.c: Renamed from set_prec.c.
-       * mpf/get_prc.c: New file.
-       * mpf/Makefile.in: Corresponding changes.
-       * gmp.h: Declare new functions.
-
-       * mpn/generic/gcdext.c: Add copyright header.
-
-Fri Mar  1 01:22:24 1996  Torbjorn Granlund  <tege@tmg.se>
-
-       * mpn/configure.in: For ppc601, search "power" before "powerpc32".
-
-       * mp?/Makefile.in (AR_FLAGS): New variable.
-       (libmp?.a): Use it.
-
-       * make.bat: New file.
-       * mpn/msdos: New directory.
-       * mpn/msdos/asm-syntax.h: New file.
-
-       * mpn/Makefile.in (distclean maintainer-clean): Delete asm-syntax.h.
-
-       * config.sub: Recognize [ctj]90-cray.
-
-       * mpn/configure.in: Recognize [ctj]90-cray-unicos*.
-
-       * mpn/generic/gcdext.c: Don't use alloca directly, use TMP_* macros.
-
-       * mpn/generic/gcd.c: Split increment from use of USIZE to avoid
-       undefined behaviour.
-
-Thu Feb 29 04:11:24 1996  Torbjorn Granlund  <tege@tmg.se>
-
-       * Makefile.in (install-info-files): Update for new install-info
-       behaviour.
-
-       * mpn/power/add_n.s: Rewrite.
-       * mpn/power/sub_n.s: Rewrite.
-
-Wed Feb 28 01:34:30 1996  Torbjorn Granlund  <tege@tmg.se>
-
-       * mpz/pow_ui.c: Compute allocation more aggressively for small bases.
-       * mpz/ui_pow_ui.c: Likewise.
-
-       * mpn/mp_bases.c (__mp_bases): Put huge value in 2nd field for index 1.
-
-       * mpn/generic/sqrtrem.c: sizeof (mp_limb_t) => BYTES_PER_MP_LIMB.
-       * mpn/generic/gcd.c: Likewise.
-       (SIGN_BIT): Compute differently.
-
-Mon Feb 26 00:07:36 1996  Torbjorn Granlund  <tege@tmg.se>
-
-       * All files: mp_limb => mp_limb_t, mp_limb_signed => mp_limb_signed_t.
-
-       * Makefile.in (install, install-bsdmp, install-info-files): Depend
-       on installdirs.  chmod all installed files.
-
-Sun Feb 25 01:47:41 1996  Torbjorn Granlund  <tege@tmg.se>
-
-       * mpbsd/configure.in: Delete debugging code.
-
-       * All Makefile.in: Update clean targets.
-
-       * Makefile.in (AR_FLAGS): New variable.
-       (libgmp.a): Use it.
-       (libmp.a): Likewise.
-
-       * VERSION: Delete file.
-
-       * Makefile.in (installdirs): New target.
-       * mkinstalldirs: New file (from the texinfo package).
-
-       * Makefile.in (INSTALL, INSTALL_DATA, INSTALL_PROGRAM): New variables.
-       (MAKEINFO, MAKEINFOFLAGS, TEXI2DVI): New variables.
-       (install-info): New target.
-       (install, install-bsdmp): Depend on install-info.
-       ($(srcdir)/gmp.info): Changed from plain gmp.info; put info files
-       into source directory.
-       (distclean, mostlyclean): New targets.
-       (maintainer-clean): New name for realclean.
-       (uninstall): New target.
-       (TAGS): New target.
-       (info, dvi): New targets.
-       (.PHONY): Assign.
-
-       * Makefile.in (install, install-bsdmp): Use INSTALL_DATA.
-
-       * mp{n,z,f,bsd}/move-if-change: Delete.
-
-       * mpbsd/Makefile.in (stamp-stddefh): Delete target.
-
-       * Makefile.in (.c.o): Pass CFLAGS last.
-       * mpbsd/Makefile.in (.c.o): Likewise.
-       * mpf/Makefile.in (.c.o): Likewise.
-       * mpq/Makefile.in (.c.o): Likewise.
-       * mpz/Makefile.in (.c.o): Likewise.
-       * mpn/Makefile.in (.c.o): Likewise.
-       (.S.o): Likewise.
-
-       * memory.c: Change allocation error message.
-
-       * Makefile.in (install): Prefix gmp.h with $(srcdir).
-       (install-bsdmp): Prefix mp.h with $(srcdir).
-
-       * mp{n,z,f,bsd}/{configure,config.sub}: Delete.
-
-       * Makefile.in (gmp.dvi): Set TEXINPUTS also for 2nd tex invocation
-       (install targets): Install gmp.info-N.
-
-Sat Feb 24 03:36:52 1996  Torbjorn Granlund  <tege@tmg.se>
-
-       * mpf/get_str.c: Fix typo.
-
-       * mpz/legendre.c: Clarify expression with extra parens.
-
-       * version.c (gmp_version): Not static.
-
-       * mpf/iset_str.c: Properly return error code.
-
-       * mpf/add.c: Delete unused variables.
-       * mpf/inp_str.c: Likewise.
-       * mpq/get_d.c: Likewise.
-
-       * mpn/generic/dump.c: #include <stdio.h>.
-       * mpf/dump.c: Likewise.
-       * mpf/set_str.c: #include <ctype.h>.
-       (strtol): Declare.
-
-       * gmp.h: mpn_sqrt => mpn_sqrtrem.
-
-       * Makefile.in (clean, realclean): Clean in mpbsd.
-       (check): Test in mpf.
-
-       * mpf/Makefile.in (clean): Clean in tests.
-       * mpq/Makefile.in (clean): Clean in tests.
-
-       * mpf/tests/Makefile.in: New file.
-       * mpf/tests/configure.in: New file.
-       * mpf/tests/t-addsub.c: New file.
-
-       * mpf/sub_ui.c: Simply call mpf_sub for now.
-
-       * mpf/sub.c: Increase prec by 1.
-       * mpf/ui_sub.c: Likewise.
-
-Fri Feb 23 00:59:54 1996  Torbjorn Granlund  <tege@tmg.se>
-
-       * mpf/ui_sub.c: Fix typos.
-
-       * mpf/get_str.c: When allocating space for tmp, allow for an extra
-       limb.  In code for fraction conversion, add special case for bases
-       that are a power of 2.
-
-       * mpf/out_str.c: Output leading "0.".
-       Default base to 10, before computing string allocation.
-
-       * mpf/get_str.c: Make variables for string size have type size_t.
-       * gmp.h: Corresponding change.
-
-       * mpf/random2.c: Allow creation of prec+1 large mantissas.
-
-       * mpf/add_ui.c: Don't abort if u < 0; special case for u <= 0.
-       Fix typo in MPN_COPY offset.
-       * mpf/sub_ui.c: Analogous changes.
-
-       * mpf/set_prec.c: Rewrite.
-
-       * mpf/init2.c: Compute precision as in set_prec.c.
-
-       * mpf/div_2exp.c: Special case for u == 0.
-       * mpf/mul_2exp.c: Likewise.  Write r->_mp_size always.
-
-       * mpf/sqrt_ui.c: mpn_sqrt => mpn_sqrtrem.
-       * mpf/sqrt.c: Likewise.  When computing new exponent, round quotient
-       towards -infinity.
-
-       * mpf/add.c: Fix typos.
-       * mpf/sub.c: Fix typos.
-
-Thu Feb 22 00:24:48 1996  Torbjorn Granlund  <tege@tmg.se>
-
-       * mpz/Makefile.in (stamp-stddefh): Delete target.
-       (test): Delete target.
-       * Makefile.in (stamp-stddefh): Delete target.
-       (cre-stddefh.o): Delete target.
-       (gmp.dvi): Set TEXINPUTS before invoking tex.
-
-       * cre-stddefh.c: Delete.
-
-       * mpz/sqrt.c: Fix typo.
-
-       * mpz/powm.c: Special case for mod == 0.
-       * mpz/powm_ui.c: Likewise.
-
-       * mpz/get_si.c: Handle -0x80000000 correctly.
-
-       * mpz/inp_str.c: Now retutns size_t.
-       Make it return number of bytes read or error indication.
-       * mpf/inp_str.c: Likewise.
-
-       * mpz/out_raw.c: Replace by mpz/out_binary.c, with modifications.
-       * mpz/inp_raw.c: Rewrite, using mpz/inp_binary as a base.
-       * mpz/inp_binary.c: Delete.
-
-       * mpn/Makefile.in (XCFLAGS): Remove variable.
-       (.c.o): Don't pass XCFLAGS.
-       (SFLAGS): Set to nothing.
-       (.S.o): Pass SFLAGS, not XCFLAGS.
-
-       * mpn/config/t-freebsd (SFLAGS): New name for XCFLAGS.
-
-       * mpf/out_str.c: Make return number of bytes written or error
-       indication.
-       * mpz/out_str.c: Likewise.
-       * gmp.h: Corresponding changes.
-
-       * gmp.h (__mpz_struct): mp_size_t => int.
-       (__mpq_struct): Likewise.
-       (__mpf_struct): Likewise.
-       (mp_size_t): int => long int.
-
-       * mpn/cray: New directory.
-       * mpn/cray/gmp-mparam.h: New file.
-       * mpn/configure.in: Recognize cray variants.
-
-       * Makefile.in: Set defaults for prefix, libdir, etc.
-       (install): New target.
-       (install-bsdmp): New target.
-       (gmp.html): New target.
-
-       * stack-alloc.c (__tmp_alloc): Cast void ptrs to char * in comparison.
-
-Wed Feb 21 04:35:02 1996  Torbjorn Granlund  <tege@tmg.se>
-
-       * gmp.h: Sort mpn declarations.
-       (mpn_gcdext): Add declaration.
-
-       * mpn/generic/divrem_1.c: New file.
-       * mpn/Makefile.in (divrem_1.o): New rule.
-       * configure.in (functions): Add divrem_1.
-
-       * mpn/generic/divmod.c: Delete file.
-       * mpn/configure.in (functions): Delete divmod.
-       * Makefile.in (divmod.o): Delete rule.
-       * gmp.h (mpn_divmod): New #define.
-
-       * gmp.h (mpn_next_bit_set): Delete spurious declaration.
-
-       * mpn/generic/divrem.c (default case): In code assigning
-       most_significant_q_limb, move reassignment of n0 into if statement.
-
-       * gmp.h (mpf_inp_str): Fix typo.
-       (mpf_out_str): Make prototype match reality.
-       * mpf/inp_str.c: New file.
-       * mpf/out_str.c: New file.
-       * mpf/Makefile.in: Compile new files.
-
-       * mpn/Makefile.in (dump.o): Fix dependency path.
-       (inlines.o): Likewise.
-
-       * mpn/configure.in: Make m68060 be the same as m68000.  Clean up
-       m68k configs.
-
-Tue Feb 20 01:35:11 1996  Torbjorn Granlund  <tege@tmg.se>
-
-       * mpn/generic/sqrtrem.c: Renamed from sqrt.
-       * mpn/configure.in (functions): Corresponding change.
-       * mpn/Makefile.in: Likewise.
-       * mpz/sqrtrem.c: Likewise.
-       * mpz/sqrt.c: Likewise.
-       * mpn/generic/perfsqr.c: Likewise.
-
-       * Makefile.in (clean): Also remove libmp.a.
-       Don't compile cre-conv-tab.c or mp_bases.c.
-       cre-conv-tab.c: Delete file.
-       (gmp.ps): New rule.
-
-       * mpn/mp_bases.c: New file.
-       * mpn/Makefile.in: Compile mp_bases.c.
-
-       * mpz/set_str.c: Skip initial whitespace.
-       * mpf/set_str.c: Likewise.
-       * mpbsd/xtom.c: Likewise.
-
-       * gmp.h: Add missing mpz declarations.
-       Delete all formal parameter names from declarations.
-
-       * mpn/Makefile.in: Add dependencies for .c files.
-
-       * Makefile.in (check): Write recursive make calls separately, not as
-       a loop.
-       (FLAGS_TO_PASS): New variable.  Use it for most recursive makes.
-
-Mon Feb 19 01:02:20 1996  Torbjorn Granlund  <tege@tmg.se>
-
-       * mpn/Makefile.in (.S.o): Pipe cpp output to grep in order to delete
-       lines starting with #.
-       (CPP): Set to $(CC) -E to avoid gcc dependency.
-
-       * mpn/m68k/syntax.h (moveql): Define to moveq for MIT_SYNTAX.
-
-       * mpn/hppa/hppa1_1/pa7100/addmul_1.S: Fix typo in s1_ptr alignment
-       code.
-       * mpn/hppa/hppa1_1/pa7100/submul_1.S: Likewise.
-
-       * gmp.h: Fix typos in #defines of recently added mpn functions.
-
-       * mpz/inp_str.c: Skip all whitespace, not just plain space.
-       * mpbsd/min.c: Likewise.
-
-       * mpn/configure.in (functions): Add gcdext.
-       * mpn/generic/gcdext.c: New file.
-
-       * mpz/legendre.c: mpz_div_2exp => mpz_tdiv_q_2exp.
-
-       * gmp.h: Surround mpn declarations with extern "C" { ... }.
-
-       * Makefile.in (check): New target.
-
-       * mpq/get_d.c: Update comments.  Use rsize instead of dsize + N_QLIMBS
-       when possible.  Add special case for nsize == 0.
-
-       * gmp.h (mpq_get_d): Add declaration.
-       (mpq_canonicalize): Likewise.
-       (mpq_cmp_ui): Likewise.
-       (mpf_diff): Likewise.
-       (mpf_ui_sub): Likewise.
-       (mpf_set_prec): Likewise.
-       (mpf_random2): Likewise.
-
-       * gmp.h (mpz_cmp_ui): New #define.
-       (mpz_cmp_si): New #define.
-       (mpq_cmp_ui): New #define.
-       (mpz_sign): New #define.
-       (mpq_sign): New #define.
-       (mpf_sign): New #define.
-       (mpq_numref): New #define.
-       (mpq_denref): New #define.
-
-       * mpq/set_z.c: File deleted.
-       * mpq/Makefile.in: Corresponding changes.
-
-Sun Feb 18 01:34:47 1996  Torbjorn Granlund  <tege@tmg.se>
-
-       * mpbsd/sdiv.c: Use _mp_realloc, not _mpz_realloc.
-
-       * mpz/inp_binary.c: Default stream to stdin.
-       * mpz/inp_str.c: Likewise.
-       * mpz/inp_raw.c: Likewise.
-       * mpz/out_binary.c: Default stream to stdout.
-       * mpz/out_raw.c: Likewise.
-       * mpz/out_str.c: Likewise.
-
-       * mpbsd/realloc.c: New file.
-       * mpbsd/Makefile.in: Corresponding changes.
-
-       * mpbsd/min.c: Rewrite (base on mpz/inp_str.c).
-       * mpbsd/mtox.c: Rewrite (base on mpz/get_str.c).
-
-       * mpbsd/mout.c: Rewrite (base on mpz/out_str) but make it output
-       spaces in each 10th position.
-       * mpbsd/xtom.c: Rewrite (base on mpz/set_str).
-
-       * mpq/tests/Makefile.in (st-cmp): New file.
-       * mpq/tests/configure.in (srcname): New file.
-
-       * mpz/tests/configure.in (srcname): Fix typo.
-
-       * mpq/cmp.c: Add check using number of significant bits, to avoid
-       general multiplication.
-
-Sat Feb 17 11:58:30 1996  Torbjorn Granlund  <tege@tmg.se>
-
-       * mpq/cmp_ui.c: Store cy_limb after the mpn_mul_1 calls.
-
-       * mpq/tests: New directory.
-       * mpq/tests/t-cmp.c: New file.
-       * mpq/tests/t-cmp_ui.c: New file.
-
-       * mpz/tests/dive.c (main): Generate zero numerator.
-       (get_random_size) : Delete.
-
-       * mpz/divexact.c: Add special case for 0/x.
-
-       * gmp.h (mpz_mod): Add declaration.
-
-Fri Feb 16 18:18:39 1996  Andreas Schwab  <schwab@informatik.uni-dortmund.de>
-
-       * mpn/m68k/*: Rewrite code not to use the INSN macros.
-       (L): New macro to properly prefix local labels for ELF.
-
-Fri Feb 16 00:20:56 1996  Torbjorn Granlund  <tege@tmg.se>
-
-       * gmp-impl.h (ieee_double_extract): Use plain `unsigned int' for
-       fields.
-       * mpn/generic/inlines.c (_FORCE_INLINES): New #define.  Delete
-       conditional __GNUC__.
-       * gmp.h (mpn_add, mpn_sub, mpn_add_1, mpn_sub_1):
-       Only define these if __GNUC__ || _FORCE_INLINES.
-       * mpf/random2.c: Add missing parameter in non-ANSI header.
-       * mpn/generic/gcd.c (SIGN_BIT): Do as #define to work around bug
-       in AIX compilers.
-       * mpq/get_d.c: #define N_QLIMBS.
-       * mpz/divexact.c: Obscure division by 0 to silent compiler warnings.
-       * stack-alloc.c: Cast void* pointer to char* before doing arithmetic
-       on it.
-
-       * Makefile.in (mpbsd/libmpbsd.a): New rule.
-       * configure.in (configdirs): Add mpbsd.
-
-       * gmp.h: Add declarations for a few missing mpn functions.
-
-       * Makefile.in (libmp.a): New rule.
-
-       * mpbsd/mdiv.c: #include "dmincl.c", not "mpz_dmincl.c"
-       * gmp.h: Move #define of __GNU_MP__ into the `#if __GNU_MP__' block.
-       * mp.h: Likewise.  Update typedefs from gmp.h.
-       * mpbsd/configure.in: New file.
-       * mpbsd/Makefile.in: New file.
-       * mpbsd/configure: Link to master configure.
-       * mpbsd/config.sub: Link to master config.sub.
-
-       * Makefile.in: Set RANLIB_TEST.
-       * (libgmp.a): Use it.
-       * (libgmp.a): Do ranlib before moving the libgmp.a to the build
-       directory.
-       * mp?/Makefile.in: Don't use or set RANLIB.
-
-Thu Feb 15 16:38:41 1996  Torbjorn Granlund  <tege@tmg.se>
-
-       * mpz/add_ui.c: MP_INT => mpz_t.
-       * mpz/cmp_ui.c: Likewise.
-       * mpz/fac_ui.c: Likewise.
-       * mpz/inp_binary.c: Likewise.
-       * mpz/inp_raw.c: Likewise.
-       * mpz/legendre.c: Likewise.
-       * mpz/jacobi.c: Likewise.
-       * mpz/out_binary.c: Likewise.
-       * mpz/out_raw.c: Likewise.
-       * mpz/random2.c: Likewise.
-       * mpz/random.c: Likewise.
-       * mpz/realloc.c: Likewise.
-
-       * mpz/legendre.c: __mpz_2factor(X) => mpz_scan1(X,0),
-       __mpz_odd_less1_2factor => mpz_scan1(X,1).
-       * mpz/ntsup.c: File deleted.
-       * mpz/Makefile.in: Corresponding changes.
-
-       * mpz/pprime_p: Use mpz_scan1 to avoid looping.
-
-       * mpz/fac_ui.c: Type of `k' and `p' is `unsigned long'.
-       * mpz/pprime_p.c: Pass long to *_ui functions.
-       * mpz/gcdext.c: Likewise.
-       * mpz/fdiv_r_2exp.c: Likewise.
-       * mpz/fac_ui.c: Likewise.
-
-       * mpz/powm.c: Don't use mpn_rshift when mod_shift_cnt is 0.
-
-       * mpz/tests/Makefile.in (st-sqrtrem): Fix typo.
-
-       * mpz/cmp_ui.c: #undef mpz_cmp_ui.
-       * mpz/cmp_si.c: #undef mpz_cmp_si.
-       * gmp.h (mpz_cmp_ui): New #define.
-       (mpz_cmp_si): New #define.
-
-Wed Feb 14 22:11:24 1996  Torbjorn Granlund  <tege@tmg.se>
-
-       * gmp.h: Test __cplusplus in addition to __STDC__.
-       * gmp-impl.h: Likewise.
-
-       * gmp.h: Surround declarations with extern "C" { ... }.
-
-Tue Feb 13 15:20:45 1996  Torbjorn Granlund  <tege@tmg.se>
-
-       * mpz/fdiv_r_2exp.c: Use MPN_NORMALIZE.
-       * mpz/tdiv_r_2exp.c: Likewise.
-
-       * mpz/fdiv_r_2exp.c: New file.
-       * mpz/fdiv_q_2exp.c: New file.
-       * mpz/tdiv_r_2exp.c: Renamed from mpz/mod_2exp.c.
-       * mpz/tdiv_q_2exp.c: Renamed from mpz/div_2exp.c
-       * mpz/Makefile.in: Corresponding changes.
-
-       * mpz/scan0.c,scan1.c: New files.
-       * mpz/Makefile.in: Compile them.
-
-       * gmp.h (mpn_normal_size): Delete.
-
-       * config.guess: Update from Cygnus version.
-
-       * mpn/m68k/rshift.S: Use INSN2 macro for lea instructions.
-       * mpn/m68k/lshift.S: Likewise.
-
-       * mpn/configure.in: Fix configuration for plain 68000.
-
-Mon Feb 12 01:06:06 1996  Torbjorn Granlund  <tege@tmg.se>
-
-       * mpz/tests/t-powm.c: Generate negative BASE operand.
-
-       * mpz/powm.c: Make result always positive.
-
-Sun Feb 11 01:44:56 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * mpz/tests/*.c: Add t- prefix.
-       * mpz/tests/Makefile.in: Corresponding changes.
-       * mpz/tests/configure.in: Update srctrigger.
-
-       * mpz/tests/gcd.c: Generate negative operands.
-       * mpz/tests/gcd2.c: Likewise.
-
-       * mpz/gcdext.c: At end, if G is negative, negate all G, S, and T.
-
-Thu Feb  8 17:16:12 UTC 1996 Ken Weber <kweber@mat.ufrgs.br>
-
-       * mp{z,n}/gcd.c: Change mpn_gcd interface.
-       * gmp.h: Ditto.
-       * gmp.texi: update documentation.
-
-Mon Feb  7 23:58:43 1996  Andreas Schwab  <schwab@informatik.uni-dortmund.de>
-
-       * mpn/m68k/{lshift,rshift}.S: New files.
-       * mpn/m68k/syntax.h: New ELF_SYNTAX macros.
-       (MEM_INDX, R, PROLOG, EPILOG): New macros.
-       * mpn/m68k/*.S: Use R macro with register name.  Use PROLOG and EPILOG
-       macros.  Rename `size' to `s_size' or s1_size to avoid clash with ELF
-       .size directive.
-       * mpn/configure.in: New target m68k-*-linux*.
-
-Wed Feb  7 07:41:31 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * Makefile.in (cre-conv-tab): Workaround for SunOS make.
-
-       * mpz/tests/reuse.c: New file.
-       * mpz/tests/Makefile.in: Handle reuse.c.
-
-Tue Feb  6 11:56:24 UTC 1996 Ken Weber <kweber@mat.ufrgs.br>
-
-       * mpz/gcd.c: Fix g->size when one op is 0 and g == other op.
-
-Tue Feb  6 01:36:39 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * gmp.h (mpz_divexact): Delete parameter names.
-       (mpz_lcm): Delete spurious declaration.
-
-       * mpz/dmincl.c: Fix typo.
-
-Mon Feb  5 01:11:56 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * mpn/generic/gcd.c (gcd_2): Declare consistently.
-
-       * mpz/tdiv_q.c: Optimize division by a single-limb divisor.
-       * mpz/dmincl.c: Likewise.
-
-       * mpz/add.c: Use MPN_NORMALIZE instead of mpn_normal_size.
-       * mpz/sub.c: Likewise.
-       * mpn/generic/sqrt.c: Likewise.
-
-       * mpn/tests/{add_n,sub_n,lshift,rshift}.c: Put garbage in the
-       destination arrays.
-
-Fri Feb  2 02:21:27 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * mpz/{jacobi.c,legendre.c,ntsup.c,invert.c}: New files.
-       * mpz/Makefile.in: Compile them.
-
-       * mpn/Makefile.in (INCLUDES): Don't search in `generic'.
-
-Thu Feb  1 02:15:11 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       Change from Ken Weber:
-       * mpz/divexact.c: Make it work when quot is identical to either input.
-
-       * mpf/ui_sub.c: New file.
-       * mpf/Makefile.in: Compile it.
-
-       * gmp-impl.h (MPZ_TMP_INIT): alloca -> TMP_ALLOC.
-       * mpz/{c,f}div_{q,qr,r}.c: Use TMP_DECL/TMP_MARK/TMP_FREE since
-       these use MPZ_TMP_INIT.
-       * mpz/mod.c: Likewise.
-       * mpq/{add,sub}.c: Likewise.
-       * mpq/canonicalize: Likewise.
-
-       * mpq/{add,sub,mul,div}.c: Use mpz_divexact. MP_INT -> mpz_t.
-       * mpq/canonicalize.c: Likewise.
-
-Wed Jan 31 01:45:00 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * mpn/generic/gcd.c: Misc changes from Ken.
-
-       * mpz/tests/gcd2.c: New file.
-       * mpz/tests/Makefile.in: Handle gcd2.c.
-
-       * mpn/generic/gcd.c (mpn_gcd): When GCD == ORIG_V, return vsize,
-       not orig_vsize.  Fix parameter declaration.
-
-       * mpz/mod_ui.c: Delete file.
-       * mpz/Makefile.in: Don't try to compile mod_ui.
-
-       * mpz/cdiv_*_ui.c): Make them work right.
-       * gmp.h: Declare cdiv*.
-
-Tue Jan 30 02:22:56 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * mpz/{cdiv_q.c,cdiv_q_ui.c,cdiv_qr.c,cdiv_qr_ui.c,cdiv_r.c,
-       cdiv_r_ui.c,cdiv_ui.c}: New files.
-       * mpz/Makefile.in: Compile them.
-
-       * All files: Make file permissions right.
-
-       Changes from Ken Weber:
-       * mpn/generic/accelgcd.c: Delete.
-       * mpn/generic/bingcd.c: Delete.
-       * mpn/generic/numbits.c: Delete.
-       * mpn/generic/gcd.c: New file.
-       * mpn/configure.in (functions): Update accordingly.
-       * mpz/divexact.c: New file.
-       * mpz/Makefile.in: Compile divexact.c.
-       * mpz/gcd.c: Rewrite to accommodate for gcd changes in mpn.
-       * gmp.h: declare new functions, delete obsolete declarations.
-       * mpz/tests/dive.c: New file.
-       * mpz/tests/Makefile.in: Handle dive.c.
-
-Mon Jan 29 03:53:24 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * mpz/random.c: Handle negative SIZE parameter.
-
-       * mpz/tests/tdiv(_ui).c: New name for tst-dm(_ui).c.
-       * mpz/tests/tst-mdm(_ui).c: Delete.
-       * mpz/tests/fdiv(_ui).c: New test based in tst-mdm(_ui).
-       * mpz/tests/*.c: Get rid of tst- prefix for DOS 8+3 naming.
-       * mpz/tests/Makefile.in: Corresponding changes.
-       * mpz/tests/configure.in: Update srctrigger.
-
-       * mpn/generic/divmod.c: Update from divrem.
-       * mpn/generic/divrem.c: Misc cleanups.
-
-Sun Jan 28 03:25:08 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * All files: Use new TMP_ALLOC interface.
-
-       * mpz/powm_ui.c: Make Jan 25 changes to powm.c also here.
-
-       * mpz/tests/powm_ui.c: New file.
-       * mpz/tests/Makefile.in: Add rules for tst-powm and tst-powm_ui.
-
-       * Makefile.in: Update dependency list.
-       * mpf/Makefile.in: Likewise.
-       * mpz/Makefile.in: Likewise.
-       * mpq/Makefile.in: Likewise.
-       * Makefile.in: Set RANLIB simply to ranlib, and allow configure
-       to override it.
-
-       * mpz/Makefile.in (conf): Delete spurious target.
-       (mp_bases.c): Delete.
-       (cre-conv-tab rules): Delete.
-
-       * Makefile.in (cre-conv-tab): Greatly simplify.
-
-Sat Jan 27 13:38:15 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * stack-alloc.c: New file.
-       * stack-alloc.h: New file.
-
-       * gmp.h (__gmp_inline): Define using __inline__.
-
-Thu Jan 25 00:28:37 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * mpn/generic/scan0.c: New file.
-       * mpn/generic/scan1.c: Renamed from next_bit.c.
-       * mpn/configure.in (functions): Include scan0 and scan1.
-
-       * mpn/m68k/*: #include sysdep.h.  Use C_GLOBAL_NAME.
-
-       * configure: Update from Cygnus version.
-       * config.guess: Likewise.
-       * config.sub: Likewise.
-       * configure: Pass --nfp to recursive configures.
-
-       * mpz/tests/tst-*.c: Adjust SIZE and reps.
-
-       * mpz/powm.c: Move esize==0 test earlier.
-       In final reduction of rp,rsize, don't call mpn_divmod unless
-       reduction is really needed.
-
-       * mpz/tests/tst-powm.c: Fix thinko in checking code.
-
-       * All files: Get rid of `__' prefix from mpn_* calls and declarations.
-       * gmp.h: #define __MPN.
-       * gmp.h: Use __MPN in #defines for mpn calls.
-
-       * mpn/generic/mul_n.c: Prepend `i' to internal routines.
-       * gmp-impl.h: Add #defines using __MPN for those internal routines.
-
-       * mpn/generic/sqrt.c: Change call to mpn_mul to mpn_mul_n.
-
-Wed Jan 24 13:28:19 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * mpn/sparc32/udiv_fp.S: New name for udiv_qrnnd.S.
-       * mpn/sparc32/udiv_nfp.S: New name for v8/udiv_qrnnd.S.
-       * mpn/sparc32/v8/supersparc: New directory.
-       * mpn/sparc32/v8/supersparc/udiv.S: New file.
-
-Tue Jan 23 01:10:11 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       This major contribution is from Ken Weber:
-       * mpn/generic/accelgcd.c: New file.
-       * mpn/generic/bdivmod.c: New file.
-       * mpn/generic/bingcd.c: New file.
-       * mpn/generic/gcd_1.c: Rewrite.
-       * mpn/generic/numbits.c: New file (to go away soon).
-       * mpz/gcd.c: Rewrite.
-       * mpz/tests/tst-gcd.c (SIZE): Now 128.
-       * gmp.h: Declare new functions.
-       * mpn/configure.in (functions): List new files.
-       * gmp-impl.h (MPN_SWAP): Delete.
-       (MPN_LESS_BITS_LIMB, MPN_LESS_BITS, MPN_MORE_BITS): Delete.
-       (MPN_COMPL_INCR, MPN_COMPL): Delete.
-
-Mon Jan 22 02:04:59 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * gmp.h (mpn_name): New #define.
-
-       * mpn/m88k/mc88110/addmul_1.s: New file.
-       * mpn/m88k/mc88110/add_n.S: New file.
-       * mpn/m88k/mc88110/sub_n.S: New file.
-
-       * mpn/m88k/sub_n.s: Correctly initialize carry.
-
-       * mpn/sparc32/{add_n.S,sub_n.S,lshift.S,rshift.S): `beq' => `be'.
-
-Sun Jan 21 00:04:35 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * mpn/sparc64/addmul_1.s: New file.
-       * mpn/sparc64/submul_1.s: New file.
-       * mpn/sparc64/rshift.s: New file.
-
-Sat Jan 20 00:32:54 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * mpz/iset.c: Fix typo introduced Dec 25.
-
-Wed Jan 17 13:16:44 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * config/mt-sprc8-gcc: New name for mt-sparc8-gcc.
-       * config/mt-sparcv8-gcc: Delete.
-       * configure.in: Corresponding changes.
-
-Tue Jan 16 16:31:01 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * gmp-impl.h: #include alloca.h when necessary.
-
-       * longlong.h: Test __alpha instead of __alpha__, since the former
-       is the standard symbol.
-
-Mon Jan 15 18:06:57 1996  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * mpn/sparc64/mul_1.s: Swap operands of mulx instructions.
-       * mpn/sparc64/lshift.s: New file.
-
-Fri Dec 29 17:34:03 1995  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * mpn/x86/pentium/add_n.S: Get rid of #defines for register names.
-       * mpn/x86/pentium/sub_n.S: Likewise.
-
-Thu Dec 28 03:16:57 1995  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * mpn/x86/pentium/mul_1.S: Rework loop to avoid AGI between update
-       of loop induction variable and load insn at beginning of loop.
-       * mpn/x86/pentium/addmul_1.S: Likewise.
-       * mpn/x86/pentium/submul_1.S: Likewise.
-
-Mon Dec 25 23:22:55 1995  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * All files: Prefix user-visible structure fields with _mp_.
-
-Fri Dec 22 20:42:17 1995  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * mpn/configure.in (m68k configs): Terminate path variable with
-       plain "m68k".
-
-Fri Dec 22 03:29:33 1995  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * mpn/sparc32/add_n.S: Update from sub_n.S to fix bugs, and to
-       clean things up.
-
-       * mpn/configure.in (m68k configs): Update #include path for new
-       mpn directory organization.
-
-Tue Dec 12 02:53:02 1995  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * gmp.h: Prefix all structure field with _mp_.
-       * gmp-impl.h: Define access macros for these fields.
-
-Sun Dec 10 00:47:17 1995  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * mpn/alpha/addmul_1.s: Prefix labels with `.'.
-       * mpn/alpha/submul_1.s: Likewise.
-       * mpn/alpha/[lr]shift.s: Likewise.
-       * mpn/alpha/udiv_qrnnd.S: Likewise.
-       * mpn/alpha/ev5/[lr]shift.s: Likewise.
-
-       * mpn/alpha/ev5/lshift.s: Fix typos.
-
-Fri Dec  1 14:28:20 1995  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * mpn/Makefile.in (.SUFFIXES): Define.
-
-Wed Nov 29 23:11:57 1995  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * mpn/sparc64/{add_n.s, sub_n.s}: New files.
-
-Tue Nov 28 06:03:13 1995  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * mpn/x86/syntax.h: Handle ELF_SYNTAX.
-       Rename GAS_SYNTAX => BSD_SYNTAX.
-
-       * mpn/configure.in: Handle linuxelf and SysV for x86 variants.
-
-Mon Nov 27 01:32:12 1995  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * mpn/hppa/hppa1_1/pa7100/submul_1.S: New file.
-
-Sun Nov 26 04:30:47 1995  Torbjorn Granlund  <tege@noisy.tmg.se>
-
-       * mpn/hppa/hppa1_1/pa7100/addmul_1.S: New file.
-
-       * mpn/sparc32/add_n.S: Rewrite to use 64 bit loads/stores.
-       * mpn/sparc32/sub_n.S: Likewise.
-
-Fri Nov 17 00:18:46 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpn/configure.in: Handle m68k on NextStep.
-
-Thu Nov 16 02:30:26 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpn: Reorganize machine-specific directories.
-       * mpn/configure.in: Corresponding changes.
-       (sh, sh2): Handle these.
-       (m68k targets): Create asm-syntax.h.
-
-Thu Nov  9 02:20:50 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpn/generic/mul_n.c (____mpn_sqr_n): Delete code that calls abort.
-       (____mpn_mul_n): Likewise.
-
-Tue Nov  7 03:25:12 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpf/get_str.c: In exponentiation code (two places), don't swap
-       input and output areas when calling mpn_mul_1.
-       * mpf/set_str.c: Likewise.
-
-Fri Nov  3 02:35:58 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpf/Makefile.in: Make sure all objects are listed in dependency list;
-       delete spurious entries.
-
-       * mpf/mul.c: Handle U or V being 0.  Allow prec+1 for result precision.
-
-       * mpf/set_prec.c: New computation of limb precision.
-       * mpf/set_dfl_prec.c: Likewise.
-
-       * mpf/random2.c: Fix typo computing exp.
-       * mpf/get_str.c: In (uexp > usize) case, set n_limbs as a function of
-       the user-requested number of digits, n_digits.
-
-Thu Nov  2 16:25:07 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpn/generic/divrem.c (case 2): Don't move np vector back, it is
-       never read.
-       (default case): Put most significant limb from np in new variable n2;
-       decrease size argument for MPN_COPY_DECR; use n2 instead of np[dsize].
-
-Wed Nov  1 02:59:53 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpn/sparc/[lr]shift.S: New files.
-
-Tue Oct 31 00:08:12 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpz/gcd_ui.c: Set w->size unconditionally when v is zero.
-
-       * gmp-impl.h (assert): Delete definition.
-
-       * mpf/sub.c: Delete all assert calls.  Delete variable `cy'.
-
-       * mpf/neg.c: Use prec+1 as precision.  Optimize for when arguments
-       are the same.
-       * mpf/abs.c: Likewise.
-       * mpf/{set,neg,abs}.c: Make structure and variable names similar.
-
-Mon Oct 30 12:45:26 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpf/random2.c (random): Test __SVR4 in addition to __svr4__.
-       * mpn/generic/random2.c (random): Likewise.
-
-Sun Oct 29 01:54:28 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpf/div.c: Special handle U or V being 0.
-
-       * mpf/random2.c: New file.
-
-       * longlong.h (i860 rshift_rhlc): Define.
-       (i960 udiv_qrnnd): Define.
-       (i960 count_leading_zeros): Define.
-       (i960 add_ssaaaa): Define.
-       (i960 sub_ddmmss): Define.
-       (i960 rshift_rhlc): Define.
-
-Sat Oct 28 19:09:15 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpn/pentium/rshift.S: Fix and generalize condition for when to use
-       special code for shift by 1.
-       * mpn/pentium/lshift.S: Likewise.
-
-Thu Oct 26 00:02:56 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * gmp.h: #undef __need_size_t.
-       * mp.h: Update from gmp.h.
-
-Wed Oct 25 00:17:27 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpf/Makefile.in: Compile set_prec.c.
-       * mpf/realloc.c: Delete this file.
-       * mpf/Makefile.in: Delete mentions of realloc.c.
-
-       * gmp.h (__mpf_struct): Get rid of `alloc' field.
-       * mpf/clear.c: Likewise.
-       * mpf/init*.c: Likewise.
-       * mpf/set_prec.c: Likewise.
-       * mpf/iset*.c: Likewise.
-
-       * mpf/iset_str.c: New file.
-
-       * mpn/configure.in: Handle pyramid.
-
-       * mpf/set.c: Use prec+1 as precision.
-
-       * mpf/set_prec.c: New file.
-
-Tue Oct 24 00:56:41 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpn/generic/divrem.c: New file.  Will replace mpn/generic/divmod.c
-       when rest of source is converted.
-       * mpn/configure.in (functions): Add `divrem'
-       * mpn/generic/set_str.c: Never call __mpn_mul_1 with zero size.
-
-       * mpf/get_str.c: Completely rewritten.
-       * mpf/add.c: Fix several problems.
-       * mpf/sub.c: Compare operands from most significant end until
-       first difference, exclude skipped limbs from computation.
-       Accordingly simplify normalization code.
-       * mpf/set_str.c: Fix several problems.
-       * mpf/dump.c: New file.
-       * mpf/Makefile.in: Compile dump.c.
-       * mpf/init2.c: Set prec field correctly.
-
-Sun Oct 22 03:02:09 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * cre-conv-tab.c: #include math.h; don't declare log and floor.
-
-Sat Oct 21 23:04:10 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpf/mul_ui.c: Handle U being 0.
-
-Wed Oct 18 19:39:27 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpn/generic/set_str.c: Correctly handle input like "000000000000".
-       Misc cleanups.
-
-Tue Oct 17 15:14:13 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * longlong.h: Define COUNT_LEADING_ZEROS_0 for machines where
-       appropriate.
-
-Mon Oct 16 19:14:43 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpf/add.c: Rewrite.
-       * mpf/set_str.c: New file.  Needs more work.
-
-Sat Oct 14 00:14:04 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpf/div_2exp.c: Vastly simplify.
-       * mpf/mul_2exp.c: Likewise.
-
-       * mpf/sub.c: Rewrite.
-
-       * gmp-impl.h (udiv_qrnnd_preinv2gen): Terminate comment.
-
-       * mpf/dump.c: Free allocated memory.
-
-       * gmp-impl.h (assert): Define.
-
-Wed Oct 11 13:31:00 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpn/pentium/rshift.S: Install new code to optimize shift-by-1.
-
-Tue Oct 10 00:37:21 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpn/pentium/lshift.S: Install new code to optimize shift-by-1.
-
-       * mpn/powerpc32/{lshift.s,rshift.s}: New files.
-
-       * configure.in: Fix typo.
-
-Sat Oct  7 08:17:09 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * longlong.h (smul_ppmm): Correct type of __m0 and __m1.
-
-Wed Oct  4 16:31:28 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpn/configure.in: Handle alphaev5.
-       * mpn/ev4: New name for alpha subdir.
-       * mpn/ev5: New subdir.
-       * mpn/ev5/lshift.s: New file.
-
-Tue Oct  3 15:06:45 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpn/alpha/mul_1.s: Avoid static increments of pointers; use
-       corresponding offsets in ldq and stq instructions instead.
-       (Loop): Swap cmpult and stq to save one cycle on EV5.
-
-       * mpn/tests/{add_n.s,sub_n.s,lshift.s,rshift.s,mul_1.s,addmul_1.s,
-       submul_1.s}: Don't check results if NOCHECK is defined.
-
-Mon Oct  2 11:40:18 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * longlong.h (mips umul_ppmm [32 and 64 bit versions]):
-       Make new variants, based on GCC version number, that use `l' and `h'
-       constraints instead of explicit mflo and mfhi instructions
-
-Sun Oct  1 00:17:47 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpn/mc88100/add_n.s: Decrease unrolling factor from 16 to 8.
-       * mpn/mc88100/sub_n.s: Likewise.
-
-       * config/mt-m88110: New file.
-       * configure.in: Use it.
-
-       * mpn/mc88110/mul_1.s: Fix thinko.
-
-Sat Sep 30 21:28:19 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpz/set_d.c: Declare `size' at function start.
-
-       * experimental: New directory for mpx and mpz2.
-
-       * mpz/tdiv_q.c: Clarify comments.
-       * mpz/{mod.c,mod_ui.c}: New file, for math mod function.
-
-       * mpn/sh2/{mul_1.s,addmul_1.s,submul_1.s}: New files.
-
-       * mpn/sh/{add_n.s,sub_n.s}: New files.
-
-       * mpn/pyr/{add_n.s,sub_n.s,mul_1.s,addmul_1.s}: New files.
-
-       * mpn/i960/{add_n.s,sub_n.s}: New files.
-
-       * mpn/alpha/addmul_1.s (Loop): Move decrement of r18 to before umulh,
-       to save cycles on EV5.
-       * mpn/alpha/submul_1.s: Ditto.
-       * mpn/alpha/mul_1.s: Ditto.
-
-Thu Sep 28 02:48:59 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * gmp.h (mp_limb, mp_limb_signed): Define as `long long' if
-       _LONG_LONG_LIMB is defined.
-
-       * longlong.h (m88110): Test __m88110__, not __mc88110__
-
-       * mpn/mc88110/mul_1.s: Rewrite.
-
-Tue Sep 26 23:29:05 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * config.sub: Update from current Cygnus version.
-
-       * mpn/configure.in: Recognize canonical m88*, not mc88*.
-
-Fri Sep 22 14:58:05 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpz/set_d.c: New file.
-       * mpz/Makefile.in: Build new files.
-
-       * mpq/get_d.c: Replace usage of scalbn with ldexp.
-
-       * mpn/{vax,i386}/gmp-mparam.h: New files.
-       * gmp-impl.h (ieee_double_extract): Define here.
-       * mpf/set_d.c (ieee_double_extract): Not here.
-
-Thu Sep 21 00:56:36 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * longlong.h (C umul_ppmm): Use UWtype, not USItype for temps.
-       (udiv_qrnnd): For cases implemented with call to __udiv_qrnnd,
-       protect with new symbol LONGLONG_STANDALONE.
-       (68000 umul_ppmm): Use %# prefix for immediate constants.
-
-Wed Sep 20 15:36:23 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpn/generic/divmod_1.c: Handle
-       divisor_limb == 1 << (BITS_PER_MP_LIMB - 1)
-       specifically also when normalization_steps != 0.
-
-Mon Sep 18 15:42:30 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpq/get_d.c: New file.
-
-Sun Sep 17 02:04:36 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * longlong.h (pyr): Botch up for now.
-
-Sat Sep 16 00:11:50 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpn/clipper/mul_1.s: New file.
-       * mpn/clipper/add_n.s: New file.
-       * mpn/clipper/sub_n.s: New file.
-       * mpn/configure.in: Handle clipper*-*-*.
-
-       * mpn/configure.in: Recognize rs6000-*-*.
-
-Fri Sep 15 00:41:34 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpn/alpha/add_n.s: New file.
-       * mpn/alpha/sub_n.s: New file.
-
-       * mpn/mips3: New name for mpn/r4000.
-       * mpn/mips2: New name for mpn/r3000.
-       * mpn/configure.in: Corresponding changes.
-
-       * mpn/generic/perfsqr.c (primes): Delete.
-       (residue_map): Delete.
-
-Thu Sep 14 00:07:58 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpn/r3000/sub_n.s: Fix typo.
-
-       * dm_trunc.c: Delete spurious file.
-
-       * mpz/out_binary.c: Fix typo.
-
-       * mpn/configure.in (per-target): Make mips*-*-irix6* imply r4000.
-
-       * gmp-impl.h: For sparc and sgi, include alloca.h.
-
-       * mpn/z8000/mul_1.s: Replace `test r' with `and r,r'.  Replace
-       `ldk r,#0' with `xor r,r'.
-
-Wed Sep  6 00:58:38 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpz/inp_binary.c: New file.
-       * mpz/out_binary.c: New file.
-       * mpz/Makefile.in: Build new files.
-
-Tue Sep  5 22:53:51 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * gmp.h (__mpz_struct): Change `long int' => `mp_size_t' for alloc
-       and size fields.
-
-Sat Sep  2 17:47:59 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpn/r4000/{add_n.s,sub_n.s}: Optimize away some pointer arithmetic.
-       * mpn/r3000/{add_n.s,sub_n.s,lshift.s,rshift.s}: New files,
-       derived from r4000 code.
-
-Fri Sep  1 05:35:52 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpn/r3000/mul_1.s: Fix typo.
-
-       * mpn/powerpc32: Fix some old vs new mnemonic issues.
-
-       * mpn/powerpc32/{add_n.s,sub_n.s}: New files.
-       * mpn/r4000/{add_n.s,sub_n.s,lshift.s,rshift.s}: New files.
-
-Wed Aug 30 10:43:47 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpn/r3000/mul_1.s ($LC1): Use addiu for immediate add.
-       * mpn/r4000/{mul_1.s,addmul_1.s,submul_1.s}: New files.
-
-       * config.guess: Update to latest FSF revision.
-
-Mon Aug 28 02:18:13 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpz/out_str.c: Cast str to char * in fputs call.
-
-       * gmp-impl.h: Define UQItype, SItype, and USItype also
-       when not __GNUC__.
-
-Fri Aug 25 01:45:04 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpn/i386/syntax.h: Renamed from asm-syntax.h.
-       * mpn/mc68020/syntax.h: Renamed from asm-syntax.h.
-       * mpn/configure.in: Corresponding changes.
-
-Sun Aug 13 19:20:04 1995  Torbjorn Granlund  <tege@bozo.tmg.se>
-
-       * mpn/generic/random2.c: Test __hpux, not hpux.
-
-Sat Apr 15 20:50:33 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
-
-       * mpn/sparc/add_n.S: Make it work for PIC.
-       * mpn/sparc/sub_n.s: Likewise.
-       * mpn/sparc8/addmul_1.S: Likewise.
-       * mpn/sparc8/mul_1.S: Likewise.
-       * mpn/i386/add_n.S: Likewise.
-       * mpn/i386/sub_n.S: Likewise.
-
-Thu Apr 13 23:15:03 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
-
-       * mpn/configure.in: Don't search power subdir for generic ppc configs.
-       Add some ppc cpu-specific configs.  Misc clean up.
-
-Mon Apr 10 00:16:35 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
-
-       * mpz/ui_pow_ui.c: Delete spurious code to handle negative results.
-
-Sun Apr  9 12:38:11 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
-
-       * longlong.h (SPARC v8 udiv_qrnnd): Generate remainder in C,
-       not in asm.
-
-       * mpn/generic/sqrt.c (SQRT): Test for __SOFT_FLOAT.
-
-Tue Mar 28 00:19:52 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
-
-       * mpn/generic/hamdist.c (popc_limb): Make Mar 16 change here too.
-
-Fri Mar 17 23:29:22 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
-
-       * longlong.h (SH umul_ppmm): Define.
-
-Thu Mar 16 16:40:44 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
-
-       * mpn/generic/popcount.c (popc_limb): Rearrange 32 bit case
-       to help CSE.
-
-Fri Mar 10 20:03:49 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
-
-       * mpn/powerpc32/mul_1.s: Clear cy before entering loop.
-       Rearrange loop to save a cycle.
-       * mpn/powerpc32/addmul_1.s: New file.
-       * mpn/powerpc32/submul_1.s: New file.
-
-Fri Feb 17 22:44:45 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
-
-       * mpn/configure.in: Set target_makefile_frag for freebsd
-       in new case stmt.
-       * mpn/config/t-freebsd: New file.
-       * mpn/Makefile.in: Add #### for frag insertion.
-       (XCFLAGS): Clear by default.
-       (.c.o, .S.o rules): Pass XCFLAGS.
-
-Tue Feb  7 16:27:50 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
-
-       * longlong.h (68000 umul_ppmm): Merge improvements from henderson.
-
-Tue Jan 24 04:23:20 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
-
-       * longlong.h (default umul_ppmm): Store input parameters in temporaries
-       to avoid reading them twice.
-       (default smul_ppmm): New definition.
-
-Thu Dec 29 04:20:07 1994  Jim Meyering  (meyering@comco.com)
-
-       * generic/perfsqr.c (__mpn_perfect_square_p): Remove declaration
-       of unused variable.
-       * generic/pre_mod_1.c (__mpn_preinv_mod_1): Likewise.
-       * mpz/powm.c (pow): Likewise.
-
-       * mpz/and.c (mpz_and): Use {} instead of `;' for empty else clause
-       to placate `gcc -Wall'.
-       * mpz/ior.c (mpz_ior): Likewise.
-
-Wed Dec 28 13:31:40 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
-
-       * mpn/m*68*/*.S: #include asm-syntax.h, not asm.h.
-
-Mon Dec 26 17:15:36 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
-
-       * longlong.h: Test for more symbols, in __mc68000__ case.
-
-       * mpn/mpn/config.sub: Recognize m68060.
-       * mpn/configure.in: Change mc* to m* for 68k targets.
-       * mpn/Makefile.in (.S.o): Delete spurious creation of temp .c file.
-
-Mon Dec 19 01:56:30 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
-
-       * config.sub: Recognize pentium as a valid CPU.
-       * mpn/configure.in: Handle pentium specifically, to use new assembly
-       code.
-
-Mon Dec 19 00:13:01 1994  Jim Meyering  (meyering@comco.com)
-
-       * gmp.h: Define _GMP_H_HAVE_FILE if FILE, __STDIO_H__, or H_STDIO
-       is defined.
-       * gmp.h: test _GMP_H_HAVE_FILE instead of FILE everywhere else.
-
-Mon Dec 19 00:04:54 1994  Kent Boortz  (boortz@sics.se)
-
-       * Makefile.in (recursive makes): Pass CFLAGS.
-
-Sun Dec 18 22:34:49 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
-
-       * mpn/pentium: New directory.
-
-       * mpz/pprime.c: Make sure to mpz_clear all temporaries.
-
-       * longlong.h: Don't use udiv instruction when SUPERSPARC is defined.
-       * configure.in: Handle supersparc*-.
-       * config/mt-supspc-gcc: New file.
-       * config/mt-sparc8-gcc: New name for mt-sparcv8-gcc.
-
-Mon Dec 12 22:22:10 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
-
-       * mpn/i386/*.S: #include "asm-syntax.h", not "asm.h".
-       #include sysdep.h before asm-syntax.h.
-
-       * mpn/mc68020/asm-syntax.h: #undef ALIGN before defining it.
-       * mpn/i386/asm-syntax.h: Likewise.
-
-       * mpn/mc68020/asm-syntax.h: New name for asm.h.
-       * mpn/i386/asm-syntax.h: New name for asm.h.
-
-Tue Dec  6 21:55:25 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
-
-       * mpz/array_init.c: Fix typo in declaration.
-
-Fri Nov 18 19:50:52 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
-
-       * mpn/Makefile.in (.S.o): Pass CFLAGS and INCLUDES.
-
-Mon Nov 14 00:34:12 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
-
-       * mpn/generic/random2.c (random): Test for __svr4__.
-
-Wed Oct 12 23:28:16 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
-
-       * cre-conv-tab.c (main): Avoid upper-case X in printf format string.
-
-Tue Aug 23 17:16:35 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
-
-       * mpz/perfsqr.c: Use mpn_perfect_square_p.
-       * mpn/generic/perfsqr.c: New file.
-
-Wed Jul  6 13:46:51 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
-
-       * mpz/array_init.c: New file.
-       * mpz/Makefile.in: Compile array_init.
-       * gmp.h: Declare mpz_array_init.
-
-Mon Jul  4 01:10:03 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
-
-       * mpz/add.c: Fix bogus comment.
-       * mpz/sub.c: Likewise.
-
-Sat Jul  2 02:14:56 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
-
-       * mpn/generic/pre_mod_1.c: New file.
-       * mpz/perfsqr.c: Use __mpn_preinv_mod_1 when faster.
-
-Fri Jul 01 22:10:19 1994  Richard Earnshaw (rwe11@cl.cam.ac.uk)
-
-       * longlong.h (arm umul_ppmm): Fix typos in last change.  Mark
-       hard-coded registers with "%|"
-
-Thu Jun 30 03:59:33 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
-
-       * mpz/perfsqr.c: Define PP, etc, for machines with 64 bit limbs.
-       Use __mpn_mod_1.
-       * mpz/perfsqr.c: Don't clobber REM in quadratic residue check loop.
-
-Wed Jun 29 18:45:41 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
-
-       * mpn/generic/sqrt.c (SQRT): New asm for IBM POWER2.
-
-       * mpz/gcd_ui.c: Return 0 if result does not fit an unsigned long.
-
-       * gmp.h: Use "defined (__STDC__)" consistently.
-
-Tue Jun 28 18:44:58 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
-
-       * gmp.h (mpz_get_si): Don't use "signed" keyword for return type.
-
-       * mpz/tests/Makefile.in: Use CFLAGS for linking.
-
-       * Makefile.in (CFLAGS): Use -O2 here.
-       * mpn/Makefile (CFLAGS): Not here.
-
-       * mpq/cmp_ui.c: Fix typo.
-       * mpq/canonicalize.c: Fix typo.
-       * mpz/gcd_ui.c: Handle gcd(0,v) and gcd(u,0) correctly.
-       * mpn/generic/gcd_1.c: Fix braino in last change.
-
-Mon Jun 27 16:10:27 1994  Torbjorn Granlund  (tege@rtl.cygnus.com)
-
-       * mpz/gcd_ui.c: Change return type and return result.
-       Allow destination param to be NULL.
-       * gmp.h: Corresponding change.
-       * mpn/generic/gcd_1.c: Handle zero return from mpn_mod_1.
-
-Tue Jun 14 02:17:43 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
-
-       * mpn/i386/asm.h (ALIGN): Make it take a parameter.
-       * mpn/i386/*.S: Use ALIGN to align all loops.
-
-       * mpn/i386/*.S: Move colon inside C_GLOBAL_NAME expression.
-       (Makes old versions of GAS happy.)
-
-Sat May 28 01:43:54 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
-
-       * Many files: Delete unused variables and labels.
-       * mpn/generic/dump.c: cast printf width argument to int.
-
-Wed May 25 00:42:37 1994  Torbjorn Granlund  (tege@thepub.cygnus.com)
-
-       * mpz/gcd.c (mpz_gcd): Normalize after __mpn_sub calls.
-       (xmod): Ignore return value of __mpn_divmod.
-       (xmod): Improve normalization code.
-
-Sat May 21 01:30:09 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
-
-       * mpz/gcdext.c: Cosmetic changes.
-
-       * mpz/fdiv_ui.c: New file.
-
-Fri May 20 00:24:53 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
-
-       * mpz/tests/Makefile.in: Use explicit rules for running tests,
-       not a shell loop.
-       (clean): Delete stmp-*.
-
-       * mpz/Makefile.in: Update.
-
-       * mpz/div_ui.c: Don't include longlong.h.
-       * mpz/dm_ui.c: Likewise.
-
-       * mpz/fdiv_q.c, mpz/fdiv_q_ui.c, mpz/fdiv_qr.c, mpz/fdiv_qr_ui.c,
-       mpz/fdiv_r.c, mpz/fdiv_r_ui.c: New files.  Code partly from deleted
-       mdm.c, mdm_ui.c, etc, partly rewritten.
-       * mpz/dm_floor_ui.c, mpz/dm_floor.c: Delete.
-       * mpz/mdm.c, mpz/mdm_ui.c, mpz/mdiv.c, mpz/mdiv_ui.c, mpz/mmod.c,
-       mpz/mmod_ui.c: Delete.
-
-       * mpz/tdiv_q.c, mpz/tdiv_q_ui.c, mpz/tdiv_qr.c, mpz/tdiv_qr_ui.c,
-       mpz/tdiv_r.c, mpz/tdiv_r_ui.c:
-       New names for files implementing truncating division.
-       * mpz/div_ui.c, mpz/dm_ui.c, mpz/mod_ui.c: Simplify.
-
-       * mpn/Makefile.in (.S.o): Don't rely on CPP being defined, use CC
-       instead.
-       (clean): Delete tmp-*.
-
-Thu May 19 01:37:44 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
-
-       * mpz/cmp.c: Call __mpn_cmp.
-
-       * mpz/popcount.c: Fix typo.
-
-       * mpz/powm_ui.c: Simplify main loop.  Keep principal operand size
-       smaller than MSIZE when possible.
-       * mpz/powm.c: Likewise.
-
-       * mpn/generic/sqrt.c: Move alloca calls into where the memory is
-       needed.  Simplify.
-
-       * gmp.h: (_PROTO): New macro.
-       Add many function declarations; use _PROTO macro in all declarations.
-
-       * mpf/*.c: Prepend mpn calls with __.
-
-Wed May 18 20:57:06 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
-
-       * mpf/*ui*.c: Make ui argument `long' for consistency with mpz
-       functions.
-
-       * mpf/div_ui.c: Simplify.
-
-Tue May 17 01:05:14 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
-
-       * mpz/*.c: Prepend mpn calls with __.
-
-       * mpz/mul_ui.c: Use mpn_mul_1.
-
-Mon May 16 17:19:41 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
-
-       * mpn/i386/mul_1.S: Use C_GLOBAL_NAME.
-       * mpn/i386/mul_1.S, mpn/i386/addmul_1.S, mpn/i386/submul_1.S:
-       Nuke use of LAB.
-
-Sat May 14 14:21:02 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
-
-       * gmp-impl.h: Don't define abort here.
-
-       * mpz/pow_ui.c: Increase temporary allocation.
-       * mpz/ui_pow_ui.c: Likewise.
-
-       * gmp.h (mpz_add_1, mpz_sub_1): Don't call memcpy.
-
-       * All Makefile.in: Delete spurious -I arguments.
-       Update dependencies.
-
-       * mpz/popcount.c: New file.
-       * mpz/hamdist.c: New file.
-
-       * All configure: Latest version from Cygnus.
-
-       * mpq/Makefile.in: New file.
-       * mpq/configure.in: New file.
-       * Makefile.in, configure.in: Enable compilation of mpq.
-
-       * mpq/set_z.c: Fix typos.
-       * mpq/canonicalize.c: Fix typos.
-       * mpq/cmp_ui.c: Fix typos.
-
-       * mpf/add_ui.c: Read U->D into UP always.  Delete spurious MPN_COPY.
-       * mpf/sub_ui.c: Likewise.
-
-       * gmp-impl.h: Don't redefine alloca.
-
-       * COPYING.LIB: Renamed from COPYING.
-
-Wed May 11 01:45:44 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
-
-       * mpz/powm_ui.c: When shifting E left by C+1, handle out-of-range
-       shift counts.  Fix typo when testing negative_result.
-       * mpz/powm.c: Likewise.
-
-       * mpz/ui_pow_ui.c: New file.
-       * mpz/Makefile.in: Update.
-
-       * mpz/pow_ui.c: Call __mpn_mul_n instead of __mpn_mul when possible.
-
-       * mpz/div.c, mpz/div_ui.c, mpz/gcd.c: Prefix external mpn calls.
-       * mpz/gcd.c: Declare mpn_xmod.
-
-       * mpz/powm.c: Major changes to accommodate changed mpn semantics.
-       * mpz/powm_ui.c: Update from mpz/powm.c.
-
-       * mpz/tests/tst-io.c: New file.
-       * mpz/tests/tst-logic: New file.
-       * mpz/tests/Makefile.in: Update.
-
-       * mpz/inp_str.c: Get base right when checking for first digit.
-       * mpz/inp_str.c: Allocate more space for DEST when needed.
-
-       * mpz/com.c: Use mpn_add_1 and mpn_sub_1.
-       * mpz/and.c, mpz/ior.c: Likewise.  Simplify somewhat.
-
-       * mpz/add_ui.c: Use mpn_add_1 and mpn_sub_1.
-       Rename parameters to be consistent with mpz/sub_ui.
-       General simplifications.
-       * mpz/sub_ui.x: Likewise.
-
-Tue Aug 10 19:41:16 1993  Torbjorn Granlund  (tege@prudens.matematik.su.se)
-
-       * mpf: New directory.
-       * mpf/*.c: Merge basic set of mpf functions.
-
-       * Many logs missing...
-
-Sun Apr 25 18:40:26 1993  Torbjorn Granlund  (tege@pde.nada.kth.se)
-
-       * memory.c: Use #if instead of #ifdef for __STDC__ for consistency.
-       * bsd/xtom.c: Likewise.
-
-       * mpz/div.c: Remove free_me and free_me_size and their usage.
-       Use mpn_divmod for division; corresponding changes in return value
-       convention.
-       * mpz/powm.c: `carry_digit' => `carry_limb'.
-       * bsd/sdiv.c: Clearify comment.
-
-Sun Apr 25 00:31:28 1993  Torbjorn Granlund  (tege@pde.nada.kth.se)
-
-       * longlong.h (__udiv_qrnnd_c): Make all variables `unsigned long int'.
-
-Sat Apr 24 16:23:33 1993  Torbjorn Granlund  (tege@pde.nada.kth.se)
-
-       * longlong.h (__udiv_qrnnd_c): Make all variables `unsigned long int'.
-
-       * gmp-impl.h: #define ABS.
-       * (Many files): Use ABS instead of abs.
-
-       * mpn/generic/sqrt.c, mpz/clrbit.c, mpz/get_si.c, mpz/mod_2exp.c,
-       mpz/pow_ui.c: Cast 1 to mp_limb before shifting.
-
-       * mpz/perfsqr.c: Use #if, not plain if for exclusion of code for
-       non-32-bit machines.
-
-Tue Apr 20 13:13:58 1993  Torbjorn Granlund  (tege@du.nada.kth.se)
-
-       * mpn/generic/sqrt.c: Handle overflow for intermediate quotients by
-       rounding them down to fit.
-
-       * mpz/perfsqr.c (PP): Define in hexadecimal to avoid GCC warnings.
-
-       * mpz/inp_str.c (char_ok_for_base): New function.
-       (mpz_inp_str): Use it.
-
-Sun Mar 28 21:54:06 1993  Torbjorn Granlund  (tege@cyklop.nada.kth.se)
-
-       * mpz/inp_raw.c: Allocate x_index, not xsize limbs.
-
-Mon Mar 15 11:44:06 1993  Torbjorn Granlund  (tege@pde.nada.kth.se)
-
-       * mpz/pprime.c: Declare param `const'.
-       * gmp.h: Add declarations for mpz_com.
-
-Thu Feb 18 14:10:34 1993  Torbjorn Granlund  (tege@pde.nada.kth.se)
-
-       * mpq/add.c, mpq/sub.c: Call mpz_clear for t.
-
-Fri Feb 12 20:27:34 1993  Torbjorn Granlund  (tege@cyklop.nada.kth.se)
-
-       * mpz/inp_str.c: Recog minus sign as first character.
-
-Wed Feb  3 01:36:02 1993  Torbjorn Granlund  (tege@cyklop.nada.kth.se)
-
-       * mpz/iset.c: Handle 0 size.
-
-Tue Feb  2 13:03:33 1993  Torbjorn Granlund  (tege@cyklop.nada.kth.se)
-
-       * mpz/mod_ui.c: Initialize dividend_size before it's used.
-
-Mon Jan  4 09:11:15 1993  Torbjorn Granlund  (tege@sics.se)
-
-       * bsd/itom.c: Declare param explicitly 'signed'.
-       * bsd/sdiv.c: Likewise.
-
-       * mpq/cmp.c: Remove unused variable tmp_size.
-       * mpz/powm_ui.c: Fix typo in esize==0 if stmt.
-       * mpz/powm.c: Likewise.
-
-Sun Nov 29 01:16:11 1992  Torbjorn Granlund  (tege@sics.se)
-
-       * mpn/generic/divmod_1.c (mpn_divmod_1): Handle
-       divisor_limb == 1 << (BITS_PER_MP_LIMB - 1)
-       specifically.
-
-       * Reorganize sources.  New directories mpn, mpn/MACH, mpn/generic,
-       mpz, mpq, bsd.  Use full file name for change logs hereafter.
-
-Wed Oct 28 17:40:04 1992  Torbjorn Granlund  (tege@jupiter.sics.se)
-
-       * longlong.h (__hppa umul_ppmm): Fix typos.
-       (__hppa sub_ddmmss): Swap input arguments.
-
-       * mpz_perfsqr.c (mpz_perfect_square_p): Avoid , before } in
-       initializator.
-
-Sun Oct 25 20:30:06 1992  Torbjorn Granlund  (tege@jupiter.sics.se)
-
-       * mpz_pprime.c (mpz_probab_prime_p): Handle numbers <= 3
-       specifically (used to consider all negative numbers prime).
-
-       * mpz_powm_ui: `carry_digit' => `carry_limb'.
-
-       * sdiv: Handle zero dividend specifically.  Replace most code in
-       this function with a call to mpn_divmod_1.
-
-Fri Sep 11 22:15:55 1992  Torbjorn Granlund  (tege@tarrega.sics.se)
-
-       * mpq_clear: Don't free the MP_RAT!
-
-       * mpn_lshift, mpn_rshift, mpn_rshiftci: Remove `long' from 4:th arg.
-
-Thu Sep  3 01:47:07 1992  Torbjorn Granlund  (tege@jupiter.sics.se)
-
-       * All files: Remove leading _ from mpn function names.
-
-Wed Sep  2 22:21:16 1992  Torbjorn Granlund  (tege@jupiter.sics.se)
-
-       Fix from Jan-Hein Buhrman:
-       * mpz_mdiv.c, mpz_mmod.c, mpz_mdm.c: Make them work as documented.
-
-       * mpz_mmod.c, mpz_mdm.c: Move decl of TEMP_DIVISOR to reflect its
-       life.
-
-Sun Aug 30 18:37:15 1992  Torbjorn Granlund  (tege@jupiter.sics.se)
-
-       * _mpz_get_str: Use mpz_sizeinbase for computing out_len.
-       * _mpz_get_str: Don't remove leading zeros.  Abort if there are some.
-
-Wed Mar  4 17:56:56 1992  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * gmp.h: Change definition of MP_INT to make the & before params
-       optional.  Use typedef to define it.
-       * mp.h: Use typedef to define MINT.
-
-Tue Feb 18 14:38:39 1992  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       longlong.h (hppa umul_ppmm): Add missing semicolon.  Declare type
-       of __w1 and __w0.
-
-Fri Feb 14 21:33:21 1992  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * longlong.h: Make default count_leading_zeros work for machines >
-       32 bits.  Prepend `__' before local variables to avoid conflicts
-       with users' variables.
-
-       * mpn_dm_1.c: Remove udiv_qrnnd_preinv ...
-       * gmp-impl.h: ... and put it here.
-       * mpn_mod_1: Use udiv_qrnnd_preinv if it is faster than udiv_qrnnd.
-
-Tue Feb 11 17:20:12 1992  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpn_mul: Enhance base case by handling small multiplicands.
-       * mpn_dm_1.c: Revert last change.
-
-Mon Feb 10 11:55:15 1992  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpn_dm_1.c: Don't define udiv_qrnnd_preinv unless needed.
-
-Fri Feb  7 16:26:16 1992  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpn_mul: Replace code for base case.
-
-Thu Feb  6 15:10:42 1992  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpn_dm_1.c (_mpn_divmod_1): Add code for avoiding division by
-       pre-inverting divisor.
-
-Sun Feb  2 11:10:25 1992  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * longlong.h: Make __LLDEBUG__ work differently.
-       (_IBMR2): Reinsert old code.
-
-Sat Feb  1 16:43:00 1992  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * longlong.h (#ifdef _IBMR2): Replace udiv_qrnnd with new code
-       using floating point operations.  Don't define
-       UDIV_NEEDS_NORMALIZATION any longer.
-
-Fri Jan 31 15:09:13 1992  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * longlong.h: Define UMUL_TIME and UDIV_TIME for most machines.
-       * longlong.h (#ifdef __hppa): Define umul_ppmm.
-
-Wed Jan 29 16:41:36 1992  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpn_cmp: Only one length parameter, assume operand lengths are
-       the same.  Don't require normalization.
-       * mpq_cmp, mpz_add, mpz_sub, mpz_gcd, mpn_mul, mpn_sqrt: Change for
-       new mpn_cmp definition.
-
-Tue Jan 28 11:18:55 1992  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * _mpz_get_str: Fix typo in comment.
-
-Mon Jan 27 09:44:16 1992  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * Makefile.in: Add new files.
-
-       * mpn_dm_1.c: New file with function _mpn_divmod_1.
-       * mpz_dm_ui.c (mpz_divmod_ui): Use _mpn_divmod_1.
-       * mpz_div_ui: Likewise.
-
-       * mpn_mod_1.c: New file with function _mpn_mod_1.
-       * mpz_mod_ui: Use _mpn_mod_1.
-
-Thu Jan 23 18:54:09 1992  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       Bug found by Paul Zimmermann (zimmermann@inria.inria.fr):
-       * mpz_div_ui.c (mpz_div_ui), mpz_dm_ui.c (mpz_divmod_ui):
-       Handle dividend == 0.
-
-Wed Jan 22 12:02:26 1992  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpz_pprime.c: Use "" for #include.
-
-Sun Jan 19 13:36:55 1992  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpn_rshiftci.c (header): Correct comment.
-
-Wed Jan 15 18:56:04 1992  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpz_powm, mpz_powm_ui (if (bsize > msize)): Do alloca (bsize + 1)
-       to make space for ignored quotient at the end.  (The quotient might
-       always be an extra limb.)
-
-Tue Jan 14 21:28:48 1992  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpz_powm_ui: Fix comment.
-       * mpz_powm: Likewise.
-
-Mon Jan 13 18:16:25 1992  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * tests/Makefile.in: Prepend $(TEST_PREFIX) to Makefile target.
-
-Sun Jan 12 13:54:28 1992  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       Fixes from Kazumaro Aoki:
-       * mpz_out_raw: Take abs of size to handle negative values.
-       * mpz_inp_raw: Reallocate before reading ptr from X.
-       * mpz_inp_raw: Store, don't read, size to x->size.
-
-Tue Jan  7 17:50:25 1992  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * gmp.h, mp.h: Remove parameter names from prototypes.
-
-Sun Dec 15 00:09:36 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * tests/Makefile.in: Prepend "./" to file names when executing
-       tests.
-
-       * Makefile.in: Fix many problems.
-
-Sat Dec 14 01:00:02 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpn_sqrt.c: New file with _mpn_sqrt.
-       * mpz_sqrt, mpz_sqrtrem, mpz_perfect_square_p: Use _mpn_sqrt.
-       * msqrt.c: Delete.  Create from mpz_sqrtrem.c in Makefile.in.
-       * mpz_do_sqrt.c: Delete.
-       * Makefile.in: Update to reflect these changes.
-
-       * Makefile.in, configure, configure.subr: New files
-       (from bothner@cygnus.com).
-       * dist-Makefile: Delete.
-
-       * mpz_fac_ui: Fix comment.
-
-       * mpz_random2: Rewrite a bit to make it possible for the most
-       significant limb to be == 1.
-
-       * mpz_pprime.c (mpz_probab_prime_p): Remove \t\n.
-
-Fri Dec 13 23:10:02 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpz_do_sqrt: Simplify special case for U == 0.
-       * m*sqrt*.c, mpz_perfsqr.c (mpz_perfect_square_p):
-         Rename _mpz_impl_sqrt to _mpz_do_sqrt.
-
-Fri Dec 13 12:52:28 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * gmp-impl.h (MPZ_TMP_INIT): Cast to the right type.
-
-Thu Dec 12 22:17:29 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpn_add, mpn_sub, mpn_mul, mpn_div: Change type of several
-       variables to mp_size.
-
-Wed Dec 11 22:00:34 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpn_rshift.c: Fix header comments.
-
-Mon Dec  9 17:46:10 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       Released 1.2.
-
-       * gmp-impl.h (MPZ_TMP_INIT): Cast alloca return value.
-
-       * dist-Makefile: Add missing dependency for cre-mparam.
-
-       * mpz_mdiv.c, mpz_mmod.c, mpz_mdm.c, mpz_mdiv_ui.c,
-         mpz_mmod_ui.c, mpz_mdm_ui.c: Remove obsolete comment.
-
-       * dist-Makefile (clean): clean in tests subdir too.
-       * tests/Makefile: Define default values for ROOT and SUB.
-
-       * longlong.h (__a29k__ udiv_qrnnd): Change "q" to "1" for operand
-       2 constraint.
-
-Mon Nov 11 00:06:05 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpz_sizeinb.c (mpz_sizeinbase): Special code for size == 0.
-
-Sat Nov  9 23:47:38 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       Released 1.1.94.
-
-       * dist-Makefile, Makefile, tests/Makefile: Merge tests into
-       distribution.
-
-Fri Nov  8 22:57:19 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * gmp.h: Don't use keyword `signed' for non-ANSI compilers.
-
-Thu Nov  7 22:06:46 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * longlong.h: Cosmetic changes to keep it identical to gcc2 version
-       of longlong.h.
-       * longlong.h (__ibm032__): Fix operand order for add_ssaaaa and
-       sub_ddmmss.
-
-Mon Nov  4 00:36:46 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpn_mul: Fix indentation.
-
-       * mpz_do_sqrt: Don't assume 32 bit limbs (had constant
-       4294967296.0).
-       * mpz_do_sqrt: Handle overflow in conversion from double returned
-       by SQRT to mp_limb.
-
-       * gmp.h: Add missing function definitions.
-
-Sun Nov  3 18:25:25 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpz_pow_ui: Change type of `i' to int.
-
-       * ChangeLog: Add change log entry.
-       * ChangeLog: Add change log entry.
-       * ChangeLog: Add change log entry.
-       * ChangeLog: Add change log entry.
-       * ChangeLog: Add change log entry.
-       * ChangeLog: Add change log entry.
-       * ChangeLog: Add change log entry.
-       * ChangeLog: Add change log entry.
-Stack overflow.
-
-       * mpz_pow_ui.c: Fix typo in comment.
-
-       * dist-Makefile: Create rpow.c from mpz_powm_ui.c.
-       * mpz_powm_ui.c: Add code for rpow.
-       * rpow.c: Delete this file.  The rpow function is now implemented
-       in mpz_powm_ui.c.
-
-       * mpz_fac_ui.c: New file.
-       * gmp.h, dist-Makefile: Add stuff for mpz_fac_ui.
-
-       Bug found by John Amanatides (amana@sasquatch.cs.yorku.ca):
-       * mpz_powm_ui, mpz_powm: Call _mpn_mul in the right way, with
-       the first argument not smaller than the second.
-
-Tue Oct 29 13:56:55 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * cre-conv-tab.c (main), cre-mparam.c (main): Fix typo in output
-       header text.
-
-Mon Oct 28 00:35:29 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpz_random2: Handle size == 0.
-
-       * gmp-impl.h (struct __mp_bases): Rename chars_per_limb_exactly to
-       chars_per_bit_exactly, and change its definition.
-       * cre-conv-tab.c (main): Output field according to its new
-       definition.
-       * mpz_out_str, _mpz_get_str, mpz_sizeinb, mout:
-       Use chars_per_bit_exactly.
-
-       * mpz_random2: Change the loop termination condition in order to
-       get a large most significant limb with higher probability.
-
-       * gmp.h: Add declaration of new mpz_random2 and mpz_get_si.
-       * mpz_get_si.c: New file.
-       * dist-Makefile: Add mpz_random2 and mpz_get_si.
-
-       * mpz_sizeinb.c (mpz_sizeinbase): Special code for base being a
-       power of 2, giving exact result.
-
-       * mpn_mul: Fix MPN_MUL_VERIFY in various ways.
-       * mpn_mul: New macro KARATSUBA_THRESHOLD.
-       * mpn_mul (karatsuba's algorithm): Don't write intermediate results
-       to prodp, use temporary pp instead.  (Intermediate results can be
-       larger than the final result, possibly writing into hyperspace.)
-       * mpn_mul: Make smarter choice between Karatsuba's algorithm and the
-       shortcut algorithm.
-       * mpn_mul: Fix typo, cy instead of xcy.  Unify carry handling code.
-
-Sun Oct 27 19:57:32 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpn_mul: In non-classical case, choose Karatsuba's algorithm only
-       when usize > 1.5 vsize.
-
-       * mpn_mul: Break between classical and Karatsuba's algorithm at
-       KARATSUBA_THRESHOLD, if defined.  Default to 8.
-
-       * mpn_div: Kludge to fix stray memory read.
-
-Sat Oct 26 20:06:14 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpz_gcdext: Handle a = b = 0.  Remove memory leakage by calling
-       mpz_clear for all temporary variables.
-
-       * mpz_gcd: Reduce w_bcnt in _mpn_lshift call to hold that
-       function's argument constraints.  Compute wsize correctly.
-
-       * mpz_gcd: Fix typo in comment.
-
-       * memory.c (_mp_default_allocate, _mp_default_reallocate): Call
-       abort if allocation fails, don't just exit.
-
-Fri Oct 25 22:17:20 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpz_random2.c: New file.
-
-Thu Oct 17 18:06:42 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       Bugs found by Pierre-Joseph Gailly (pjg@sunbim.be):
-       * mpq_cmp: Take sign into account, don't just compare the
-       magnitudes.
-       * mpq_cmp: Call _mpn_mul in the right way, with the first argument
-       not smaller than the second.
-
-Wed Oct 16 19:27:32 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpz_random: Ensure the result is normalized.
-
-Tue Oct 15 14:55:13 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpz_clrbit: Support non-ANSI compilers.
-
-Wed Oct  9 18:03:28 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * longlong.h (68k add_ssaaaa, sub_ddmmss): Generalize constraints.
-
-Tue Oct  8 17:42:59 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpz_mdm_ui: Add comments.
-
-       * mpz_mdiv: Use MPZ_TMP_INIT instead of mpz_init.
-       * mpz_init_ui: Change spacing and header comment.
-
-Thu Oct  3 18:36:13 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * dist-Makefile: Prepend `./' before some filenames.
-
-Sun Sep 29 14:02:11 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       Released 1.1 (public).
-
-       * mpz_com: New name of mpz_not.
-       * dist-Makefile: Change mpz_not to mpz_com.
-
-Tue Sep 24 12:44:11 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * longlong.h: Fix header comment.
-
-Mon Sep  9 15:16:24 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       Released 1.0.92.
-
-       * mpn_mul.c (_mpn_mul): Handle leading zero limbs in non-Karatsuba
-       case.
-
-       * longlong.h (m68000 umul_ppmm): Clobber one register less by
-       slightly rearranging the code.
-
-Sun Sep  1 18:53:25 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * dist-Makefile (stamp-stddefh): Fix typo.
-
-Sat Aug 31 20:41:31 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       Released 1.0.91.
-
-       * mpz_mdiv.c, mpz_mmod.c, mpz_mdm.c, mpz_mdiv_ui.c,
-         mpz_mmod_ui.c, mpz_mdm_ui.c: New files and functions.
-       * gmp.h, gmp.texi: Define the new functions.
-
-Fri Aug 30 08:32:56 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpz_gcdext: Compute t argument from the other quantities at the
-         end, of the function, not in the loop.  New feature: Allow t to be
-         NULL.
-
-       * mpz_add.c, mpz_sub.c, mpz_mul.c, mpz_powm.c, mpz_gcd.c: Don't
-         include "mp.h".  Use type name `MP_INT' always.
-
-       * dist-Makefile, mpz_cmp.c: Merge mcmp.c from mpz_cmp.c.
-
-Wed Aug 28 00:45:11 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * dist-Makefile (documentation): Go via tmp.texi to avoid the
-         creation of gmp.dvi if any errors occur.  Make tex read input
-         from /dev/null.
-
-Fri Aug 23 15:58:52 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * longlong.h (68020, i386): Don't define machine-dependent
-         __umulsidi3 (so the default definition is used).
-       * longlong.h (all machines): Cast all operands, sources and
-         destinations, to `unsigned long int'.
-       * longlong.h: Add gmicro support.
-
-Thu Aug 22 00:28:29 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * longlong.h: Rename BITS_PER_LONG to LONG_TYPE_SIZE.
-       * longlong.h (__ibm032__): Define count_leading_zeros and umul_ppmm.
-       * longlong.h: Define UMUL_TIME and UDIV_TIME for some CPUs.
-       * _mpz_get_str.c: Add code to do division by big_base using only
-         umul_qrnnd, if that is faster.  Use UMUL_TIME and UDIV_TIME to
-         decide which variant to use.
-
-Wed Aug 21 15:45:23 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * longlong.h (__sparc__ umul_ppmm): Move two insn from end to the
-         nops.  (Saves two insn.)
-
-       * longlong.h (__sparc__ umul_ppmm): Rewrite in order to avoid
-         branch, and to permit input/output register overlap.
-
-       * longlong.h (__29k__): Remove duplicated udiv_qrnnd definition.
-       * longlong.h (__29k__ umul_ppmm): Split asm instructions into two
-         asm statements (gives better code if either the upper or lower
-         part of the product is unused.
-
-Tue Aug 20 17:57:59 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * _mpz_get_str.c (outside of functions): Remove
-         num_to_ascii_lower_case and num_to_ascii_upper_case.  Use string
-         constants in the function instead.
-
-Mon Aug 19 00:37:42 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * cre-conv-tab.c (main): Output table in hex.  Output 4 fields, not
-         3, for components 0 and 1.
-
-       * gmp.h: Add declaration of mpq_neg.
-
-       Released 1.0beta.13.
-
-       * _mpz_set_str.c (mpz_set_str): Cast EOF and SPC to char before
-         comparing to enum literals SPC and EOF.  This makes the code work
-         for compilers where `char' is unsigned.  (Bug found by Brian
-         Beuning).
-
-       Released 1.0beta.12.
-
-       * mpz_mod_ui: Remove references to quot.  Remove quot_ptr, quot_size
-         declarations and assignment code.
-
-Sun Aug 18 14:44:26 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpz_mod_ui: Handle dividend < 0.
-
-       Released 1.0beta.11.
-
-       * mpz_dm_ui, mpz_div_ui, mpz_mod_ui, sdiv: Make them share the same
-         general structure, variable names, etc.
-
-       * sdiv: Un-normalize the remainder in n1 before it is negated.
-
-       * longlong.h: Mention UDIV_NEEDS_NORMALIZATION in description of
-         udiv_qrnnd.
-
-       * mpz_dm_ui.c (mpz_divmod_ui), mpz_div_ui.c (mpz_div_ui): Increment
-         the quotient size if the dividend size is incremented.  (Bug found
-         by Brian Beuning.)
-
-       * mpz_mod_ui: Shift back the remainder, if UDIV_NEEDS_NORMALIZATION.
-         (Bug found by Brian Beuning.)
-
-       * mpz_mod_ui: Replace "digit" by "limb".
-
-       * mpz_perfsqr.c (mpz_perfect_square_p): Disable second test case
-         for non-32-bit machines (PP is hardwired for such machines).
-       * mpz_perfsqr.c (outside of functions): Define PP value with an L.
-
-       * mpn_mul.c (_mpn_mul): Add verification code that is activated if
-         DEBUG is defined.  Replace "digit" by "limb".
-       * mpn_mul.c (_mpn_mul: Karatsuba's algorithm: 4.): Normalize temp
-         after the addition.
-       * mpn_mul.c (_mpn_mul: Karatsuba's algorithm: 1.): Compare u0_size
-         and v0_size, and according to the result, swap arguments in
-         recursive call.  (Don't violate mpn_mul's own argument
-         constraints.)
-
-Fri Aug 16 13:47:12 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       Released 1.0beta.10.
-
-       * longlong.h (IBMR2): Add udiv_qrnnd.
-
-       * mpz_perfsqr: Remove unused variables.
-
-       * mpz_and (case for different signs): Initialize loop variable i!
-
-       * dist-Makefile: Update automatically generated dependencies.
-       * dist-Makefile (madd.c, msub.c, pow.c, mult.c, gcd.c): Add mp.h,
-         etc to dependency file lists.
-
-       * longlong.h (add_ssaaaa, sub_ddmmss [C default versions]): Make __x
-         `unsigned long int'.
-       * longlong.h: Add `int' after `unsigned' and `long' everywhere.
-
-Wed Aug 14 18:06:48 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * longlong.h: Add ARM, i860 support.
-
-       * mpn_lshift, mpn_rshift, mpn_rshiftci: Rename *_word with *_limb.
-
-Tue Aug 13 21:57:43 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * _mpz_get_str.c, _mpz_set_str.c, mpz_sizeinb.c (mpz_sizeinbase),
-         mpz_out_str.c, mout.c: Remove declaration of __mp_bases.
-       * gmp-impl.h: Put it here, and make it `const'.
-       * cre-conv-tab.c (main): Make struct __mp_bases `const'.
-
-Mon Aug 12 17:11:46 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * cre-conv-tab.c (main): Use %lu in printf for long ints.
-
-       * dist-Makefile: Fix cre-* dependencies.
-
-       * cre-conv-tab.c (main): Output field big_base_inverted.
-
-       * gmp-impl.h (struct bases): New field big_base_inverted.
-       * gmp-impl.h (struct bases): Change type of chars_per_limb_exactly
-         to float (in order to keep the structure smaller).
-
-       * mp.h, gmp.h: Change names of macros for avoiding multiple
-         includes.
-
-Fri Aug  9 18:01:36 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * _mpz_get_str: Only shift limb array if normalization_steps != 0
-         (optimization).
-
-       * longlong.h (sparc umul_ppmm): Use __asm__, not asm.
-       * longlong.h (IBMR2 umul_ppmm): Refer to __m0 and __m1, not to m0
-         and m1 (overlap between output and input operands did not work).
-       * longlong.h: Add VAX, ROMP and HP-PA support.
-       * longlong.h: Sort the machine dependent code in alphabetical order
-         on the CPU name.
-       * longlong.h: Hack comments.
-
-Thu Aug  8 14:13:36 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       Released 1.0beta.9.
-
-       * longlong.h: Define BITS_PER_LONG to 32 if it's not already
-         defined.
-       * Define __BITS4 to BITS_PER_LONG / 4.
-       * Don't assume 32 bit word size in "count_leading_zeros" C macro.
-         Use __BITS4 and BITS_PER_LONG instead.
-
-       * longlong.h: Don't #undef internal macros (reverse change of Aug 3).
-
-       * longlong.h (68k): Define add_ssaaaa sub_ddmmss, and umul_ppmm
-         even for plain mc68000.
-
-       * mpq_div: Flip the sign of the numerator *and* denominator of the
-         result if the intermediate denominator is negative.
-
-       * mpz_and.c, mpz_ior.c: Use MPN_COPY for all copying operations.
-
-       * mpz_and.c: Compute the result size more conservatively.
-       * mpz_ior.c: Likewise.
-
-       * mpz_realloc: Never allocate zero space even if NEW_SIZE == 0.
-
-       * dist-Makefile: Remove madd.c, msub.c, pow.c, mult.c, gcd.c from
-         BSDMP_SRCS.
-
-       * dist-Makefile: Create mult.c from mpz_mul.c.
-       * mult.c: Delete this file.
-
-       * _mpz_set_str: Normalize the result (for bases 2, 4, 8... it was
-         not done properly if the input string had many leading zeros).
-
-Sun Aug  4 16:54:14 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * dist-Makefile (gcd.c, pow.c, madd.c, msub.c): Make these targets
-         work with VPATH and GNU MP.
-
-       * mpz_gcd: Don't call mpz_set; inline its functionality.
-
-       * mpq_mul, mpq_div: Fix several serious typos.
-
-       * mpz_dmincl, mpz_div: Don't normalize the quotient if it's already
-         zero.
-
-       * mpq_neg.c: New file.
-
-       * dist-Makefile: Remove obsolete dependencies.
-
-       * mpz_sub: Fix typo.
-
-       Bugs found by Pierre-Joseph Gailly (pjg@sunbim.be):
-       * mpq_mul, mpq_div: Initialize tmp[12] variables even when the gcd
-         is just 1.
-       * mpz_gcd: Handle gcd(0,v) and gcd(u,0) in special cases.
-
-Sat Aug  3 23:45:28 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * longlong.h: Clean up comments.
-       * longlong.h: #undef internal macros.
-
-Fri Aug  2 18:29:11 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpq_set_si, mpq_set_ui: Canonicalize 0/x to 0/1.
-       * mpq_set_si, mpq_set_ui: Cosmetic formatting changes.
-
-       * mpz_dmincl.c: Normalize the remainder before shifting it back.
-
-       * mpz_dm_ui.c (mpz_divmod_ui): Handle rem == dividend.
-
-       * mpn_div.c: Fix comment.
-
-       * mpz_add.c, mpz_sub.c: Use __MP_INT (not MP_INT) for intermediate
-         type, in order to work for both GNU and Berkeley functions.
-
-       * dist-Makefile: Create gcd.c from mpz_gcd.c, pow.c from mpz_powm,
-         madd.c from mpz_add.c, msub.c from mpz_sub.c.
-         respectively.
-       * pow.c, gcd.c, mpz_powmincl.c, madd.c, msub.c: Remove these.
-       * mpz_powm.c, mpz_gcd.c, mpz_add.c, mpz_sub.c: #ifdef for GNU and
-         Berkeley function name variants.
-       * dist-Makefile: Add created files to "clean" target.
-
-Tue Jul 16 15:19:46 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpq_get_den: No need for absolute value of the size, the
-         denominator is always positive.
-
-       * mpz_get_ui: If the operand is zero, return zero.  Don't read the
-         limb array!
-
-       * mpz_dmincl.c: Don't ignore the return value from _mpn_rshift, it
-         is the size of the remainder.
-
-Mon Jul 15 11:08:05 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * Several files: Remove unused variables and functions.
-
-       * gmp-impl.h: Declare _mpz_impl_sqrt.
-
-       * mpz_dm_ui (mpz_divmod_ui), sdiv: Shift back the remainder if
-         UDIV_NEEDS_NORMALIZATION.  (Fix from Brian Beuning.)
-
-       * mpz_dm_ui.c, sdiv: Replace *digit with *limb.
-
-       * mpz_ior: Add missing else statement in -OP1 | -OP2 case.
-       * mpz_ior: Add missing else statement in OP1 | -OP2 case.
-       * mpz_ior: Swap also OP1 and OP2 pointers in -OP1 & OP2 case.
-       * mpz_ior: Duplicate _mpz_realloc code.
-
-       * mpz_and: Add missing else statement in -OP1 & -OP2 case.
-       * mpz_and: Rewrite OP1 & -OP2 case.
-       * mpz_and: Swap also OP1 and OP2 pointers in -OP1 & OP2 case.
-
-       * mpz_gcdext: Loop in d1.size (not b->size).  (Fix from Brian
-         Beuning.)
-
-       * mpz_perfsqr: Fix argument order in _mpz_impl_sqrt call.  (Fix from
-         Brian Beuning.)
-
-Fri Jul 12 17:10:33 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpq_set.c, mpq_set_ui.c, mpq_set_si.c, mpq_inv.c,
-         mpq_get_num.c, mpq_get_den.c, mpq_set_num.c, mpq_set_den.c:
-         New files.
-
-       * mpz_dmincl.c: Remove second re-allocation of rem->d.  It
-         was never executed.
-
-       * dist-Makefile: Use `-r' instead of `-x' for test for ranlib (as
-         some unixes' test doesn't have the -r option).
-
-       * *.*: Cast allocated pointers to the appropriate type (makes old C
-         compilers happier).
-
-       * cre-conv-tab.c (main): Divide max_uli by 2 and multiply again
-         after conversion to double.  (Kludge for broken C compilers.)
-
-       * dist-Makefile (stamp-stddefh): New target.  Test if "stddef.h"
-         exists in the system and creates a minimal one if it does not
-         exist.
-       * cre-stddefh.c: New file.
-       * dist-Makefile: Make libgmp.a and libmp.a depend on stamp-stddefh.
-       * dist-Makefile (clean): Add some more.
-       * gmp.h, mp.h: Unconditionally include "stddef.h".
-
-Thu Jul 11 10:08:21 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * min: Do ungetc of last read character.
-       * min.c: include stdio.h.
-
-       * dist-Makefile: Go via tmp- files for cre* redirection.
-       * dist-Makefile: Add tmp* to "clean" target.
-
-       * dist-Makefile: Use LOCAL_CC for cre*, to simplyfy cross
-         compilation.
-
-       * gmp.h, mp.h: Don't define NULL here.
-       * gmp-impl.h: Define it here.
-
-Wed Jul 10 14:13:33 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpz_mod_2exp: Don't copy too much, overwriting most significant
-         limb.
-
-       * mpz_and, mpz_ior: Don't read op[12]_ptr from op[12] when
-         reallocating res, if op[12]_ptr got their value from alloca.
-
-       * mpz_and, mpz_ior: Clear up comments.
-
-       * cre-mparam.c: Output parameters for `short int' and `int'.
-
-       * mpz_and, mpz_ior: Negate negative op[12]_size in several places.
-
-Tue Jul  9 18:40:30 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * gmp.h, mp.h: Test for _SIZE_T defined before typedef'ing size_t.
-         (Fix for Sun lossage.)
-
-       * gmp.h: Add declaration of mpq_clear.
-
-       * dist-Makefile: Chack if "ranlib" exists, before using it.
-       * dist-Makefile: Add mpz_sqrtrem.c and mpz_size.c.
-       * mpz_powm: Fix typo, "pow" instead of "mpz_powm".
-
-Fri Jul  5 19:08:09 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * move: Remove incorrect comment.
-
-       * mpz_free, mpq_free: Rename to *_clear.
-       * dist-Makefile: Likewise.
-       * mpq_add, mpq_sub, mpq_mul, mpq_div: Likewise.
-
-       * mpz_dmincl.c: Don't call "move", inline its functionality.
-
-Thu Jul  4 00:06:39 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * Makefile: Include dist-Makefile.  Fix dist target to include
-         dist-Makefile (with the name "Makefile" in the archive).
-
-       * dist-Makefile: New file made from Makefile.  Add new mpz_...
-         functions.
-
-       * mpz_powincl.c New file for mpz_powm (Berkeley MP pow)
-         functionality.  Avoids code duplication.
-       * pow.c, mpz_powm.c: Include mpz_powincl.c
-
-       * mpz_dmincl.c: New file containing general division code.  Avoids
-         code duplication.
-       * mpz_dm.c (mpz_divmod), mpz_mod.c (mpz_mod), mdiv.c (mdiv): Include
-         mpz_dmincl.c.
-
-       * _mpz_get_str: Don't call memmove, unless HAS_MEMMOVE is defined.
-         Instead, write the overlapping memory copying inline.
-
-       * mpz_dm_ui.c: New name for mpz_divmod_ui.c (SysV file name limit).
-
-       * longlong.h: Don't use #elif.
-       * mpz_do_sqrt.c: Likewise.
-
-       * longlong.h: Use __asm__ instead of asm.
-       * longlong.h (sparc udiv_qrnnd): Make it to one string over several
-         lines.
-
-       * longlong.h: Preend __ll_ to B, highpart, and lowpart.
-
-       * longlong.h: Move array t in count_leading_zeros to the new file
-         mp_clz_tab.c.  Rename the array __clz_tab.
-       * All files: #ifdef for traditional C compatibility.
-
-Wed Jul  3 11:42:14 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpz_and: Initialize res_ptr always (used to be initialized only
-         when reallocating).
-
-       * longlong.h (umul_ppmm [C variant]): Make __ul...__vh
-         `unsigned int', and cast the multiplications.  This way
-         compilers more easily can choose cheaper multiplication
-         instructions.
-
-       * mpz_mod_2exp: Handle input argument < modulo argument.
-       * mpz_many: Make sure mp_size is the type for sizes, not int.
-
-       * mpz_init, mpz_init_set*, mpq_init, mpq_add, mpq_sub, mpq_mul,
-         mpq_div: Change mpz_init* interface.  Structure pointer as first
-         arg to initialization function, no longer *return* struct.
-
-Sun Jun 30 19:21:44 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * Rename mpz_impl_sqrt.c to mpz_do_sqrt.c to satisfy SysV 14
-         character file name length limit.
-
-       * Most files: Rename MINT to MP_INT.  Rename MRAT to MP_RAT.
-       * mpz_sizeinb.c: New file with function mpz_sizeinbase.
-       * mp_bases.c: New file, with array __mp_bases.
-       * _mpz_get_str, _mpz_set_str: Remove struct bases, use extern
-         __mp_bases instead.
-       * mout, mpz_out_str: Use array __mp_bases instead of function
-         _mpz_get_cvtlen.
-       * mpz_get_cvtlen.c: Remove.
-       * Makefile: Update.
-
-Sat Jun 29 21:57:28 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * longlong.h (__sparc8__ umul_ppmm): Insert 3 nop:s for wr delay.
-       * longlong.h (___IBMR2__): Define umul_ppmm, add_ssaaaa, sub_ddmmss.
-       * longlong.h (__sparc__): Don't call .umul; expand asm instead.
-         Don't define __umulsidi3 (i.e. use default definition).
-
-Mon Jun 24 17:37:23 1991  Torbjorn Granlund  (tege@amon.sics.se)
-
-       * _mpz_get_str.c (num_to_ascii_lower_case, num_to_ascii_upper_case):
-         Swap 't' and 's'.
-
-Sat Jun 22 13:54:01 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpz_gcdext.c: New file.
-
-       * mpn_mul: Handle carry and unexpected operand sizes in last
-         additions/subtractions.  (Bug trigged when v1_size == 1.)
-
-       * mp*_alloc*: Rename functions to mp*_init* (files to mp*_iset*.c).
-       * mpq_*: Call mpz_init*.
-
-       * mpz_pow_ui, rpow: Use _mpn_mul instead of mult.  Restructure.
-
-Wed May 29 20:32:33 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpz_get_cvtlen: multiply by size.
-
-Sun May 26 15:01:15 1991  Torbjorn Granlund  (tege@bella.nada.kth.se)
-
-       Alpha-release 0.95.
-
-       Fixes from Doug Lea (dl@g.oswego.edu):
-       * mpz_mul_ui: Loop to MULT_SIZE (not PROD_SIZE).  Adjust PROD_SIZE
-         correctly.
-       * mpz_div: Prepend _ to mpz_realloc.
-       * mpz_set_xs, mpz_set_ds: Fix typos in function name.
-
-Sat May 25 22:51:16 1991  Torbjorn Granlund  (tege@bella.nada.kth.se)
-
-       * mpz_divmod_ui: New function.
-
-       * sdiv: Make the sign of the remainder correct.
-
-Thu May 23 15:28:24 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * Alpha-release 0.94.
-
-       * mpz_mul_ui: Include longlong.h.
-
-       * mpz_perfsqr.c (mpz_perfect_square_p): Call _mpz_impl_sqrt instead
-         of msqrt.
-
-       * mpz_impl_sqrt: Don't call "move", inline its functionality.
-
-       * mdiv: Use MPN_COPY instead of memcpy.
-       * rpow, mpz_mul, mpz_mod_2exp: Likewise.
-       * pow.c: Likewise, and fix bug in the size arg.
-
-       * xtom: Don't use mpz_alloc, inline needed code instead.  Call
-         _mpz_set_str instead of mpz_set_str.
-
-       * Makefile: Make two libraries, libmp.a and libgmp.a.
-
-Thu May 22 20:25:29 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * Add manual to distribution.
-       * Fold in many missing routines descibed in the manual.
-       * Update Makefile.
-
-Wed May 22 13:48:46 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpz_set_str: Make it handle 0x prefix OK.
-
-Sat May 18 18:31:02 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * memory.c (_mp_default_reallocate): Swap OLD_SIZE and NEW_SIZE
-         arguments.
-       * mpz_realloc (_mpz_realloc): Swap in call to _mp_reallocate_func.
-       * min: Likewise.
-
-Thu May 16 20:43:05 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * memory.c: Make the default allocations functions global.
-       * mp_set_fns (mp_set_memory_functions): Make a NULL pointer mean the
-         default memory function.
-
-Wed May  8 20:02:42 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpz_div: Handle DEN the same as QUOT correctly by copying DEN->D
-         even if no normalization is needed.
-       * mpz_div: Rework reallocation scheme, to avoid excess copying.
-
-       * mpz_sub_ui.c, mpz_add_ui.c: New files.
-
-       * mpz_cmp.c, mpz_cmp_ui.c: New files.
-
-       * mpz_mul_2exp: Handle zero input MINT correctly.
-
-       * mpn_rshiftci:  Don't handle shift counts > BITS_PER_MP_DIGIT.
-
-       * mpz_out_raw.c, mpz_inp_raw.c: New files for raw I/O.
-
-Tue May  7 15:44:58 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpn_rshift: Don't handle shift counts > BITS_PER_MP_DIGIT.
-       * mpz_div_2exp: Don't call _mpn_rshift with cnt > BITS_PER_MP_DIGIT.
-       * gcd, mpz_gcd: Likewise.
-
-       * gcd, mpz_gcd: Handle common 2 factors correctly.
-
-Mon May  6 20:22:59 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * gmp-impl.h (MPN_COPY): Inline a loop instead of calling memcpy.
-
-       * gmp-impl.h, mpz_get_str, rpow: Swap DST and SRC in TMPCOPY* macros.
-
-Sun May  5 15:16:23 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpz_div: Remove test for QUOT == 0.
-
-Sun Apr 28 20:21:04 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * pow: Don't make MOD normalization in place, as it's a bad idea to
-         write on an input parameter.
-       * pow: Reduce BASE if it's > MOD.
-       * pow, mult, mpz_mul: Simplify realloc code.
-
-Sat Apr 27 21:03:11 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * Install multplication using Karatsuba's algorithm as default.
-
-Fri Apr 26 01:03:57 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * msqrt: Store in ROOT even for U==0, to make msqrt(0) defined.
-
-       * mpz_div_2exp.c, mpz_mul_2exp.c: New files for shifting right and
-         left, respectively.
-       * gmp.h: Add definitions for mpz_div_2exp and mpz_mul_2exp.
-
-       * mlshift.c, mrshift.c: Remove.
-
-Wed Apr 24 21:39:22 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * mpn_mul: Check only for m2_size == 0 in function header.
-
-Mon Apr 22 01:31:57 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * karatsuba.c: New file for Karatsuba's multplication algorithm.
-
-       * mpz_random, mpz_init, mpz_mod_2exp: New files and functions.
-
-       * mpn_cmp: Fix header comment.
-
-Sun Apr 21 00:10:44 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * pow: Switch off initial base reduction.
-
-Sat Apr 20 22:06:05 1991  Torbjorn Granlund  (tege@echnaton.sics.se)
-
-       * mpz_get_str: Don't generate initial zeros for initial word.
-         Used to write outside of allocated storage.
-
-Mon Apr 15 15:48:08 1991  Torbjorn Granlund  (tege@zevs.sics.se)
-
-       * _mpz_realloc: Make it accept size in number of mp_digits.
-       * Most functions: Use new _mpz_realloc definition.
-
-       * mpz_set_str: Remove calls _mp_free_func.
-
-       * Most functions: Rename mpn_* to _mpn_*.  Rename mpz_realloc to
-         _mpz_realloc.
-       * mpn_lshift: Redefine _mpn_lshift to only handle small shifts.
-       * mdiv, mpz_div, ...: Changes for new definition of _mpn_lshift.
-       * msqrt, mp*_*shift*: Define cnt as unsigned (for speed).
-
-Sat Apr  6 14:05:16 1991  Torbjorn Granlund  (tege@musta.nada.kth.se)
-
-       * mpn_mul: Multiply by the first digit in M2 in a special
-         loop instead of zeroing the product area.
-
-       * mpz_abs.c: New file.
-
-       * sdiv: Implement as mpz_div_si for speed.
-
-       * mpn_add: Make it work for second source operand == 0.
-
-       * msub: Negate the correct operand, i.e. V before swapping, not
-         the smaller of U and V!
-       * madd, msub: Update abs_* when swapping operands, and not after
-         (optimization).
-
-Fri Apr  5 00:19:36 1991  Torbjorn Granlund  (tege@black.nada.kth.se)
-
-       * mpn_sub: Make it work for subtrahend == 0.
-
-       * madd, msub: Rewrite to minimize mpn_cmp calls.  Ensure
-         mpn_cmp is called with positive sizes (used to be called
-         incorrectly with negative sizes sometimes).
-
-       * msqrt: Make it divide by zero if fed with a negative number.
-       * Remove if statement at end of precision calculation that was
-         never true.
-
-       * itom, mp.h: The argument is of type short, not int.
-
-       * mpz_realloc, gmp.h: Make mpz_realloc return the new digit pointer.
-
-       * mpz_get_str.c, mpz_set_str.c, mpz_new_str.c: Don't include mp.h.
-
-       * Add COPYING to distribution.
-
-       * mpz_div_ui.c, mpz_div_si.c, mpz_new_ui.c, mpz_new_si.c: New files.
-
-Fri Mar 15 00:26:29 1991  Torbjorn Granlund  (tege@musta.nada.kth.se)
-
-       * Add Copyleft headers to all files.
-
-       * mpn_mul.c, mpn_div.c: Add header comments.
-       * mult.c, mdiv.c: Update header comments.
-
-       * mpq_add.c, mpq_sub.c, mpq_div.c, mpq_new.c, mpq_new_ui.c,
-         mpq_free.c: New files for rational arithmetics.
-
-       * mpn_lshift.c: Avoid writing the most significant word if it is 0.
-
-       * mdiv.c: Call mpn_lshift for the normalization.
-       * mdiv.c: Remove #ifdefs.
-
-       * Makefile: Add ChangeLog to DISTFILES.
-
-       * mpn_div.c: Make the add_back code work (by removing abort()).
-       * mpn_div.c: Make it return if the quotient is size as compared
-         with the difference NSIZE - DSIZE.  If the stored quotient is
-         larger than that, return 1, otherwise 0.
-       * gmp.h: Fix mpn_div declaration.
-       * mdiv.c: Adopt call to mpn_div.
-       * mpz_div.c: New file (developed from mdiv.c).
-
-       * README: Update routine names.
-
-Thu Mar 14 18:45:28 1991  Torbjorn Granlund  (tege@musta.nada.kth.se)
-
-       * mpq_mul.c: New file for rational multplication.
-
-       * gmp.h: Add definitions for rational arithmetics.
-
-       * mpn_div: Kludge the case where the high numerator digit > the
-         high denominator digit.  (This code is going to be optimized later.)
-
-       * New files: gmp.h for GNU specific functions, gmp-common.h for
-         definitions common for mp.h and gmp.h.
-
-       * Ensure mp.h just defines what BSD mp.h defines.
-
-       * pow.c: Fix typo for bp allocation.
-
-       * Rename natural number functions to mpn_*, integer functions to
-         mpz_*.
-
-Tue Mar  5 18:47:04 1991  Torbjorn Granlund  (tege@musta.nada.kth.se)
-
-       * mdiv.c (_mp_divide, case 2): Change test for estimate of Q from
-         "n0 >= r" to "n0 > r".
-
-       * msqrt: Tune the increasing precision scheme, to do fewer steps.
-
-Tue Mar  3 18:50:10 1991  Torbjorn Granlund  (tege@musta.nada.kth.se)
-
-       * msqrt: Use the low level routines.  Use low precision in the
-       beginning, and increase the precision as the result converges.
-       (This optimization gave a 6-fold speedup.)
-\f
-Local Variables:
-mode: indented-text
-left-margin: 8
-fill-column: 75
-version-control: never
-End:
index 77173bf..9573237 100644 (file)
-# Top Makefile for GNU MP
-# Copyright (C) 1991, 1993, 1994, 1996 Free Software Foundation, Inc.
-
+# Makefile.in generated automatically by automake 1.4a from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = .
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_FLAG =
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+
+@SET_MAKE@
+build_alias = @build_alias@
+build_triplet = @build@
+host_alias = @host_alias@
+host_triplet = @host@
+target_alias = @target_alias@
+target_triplet = @target@
+AMDEP = @AMDEP@
+AMTAR = @AMTAR@
+AR = @AR@
+AS = @AS@
+AWK = @AWK@
+CALLING_CONVENTIONS_OBJS = @CALLING_CONVENTIONS_OBJS@
+CC = @CC@
+CCAS = @CCAS@
+CPP = @CPP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+EXEEXT = @EXEEXT@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+M4 = @M4@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+SPEED_CYCLECOUNTER_OBJS = @SPEED_CYCLECOUNTER_OBJS@
+STRIP = @STRIP@
+U = @U@
+VERSION = @VERSION@
+gmp_srclinks = @gmp_srclinks@
+install_sh = @install_sh@
+mpn_objects = @mpn_objects@
+mpn_objs_in_libgmp = @mpn_objs_in_libgmp@
+
+# Copyright (C) 1991, 1993, 1994, 1996, 1997, 1999, 2000 Free Software
+# Foundation, Inc.
+#
 # This file is part of the GNU MP Library.
-
+#
 # The GNU MP Library is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Library General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or (at your
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at your
 # option) any later version.
-
+#
 # The GNU MP 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 Library General Public
+# 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 Library General Public License
+#
+# You should have received a copy of the GNU Lesser General Public License
 # along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 # MA 02111-1307, USA.
 
-srcdir = .
+# make check
+#
+#     It'd be good if "make check" first did a "make all" or whatever to
+#     build libgmp.la, but it's not clear how best to do this.  Putting a
+#     "check:" target is overridden by automake, and a "check-local:" runs
+#     too late (due to depth-first subdirectory processing).  For now it's
+#     necessary to do "make && make check".
+#
+# MPF_OBJECTS etc
+#
+#     Libtool needs all the .lo files passed to it if it's going to build
+#     both a static and shared library.  If a convenience library like
+#     mpf/libmpf.la is passed then the resulting libgmp.a gets the PIC .lo
+#     objects rather than the non-PIC .o's.
+#
+#     Unfortunately this leads to the big lists of objects below.  Something
+#     like mpz/*.lo would probably work, but might risk missing something
+#     out or getting something extra.  The source files for each .lo are
+#     listed in the Makefile.am's in the subdirectories.
+
+# Libtool -version-info for libgmp.la and libmp.la.  See (libtool)Versioning
+#
+# 1. No interfaces changed, only implementations (good): Increment REVISION.
+#
+# 2. Interfaces added, none removed (good): Increment CURRENT, increment
+#    AGE, set REVISION to 0.
+#
+# 3. Interfaces removed (BAD, breaks upward compatibility): Increment
+#    CURRENT, set AGE and REVISION to 0.
+#
+# Do this separately for libgmp and libmp, only do it just before a release.
+#
+#        GMP      -version-info
+#      release   libgmp  libmp
+#       2.0.x      -       -
+#       3.0      3:0:0   3:0:0
+#        3.0.1    3:1:0   3:0:0
+#        3.1      4:0:1   4:0:1
+#
+#
+# Starting at 3:0:0 is a slight abuse of the versioning system, but it
+# ensures we're past soname libgmp.so.2, which is what has been used on
+# Debian GNU/Linux packages of gmp 2.  Pretend gmp 2 was 2:0:0, so the
+# interface changes for gmp 3 mean 3:0:0 is right.
+
+
+LIBGMP_LT_CURRENT = 4
+LIBGMP_LT_REVISION = 0
+LIBGMP_LT_AGE = 1
+
+LIBMP_LT_CURRENT = 4
+LIBMP_LT_REVISION = 0
+LIBMP_LT_AGE = 1
+
+AUTOMAKE_OPTIONS = gnu check-news no-dependencies ansi2knr
+
+SUBDIRS = mpn mpz mpq mpf mpbsd mpfr tests demos tune
+
+include_HEADERS = gmp.h $(MPBSD_HEADERS_OPTION) $(MPFR_HEADERS_OPTION)
+EXTRA_HEADERS = mp.h
+
+lib_LTLIBRARIES = libgmp.la $(MPBSD_LTLIBRARIES_OPTION)
+
+EXTRA_DIST = .gdbinit gmp-impl.h longlong.h stack-alloc.h urandom.h doc macos
+
+DISTCLEANFILES = asm-syntax.h config.m4 @gmp_srclinks@
+
+MPF_OBJECTS = mpf/init.lo mpf/init2.lo mpf/set.lo mpf/set_ui.lo mpf/set_si.lo \
+  mpf/set_str.lo mpf/set_d.lo mpf/set_z.lo mpf/iset.lo mpf/iset_ui.lo \
+  mpf/iset_si.lo mpf/iset_str.lo mpf/iset_d.lo mpf/clear.lo mpf/get_str.lo \
+  mpf/dump.lo mpf/size.lo mpf/eq.lo mpf/reldiff.lo mpf/sqrt.lo mpf/random2.lo \
+  mpf/inp_str.lo mpf/out_str.lo mpf/add.lo mpf/add_ui.lo mpf/sub.lo \
+  mpf/sub_ui.lo mpf/ui_sub.lo mpf/mul.lo mpf/mul_ui.lo mpf/div.lo \
+  mpf/div_ui.lo mpf/cmp.lo mpf/cmp_ui.lo mpf/cmp_si.lo mpf/mul_2exp.lo \
+  mpf/div_2exp.lo mpf/abs.lo mpf/neg.lo mpf/set_q.lo mpf/get_d.lo \
+  mpf/set_dfl_prec.lo mpf/set_prc.lo mpf/set_prc_raw.lo mpf/get_prc.lo \
+  mpf/ui_div.lo mpf/sqrt_ui.lo mpf/floor.lo mpf/ceil.lo mpf/trunc.lo \
+  mpf/pow_ui.lo mpf/urandomb.lo mpf/swap.lo
+
+MPZ_OBJECTS = mpz/abs.lo mpz/add.lo mpz/add_ui.lo mpz/addmul_ui.lo mpz/and.lo \
+  mpz/array_init.lo mpz/bin_ui.lo mpz/bin_uiui.lo mpz/cdiv_q.lo \
+  mpz/cdiv_q_ui.lo mpz/cdiv_qr.lo mpz/cdiv_qr_ui.lo mpz/cdiv_r.lo \
+  mpz/cdiv_r_ui.lo mpz/cdiv_ui.lo mpz/clear.lo mpz/clrbit.lo mpz/cmp.lo \
+  mpz/cmp_si.lo mpz/cmp_ui.lo mpz/cmpabs.lo mpz/cmpabs_ui.lo mpz/com.lo \
+  mpz/divexact.lo mpz/dump.lo mpz/fac_ui.lo mpz/fdiv_q.lo mpz/fdiv_q_2exp.lo \
+  mpz/fdiv_q_ui.lo mpz/fdiv_qr.lo mpz/fdiv_qr_ui.lo mpz/fdiv_r.lo \
+  mpz/fdiv_r_2exp.lo mpz/fdiv_r_ui.lo mpz/fdiv_ui.lo mpz/fib_ui.lo \
+  mpz/fits_sint_p.lo mpz/fits_slong_p.lo mpz/fits_sshort_p.lo \
+  mpz/fits_uint_p.lo mpz/fits_ulong_p.lo mpz/fits_ushort_p.lo mpz/gcd.lo \
+  mpz/gcd_ui.lo mpz/gcdext.lo mpz/get_d.lo mpz/get_si.lo mpz/get_str.lo \
+  mpz/get_ui.lo mpz/getlimbn.lo mpz/hamdist.lo mpz/init.lo mpz/inp_raw.lo \
+  mpz/inp_str.lo mpz/invert.lo mpz/ior.lo mpz/iset.lo mpz/iset_d.lo \
+  mpz/iset_si.lo mpz/iset_str.lo mpz/iset_ui.lo mpz/jacobi.lo \
+  mpz/kronsz.lo mpz/kronuz.lo mpz/kronzs.lo mpz/kronzu.lo \
+  mpz/lcm.lo mpz/legendre.lo \
+  mpz/mod.lo mpz/mul.lo mpz/mul_2exp.lo mpz/mul_si.lo mpz/mul_ui.lo \
+  mpz/neg.lo mpz/nextprime.lo mpz/out_raw.lo mpz/out_str.lo mpz/perfpow.lo mpz/perfsqr.lo \
+  mpz/popcount.lo mpz/pow_ui.lo mpz/powm.lo mpz/powm_ui.lo mpz/pprime_p.lo \
+  mpz/random.lo mpz/random2.lo mpz/realloc.lo mpz/remove.lo mpz/root.lo \
+  mpz/rrandomb.lo \
+  mpz/scan0.lo mpz/scan1.lo mpz/set.lo mpz/set_d.lo mpz/set_f.lo mpz/set_q.lo \
+  mpz/set_si.lo mpz/set_str.lo mpz/set_ui.lo mpz/setbit.lo mpz/size.lo \
+  mpz/sizeinbase.lo mpz/sqrt.lo mpz/sqrtrem.lo mpz/sub.lo mpz/sub_ui.lo \
+  mpz/swap.lo mpz/tdiv_ui.lo mpz/tdiv_q.lo mpz/tdiv_q_2exp.lo mpz/tdiv_q_ui.lo \
+  mpz/tdiv_qr.lo mpz/tdiv_qr_ui.lo mpz/tdiv_r.lo mpz/tdiv_r_2exp.lo \
+  mpz/tdiv_r_ui.lo mpz/tstbit.lo mpz/ui_pow_ui.lo mpz/urandomb.lo \
+  mpz/urandomm.lo mpz/xor.lo
+
+MPQ_OBJECTS = mpq/add.lo mpq/canonicalize.lo mpq/clear.lo mpq/cmp.lo \
+  mpq/cmp_ui.lo mpq/div.lo mpq/get_d.lo mpq/get_den.lo mpq/get_num.lo \
+  mpq/init.lo mpq/inv.lo mpq/mul.lo mpq/neg.lo mpq/out_str.lo \
+  mpq/set.lo mpq/set_den.lo \
+  mpq/set_num.lo mpq/set_si.lo mpq/set_ui.lo mpq/sub.lo mpq/equal.lo \
+  mpq/set_z.lo mpq/set_d.lo mpq/swap.lo
+
+MPN_OBJECTS = @mpn_objs_in_libgmp@
+
+MPBSD_OBJECTS = mpbsd/add.lo mpbsd/tdiv_qr.lo mpbsd/move.lo mpbsd/powm.lo \
+  mpbsd/sub.lo mpbsd/cmp.lo mpbsd/mfree.lo mpbsd/mtox.lo mpbsd/realloc.lo \
+  mpbsd/gcd.lo mpbsd/itom.lo mpbsd/min.lo mpbsd/mul.lo mpbsd/mout.lo     \
+  mpbsd/pow_ui.lo mpbsd/sdiv.lo mpbsd/sqrtrem.lo mpbsd/xtom.lo 
+
+
+# FIXME: Add mpfr/rnd_mode.lo when it's clean.
+MPFR_OBJECTS = mpfr/add.lo mpfr/div_2exp.lo mpfr/neg.lo mpfr/set_dfl_prec.lo \
+  mpfr/set_str_raw.lo mpfr/agm.lo mpfr/get_str.lo mpfr/print_raw.lo \
+  mpfr/set_dfl_rnd.lo mpfr/sqrt.lo mpfr/clear.lo mpfr/init.lo \
+  mpfr/set_f.lo mpfr/sub.lo mpfr/cmp.lo mpfr/mul.lo mpfr/round.lo \
+  mpfr/set_prec.lo mpfr/cmp_ui.lo mpfr/mul_2exp.lo mpfr/set.lo mpfr/set_si.lo \
+  mpfr/div.lo mpfr/mul_ui.lo mpfr/set_d.lo mpfr/pow.lo mpfr/out_str.lo \
+  mpfr/pi.lo mpfr/set_z.lo mpfr/add_ulp.lo mpfr/log2.lo mpfr/random.lo \
+  mpfr/log.lo mpfr/exp.lo mpfr/div_ui.lo mpfr/zeta.lo mpfr/karadiv.lo \
+  mpfr/karasqrt.lo mpfr/print_rnd_mode.lo
+
+
+@WANT_MPFR_TRUE@MPFR_HEADERS_OPTION = @WANT_MPFR_TRUE@mpfr/mpfr.h
+@WANT_MPFR_TRUE@MPFR_OBJECTS_OPTION = @WANT_MPFR_TRUE@$(MPFR_OBJECTS)
+@WANT_MPFR_TRUE@MPFR_LIBADD_OPTION = @WANT_MPFR_TRUE@-lm
+libgmp_la_SOURCES = assert.c compat.c errno.c memory.c mp_set_fns.c     \
+  mp_clz_tab.c mp_minv_tab.c                                            \
+  rand.c randclr.c randlc.c randlc2x.c randraw.c randsd.c               \
+  randsdui.c version.c stack-alloc.c mp_bpl.c extract-dbl.c insert-dbl.c
+
+libgmp_la_DEPENDENCIES = \
+  $(MPF_OBJECTS) $(MPZ_OBJECTS) $(MPN_OBJECTS) $(MPQ_OBJECTS) \
+  $(MPFR_OBJECTS_OPTION)
+
+libgmp_la_LIBADD = $(libgmp_la_DEPENDENCIES) $(MPFR_LIBADD_OPTION)
+libgmp_la_LDFLAGS = \
+  -version-info $(LIBGMP_LT_CURRENT):$(LIBGMP_LT_REVISION):$(LIBGMP_LT_AGE)
+
+
+@WANT_MPBSD_TRUE@MPBSD_HEADERS_OPTION = @WANT_MPBSD_TRUE@mp.h
+@WANT_MPBSD_TRUE@MPBSD_LTLIBRARIES_OPTION = @WANT_MPBSD_TRUE@libmp.la
+libmp_la_SOURCES = assert.c errno.c memory.c mp_bpl.c mp_clz_tab.c     \
+  mp_minv_tab.c mp_set_fns.c stack-alloc.c
+
+libmp_la_DEPENDENCIES = $(MPBSD_OBJECTS) $(MPN_OBJECTS)                        \
+  mpz/add.lo mpz/clear.lo mpz/cmp.lo mpz/init.lo mpz/mod.lo mpz/mul.lo \
+  mpz/mul_2exp.lo mpz/realloc.lo mpz/set.lo mpz/set_ui.lo mpz/tdiv_r.lo        \
+  mpz/sub.lo
+
+libmp_la_LIBADD = $(libmp_la_DEPENDENCIES)
+libmp_la_LDFLAGS = \
+  -version-info $(LIBMP_LT_CURRENT):$(LIBMP_LT_REVISION):$(LIBMP_LT_AGE)
+
+
+info_TEXINFOS = gmp.texi
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES = 
+LTLIBRARIES =  $(lib_LTLIBRARIES)
+
+
+DEFS = @DEFS@ -I. -I$(srcdir) -I.
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+ANSI2KNR = @ANSI2KNR@
+am_libgmp_la_OBJECTS =  assert$U.lo compat$U.lo errno$U.lo memory$U.lo \
+mp_set_fns$U.lo mp_clz_tab$U.lo mp_minv_tab$U.lo rand$U.lo randclr$U.lo \
+randlc$U.lo randlc2x$U.lo randraw$U.lo randsd$U.lo randsdui$U.lo \
+version$U.lo stack-alloc$U.lo mp_bpl$U.lo extract-dbl$U.lo \
+insert-dbl$U.lo
+libgmp_la_OBJECTS =  $(am_libgmp_la_OBJECTS)
+am_libmp_la_OBJECTS =  assert$U.lo errno$U.lo memory$U.lo mp_bpl$U.lo \
+mp_clz_tab$U.lo mp_minv_tab$U.lo mp_set_fns$U.lo stack-alloc$U.lo
+libmp_la_OBJECTS =  $(am_libmp_la_OBJECTS)
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CFLAGS = @CFLAGS@
+CCLD = $(CC)
+LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+DIST_SOURCES =  $(libgmp_la_SOURCES) $(libmp_la_SOURCES)
+TEXI2DVI = texi2dvi
+INFO_DEPS = gmp.info
+DVIS = gmp.dvi
+TEXINFOS = gmp.texi
+HEADERS =  $(include_HEADERS)
+
+DIST_COMMON =  README $(EXTRA_HEADERS) $(include_HEADERS) ./stamp-h.in \
+AUTHORS COPYING COPYING.LIB ChangeLog INSTALL Makefile.am Makefile.in \
+NEWS acconfig.h acinclude.m4 aclocal.m4 ansi2knr.1 ansi2knr.c \
+config.guess config.in config.sub configure configure.in depcomp \
+install-sh ltconfig ltmain.sh mdate-sh missing mkinstalldirs stamp-vti \
+texinfo.tex version.texi
+
+
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+GZIP_ENV = --best
+depcomp = 
+SOURCES = $(libgmp_la_SOURCES) $(libmp_la_SOURCES)
+OBJECTS = $(am_libgmp_la_OBJECTS) $(am_libmp_la_OBJECTS)
+
+all: all-redirect
+.SUFFIXES:
+.SUFFIXES: .c .dvi .info .lo .o .obj .ps .texi .texinfo .txi
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
+       cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile
 
-prefix = /usr/local
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
+       cd $(top_builddir) \
+         && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
-exec_prefix = $(prefix)
-libdir = $(exec_prefix)/lib
-infodir = $(prefix)/info
-includedir = $(prefix)/include
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in  acinclude.m4
+       cd $(srcdir) && $(ACLOCAL)
 
-CC = gcc
-LOCAL_CC = $(CC)
-CFLAGS = @CFLAGS@
-XCFLAGS = 
-AR = ar
-AR_FLAGS = rc
-RANLIB_TEST = [ -f /usr/bin/ranlib -o -f /bin/ranlib ]
-RANLIB = ranlib
-SHELL = /bin/sh
-INSTALL = $(srcdir)/install.sh -c
-INSTALL_PROGRAM = $(INSTALL)
-INSTALL_DATA = $(INSTALL)
-MAKEINFO = makeinfo
-MAKEINFOFLAGS =
-TEXI2DVI = texi2dvi
-LN = ln -s
-
-#### host and target specific makefile fragments come in here.
-###
-
-SRCS = memory.c mp_set_fns.c mp_clz_tab.c version.c stack-alloc.c mp_bpl.c \
-  extract-double.c insert-double.c
-OBJS = memory.o mp_set_fns.o mp_clz_tab.o version.o stack-alloc.o mp_bpl.o \
-  extract-double.o insert-double.o
-FILES = gmp.h mp.h gmp-impl.h longlong.h urandom.h move-if-change \
- mkinstalldirs INSTALL COPYING.LIB ChangeLog Makefile.in \
- NEWS README SPEED TODO config.guess config.sub configure configure.in \
- gmp.info* gmp.texi texinfo.tex $(SRCS)
-
-INCLUDES = -I. -Impn -I$(srcdir)
-FLAGS_TO_PASS = "CC=$(CC)" "CFLAGS=$(CFLAGS)" "XCFLAGS=$(XCFLAGS)"
-
-all: libgmp.a
-
-ifeq "(EnableWin32DLLs)" "YES"
-all: gmp.dll
-endif
-
-%.o : %.c
-       $(CC) -c $(INCLUDES) $(CFLAGS) $(XCFLAGS) $<
-
-libgmp.a: mpn/libmpn.a mpz/libmpz.a $(OBJS)
-       rm -rf tmpdir
-       mkdir tmpdir
-       for i in mpn mpz; \
-         do \
-           mkdir tmpdir/$$i; \
-           ( cd tmpdir/$$i; $(AR) x ../../$$i/lib$$i.a ); \
-         done
-       cp $(OBJS) tmpdir
-       cd tmpdir; $(AR) $(AR_FLAGS) $@ *.o */*.o
-       if $(RANLIB_TEST) ; then $(RANLIB) tmpdir/$@; else true; fi
-       mv tmpdir/$@ .
-       rm -rf tmpdir
-
-gmp.dll: libgmp.a
-       dllwrap -mno-cygwin --target=i386-unknown-mingw32 \
-               --export-all --dllname gmp.dll --output-lib=libgmp_imp.a \
-               -o gmp.dll libgmp.a
-
-libmp.a: mpn/libmpn.a mpbsd/libmpbsd.a $(OBJS)
-       rm -rf tmpdir
-       mkdir tmpdir
-       for i in mpn mpbsd; \
-         do \
-           mkdir tmpdir/$$i; \
-           ( cd tmpdir/$$i; $(AR) x ../../$$i/lib$$i.a ); \
-         done
-       cp $(OBJS) tmpdir
-       cd tmpdir; $(AR) $(AR_FLAGS) $@ *.o */*.o
-       if $(RANLIB_TEST) ; then $(RANLIB) tmpdir/$@; else true; fi
-       mv tmpdir/$@ .
-       rm -rf tmpdir
-
-mpn/libmpn.a: force
-       cd mpn; $(MAKE) $(FLAGS_TO_PASS) libmpn.a
-mpz/libmpz.a: force
-       cd mpz; $(MAKE) $(FLAGS_TO_PASS) libmpz.a
-
-check: libgmp.a
-       cd mpz/tests; $(MAKE) $(FLAGS_TO_PASS) check
-
-doc: gmp.dvi gmp.info
-
-info: $(srcdir)/gmp.info
-$(srcdir)/gmp.info: $(srcdir)/gmp.texi
-       cd $(srcdir); $(MAKEINFO) gmp.texi
-
-dvi: gmp.dvi
-gmp.dvi: $(srcdir)/gmp.texi
-       rm -f tmp.texi
-       $(LN) $(srcdir)/gmp.texi tmp.texi
-       TEXINPUTS=.:$(srcdir) $(TEXI2DVI) tmp.texi
-       rm -f tmp.texi
-       mv tmp.dvi gmp.dvi
-       rm -f tmp.*
-
-ps: gmp.ps
-gmp.ps: gmp.dvi
-       dvips gmp.dvi -o gmp.ps
-
-html: gmp_toc.html
-gmp_toc.html: $(srcdir)/gmp.texi
-       texi2html -acc -split_chapter $(srcdir)/gmp.texi
-
-# The semicolon is to prevent the install.sh -> install default rule
-# from doing anything.  Having it run true helps avoid problems and
-# noise from versions of make which don't like to have null commands.
-install: install-normal ; @true
-
-install-strip: install-normal
-install-normal: installdirs libgmp.a
-       $(INSTALL_DATA) libgmp.a $(libdir)/libgmp.a
-       -chmod a-x $(libdir)/libgmp.a
-#      $(INSTALL_DATA) $(srcdir)/gmp.h $(includedir)/gmp.h
-#      -chmod a-x $(includedir)/gmp.h
-install-bsdmp: installdirs libmp.a gmp.info install-info-files
-       $(INSTALL_DATA) libmp.a $(libdir)/libmp.a
-       -chmod a-x $(libdir)/libmp.a
-       $(INSTALL_DATA) $(srcdir)/mp.h $(includedir)/mp.h
-       -chmod a-x $(includedir)/mp.h
-install-info-files: installdirs $(srcdir)/gmp.info
-       cd $(srcdir); for f in gmp.info*; \
-       do $(INSTALL_DATA) $$f $(infodir)/$$f; done
-       -chmod a-x $(infodir)/gmp.info*
-       # Attempt to edit the info directory node
-       if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
-         install-info --dir-file=$(infodir)/dir $(infodir)/gmp.info; \
-         else true; fi
-
-installdirs: $(srcdir)/mkinstalldirs
-       $(srcdir)/mkinstalldirs $(includedir) $(libdir) $(infodir)
-
-uninstall:
-       rm -f $(libdir)/libgmp.a
-       rm -f $(includedir)/gmp.h
-       rm -f $(libdir)/libmp.a
-       rm -f $(includedir)/mp.h
-       rm -f $(infodir)/gmp.info*
-
-clean mostlyclean:
-       rm -f *.o libgmp.a libmp.a gmp.dvi gmp.ps tmp.* tmp-*
-       rm -f gmp.?? gmp.??s gmp.log gmp.toc gmp.*aux gmp*.html
-       -cd mpn; $(MAKE) $@
-       -cd mpz; $(MAKE) $@
-distclean: clean
-       rm -f Makefile config.status
-       -cd mpn; $(MAKE) $@
-       -cd mpz; $(MAKE) $@
-maintainer-clean: distclean
-       rm -f $(srcdir)/gmp.info*
-
-TAGS: force
-       cd $(srcdir); etags *.[ch] mp*/*.c mpn/generic/*.c >TAGS
-
-dist:
-       @echo "sorry, not supported target"
-       @exit 1
-
-Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
-       $(SHELL) ./config.status
-
-H = $(srcdir)/gmp.h $(srcdir)/gmp-impl.h mpn/gmp-mparam.h
-
-extract-double.o: $(srcdir)/extract-double.c $(H)
-insert-double.o: $(srcdir)/insert-double.c $(H)
-memory.o: $(srcdir)/memory.c $(H)
-mp_bpl.o: $(srcdir)/mp_bpl.c
-mp_clz_tab.o: $(srcdir)/mp_clz_tab.c
-mp_set_fns.o: $(srcdir)/mp_set_fns.c $(H)
-stack-alloc.o: $(srcdir)/stack-alloc.c $(srcdir)/stack-alloc.h
-version.o: $(srcdir)/version.c
-
-force:
-.PNONY: check install install-bsdmp install-info-files install-strip uninstall
-.PHONY: doc clean distclean maintainer-clean force info dvi
+config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       $(SHELL) ./config.status --recheck
+$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+       cd $(srcdir) && $(AUTOCONF)
+
+config.h: stamp-h
+       @if test ! -f $@; then \
+               rm -f stamp-h; \
+               $(MAKE) stamp-h; \
+       else :; fi
+stamp-h: $(srcdir)/config.in $(top_builddir)/config.status
+       @rm -f stamp-h stamp-hT
+       @echo timestamp > stamp-hT 2> /dev/null
+       cd $(top_builddir) \
+         && CONFIG_FILES= CONFIG_HEADERS=config.h:config.in \
+            $(SHELL) ./config.status
+       @mv stamp-hT stamp-h
+$(srcdir)/config.in: @MAINTAINER_MODE_TRUE@$(srcdir)/./stamp-h.in
+       @if test ! -f $@; then \
+               rm -f $(srcdir)/./stamp-h.in; \
+               $(MAKE) $(srcdir)/./stamp-h.in; \
+       else :; fi
+$(srcdir)/./stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
+       @rm -f $(srcdir)/./stamp-h.in $(srcdir)/./stamp-h.inT
+       @echo timestamp > $(srcdir)/./stamp-h.inT 2> /dev/null
+       cd $(top_srcdir) && $(AUTOHEADER)
+       @mv $(srcdir)/./stamp-h.inT $(srcdir)/./stamp-h.in
+
+mostlyclean-hdr:
+
+clean-hdr:
+
+distclean-hdr:
+       -rm -f config.h
+
+maintainer-clean-hdr:
+
+mostlyclean-libLTLIBRARIES:
+
+clean-libLTLIBRARIES:
+       -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+
+distclean-libLTLIBRARIES:
+
+maintainer-clean-libLTLIBRARIES:
+
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+       @$(NORMAL_INSTALL)
+       $(mkinstalldirs) $(DESTDIR)$(libdir)
+       @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+         if test -f $$p; then \
+           echo " $(LIBTOOL)  --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$p"; \
+           $(LIBTOOL)  --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$p; \
+         else :; fi; \
+       done
+
+uninstall-libLTLIBRARIES:
+       @$(NORMAL_UNINSTALL)
+       @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+         echo " $(LIBTOOL)  --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \
+         $(LIBTOOL)  --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
+       done
+
+mostlyclean-compile:
+       -rm -f *.o core *.core
+       -rm -f *.$(OBJEXT)
+
+clean-compile:
+
+distclean-compile:
+       -rm -f *.tab.c
+
+maintainer-clean-compile:
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+distclean-libtool:
+
+maintainer-clean-libtool:
+
+mostlyclean-krextra:
+
+clean-krextra:
+       -rm -f ansi2knr
+
+distclean-krextra:
+
+maintainer-clean-krextra:
+ansi2knr: ansi2knr.$(OBJEXT)
+       $(LINK) ansi2knr.$(OBJEXT) $(LIBS)
+ansi2knr.$(OBJEXT): $(CONFIG_HEADER)
+
+
+mostlyclean-kr:
+       -rm -f *_.c
+
+clean-kr:
+
+distclean-kr:
+
+maintainer-clean-kr:
+
+libgmp.la: $(libgmp_la_OBJECTS) $(libgmp_la_DEPENDENCIES)
+       $(LINK) -rpath $(libdir) $(libgmp_la_LDFLAGS) $(libgmp_la_OBJECTS) $(libgmp_la_LIBADD) $(LIBS)
+
+libmp.la: $(libmp_la_OBJECTS) $(libmp_la_DEPENDENCIES)
+       $(LINK) -rpath $(libdir) $(libmp_la_LDFLAGS) $(libmp_la_OBJECTS) $(libmp_la_LIBADD) $(LIBS)
+.c.o:
+       $(COMPILE) -c $<
+.c.obj:
+       $(COMPILE) -c `cygpath -w $<`
+.c.lo:
+       $(LTCOMPILE) -c -o $@ $<
+assert_.c: assert.c $(ANSI2KNR)
+       $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/assert.c; then echo $(srcdir)/assert.c; else echo assert.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > assert_.c
+compat_.c: compat.c $(ANSI2KNR)
+       $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/compat.c; then echo $(srcdir)/compat.c; else echo compat.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > compat_.c
+errno_.c: errno.c $(ANSI2KNR)
+       $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/errno.c; then echo $(srcdir)/errno.c; else echo errno.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > errno_.c
+extract-dbl_.c: extract-dbl.c $(ANSI2KNR)
+       $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/extract-dbl.c; then echo $(srcdir)/extract-dbl.c; else echo extract-dbl.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > extract-dbl_.c
+insert-dbl_.c: insert-dbl.c $(ANSI2KNR)
+       $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/insert-dbl.c; then echo $(srcdir)/insert-dbl.c; else echo insert-dbl.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > insert-dbl_.c
+memory_.c: memory.c $(ANSI2KNR)
+       $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memory.c; then echo $(srcdir)/memory.c; else echo memory.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memory_.c
+mp_bpl_.c: mp_bpl.c $(ANSI2KNR)
+       $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/mp_bpl.c; then echo $(srcdir)/mp_bpl.c; else echo mp_bpl.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > mp_bpl_.c
+mp_clz_tab_.c: mp_clz_tab.c $(ANSI2KNR)
+       $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/mp_clz_tab.c; then echo $(srcdir)/mp_clz_tab.c; else echo mp_clz_tab.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > mp_clz_tab_.c
+mp_minv_tab_.c: mp_minv_tab.c $(ANSI2KNR)
+       $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/mp_minv_tab.c; then echo $(srcdir)/mp_minv_tab.c; else echo mp_minv_tab.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > mp_minv_tab_.c
+mp_set_fns_.c: mp_set_fns.c $(ANSI2KNR)
+       $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/mp_set_fns.c; then echo $(srcdir)/mp_set_fns.c; else echo mp_set_fns.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > mp_set_fns_.c
+rand_.c: rand.c $(ANSI2KNR)
+       $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/rand.c; then echo $(srcdir)/rand.c; else echo rand.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > rand_.c
+randclr_.c: randclr.c $(ANSI2KNR)
+       $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/randclr.c; then echo $(srcdir)/randclr.c; else echo randclr.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > randclr_.c
+randlc_.c: randlc.c $(ANSI2KNR)
+       $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/randlc.c; then echo $(srcdir)/randlc.c; else echo randlc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > randlc_.c
+randlc2x_.c: randlc2x.c $(ANSI2KNR)
+       $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/randlc2x.c; then echo $(srcdir)/randlc2x.c; else echo randlc2x.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > randlc2x_.c
+randraw_.c: randraw.c $(ANSI2KNR)
+       $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/randraw.c; then echo $(srcdir)/randraw.c; else echo randraw.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > randraw_.c
+randsd_.c: randsd.c $(ANSI2KNR)
+       $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/randsd.c; then echo $(srcdir)/randsd.c; else echo randsd.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > randsd_.c
+randsdui_.c: randsdui.c $(ANSI2KNR)
+       $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/randsdui.c; then echo $(srcdir)/randsdui.c; else echo randsdui.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > randsdui_.c
+stack-alloc_.c: stack-alloc.c $(ANSI2KNR)
+       $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/stack-alloc.c; then echo $(srcdir)/stack-alloc.c; else echo stack-alloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > stack-alloc_.c
+version_.c: version.c $(ANSI2KNR)
+       $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/version.c; then echo $(srcdir)/version.c; else echo version.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > version_.c
+assert_.$(OBJEXT) assert_.lo compat_.$(OBJEXT) compat_.lo \
+errno_.$(OBJEXT) errno_.lo extract-dbl_.$(OBJEXT) extract-dbl_.lo \
+insert-dbl_.$(OBJEXT) insert-dbl_.lo memory_.$(OBJEXT) memory_.lo \
+mp_bpl_.$(OBJEXT) mp_bpl_.lo mp_clz_tab_.$(OBJEXT) mp_clz_tab_.lo \
+mp_minv_tab_.$(OBJEXT) mp_minv_tab_.lo mp_set_fns_.$(OBJEXT) \
+mp_set_fns_.lo rand_.$(OBJEXT) rand_.lo randclr_.$(OBJEXT) randclr_.lo \
+randlc_.$(OBJEXT) randlc_.lo randlc2x_.$(OBJEXT) randlc2x_.lo \
+randraw_.$(OBJEXT) randraw_.lo randsd_.$(OBJEXT) randsd_.lo \
+randsdui_.$(OBJEXT) randsdui_.lo stack-alloc_.$(OBJEXT) stack-alloc_.lo \
+version_.$(OBJEXT) version_.lo : $(ANSI2KNR)
+
+$(srcdir)/version.texi: @MAINTAINER_MODE_TRUE@stamp-vti
+       @:
+
+$(srcdir)/stamp-vti: gmp.texi $(top_srcdir)/configure.in
+       @echo "@set UPDATED `$(SHELL) $(srcdir)/mdate-sh $(srcdir)/gmp.texi`" > vti.tmp
+       @echo "@set EDITION $(VERSION)" >> vti.tmp
+       @echo "@set VERSION $(VERSION)" >> vti.tmp
+       @cmp -s vti.tmp $(srcdir)/version.texi \
+         || (echo "Updating $(srcdir)/version.texi"; \
+             cp vti.tmp $(srcdir)/version.texi)
+       -@rm -f vti.tmp
+       @cp $(srcdir)/version.texi $@
+
+mostlyclean-vti:
+       -rm -f vti.tmp
+
+clean-vti:
+
+distclean-vti:
+
+maintainer-clean-vti:
+       -@MAINTAINER_MODE_TRUE@rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi
+
+gmp.info: gmp.texi version.texi
+gmp.dvi: gmp.texi version.texi
+
+
+DVIPS = dvips
+
+.texi.info:
+       @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
+       cd $(srcdir) \
+         && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
+
+.texi.dvi:
+       TEXINPUTS=$(srcdir):$$TEXINPUTS \
+         MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.texi:
+       @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
+       cd $(srcdir) \
+         && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
+
+.texinfo.info:
+       @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
+       cd $(srcdir) \
+         && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
+
+.texinfo:
+       @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
+       cd $(srcdir) \
+         && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
+
+.texinfo.dvi:
+       TEXINPUTS=$(srcdir):$$TEXINPUTS \
+         MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.txi.info:
+       @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
+       cd $(srcdir) \
+         && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
+
+.txi.dvi:
+       TEXINPUTS=$(srcdir):$$TEXINPUTS \
+         MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
+
+.txi:
+       @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
+       cd $(srcdir) \
+         && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
+.dvi.ps:
+       $(DVIPS) $< -o $@
+
+install-info-am: $(INFO_DEPS)
+       @$(NORMAL_INSTALL)
+       $(mkinstalldirs) $(DESTDIR)$(infodir)
+       @list='$(INFO_DEPS)'; \
+       for file in $$list; do \
+         d=$(srcdir); \
+         for ifile in `CDPATH=: && cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
+           if test -f $$d/$$ifile; then \
+             echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
+             $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
+           else : ; fi; \
+         done; \
+       done
+       @$(POST_INSTALL)
+       @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
+         list='$(INFO_DEPS)'; \
+         for file in $$list; do \
+           echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
+           install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
+         done; \
+       else : ; fi
+
+uninstall-info:
+       $(PRE_UNINSTALL)
+       @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
+         list='$(INFO_DEPS)'; \
+         for file in $$list; do \
+           echo " install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$file"; \
+           install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$file; \
+         done; \
+       else :; fi
+       @$(NORMAL_UNINSTALL)
+       @list='$(INFO_DEPS)'; \
+       for file in $$list; do \
+         (if cd $(DESTDIR)$(infodir); then \
+            echo " rm -f $$file $$file-[0-9] $$file-[0-9][0-9])"; \
+            rm -f $$file $$file-[0-9] $$file-[0-9][0-9]; \
+          else :; fi); \
+       done
+
+dist-info: $(INFO_DEPS)
+       list='$(INFO_DEPS)'; \
+       for base in $$list; do \
+         d=$(srcdir); \
+         for file in `CDPATH=: && cd $$d && eval echo $$base*`; do \
+           test -f $(distdir)/$$file \
+           || cp -p $$d/$$file $(distdir)/$$file; \
+         done; \
+       done
+
+mostlyclean-aminfo:
+       -rm -f gmp.aux gmp.cp gmp.cps gmp.dvi gmp.fn gmp.fns gmp.pgs gmp.ky \
+         gmp.kys gmp.ps gmp.log gmp.pg gmp.toc gmp.tp gmp.tps gmp.vr \
+         gmp.vrs gmp.op gmp.tr gmp.cv gmp.cn gmp.cm gmp.ov
+
+clean-aminfo:
+
+distclean-aminfo:
+
+maintainer-clean-aminfo:
+       cd $(srcdir) && for i in $(INFO_DEPS); do \
+         rm -f $$i; \
+         if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \
+           rm -f $$i-[0-9]*; \
+         fi; \
+       done
+
+install-includeHEADERS: $(include_HEADERS)
+       @$(NORMAL_INSTALL)
+       $(mkinstalldirs) $(DESTDIR)$(includedir)
+       @list='$(include_HEADERS)'; for p in $$list; do \
+         if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
+         f="`echo $$p | sed -e 's|^.*/||'`"; \
+         echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/$$f"; \
+         $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/$$f; \
+       done
+
+uninstall-includeHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(include_HEADERS)'; for p in $$list; do \
+         f="`echo $$p | sed -e 's|^.*/||'`"; \
+         echo " rm -f $(DESTDIR)$(includedir)/$$f"; \
+         rm -f $(DESTDIR)$(includedir)/$$f; \
+       done
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+
+all-recursive install-data-recursive install-exec-recursive \
+installdirs-recursive install-recursive uninstall-recursive  \
+check-recursive installcheck-recursive info-recursive dvi-recursive:
+       @set fnord $(MAKEFLAGS); amf=$$2; \
+       dot_seen=no; \
+       target=`echo $@ | sed s/-recursive//`; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         echo "Making $$target in $$subdir"; \
+         if test "$$subdir" = "."; then \
+           dot_seen=yes; \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+          || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+       done; \
+       if test "$$dot_seen" = "no"; then \
+         $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+       fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+       @set fnord $(MAKEFLAGS); amf=$$2; \
+       dot_seen=no; \
+       rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
+         rev="$$subdir $$rev"; \
+         if test "$$subdir" = "."; then dot_seen=yes; else :; fi; \
+       done; \
+       test "$$dot_seen" = "no" && rev=". $$rev"; \
+       target=`echo $@ | sed s/-recursive//`; \
+       for subdir in $$rev; do \
+         echo "Making $$target in $$subdir"; \
+         if test "$$subdir" = "."; then \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+          || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+       done && test -z "$$fail"
+tags-recursive:
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+       done
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+       list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       mkid -f$$here/ID $$unique $(LISP)
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+   if test "$$subdir" = .; then :; else \
+           test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+   fi; \
+       done; \
+       list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       test -z "$(ETAGS_ARGS)config.in$$unique$(LISP)$$tags" \
+         || etags $(ETAGS_ARGS) $$tags config.in $$unique $(LISP)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+       -rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+
+
+# This target untars the dist file and tries a VPATH configuration.  Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+       -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
+       GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
+       chmod -R a-w $(distdir); chmod a+w $(distdir)
+       mkdir $(distdir)/=build
+       mkdir $(distdir)/=inst
+       chmod a-w $(distdir)
+       dc_install_base=`CDPATH=: && cd $(distdir)/=inst && pwd` \
+         && cd $(distdir)/=build \
+         && ../configure --srcdir=.. --prefix=$$dc_install_base \
+         && $(MAKE) $(AM_MAKEFLAGS) \
+         && $(MAKE) $(AM_MAKEFLAGS) dvi \
+         && $(MAKE) $(AM_MAKEFLAGS) check \
+         && $(MAKE) $(AM_MAKEFLAGS) install \
+         && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+         && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+         && test `find $$dc_install_base -type f -print | wc -l` -le 1 \
+         && $(MAKE) $(AM_MAKEFLAGS) dist \
+         && $(MAKE) $(AM_MAKEFLAGS) distclean \
+         && rm -f $(distdir).tar.gz \
+         && test `find . -type f -print | wc -l` -eq 0
+       -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
+       @banner="$(distdir).tar.gz is ready for distribution"; \
+       dashes=`echo "$$banner" | sed s/./=/g`; \
+       echo "$$dashes"; \
+       echo "$$banner"; \
+       echo "$$dashes"
+dist: distdir
+       -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+         ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+         ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+         ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+       || chmod -R a+r $(distdir)
+       $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).tar.gz
+       -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
+dist-all: distdir
+       -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+         ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+         ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+         ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+       || chmod -R a+r $(distdir)
+       $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).tar.gz
+       -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
+distdir: $(DISTFILES)
+       @if sed 15q $(srcdir)/NEWS | fgrep -e "$(VERSION)" > /dev/null; then :; else \
+         echo "NEWS not updated; not releasing" 1>&2; \
+         exit 1; \
+       fi
+       -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
+       mkdir $(distdir)
+       $(mkinstalldirs) $(distdir)/mpfr
+       @for file in $(DISTFILES); do \
+         d=$(srcdir); \
+         if test -d $$d/$$file; then \
+           cp -pR $$d/$$file $(distdir); \
+         else \
+           test -f $(distdir)/$$file \
+           || cp -p $$d/$$file $(distdir)/$$file || :; \
+         fi; \
+       done
+       for subdir in $(SUBDIRS); do \
+         if test "$$subdir" = .; then :; else \
+           test -d $(distdir)/$$subdir \
+           || mkdir $(distdir)/$$subdir \
+           || exit 1; \
+           (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
+             || exit 1; \
+         fi; \
+       done
+       $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
+       $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook
+info-am: $(INFO_DEPS)
+info: info-recursive
+dvi-am: $(DVIS)
+dvi: dvi-recursive
+check-am: all-am
+check: check-recursive
+installcheck-am:
+installcheck: installcheck-recursive
+all-recursive-am: config.h
+       $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+install-exec-am: install-libLTLIBRARIES
+install-exec: install-exec-recursive
+
+install-data-am: install-info-am install-includeHEADERS
+install-data: install-data-recursive
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-recursive
+uninstall-am: uninstall-libLTLIBRARIES uninstall-info \
+               uninstall-includeHEADERS
+uninstall: uninstall-recursive
+all-am: Makefile $(INFO_DEPS) $(ANSI2KNR) $(LTLIBRARIES) $(HEADERS) \
+               config.h
+all-redirect: all-recursive-am
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
+installdirs: installdirs-recursive
+installdirs-am:
+       $(mkinstalldirs)  $(DESTDIR)$(libdir) $(DESTDIR)$(infodir) \
+               $(DESTDIR)$(includedir)
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -rm -f Makefile $(CONFIG_CLEAN_FILES)
+       -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+       -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+       -rm -f Makefile.in
+mostlyclean-am:  mostlyclean-hdr mostlyclean-libLTLIBRARIES \
+               mostlyclean-compile mostlyclean-libtool \
+               mostlyclean-krextra mostlyclean-kr mostlyclean-vti \
+               mostlyclean-aminfo mostlyclean-tags mostlyclean-generic
+
+mostlyclean: mostlyclean-recursive
+
+clean-am:  clean-hdr clean-libLTLIBRARIES clean-compile clean-libtool \
+               clean-krextra clean-kr clean-vti clean-aminfo \
+               clean-tags clean-generic mostlyclean-am
+
+clean: clean-recursive
+
+distclean-am:  distclean-hdr distclean-libLTLIBRARIES distclean-compile \
+               distclean-libtool distclean-krextra distclean-kr \
+               distclean-vti distclean-aminfo distclean-tags \
+               distclean-generic clean-am
+       -rm -f libtool
+
+distclean: distclean-recursive
+       -rm -f config.status
+
+maintainer-clean-am:  maintainer-clean-hdr \
+               maintainer-clean-libLTLIBRARIES \
+               maintainer-clean-compile maintainer-clean-libtool \
+               maintainer-clean-krextra maintainer-clean-kr \
+               maintainer-clean-vti maintainer-clean-aminfo \
+               maintainer-clean-tags maintainer-clean-generic \
+               distclean-am
+       @echo "This command is intended for maintainers to use;"
+       @echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-recursive
+       -rm -f config.status
+
+.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
+mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \
+clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \
+uninstall-libLTLIBRARIES install-libLTLIBRARIES mostlyclean-compile \
+distclean-compile clean-compile maintainer-clean-compile \
+mostlyclean-libtool distclean-libtool clean-libtool \
+maintainer-clean-libtool mostlyclean-krextra distclean-krextra \
+clean-krextra maintainer-clean-krextra mostlyclean-kr distclean-kr \
+clean-kr maintainer-clean-kr mostlyclean-vti distclean-vti clean-vti \
+maintainer-clean-vti install-info-am uninstall-info mostlyclean-aminfo \
+distclean-aminfo clean-aminfo maintainer-clean-aminfo \
+uninstall-includeHEADERS install-includeHEADERS install-recursive \
+uninstall-recursive install-data-recursive uninstall-data-recursive \
+install-exec-recursive uninstall-exec-recursive installdirs-recursive \
+uninstalldirs-recursive all-recursive check-recursive \
+installcheck-recursive info-recursive dvi-recursive \
+mostlyclean-recursive distclean-recursive clean-recursive \
+maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
+distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
+dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \
+install-exec-am install-exec install-data-am install-data install-am \
+install uninstall-am uninstall all-redirect all-am all install-strip \
+installdirs-am installdirs mostlyclean-generic distclean-generic \
+clean-generic maintainer-clean-generic clean mostlyclean distclean \
+maintainer-clean
+
+
+# Don't ship CVS directories or emacs backups.
+dist-hook:
+       -find $(distdir) \( -name CVS -type d \) -o -name "*.~*" \
+               | xargs rm -rf
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/ghc/rts/gmp/PROJECTS b/ghc/rts/gmp/PROJECTS
deleted file mode 100644 (file)
index 75016bd..0000000
+++ /dev/null
@@ -1,270 +0,0 @@
-IDEAS ABOUT THINGS TO WORK ON
-
-* mpq_cmp: Maybe the most sensible thing to do would be to multiply the, say,
-  4 most significant limbs of each operand and compare them.  If that is not
-  sufficient, do the same for 8 limbs, etc.
-
-* Write mpi, the Multiple Precision Interval Arithmetic layer.
-
-* Write `mpX_eval' that take lambda-like expressions and a list of operands.
-
-* As a general rule, recognize special operand values in mpz and mpf, and
-  use shortcuts for speed.  Examples: Recognize (small or all) 2^n in
-  multiplication and division.  Recognize small bases in mpz_pow_ui.
-
-* Implement lazy allocation?  mpz->d == 0 would mean no allocation made yet.
-
-* Maybe store one-limb numbers according to Per Bothner's idea:
-    struct {
-      mp_ptr d;
-      union {
-       mp_limb val;    /* if (d == NULL).  */
-        mp_size size;   /* Length of data array, if (d != NULL).  */
-      } u;
-    };
-  Problem: We can't normalize to that format unless we free the space
-  pointed to by d, and therefore small values will not be stored in a
-  canonical way.
-
-* Document complexity of all functions.
-
-* Add predicate functions mpz_fits_signedlong_p, mpz_fits_unsignedlong_p,
-  mpz_fits_signedint_p, etc.
-
-  mpz_floor (mpz, mpq), mpz_trunc (mpz, mpq), mpz_round (mpz, mpq).
-
-* Better random number generators.  There should be fast (like mpz_random),
-  very good (mpz_veryrandom), and special purpose (like mpz_random2).  Sizes
-  in *bits*, not in limbs.
-
-* It'd be possible to have an interface "s = add(a,b)" with automatic GC.
-  If the mpz_xinit routine remembers the address of the variable we could
-  walk-and-mark the list of remembered variables, and free the space
-  occupied by the remembered variables that didn't get marked.  Fairly
-  standard.
-
-* Improve speed for non-gcc compilers by defining umul_ppmm, udiv_qrnnd,
-  etc, to call __umul_ppmm, __udiv_qrnnd.  A typical definition for
-  umul_ppmm would be
-  #define umul_ppmm(ph,pl,m0,m1) \
-    {unsigned long __ph; (pl) = __umul_ppmm (&__ph, (m0), (m1)); (ph) = __ph;}
-  In order to maintain just one version of longlong.h (gmp and gcc), this
-  has to be done outside of longlong.h.
-
-Bennet Yee at CMU proposes:
-* mpz_{put,get}_raw for memory oriented I/O like other *_raw functions.
-* A function mpfatal that is called for exceptions.  Let the user override
-  a default definition.
-
-* Make all computation mpz_* functions return a signed int indicating if the
-  result was zero, positive, or negative?
-
-* Implement mpz_cmpabs, mpz_xor, mpz_to_double, mpz_to_si, mpz_lcm, mpz_dpb,
-  mpz_ldb, various bit string operations.  Also mpz_@_si for most @??
-
-* Add macros for looping efficiently over a number's limbs:
-       MPZ_LOOP_OVER_LIMBS_INCREASING(num,limb)
-         { user code manipulating limb}
-       MPZ_LOOP_OVER_LIMBS_DECREASING(num,limb)
-         { user code manipulating limb}
-
-Brian Beuning proposes:
-   1. An array of small primes
-   3. A function to factor a mpz_t.  [How do we return the factors?  Maybe
-      we just return one arbitrary factor?  In the latter case, we have to
-      use a data structure that records the state of the factoring routine.]
-   4. A routine to look for "small" divisors of an mpz_t
-   5. A 'multiply mod n' routine based on Montgomery's algorithm.
-
-Dough Lea proposes:
-   1. A way to find out if an integer fits into a signed int, and if so, a
-      way to convert it out.
-   2. Similarly for double precision float conversion.
-   3. A function to convert the ratio of two integers to a double.  This
-      can be useful for mixed mode operations with integers, rationals, and
-      doubles.
-
-Elliptic curve method description in the Chapter `Algorithms in Number
-Theory' in the Handbook of Theoretical Computer Science, Elsevier,
-Amsterdam, 1990.  Also in Carl Pomerance's lecture notes on Cryptology and
-Computational Number Theory, 1990.
-
-* Harald Kirsh suggests:
-  mpq_set_str (MP_RAT *r, char *numerator, char *denominator).
-
-* New function: mpq_get_ifstr (int_str, frac_str, base,
-  precision_in_som_way, rational_number).  Convert RATIONAL_NUMBER to a
-  string in BASE and put the integer part in INT_STR and the fraction part
-  in FRAC_STR.  (This function would do a division of the numerator and the
-  denominator.)
-
-* Should mpz_powm* handle negative exponents?
-
-* udiv_qrnnd: If the denominator is normalized, the n0 argument has very
-  little effect on the quotient.  Maybe we can assume it is 0, and
-  compensate at a later stage?
-
-* Better sqrt: First calculate the reciprocal square root, then multiply by
-  the operand to get the square root.  The reciprocal square root can be
-  obtained through Newton-Raphson without division.  To compute sqrt(A), the
-  iteration is,
-
-                                   2
-                  x   = x  (3 - A x )/2.
-                   i+1   i         i
-
-  The final result can be computed without division using,
-
-                    sqrt(A) = A x .
-                                 n
-
-* Newton-Raphson using multiplication: We get twice as many correct digits
-  in each iteration.  So if we square x(k) as part of the iteration, the
-  result will have the leading digits in common with the entire result from
-  iteration k-1.  A _mpn_mul_lowpart could help us take advantage of this.
-
-* Peter Montgomery: If 0 <= a, b < p < 2^31 and I want a modular product
-  a*b modulo p and the long long type is unavailable, then I can write
-
-         typedef   signed long slong;
-         typedef unsigned long ulong;
-         slong a, b, p, quot, rem;
-
-         quot = (slong) (0.5 + (double)a * (double)b / (double)p);
-         rem =  (slong)((ulong)a * (ulong)b - (ulong)p * (ulong)quot);
-         if (rem < 0} {rem += p; quot--;}
-
-* Speed modulo arithmetic, using Montgomery's method or my pre-inversion
-  method.  In either case, special arithmetic calls would be needed,
-  mpz_mmmul, mpz_mmadd, mpz_mmsub, plus some kind of initialization
-  functions.  Better yet: Write a new mpr layer.
-
-* mpz_powm* should not use division to reduce the result in the loop, but
-  instead pre-compute the reciprocal of the MOD argument and do reduced_val
-  = val-val*reciprocal(MOD)*MOD, or use Montgomery's method.
-
-* mpz_mod_2expplussi -- to reduce a bignum modulo (2**n)+s
-
-* It would be a quite important feature never to allocate more memory than
-  really necessary for a result.  Sometimes we can achieve this cheaply, by
-  deferring reallocation until the result size is known.
-
-* New macro in longlong.h: shift_rhl that extracts a word by shifting two
-  words as a unit.  (Supported by i386, i860, HP-PA, POWER, 29k.)  Useful
-  for shifting multiple precision numbers.
-
-* The installation procedure should make a test run of multiplication to
-  decide the threshold values for algorithm switching between the available
-  methods.
-
-* Fast output conversion of x to base B:
-    1. Find n, such that (B^n > x).
-    2. Set y to (x*2^m)/(B^n), where m large enough to make 2^n ~~ B^n
-    3. Multiply the low half of y by B^(n/2), and recursively convert the
-       result.  Truncate the low half of y and convert that recursively.
-  Complexity: O(M(n)log(n))+O(D(n))!
-
-* Improve division using Newton-Raphson.  Check out "Newton Iteration and
-  Integer Division" by Stephen Tate in "Synthesis of Parallel Algorithms",
-  Morgan Kaufmann, 1993 ("beware of some errors"...)
-
-* Improve implementation of Karatsuba's algorithm.  For most operand sizes,
-  we can reduce the number of operations by splitting differently.
-
-* Faster multiplication: The best approach is to first implement Toom-Cook.
-  People report that it beats Karatsuba's algorithm already at about 100
-  limbs.  FFT would probably never beat a well-written Toom-Cook (not even for
-  millions of bits).
-
-FFT:
-{
-  * Multiplication could be done with Montgomery's method combined with
-    the "three primes" method described in Lipson.  Maybe this would be
-    faster than to Nussbaumer's method with 3 (simple) moduli?
-
-  * Maybe the modular tricks below are not needed: We are using very
-    special numbers, Fermat numbers with a small base and a large exponent,
-    and maybe it's possible to just subtract and add?
-
-  * Modify Nussbaumer's convolution algorithm, to use 3 words for each
-    coefficient, calculating in 3 relatively prime moduli (e.g.
-    0xffffffff, 0x100000000, and 0x7fff on a 32-bit computer).  Both all
-    operations and CRR would be very fast with such numbers.
-
-  * Optimize the Schoenhage-Stassen multiplication algorithm.  Take advantage
-    of the real valued input to save half of the operations and half of the
-    memory.  Use recursive FFT with large base cases, since recursive FFT has
-    better memory locality.  A normal FFT get 100% cache misses for large
-    enough operands.
-
-  * In the 3-prime convolution method, it might sometimes be a win to use 2,
-    3, or 5 primes.  Imagine that using 3 primes would require a transform
-    length of 2^n.  But 2 primes might still sometimes give us correct
-    results with that same transform length, or 5 primes might allow us to
-    decrease the transform size to 2^(n-1).
-
-  To optimize floating-point based complex FFT we have to think of:
-
-  1. The normal implementation accesses all input exactly once for each of
-     the log(n) passes.  This means that we will get 0% cache hit when n >
-     our cache.  Remedy: Reorganize computation to compute partial passes,
-     maybe similar to a standard recursive FFT implementation.  Use a large
-     `base case' to make any extra overhead of this organization negligible.
-
-  2. Use base-4, base-8 and base-16 FFT instead of just radix-2.  This can
-     reduce the number of operations by 2x.
-
-  3. Inputs are real-valued.  According to Knuth's "Seminumerical
-     Algorithms", exercise 4.6.4-14, we can save half the memory and half
-     the operations if we take advantage of that.
-
-  4. Maybe make it possible to write the innermost loop in assembly, since
-     that could win us another 2x speedup.  (If we write our FFT to avoid
-     cache-miss (see #1 above) it might be logical to write the `base case'
-     in assembly.)
-
-  5. Avoid multiplication by 1, i, -1, -i.  Similarly, optimize
-     multiplication by (+-\/2 +- i\/2).
-
-  6. Put as many bits as possible in each double (but don't waste time if
-     that doesn't make the transform size become smaller).
-
-  7. For n > some large number, we will get accuracy problems because of the
-     limited precision of our floating point arithmetic.  This can easily be
-     solved by using the Karatsuba trick a few times until our operands
-     become small enough.
-
-  8. Precompute the roots-of-unity and store them in a vector.
-}
-
-* When a division result is going to be just one limb, (i.e. nsize-dsize is
-  small) normalization could be done in the division loop.
-
-* Never allocate temporary space for a source param that overlaps with a
-  destination param needing reallocation.  Instead malloc a new block for
-  the destination (and free the source before returning to the caller).
-
-* Parallel addition.  Since each processors have to tell it is ready to the
-  next processor, we can use simplified synchronization, and actually write
-  it in C:  For each processor (apart from the least significant):
-
-       while (*svar != my_number)
-         ;
-       *svar = my_number + 1;
-
-  The least significant processor does this:
-
-       *svar = my_number + 1;  /* i.e., *svar = 1 */
-
-  Before starting the addition, one processor has to store 0 in *svar.
-
-  Other things to think about for parallel addition: To avoid false
-  (cache-line) sharing, allocate blocks on cache-line boundaries.
-
-\f
-Local Variables:
-mode: text
-fill-column: 77
-fill-prefix: "  "
-version-control: never
-End:
diff --git a/ghc/rts/gmp/SPEED b/ghc/rts/gmp/SPEED
deleted file mode 100644 (file)
index e888e17..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-==============================================================================
-Cycle counts and throughput for low-level routines in GNU MP as currently
-implemented.
-
-A range means that the timing is data-dependent.  The slower number of such
-an interval is usually the best performance estimate.
-
-The throughput value, measured in Gb/s (gigabits per second) has a meaning
-only for comparison between CPUs.
-
-A star before a line means that all values on that line are estimates.  A
-star before a number means that that number is an estimate.  A `p' before a
-number means that the code is not complete, but the timing is believed to be
-accurate.
-
-           |   mpn_lshift      mpn_add_n       mpn_mul_1       mpn_addmul_1
-           |   mpn_rshift      mpn_sub_n                       mpn_submul_1
-------------+-----------------------------------------------------------------
-DEC/Alpha   |
-EV4        |   4.75 cycles/64b 7.75 cycles/64b 42 cycles/64b   42 cycles/64b
-  200MHz    |  2.7 Gb/s        1.65 Gb/s       20 Gb/s         20 Gb/s
-EV5 old code|  4.0 cycles/64b  5.5 cycles/64b  18 cycles/64b   18 cycles/64b
-  267MHz    |  4.27 Gb/s       3.10 Gb/s       61 Gb/s         61 Gb/s
-  417MHz    |  6.67 Gb/s       4.85 Gb/s       95 Gb/s         95 Gb/s
-EV5 tuned   |  3.25 cycles/64b 4.75 cycles/64b
-  267MHz    |  5.25 Gb/s       3.59 Gb/s               as above
-  417MHz    |  8.21 Gb/s       5.61 Gb/s
-------------+-----------------------------------------------------------------
-Sun/SPARC   |
-SPARC v7    |  14.0 cycles/32b 8.5 cycles/32b  37-54 cycl/32b  37-54 cycl/32b
-SuperSPARC  |  3 cycles/32b    2.5 cycles/32b  8.2 cycles/32b  10.8 cycles/32b
-  50MHz            |   0.53 Gb/s       0.64 Gb/s       6.2 Gb/s        4.7 Gb/s
-**SuperSPARC|          tuned addmul and submul will take:      9.25 cycles/32b
-MicroSPARC2 |  ?               6.65 cycles/32b 30 cycles/32b   31.5 cycles/32b
-  110MHz    |  ?               0.53 Gb/s       3.75 Gb/s       3.58 Gb/s
-SuperSPARC2 |  ?               ?               ?               ?
-Ultra/32 (4)|  2.5 cycles/32b  6.5 cycles/32b  13-27 cyc/32b   16-30 cyc/32b
-  182MHz    |  2.33 Gb/s       0.896 Gb/s      14.3-6.9 Gb/s
-Ultra/64 (5)|  2.5 cycles/64b  10 cycles/64b   40-70 cyc/64b   46-76 cyc/64b
-  182MHz    |  4.66 Gb/s       1.16 Gb/s       18.6-11 Gb/s
-HalSPARC64  |  ?               ?               ?               ?
-------------+-----------------------------------------------------------------
-SGI/MIPS    |
-R3000      |   6 cycles/32b    9.25 cycles/32b 16 cycles/32b   16 cycles/32b
-  40MHz     |  0.21 Gb/s       0.14 Gb/s       2.56 Gb/s       2.56 Gb/s
-R4400/32    |  8.6 cycles/32b  10 cycles/32b   16-18           19-21
-  200MHz    |  0.74 Gb/s       0.64 Gb/s       13-11 Gb/s      11-9.6 Gb/s
-*R4400/64   |  8.6 cycles/64b  10 cycles/64b   22 cycles/64b   22 cycles/64b
-  *200MHz   |  1.48 Gb/s       1.28 Gb/s       37 Gb/s         37 Gb/s
-R4600/32    |  6 cycles/64b    9.25 cycles/32b 15 cycles/32b   19 cycles/32b
-  134MHz    |  0.71 Gb/s       0.46 Gb/s       9.1 Gb/s        7.2 Gb/s
-R4600/64    |  6 cycles/64b    9.25 cycles/64b ?               ?
-  134MHz    |  1.4 Gb/s        0.93 Gb/s       ?               ?
-R8000/64    |  3 cycles/64b    4.6 cycles/64b  8 cycles/64b    8 cycles/64b
-  75MHz            |   1.6 Gb/s        1.0 Gb/s        38 Gb/s         38 Gb/s
-*R10000/64  |  2 cycles/64b    3 cycles/64b    11 cycles/64b   11 cycles/64b
-  *200MHz   |  6.4 Gb/s        4.27 Gb/s       74 Gb/s         74 Gb/s
-  *250MHz   |  8.0 Gb/s        5.33 Gb/s       93 Gb/s         93 Gb/s
-------------+-----------------------------------------------------------------
-Motorola    |
-MC68020     |  ?               24 cycles/32b   62 cycles/32b   70 cycles/32b
-MC68040     |  ?               6 cycles/32b    24 cycles/32b   25 cycles/32b
-MC88100            |   >5 cycles/32b   4.6 cycles/32b  16/21 cyc/32b   p 18/23 cyc/32b
-MC88110  wt |  ?               3.75 cycles/32b 6 cycles/32b    8.5 cyc/32b
-*MC88110 wb |  ?               2.25 cycles/32b 4 cycles/32b    5 cycles/32b
-------------+-----------------------------------------------------------------
-HP/PA-RISC  |
-PA7000     |   4 cycles/32b    5 cycles/32b    9 cycles/32b    11 cycles/32b
-  67MHz            |   0.53 Gb/s       0.43 Gb/s       7.6 Gb/s        6.2 Gb/s
-PA7100     |   3.25 cycles/32b 4.25 cycles/32b 7 cycles/32b    8 cycles/32b
-  99MHz            |   0.97 Gb/s       0.75 Gb/s       14 Gb/s         12.8 Gb/s
-PA7100LC    |  ?               ?               ?               ?
-PA7200  (3) |  3 cycles/32b    4 cycles/32b    7 cycles/32b    6.5 cycles/32b
-  100MHz    |  1.07 Gb/s       0.80            14 Gb/s         15.8 Gb/s
-PA7300LC    |  ?               ?               ?               ?
-*PA8000            |   3 cycles/64b    4 cycles/64b    7 cycles/64b    6.5 cycles/64b
-  180MHz    |  3.84 Gb/s       2.88 Gb/s       105 Gb/s        113 Gb/s
-------------+-----------------------------------------------------------------
-Intel/x86   |
-386DX      |   20 cycles/32b   17 cycles/32b   41-70 cycl/32b  50-79 cycl/32b
-  16.7MHz   |  0.027 Gb/s      0.031 Gb/s      0.42-0.24 Gb/s  0.34-0.22 Gb/s
-486DX      |   ?               ?               ?               ?
-486DX4     |   9.5 cycles/32b  9.25 cycles/32b 17-23 cycl/32b  20-26 cycl/32b
-  100MHz    |  0.34 Gb/s       0.35 Gb/s       6.0-4.5 Gb/s    5.1-3.9 Gb/s
-Pentium     |  2/6 cycles/32b  2.5 cycles/32b  13 cycles/32b   14 cycles/32b
-  167MHz    |  2.7/0.89 Gb/s   2.1 Gb/s        13.1 Gb/s       12.2 Gb/s
-Pentium Pro |  2.5 cycles/32b  3.5 cycles/32b  6 cycles/32b    9 cycles/32b
-  200MHz    |  2.6 Gb/s        1.8 Gb/s        34 Gb/s         23 Gb/s
-------------+-----------------------------------------------------------------
-IBM/POWER   |
-RIOS 1     |   3 cycles/32b    4 cycles/32b    11.5-12.5 c/32b 14.5/15.5 c/32b
-RIOS 2     |   2 cycles/32b    2 cycles/32b    7 cycles/32b    8.5 cycles/32b
-------------+-----------------------------------------------------------------
-PowerPC            |
-PPC601  (1) |  3 cycles/32b    6 cycles/32b    11-16 cycl/32b  14-19 cycl/32b
-PPC601  (2) |  5 cycles/32b    6 cycles/32b    13-22 cycl/32b  16-25 cycl/32b
-  67MHz (2) |  0.43 Gb/s       0.36 Gb/s       5.3-3.0 Gb/s    4.3-2.7 Gb/s
-PPC603     |   ?               ?               ?               ?
-*PPC604            |   2               3               2               3
-  *167MHz   |                                                  57 Gb/s
-PPC620     |   ?               ?               ?               ?
-------------+-----------------------------------------------------------------
-Tege       |
-Model 1            |   2 cycles/64b    3 cycles/64b    2 cycles/64b    3 cycles/64b
-  250MHz    |  8 Gb/s          5.3 Gb/s        500 Gb/s        340 Gb/s
-  500MHz    |  16 Gb/s         11 Gb/s         1000 Gb/s       680 Gb/s
-____________|_________________________________________________________________
-(1) Using POWER and PowerPC instructions
-(2) Using only PowerPC instructions
-(3) Actual timing for shift/add/sub depends on code alignment.  PA7000 code
-    is smaller and therefore often faster on this CPU.
-(4) Multiplication routines modified for bogus UltraSPARC early-out
-    optimization.  Smaller operand is put in rs1, not rs2 as it should
-    according to the SPARC architecture manuals.
-(5) Preliminary timings, since there is no stable 64-bit environment.
-(6) Use mulu.d at least for mpn_lshift.  With mak/extu/or, we can only get
-    to 2 cycles/32b.
-
-=============================================================================
-Estimated theoretical asymptotic cycle counts for low-level routines:
-
-           |   mpn_lshift      mpn_add_n       mpn_mul_1       mpn_addmul_1
-           |   mpn_rshift      mpn_sub_n                       mpn_submul_1
-------------+-----------------------------------------------------------------
-DEC/Alpha   |
-EV4        |   3 cycles/64b    5 cycles/64b    42 cycles/64b   42 cycles/64b
-EV5        |   3 cycles/64b    4 cycles/64b    18 cycles/64b   18 cycles/64b
-------------+-----------------------------------------------------------------
-Sun/SPARC   |
-SuperSPARC  |  2.5 cycles/32b  2 cycles/32b    8 cycles/32b    9 cycles/32b
-------------+-----------------------------------------------------------------
-SGI/MIPS    |
-R4400/32    |  5 cycles/64b    8 cycles/64b    16 cycles/64b   16 cycles/64b
-R4400/64    |  5 cycles/64b    8 cycles/64b    22 cycles/64b   22 cycles/64b
-R4600      |
-------------+-----------------------------------------------------------------
-HP/PA-RISC  |
-PA7100     |   3 cycles/32b    4 cycles/32b    6.5 cycles/32b  7.5 cycles/32b
-PA7100LC    |
-------------+-----------------------------------------------------------------
-Motorola    |
-MC88110            |   1.5 cyc/32b (6) 1.5 cycle/32b   1.5 cycles/32b  2.25 cycles/32b
-------------+-----------------------------------------------------------------
-Intel/x86   |
-486DX4     |
-Pentium P5x |  5 cycles/32b    2 cycles/32b    11.5 cycles/32b 13 cycles/32b
-Pentium Pro |  2 cycles/32b    3 cycles/32b    4 cycles/32b    6 cycles/32b
-------------+-----------------------------------------------------------------
-IBM/POWER   |
-RIOS 1     |   3 cycles/32b    4 cycles/32b
-RIOS 2     |   1.5 cycles/32b  2 cycles/32b    4.5 cycles/32b  5.5 cycles/32b
-------------+-----------------------------------------------------------------
-PowerPC            |
-PPC601  (1) |  3 cycles/32b    ?4 cycles/32b
-PPC601  (2) |  4 cycles/32b    ?4 cycles/32b
-____________|_________________________________________________________________
index 2960d6e..08018f4 100644 (file)
@@ -1,6 +1,8 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -22,7 +24,7 @@
 # the same distribution terms that you use for the rest of that program.
 
 # Written by Per Bothner <bothner@cygnus.com>.
-# The master version of this file is at the FSF in /home/gd/gnu/lib.
+# Please send patches to <config-patches@gnu.org>.
 #
 # This script attempts to guess a canonical system name similar to
 # config.sub.  If it succeeds, it prints the system name on stdout, and
@@ -35,6 +37,7 @@
 # (but try to keep the structure clean).
 #
 
+
 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
 # (ghazi@noc.rutgers.edu 8/24/94.)
 if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
@@ -46,7 +49,145 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
-trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
+dummy=dummy-$$
+trap 'rm -f $dummy.c $dummy.o $dummy ${dummy}1.s ${dummy}2.c ; exit 1' 1 2 15
+
+# Use $HOST_CC if defined. $CC may point to a cross-compiler
+if test x"$CC_FOR_BUILD" = x; then
+  if test x"$HOST_CC" != x; then
+    CC_FOR_BUILD="$HOST_CC"
+  else
+    if test x"$CC" != x; then
+      CC_FOR_BUILD="$CC"
+    else
+      echo 'dummy(){}' >$dummy.c
+      for c in cc c89 gcc; do 
+         ($c $dummy.c -c) >/dev/null 2>&1
+         if test $? = 0; then
+             CC_FOR_BUILD="$c"; break
+         fi
+      done
+      rm -f $dummy.c $dummy.o
+      if test x"$CC_FOR_BUILD" = x; then
+       CC_FOR_BUILD=no_compiler_found
+      fi
+    fi
+  fi
+fi
+
+
+# First make a best effort at recognizing x86 CPU type and leave it in X86CPU.
+# If we fail, set X86CPU to UNAME_MACHINE
+#
+# DJGPP v2 (or 2.03 at least) always gives "pc" for uname -m, and the
+# OEM for uname -s.  Eg. pc:MS-DOS:6:2 on MS-DOS 6.21.  The list of
+# possible OEMs is in src/libc/dos/dos/getdos_v.c of djlsr203.zip, but
+# just pc:*:*:* seems ok.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+    i?86:*:*:* | i86pc:*:*:* | pc:*:*:*)
+       case "${UNAME_MACHINE}" in
+       i86pc | pc)  UNAME_MACHINE=i386 ;;
+       esac
+       cat <<EOF >${dummy}1.s
+       .globl cpuid
+       .globl _cpuid
+cpuid:
+_cpuid:
+       pushl %esi
+       pushl %ebx
+       movl 16(%esp),%eax
+       .byte 0x0f
+       .byte 0xa2
+       movl 12(%esp),%esi
+       movl %ebx,(%esi)
+       movl %edx,4(%esi)
+       movl %ecx,8(%esi)
+       popl %ebx
+       popl %esi
+       ret
+EOF
+       cat <<EOF >${dummy}2.c
+main ()
+{
+  char vendor_string[13];
+  char dummy_string[12];
+  long fms;
+  int family, model;
+  char *modelstr;
+
+  cpuid (vendor_string, 0);
+  vendor_string[12] = 0;
+
+  fms = cpuid (dummy_string, 1);
+
+  family = (fms >> 8) & 15;
+  model = (fms >> 4) & 15;
+
+  modelstr = "i486";
+  if (strcmp (vendor_string, "GenuineIntel") == 0)
+    {
+      switch (family)
+       {
+       case 5:
+         if (model <= 2)
+           modelstr = "pentium";
+         else if (model >= 4)
+           modelstr = "pentiummmx";
+         break;
+       case 6:
+         if (model == 1)
+           modelstr = "pentiumpro";
+         else if (model <= 6)
+           modelstr = "pentium2";
+         else
+           modelstr = "pentium3";
+         break;
+       }
+    }
+  else if (strcmp (vendor_string, "AuthenticAMD") == 0)
+    {
+      switch (family)
+       {
+       case 5:
+         if (model <= 3)
+           modelstr = "k5";
+         else if (model <= 7)
+           modelstr = "k6";
+         else if (model <= 8)
+           modelstr = "k62";
+         else if (model <= 9)
+           modelstr = "k63";
+         break;
+       case 6:
+         modelstr = "athlon";
+         break;
+       }
+    }
+  else if (strcmp (vendor_string, "CyrixInstead") == 0)
+    {
+      /* Should recognize Cyrix' processors too.  */
+    }
+
+  printf ("%s\n", modelstr);
+  return 0;
+}
+EOF
+       $CC_FOR_BUILD ${dummy}1.s ${dummy}2.c -o $dummy >/dev/null 2>&1
+       if test "$?" = 0 ; then
+         X86CPU=`./$dummy`
+       fi
+
+
+       # Default to believing uname -m if the program fails to compile or
+       # run.  Will fail to run on 386 since cpuid was only added on 486.
+       if test -z "$X86CPU"
+       then
+           X86CPU="$UNAME_MACHINE"
+       fi
+       rm -f ${dummy}1.s ${dummy}2.c $dummy
+  ;;
+esac
 
 # Note: order is significant - the case branches are not exclusive.
 
@@ -59,7 +200,59 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        # A Tn.n version is a released field test version.
        # A Xn.n version is an unreleased experimental baselevel.
        # 1.2 uses "1.2" for uname -r.
-       cat <<EOF >dummy.s
+       cat <<EOF >$dummy.s
+       .data
+\$Lformat:
+       .byte 37,100,45,37,120,10,0     # "%d-%x\n"
+
+       .text
+       .globl main
+       .align 4
+       .ent main
+main:
+       .frame \$30,16,\$26,0
+       ldgp \$29,0(\$27)
+       .prologue 1
+       .long 0x47e03d80 # implver \$0
+       lda \$2,-1
+       .long 0x47e20c21 # amask \$2,\$1
+       lda \$16,\$Lformat
+       mov \$0,\$17
+       not \$1,\$18
+       jsr \$26,printf
+       ldgp \$29,0(\$26)
+       mov 0,\$16
+       jsr \$26,exit
+       .end main
+EOF
+       $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
+       if test "$?" = 0 ; then
+               case `./$dummy` in
+                       0-0)
+                               UNAME_MACHINE="alpha"
+                               ;;
+                       1-0)
+                               UNAME_MACHINE="alphaev5"
+                               ;;
+                       1-1)
+                               UNAME_MACHINE="alphaev56"
+                               ;;
+                       1-101)
+                               UNAME_MACHINE="alphapca56"
+                               ;;
+                       2-303)
+                               UNAME_MACHINE="alphaev6"
+                               ;;
+                       2-307)
+                               UNAME_MACHINE="alphaev67"
+                               ;;
+               esac
+       fi
+       rm -f $dummy.s $dummy
+       echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+       exit 0 ;;
+    alpha:NetBSD:*:* | alpha:FreeBSD:*:*)
+       cat <<EOF >$dummy.s
        .globl main
        .ent main
 main:
@@ -76,9 +269,9 @@ main:
        ret \$31,(\$26),1
        .end main
 EOF
-       ${CC-cc} dummy.s -o dummy 2>/dev/null
+       $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
        if test "$?" = 0 ; then
-               ./dummy
+               ./$dummy
                case "$?" in
                        7)
                                UNAME_MACHINE="alpha"
@@ -97,8 +290,14 @@ EOF
                                ;;
                esac
        fi
-       rm -f dummy.s dummy
-       echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]`
+       rm -f $dummy.s $dummy
+       echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM}${UNAME_RELEASE} | sed -e 's/^[VTX]//' -e 's/[-(].*//' | tr [[A-Z]] [[a-z]]`
+       exit 0 ;;
+    Alpha\ *:Windows_NT*:*)
+       # How do we know it's Interix rather than the generic POSIX subsystem?
+       # Should we change UNAME_MACHINE based on the output of uname instead
+       # of the specific Alpha model?
+       echo alpha-pc-interix
        exit 0 ;;
     21064:Windows_NT:50:3)
        echo alpha-dec-winnt3.5
@@ -133,6 +332,9 @@ EOF
     wgrisc:OpenBSD:*:*)
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
        exit 0 ;;
+    *:OS/390:*:*)
+       echo i370-ibm-openedition
+       exit 0 ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
        echo arm-acorn-riscix${UNAME_RELEASE}
        exit 0;;
@@ -142,7 +344,7 @@ EOF
     SR2?01:HI-UX/MPP:*:*)
        echo hppa1.1-hitachi-hiuxmpp
        exit 0;;
-    Pyramid*:OSx*:*:*|MIS*:OSx*:*:*|MIS*:SMP_DC-OSx*:*:*)
+    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
        # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
        if test "`(/bin/universe) 2>/dev/null`" = att ; then
                echo pyramid-pyramid-sysv3
@@ -150,23 +352,32 @@ EOF
                echo pyramid-pyramid-bsd
        fi
        exit 0 ;;
-    NILE:*:*:dcosx)
+    NILE*:*:*:dcosx)
        echo pyramid-pyramid-svr4
        exit 0 ;;
     sun4H:SunOS:5.*:*)
        echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
        exit 0 ;;
+    sun4[md]:SunOS:5.*:*)
+       echo sparcv8-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit 0 ;;
+    sun4u:SunOS:5.*:*)
+       echo sparcv9-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit 0 ;;
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
        echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
        exit 0 ;;
-    i86pc:SunOS:5.*:*)
-       echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+    i386:SunOS:5.*:*)
+       echo ${X86CPU}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
        exit 0 ;;
-    sun4*:SunOS:6*:*)
-       # According to config.sub, this is the proper way to canonicalize
-       # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
-       # it's likely to be more like Solaris than SunOS4.
-       echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+    sun4[md]:SunOS:*:*)
+       case "`/usr/bin/arch -k`" in
+           Series*|S4*)
+               UNAME_RELEASE=`uname -v`
+               ;;
+       esac
+       # Japanese Language versions have a version number like `4.1.3-JL'.
+       echo sparcv8-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
        exit 0 ;;
     sun4*:SunOS:*:*)
        case "`/usr/bin/arch -k`" in
@@ -201,6 +412,32 @@ EOF
     atari*:OpenBSD:*:*)
        echo m68k-unknown-openbsd${UNAME_RELEASE}
        exit 0 ;;
+    # The situation for MiNT is a little confusing.  The machine name
+    # can be virtually everything (everything which is not
+    # "atarist" or "atariste" at least should have a processor
+    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
+    # to the lowercase version "mint" (or "freemint").  Finally
+    # the system name "TOS" denotes a system which is actually not
+    # MiNT.  But MiNT is downward compatible to TOS, so this should
+    # be no problem.
+    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+       exit 0 ;;
+    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+       echo m68k-atari-mint${UNAME_RELEASE}
+        exit 0 ;;
+    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+       exit 0 ;;
+    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+        echo m68k-milan-mint${UNAME_RELEASE}
+        exit 0 ;;
+    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+        echo m68k-hades-mint${UNAME_RELEASE}
+        exit 0 ;;
+    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+        echo m68k-unknown-mint${UNAME_RELEASE}
+        exit 0 ;;
     sun3*:NetBSD:*:*)
        echo m68k-sun-netbsd${UNAME_RELEASE}
        exit 0 ;;
@@ -213,6 +450,9 @@ EOF
     mac68k:OpenBSD:*:*)
        echo m68k-unknown-openbsd${UNAME_RELEASE}
        exit 0 ;;
+    macppc:NetBSD:*:*)
+       echo powerpc-apple-netbsd${UNAME_RELEASE}
+       exit 0 ;;
     mvme68k:OpenBSD:*:*)
        echo m68k-unknown-openbsd${UNAME_RELEASE}
        exit 0 ;;
@@ -222,9 +462,6 @@ EOF
     powerpc:machten:*:*)
        echo powerpc-apple-machten${UNAME_RELEASE}
        exit 0 ;;
-    macppc:NetBSD:*:*)
-        echo powerpc-apple-netbsd${UNAME_RELEASE}
-        exit 0 ;;
     RISC*:Mach:*:*)
        echo mips-dec-mach_bsd4.3
        exit 0 ;;
@@ -234,12 +471,17 @@ EOF
     VAX*:ULTRIX*:*:*)
        echo vax-dec-ultrix${UNAME_RELEASE}
        exit 0 ;;
-    2020:CLIX:*:*)
+    2020:CLIX:*:* | 2430:CLIX:*:*)
        echo clipper-intergraph-clix${UNAME_RELEASE}
        exit 0 ;;
     mips:*:*:UMIPS | mips:*:*:RISCos)
-       sed 's/^        //' << EOF >dummy.c
-       int main (argc, argv) int argc; char **argv; {
+       sed 's/^        //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h>  /* for printf() prototype */
+       int main (int argc, char *argv[]) {
+#else
+       int main (argc, argv) int argc; char *argv[]; {
+#endif
        #if defined (host_mips) && defined (MIPSEB)
        #if defined (SYSTYPE_SYSV)
          printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
@@ -254,10 +496,10 @@ EOF
          exit (-1);
        }
 EOF
-       ${CC-cc} dummy.c -o dummy \
-         && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
-         && rm dummy.c dummy && exit 0
-       rm -f dummy.c dummy
+       $CC_FOR_BUILD $dummy.c -o $dummy \
+         && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+         && rm $dummy.c $dummy && exit 0
+       rm -f $dummy.c $dummy
        echo mips-mips-riscos${UNAME_RELEASE}
        exit 0 ;;
     Night_Hawk:Power_UNIX:*:*)
@@ -275,15 +517,18 @@ EOF
     AViiON:dgux:*:*)
         # DG/UX returns AViiON for all architectures
         UNAME_PROCESSOR=`/usr/bin/uname -p`
-        if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
-       if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
-            -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
+       if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+       then
+           if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+              [ ${TARGET_BINARY_INTERFACE}x = x ]
+           then
                echo m88k-dg-dgux${UNAME_RELEASE}
-       else
+           else
                echo m88k-dg-dguxbcs${UNAME_RELEASE}
+           fi
+       else
+           echo i586-dg-dgux${UNAME_RELEASE}
        fi
-        else echo i586-dg-dgux${UNAME_RELEASE}
-        fi
        exit 0 ;;
     M88*:DolphinOS:*:*)        # DolphinOS (SVR3)
        echo m88k-dolphin-sysv3
@@ -309,7 +554,7 @@ EOF
        exit 0 ;;
     *:AIX:2:3)
        if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
-               sed 's/^                //' << EOF >dummy.c
+               sed 's/^                //' << EOF >$dummy.c
                #include <sys/systemcfg.h>
 
                main()
@@ -320,8 +565,8 @@ EOF
                        exit(0);
                        }
 EOF
-               ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
-               rm -f dummy.c dummy
+               $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
+               rm -f $dummy.c $dummy
                echo rs6000-ibm-aix3.2.5
        elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
                echo rs6000-ibm-aix3.2.4
@@ -330,12 +575,27 @@ EOF
        fi
        exit 0 ;;
     *:AIX:*:4)
-       IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
-       if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then
-               IBM_ARCH=rs6000
-       else
-               IBM_ARCH=powerpc
-       fi
+       sed 's/^        //' << EOF >$dummy.c
+       #include <stdio.h>
+       #include <sys/systemcfg.h>
+       main ()
+       {
+         if (_system_configuration.architecture == POWER_RS
+             || _system_configuration.implementation == POWER_601)
+           puts ("power");
+         else
+           {
+             if (_system_configuration.width == 64)
+               puts ("powerpc64");
+             else
+               puts ("powerpc");
+           }
+         exit (0);
+       }
+EOF
+       $CC_FOR_BUILD $dummy.c -o $dummy
+       IBM_ARCH=`./$dummy`
+       rm -f $dummy.c $dummy
        if [ -x /usr/bin/oslevel ] ; then
                IBM_REV=`/usr/bin/oslevel`
        else
@@ -349,7 +609,7 @@ EOF
     ibmrt:4.4BSD:*|romp-ibm:BSD:*)
        echo romp-ibm-bsd4.4
        exit 0 ;;
-    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC NetBSD and
+    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
        echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
        exit 0 ;;                           # report: romp-ibm BSD 4.3
     *:BOSX:*:*)
@@ -368,25 +628,27 @@ EOF
        case "${UNAME_MACHINE}" in
            9000/31? )            HP_ARCH=m68000 ;;
            9000/[34]?? )         HP_ARCH=m68k ;;
-           9000/6?? | 9000/7?? | 9000/80[24] | 9000/8?[13679] | 9000/892 )
-              sed 's/^              //' << EOF >dummy.c
+           9000/[678][0-9][0-9])
+              sed 's/^              //' << EOF >$dummy.c
+
+              #define _HPUX_SOURCE
               #include <stdlib.h>
               #include <unistd.h>
-              
+
               int main ()
               {
               #if defined(_SC_KERNEL_BITS)
                   long bits = sysconf(_SC_KERNEL_BITS);
-              #endif 
+              #endif
                   long cpu  = sysconf (_SC_CPU_VERSION);
-              
-                  switch (cpu) 
+
+                  switch (cpu)
                {
                case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
                case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
-               case CPU_PA_RISC2_0: 
+               case CPU_PA_RISC2_0:
               #if defined(_SC_KERNEL_BITS)
-                   switch (bits) 
+                   switch (bits)
                        {
                        case 64: puts ("hppa2.0w"); break;
                        case 32: puts ("hppa2.0n"); break;
@@ -394,20 +656,20 @@ EOF
                        } break;
               #else  /* !defined(_SC_KERNEL_BITS) */
                    puts ("hppa2.0"); break;
-              #endif 
+              #endif
                default: puts ("hppa1.0"); break;
                }
                   exit (0);
               }
 EOF
-       (${CC-cc} dummy.c -o dummy 2>/dev/null ) && HP_ARCH=`./dummy`
-       rm -f dummy.c dummy
+       (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
+       rm -f $dummy.c $dummy
        esac
        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
        echo ${HP_ARCH}-hp-hpux${HPUX_REV}
        exit 0 ;;
     3050*:HI-UX:*:*)
-       sed 's/^        //' << EOF >dummy.c
+       sed 's/^        //' << EOF >$dummy.c
        #include <unistd.h>
        int
        main ()
@@ -432,8 +694,8 @@ EOF
          exit (0);
        }
 EOF
-       ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
-       rm -f dummy.c dummy
+       $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
+       rm -f $dummy.c $dummy
        echo unknown-hitachi-hiuxwe2
        exit 0 ;;
     9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
@@ -442,6 +704,9 @@ EOF
     9000/8??:4.3bsd:*:*)
        echo hppa1.0-hp-bsd
        exit 0 ;;
+    *9??*:MPE/iX:*:*)
+       echo hppa1.0-hp-mpeix
+       exit 0 ;;
     hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
        echo hppa1.1-hp-osf
        exit 0 ;;
@@ -458,6 +723,9 @@ EOF
     parisc*:Lites*:*:*)
        echo hppa1.1-hp-lites
        exit 0 ;;
+    hppa*:OpenBSD:*:*)
+       echo hppa-unknown-openbsd
+       exit 0 ;;
     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
        echo c1-convex-bsd
         exit 0 ;;
@@ -488,13 +756,22 @@ EOF
              -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
        exit 0 ;;
     CRAY*TS:*:*:*)
-       echo t90-cray-unicos${UNAME_RELEASE}
+       echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       exit 0 ;;
+    CRAY*T3D:*:*:*)
+       echo alpha-cray-unicos
+       exit 0 ;;
+    CRAY*T3E:*:*:*)
+       echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       exit 0 ;;
+    CRAY*SV1:*:*:*)
+       echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
        exit 0 ;;
     CRAY-2:*:*:*)
        echo cray2-cray-unicos
         exit 0 ;;
     F300:UNIX_System_V:*:*)
-        FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
         FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
         echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
         exit 0 ;;
@@ -507,27 +784,48 @@ EOF
     hp300:OpenBSD:*:*)
        echo m68k-unknown-openbsd${UNAME_RELEASE}
        exit 0 ;;
+    i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+       echo ${X86CPU}-pc-bsdi${UNAME_RELEASE}
+       exit 0 ;;
     sparc*:BSD/OS:*:*)
        echo sparc-unknown-bsdi${UNAME_RELEASE}
        exit 0 ;;
-    i?86:BSD/386:*:* | *:BSD/OS:*:*)
-       echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+    *:BSD/OS:*:*)
+       echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+       exit 0 ;;
+    i386:FreeBSD:*:*)
+       echo ${X86CPU}-pc-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
        exit 0 ;;
     *:FreeBSD:*:*)
        echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
        exit 0 ;;
+    i386:NetBSD:*:*)
+       echo ${X86CPU}-pc-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+       exit 0 ;;
     *:NetBSD:*:*)
        echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
        exit 0 ;;
+    i386:OpenBSD:*:*)
+       echo ${X86CPU}-pc-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+       exit 0 ;;
     *:OpenBSD:*:*)
        echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
        exit 0 ;;
     i*:CYGWIN*:*)
-       echo ${UNAME_MACHINE}-pc-cygwin
+       echo ${X86CPU}-pc-cygwin
        exit 0 ;;
     i*:MINGW*:*)
        echo ${UNAME_MACHINE}-pc-mingw32
        exit 0 ;;
+    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+       # How do we know it's Interix rather than the generic POSIX subsystem?
+       # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+       # UNAME_MACHINE based on the output of uname instead of i386?
+       echo i386-pc-interix
+       exit 0 ;;
+    i*:UWIN*:*)
+       echo ${UNAME_MACHINE}-pc-uwin
+       exit 0 ;;
     p*:CYGWIN*:*)
        echo powerpcle-unknown-cygwin
        exit 0 ;;
@@ -538,15 +836,11 @@ EOF
        echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
        exit 0 ;;
     *:Linux:*:*)
-       # uname on the ARM produces all sorts of strangeness, and we need to
-       # filter it out.
-       case "$UNAME_MACHINE" in
-         arm* | sa110*)              UNAME_MACHINE="arm" ;;
-       esac
 
        # The BFD linker knows what the default object file format is, so
-       # first see if it will tell us.
-       ld_help_string=`ld --help 2>&1`
+       # first see if it will tell us. cd to the root directory to prevent
+       # problems with other programs or directories called `ld' in the path.
+       ld_help_string=`cd /; ld --help 2>&1`
        ld_supported_emulations=`echo $ld_help_string \
                         | sed -ne '/supported emulations:/!d
                                    s/[         ][      ]*/ /g
@@ -554,68 +848,138 @@ EOF
                                    s/ .*//
                                    p'`
         case "$ld_supported_emulations" in
-         i?86linux)  echo "${UNAME_MACHINE}-pc-linux-gnuaout"      ; exit 0 ;;
-         i?86coff)   echo "${UNAME_MACHINE}-pc-linux-gnucoff"      ; exit 0 ;;
-         sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
-         armlinux)   echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
-         m68klinux)  echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
-         elf32ppc)   echo "powerpc-unknown-linux-gnu"              ; exit 0 ;;
+         *ia64)
+               echo "${UNAME_MACHINE}-unknown-linux"
+               exit 0
+               ;;
+         i?86linux)
+               echo "${X86CPU}-pc-linux-gnuaout"
+               exit 0
+               ;;
+         i?86coff)
+               echo "${X86CPU}-pc-linux-gnucoff"
+               exit 0
+               ;;
+         sparclinux)
+               echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
+               exit 0
+               ;;
+         armlinux)
+               echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
+               exit 0
+               ;;
+         elf32arm*)
+               echo "${UNAME_MACHINE}-unknown-linux-gnuoldld"
+               exit 0
+               ;;
+         armelf_linux*)
+               echo "${UNAME_MACHINE}-unknown-linux-gnu"
+               exit 0
+               ;;
+         m68klinux)
+               echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
+               exit 0
+               ;;
+         elf32ppc | elf32ppclinux)
+               # Determine Lib Version
+               cat >$dummy.c <<EOF
+#include <features.h>
+#if defined(__GLIBC__)
+extern char __libc_version[];
+extern char __libc_release[];
+#endif
+main(argc, argv)
+     int argc;
+     char *argv[];
+{
+#if defined(__GLIBC__)
+  printf("%s %s\n", __libc_version, __libc_release);
+#else
+  printf("unkown\n");
+#endif
+  return 0;
+}
+EOF
+               LIBC=""
+               $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
+               if test "$?" = 0 ; then
+                       ./$dummy | grep 1\.99 > /dev/null
+                       if test "$?" = 0 ; then
+                               LIBC="libc1"
+                       fi
+               fi
+               rm -f $dummy.c $dummy
+               echo powerpc-unknown-linux-gnu${LIBC}
+               exit 0
+               ;;
        esac
 
        if test "${UNAME_MACHINE}" = "alpha" ; then
-               sed 's/^        //'  <<EOF >dummy.s
-               .globl main
-               .ent main
-       main:
-               .frame \$30,0,\$26,0
-               .prologue 0
-               .long 0x47e03d80 # implver $0
-               lda \$2,259
-               .long 0x47e20c21 # amask $2,$1
-               srl \$1,8,\$2
-               sll \$2,2,\$2
-               sll \$0,3,\$0
-               addl \$1,\$0,\$0
-               addl \$2,\$0,\$0
-               ret \$31,(\$26),1
-               .end main
+               cat <<EOF >$dummy.s
+                       .data
+               \$Lformat:
+                       .byte 37,100,45,37,120,10,0     # "%d-%x\n"
+
+                       .text
+                       .globl main
+                       .align 4
+                       .ent main
+               main:
+                       .frame \$30,16,\$26,0
+                       ldgp \$29,0(\$27)
+                       .prologue 1
+                       .long 0x47e03d80 # implver \$0
+                       lda \$2,-1
+                       .long 0x47e20c21 # amask \$2,\$1
+                       lda \$16,\$Lformat
+                       mov \$0,\$17
+                       not \$1,\$18
+                       jsr \$26,printf
+                       ldgp \$29,0(\$26)
+                       mov 0,\$16
+                       jsr \$26,exit
+                       .end main
 EOF
                LIBC=""
-               ${CC-cc} dummy.s -o dummy 2>/dev/null
+               $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
                if test "$?" = 0 ; then
-                       ./dummy
-                       case "$?" in
-                       7)
+                       case `./$dummy` in
+                       0-0)
                                UNAME_MACHINE="alpha"
                                ;;
-                       15)
+                       1-0)
                                UNAME_MACHINE="alphaev5"
                                ;;
-                       14)
+                       1-1)
                                UNAME_MACHINE="alphaev56"
                                ;;
-                       10)
+                       1-101)
                                UNAME_MACHINE="alphapca56"
                                ;;
-                       16)
+                       2-303)
                                UNAME_MACHINE="alphaev6"
                                ;;
-                       esac    
+                       2-307)
+                               UNAME_MACHINE="alphaev67"
+                               ;;
+                       esac
 
-                       objdump --private-headers dummy | \
+                       objdump --private-headers $dummy | \
                          grep ld.so.1 > /dev/null
                        if test "$?" = 0 ; then
                                LIBC="libc1"
                        fi
-               fi      
-               rm -f dummy.s dummy
+               fi
+               rm -f $dummy.s $dummy
                echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
        elif test "${UNAME_MACHINE}" = "mips" ; then
-         cat >dummy.c <<EOF
-main(argc, argv)
-     int argc;
-     char *argv[];
-{
+         cat >$dummy.c <<EOF
+#ifdef __cplusplus
+#include <stdio.h>  /* for printf() prototype */
+       int main (int argc, char *argv[]) {
+#else
+       int main (argc, argv) int argc; char *argv[]; {
+#endif
 #ifdef __MIPSEB__
   printf ("%s-unknown-linux-gnu\n", argv[1]);
 #endif
@@ -625,8 +989,10 @@ main(argc, argv)
   return 0;
 }
 EOF
-         ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
-         rm -f dummy.c dummy
+         $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
+         rm -f $dummy.c $dummy
+       elif test "${UNAME_MACHINE}" = "s390"; then
+         echo s390-ibm-linux && exit 0
        else
          # Either a pre-BFD a.out linker (linux-gnuoldld)
          # or one that does not give us useful --help.
@@ -634,23 +1000,26 @@ EOF
          # If ld does not provide *any* "supported emulations:"
          # that means it is gnuoldld.
          echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
-         test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
+         test $? != 0 && echo "${X86CPU}-pc-linux-gnuoldld" && exit 0
 
          case "${UNAME_MACHINE}" in
          i?86)
            VENDOR=pc;
+           UNAME_MACHINE=${X86CPU}
            ;;
          *)
            VENDOR=unknown;
            ;;
          esac
          # Determine whether the default compiler is a.out or elf
-         cat >dummy.c <<EOF
+         cat >$dummy.c <<EOF
 #include <features.h>
-main(argc, argv)
-     int argc;
-     char *argv[];
-{
+#ifdef __cplusplus
+#include <stdio.h>  /* for printf() prototype */
+       int main (int argc, char *argv[]) {
+#else
+       int main (argc, argv) int argc; char *argv[]; {
+#endif
 #ifdef __ELF__
 # ifdef __GLIBC__
 #  if __GLIBC__ >= 2
@@ -667,8 +1036,8 @@ main(argc, argv)
   return 0;
 }
 EOF
-         ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
-         rm -f dummy.c dummy
+         $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
+         rm -f $dummy.c $dummy
        fi ;;
 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.  earlier versions
 # are messed up and put the nodename in both sysname and nodename.
@@ -681,37 +1050,48 @@ EOF
         # I am not positive that other SVR4 systems won't match this,
        # I just have to hope.  -- rms.
         # Use sysv4.2uw... so that sysv4* matches it.
-       echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+       echo ${X86CPU}-pc-sysv4.2uw${UNAME_VERSION}
        exit 0 ;;
     i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
+       UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
        if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
-               echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
+               echo ${X86CPU}-univel-sysv${UNAME_REL}
+       else
+               echo ${X86CPU}-pc-sysv${UNAME_REL}
+       fi
+       exit 0 ;;
+    i?86:*:5:7*)
+        # Fixed at (any) Pentium or better
+        UNAME_MACHINE=i586
+        if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then
+           echo ${X86CPU}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION}
        else
-               echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
+           echo ${X86CPU}-pc-sysv${UNAME_RELEASE}
        fi
        exit 0 ;;
     i?86:*:3.2:*)
        if test -f /usr/options/cb.name; then
                UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
-               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+               echo ${X86CPU}-pc-isc$UNAME_REL
        elif /bin/uname -X 2>/dev/null >/dev/null ; then
                UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
                (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
                (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
                        && UNAME_MACHINE=i586
-               echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+               (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
+                       && UNAME_MACHINE=i686
+               (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
+                       && UNAME_MACHINE=i686
+               echo ${X86CPU}-pc-sco$UNAME_REL
        else
-               echo ${UNAME_MACHINE}-pc-sysv32
+               echo ${X86CPU}-pc-sysv32
        fi
        exit 0 ;;
-    i?86:UnixWare:*:*)
-       if /bin/uname -X 2>/dev/null >/dev/null ; then
-         (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
-           && UNAME_MACHINE=i586
-       fi
-       echo ${UNAME_MACHINE}-unixware-${UNAME_RELEASE}-${UNAME_VERSION}
+    i?86:*DOS:*:*)
+       echo ${X86CPU}-pc-msdosdjgpp
        exit 0 ;;
     pc:*:*:*)
+       # Left here for compatibility:
         # uname -m prints for DJGPP always 'pc', but it prints nothing about
         # the processor, so we play safe by assuming i386.
        echo i386-pc-msdosdjgpp
@@ -752,7 +1132,7 @@ EOF
     mc68030:UNIX_System_V:4.*:*)
        echo m68k-atari-sysv4
        exit 0 ;;
-    i?86:LynxOS:2.*:*)
+    i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*)
        echo i386-unknown-lynxos${UNAME_RELEASE}
        exit 0 ;;
     TSUNAMI:LynxOS:2.*:*)
@@ -764,6 +1144,9 @@ EOF
     SM[BE]S:UNIX_SV:*:*)
        echo mips-dde-sysv${UNAME_RELEASE}
        exit 0 ;;
+    RM*:ReliantUNIX-*:*:*)
+       echo mips-sni-sysv4
+       exit 0 ;;
     RM*:SINIX-*:*:*)
        echo mips-sni-sysv4
        exit 0 ;;
@@ -794,7 +1177,7 @@ EOF
     news*:NEWS-OS:*:6*)
        echo mips-sony-newsos6
        exit 0 ;;
-    R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*)
+    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
        if [ -d /usr/nec ]; then
                echo mips-nec-sysv${UNAME_RELEASE}
        else
@@ -810,12 +1193,48 @@ EOF
     BePC:BeOS:*:*)     # BeOS running on Intel PC compatible.
        echo i586-pc-beos
        exit 0 ;;
+    SX-4:SUPER-UX:*:*)
+       echo sx4-nec-superux${UNAME_RELEASE}
+       exit 0 ;;
+    SX-5:SUPER-UX:*:*)
+       echo sx5-nec-superux${UNAME_RELEASE}
+       exit 0 ;;
+    Power*:Rhapsody:*:*)
+       echo powerpc-apple-rhapsody${UNAME_RELEASE}
+       exit 0 ;;
+    *:Rhapsody:*:*)
+       echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+       exit 0 ;;
+    Power*:Mac*OS:*:*)
+       echo powerpc-apple-macos${UNAME_RELEASE}
+       exit 0 ;;
+    *:Mac*OS:*:*)
+       echo ${UNAME_MACHINE}-apple-macos${UNAME_RELEASE}
+       exit 0 ;;
+    *:Darwin:*:*)
+       echo `uname -p`-apple-darwin${UNAME_RELEASE}
+       exit 0 ;;
+    *:procnto*:*:* | *:QNX:[0123456789]*:*)
+       if test "${UNAME_MACHINE}" = "x86pc"; then
+               UNAME_MACHINE=pc
+       fi
+       echo `uname -p`-${UNAME_MACHINE}-nto-qnx
+       exit 0 ;;
+    *:QNX:*:4*)
+       echo i386-pc-qnx
+       exit 0 ;;
+    NSR-W:NONSTOP_KERNEL:*:*)
+       echo nsr-tandem-nsk${UNAME_RELEASE}
+       exit 0 ;;
+    BS2000:POSIX*:*:*)
+       echo bs2000-siemens-sysv
+       exit 0 ;;
 esac
 
 #echo '(No uname command or uname output not recognized.)' 1>&2
 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
 
-cat >dummy.c <<EOF
+cat >$dummy.c <<EOF
 #ifdef _SEQUENT_
 # include <sys/types.h>
 # include <sys/utsname.h>
@@ -853,7 +1272,10 @@ main ()
 #endif
   int version;
   version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
-  printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+  if (version < 4)
+    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+  else
+    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
   exit (0);
 #endif
 
@@ -913,8 +1335,8 @@ main ()
 }
 EOF
 
-${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
-rm -f dummy.c dummy
+$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
+rm -f $dummy.c $dummy
 
 # Apollos put the system type in the environment.
 
index 00bea6e..c4123f2 100644 (file)
@@ -1,6 +1,8 @@
 #! /bin/sh
 # Configuration validation subroutine script, version 1.1.
-#   Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+#   Free Software Foundation, Inc.
+#
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
 # can handle that machine.  It does not imply ALL GNU software can.
@@ -25,6 +27,9 @@
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
+# Written by Per Bothner <bothner@cygnus.com>.
+# Please send patches to <config-patches@gnu.org>.
+#
 # Configuration subroutine to validate and canonicalize a configuration type.
 # Supply the specified configuration type as an argument.
 # If it is invalid, we print an error message on stderr and exit with code 1.
@@ -68,7 +73,7 @@ esac
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
-  linux-gnu*)
+  nto-qnx* | linux-gnu*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
@@ -98,11 +103,21 @@ case $os in
                os=
                basic_machine=$1
                ;;
+       -sim | -cisco | -oki | -wec | -winbond)
+               os=
+               basic_machine=$1
+               ;;
+       -scout)
+               ;;
+       -wrs)
+               os=-vxworks
+               basic_machine=$1
+               ;;
        -hiux*)
                os=-hiuxwe2
                ;;
        -sco5)
-               os=sco3.2v5
+               os=-sco3.2v5
                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
                ;;
        -sco4)
@@ -121,6 +136,9 @@ case $os in
                os=-sco3.2v2
                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
                ;;
+       -udk*)
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
        -isc)
                os=-isc2.2
                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -143,26 +161,40 @@ case $os in
        -psos*)
                os=-psos
                ;;
+       -mint | -mint[0-9]*)
+               basic_machine=m68k-atari
+               os=-mint
+               ;;
 esac
 
 # Decode aliases for certain CPU-COMPANY combinations.
 case $basic_machine in
        # Recognize the basic CPU types without company name.
        # Some are omitted here because they have special meanings below.
-       tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
+       tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
                | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
-               | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 | hppa2.0 \
-               | alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \
-               | i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \
-               | mips64 | mipsel | mips64el | mips64orion | mips64orionel \
-               | mipstx39 | mipstx39el \
-               | sparc | sparclet | sparclite | sparc64 | v850)
+               | 580 | i960 | h8300 \
+               | x86 | ppcbe | mipsbe | mipsle | shbe | shle | armbe | armle \
+               | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
+               | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \
+               | alphaev6[78] \
+               | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
+               | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
+               | mips64orion | mips64orionel | mipstx39 | mipstx39el \
+               | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
+               | mips64vr5000 | miprs64vr5000el | mcore \
+               | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
+               | powerpc64 | sparcv8 | supersparc | microsparc | ultrasparc \
+               | thumb | d10v | fr30 | avr)
                basic_machine=$basic_machine-unknown
                ;;
+       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl)
+               ;;
+
        # We use `pc' rather than `unknown'
        # because (1) that's what they normally are, and
        # (2) the word "unknown" tends to confuse beginning users.
-       i[34567]86)
+       i[34567]86 | pentium[23] | k[56] | k6[23] | athlon)
          basic_machine=$basic_machine-pc
          ;;
        # Object if more than one company name word.
@@ -171,18 +203,27 @@ case $basic_machine in
                exit 1
                ;;
        # Recognize the basic CPU types with company name.
-       vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \
+       vax-* | tahoe-* | i[34567]86-* | pentium[23]-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
              | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
              | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
-             | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
-             | xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* \
-             | alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \
-             | ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \
+             | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
+             | xmp-* | ymp-* \
+             | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* | armbe-* | armle-* \
+             | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
+             | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \
+             | alphaev6[78]-* \
+             | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
+             | clipper-* | orion-* \
              | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
-             | sparc64-* | mips64-* | mipsel-* \
-             | mips64el-* | mips64orion-* | mips64orionel-*  \
-             | mipstx39-* | mipstx39el-* \
-             | f301-*)
+             | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
+             | mips64el-* | mips64orion-* | mips64orionel-* \
+             | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
+             | mipstx39-* | mipstx39el-* | mcore-* \
+             | f301-* | armv*-* | s390-* | sv1-* | t3e-* \
+             | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
+             | k[56]-* | k6[23]-* | athlon-* | powerpc64-* \
+             | sparcv8-* | supersparc-* | microsparc-* | ultrasparc-* \
+             | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* )
                ;;
        # Recognize the various machine names and aliases which stand
        # for a CPU type and a company and sometimes even an OS.
@@ -192,6 +233,14 @@ case $basic_machine in
        3b*)
                basic_machine=we32k-att
                ;;
+       a29khif)
+               basic_machine=a29k-amd
+               os=-udi
+               ;;
+       adobe68k)
+               basic_machine=m68010-adobe
+               os=-scout
+               ;;
        alliant | fx80)
                basic_machine=fx80-alliant
                ;;
@@ -221,6 +270,10 @@ case $basic_machine in
                basic_machine=m68k-apollo
                os=-sysv
                ;;
+       apollo68bsd)
+               basic_machine=m68k-apollo
+               os=-bsd
+               ;;
        aux)
                basic_machine=m68k-apple
                os=-aux
@@ -297,6 +350,10 @@ case $basic_machine in
        encore | umax | mmax)
                basic_machine=ns32k-encore
                ;;
+       es1800 | OSE68k | ose68k | ose | OSE)
+               basic_machine=m68k-ericsson
+               os=-ose
+               ;;
        fx2800)
                basic_machine=i860-alliant
                ;;
@@ -315,6 +372,14 @@ case $basic_machine in
                basic_machine=h8300-hitachi
                os=-hms
                ;;
+       h8300xray)
+               basic_machine=h8300-hitachi
+               os=-xray
+               ;;
+       h8500hms)
+               basic_machine=h8500-hitachi
+               os=-hms
+               ;;
        harris)
                basic_machine=m88k-harris
                os=-sysv3
@@ -330,13 +395,28 @@ case $basic_machine in
                basic_machine=m68k-hp
                os=-hpux
                ;;
+       hp3k9[0-9][0-9] | hp9[0-9][0-9])
+               basic_machine=hppa1.0-hp
+               ;;
        hp9k2[0-9][0-9] | hp9k31[0-9])
                basic_machine=m68000-hp
                ;;
        hp9k3[2-9][0-9])
                basic_machine=m68k-hp
                ;;
-       hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
+       hp9k6[0-9][0-9] | hp6[0-9][0-9])
+               basic_machine=hppa1.0-hp
+               ;;
+       hp9k7[0-79][0-9] | hp7[0-79][0-9])
+               basic_machine=hppa1.1-hp
+               ;;
+       hp9k78[0-9] | hp78[0-9])
+               basic_machine=hppa2.0-hp
+               ;;
+       hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+               basic_machine=hppa2.0-hp
+               ;;
+       hp9k8[0-9][13679] | hp8[0-9][13679])
                basic_machine=hppa1.1-hp
                ;;
        hp9k8[0-9][0-9] | hp8[0-9][0-9])
@@ -345,9 +425,16 @@ case $basic_machine in
        hppa-next)
                os=-nextstep3
                ;;
+       hppaosf)
+               basic_machine=hppa1.1-hp
+               os=-osf
+               ;;
+       hppro)
+               basic_machine=hppa1.1-hp
+               os=-proelf
+               ;;
        i370-ibm* | ibm*)
                basic_machine=i370-ibm
-               os=-mvs
                ;;
 # I'm not sure what "Sysv32" means.  Should this be sysv3.2?
        i[34567]86v32)
@@ -366,6 +453,22 @@ case $basic_machine in
                basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
                os=-solaris2
                ;;
+       i386mach)
+               basic_machine=i386-mach
+               os=-mach
+               ;;
+       i386-vsta | vsta)
+               basic_machine=i386-unknown
+               os=-vsta
+               ;;
+       i386-go32 | go32)
+               basic_machine=i386-unknown
+               os=-go32
+               ;;
+       i386-mingw32 | mingw32)
+               basic_machine=i386-unknown
+               os=-mingw32
+               ;;
        iris | iris4d)
                basic_machine=mips-sgi
                case $os in
@@ -380,6 +483,9 @@ case $basic_machine in
                basic_machine=m68k-isi
                os=-sysv
                ;;
+       macppc*)
+               basic_machine=powerpc-apple
+               ;;
        m88k-omron*)
                basic_machine=m88k-omron
                ;;
@@ -394,6 +500,10 @@ case $basic_machine in
        miniframe)
                basic_machine=m68000-convergent
                ;;
+       *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+               basic_machine=m68k-atari
+               os=-mint
+               ;;
        mipsel*-linux*)
                basic_machine=mipsel-unknown
                os=-linux-gnu
@@ -408,10 +518,34 @@ case $basic_machine in
        mips3*)
                basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
                ;;
+       mmix*)
+               basic_machine=mmix-knuth
+               os=-mmixware
+               ;;
+       monitor)
+               basic_machine=m68k-rom68k
+               os=-coff
+               ;;
+       msdos)
+               basic_machine=i386-unknown
+               os=-msdos
+               ;;
+       mvs)
+               basic_machine=i370-ibm
+               os=-mvs
+               ;;
        ncr3000)
                basic_machine=i486-ncr
                os=-sysv4
                ;;
+       netbsd386)
+               basic_machine=i386-unknown
+               os=-netbsd
+               ;;
+       netwinder)
+               basic_machine=armv4l-rebel
+               os=-linux
+               ;;
        news | news700 | news800 | news900)
                basic_machine=m68k-sony
                os=-newsos
@@ -424,6 +558,10 @@ case $basic_machine in
                basic_machine=mips-sony
                os=-newsos
                ;;
+       necv70)
+               basic_machine=v70-nec
+               os=-sysv
+               ;;
        next | m*-next )
                basic_machine=m68k-next
                case $os in
@@ -449,9 +587,28 @@ case $basic_machine in
                basic_machine=i960-intel
                os=-nindy
                ;;
+       mon960)
+               basic_machine=i960-intel
+               os=-mon960
+               ;;
        np1)
                basic_machine=np1-gould
                ;;
+       nsr-tandem)
+               basic_machine=nsr-tandem
+               ;;
+       op50n-* | op60c-*)
+               basic_machine=hppa1.1-oki
+               os=-proelf
+               ;;
+       OSE68000 | ose68000)
+               basic_machine=m68000-ericsson
+               os=-ose
+               ;;
+       os68k)
+               basic_machine=m68k-none
+               os=-os68k
+               ;;
        pa-hitachi)
                basic_machine=hppa1.1-hitachi
                os=-hiuxwe2
@@ -469,23 +626,27 @@ case $basic_machine in
         pc532 | pc532-*)
                basic_machine=ns32k-pc532
                ;;
-       pentium | p5 | k5 | nexen)
-               basic_machine=i586-pc
+       pentiummmx | p55)
+               basic_machine=pentiummmx-pc
                ;;
-       pentiumpro | p6 | k6 | 6x86)
-               basic_machine=i686-pc
+       pentium | p5 | i586)
+               basic_machine=pentium-pc
                ;;
-       pentiumii | pentium2)
-               basic_machine=i786-pc
+       pentiumpro | p6)
+               basic_machine=pentiumpro-pc
                ;;
-       pentium-* | p5-* | k5-* | nexen-*)
-               basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+       pentiummmx-* | p55-*)
+               basic_machine=pentiummmx-`echo $basic_machine | sed 's/^[^-]*-//'`
                ;;
-       pentiumpro-* | p6-* | k6-* | 6x86-*)
-               basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+       pentium-* | p5-* | i586-*)
+               basic_machine=pentium-`echo $basic_machine | sed 's/^[^-]*-//'`
                ;;
-       pentiumii-* | pentium2-*)
-               basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+       pentiumpro-* | p6-*)
+               basic_machine=pentiumpro-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       nexen)
+               # We don't have specific support for Nexgen yet, so just call it a Pentium
+               basic_machine=i586-nexgen
                ;;
        pn)
                basic_machine=pn-gould
@@ -496,6 +657,11 @@ case $basic_machine in
                ;;
        ppc-*)  basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
                ;;
+       ppc64)  basic_machine=powerpc64-unknown
+               ;;
+       ppc64-*)
+               basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
        ppcle | powerpclittle | ppc-le | powerpc-little)
                basic_machine=powerpcle-unknown
                ;;
@@ -505,12 +671,20 @@ case $basic_machine in
        ps2)
                basic_machine=i386-ibm
                ;;
+       rom68k)
+               basic_machine=m68k-rom68k
+               os=-coff
+               ;;
        rm[46]00)
                basic_machine=mips-siemens
                ;;
        rtpc | rtpc-*)
                basic_machine=romp-ibm
                ;;
+       sa29200)
+               basic_machine=a29k-amd
+               os=-udi
+               ;;
        sequent)
                basic_machine=i386-sequent
                ;;
@@ -518,6 +692,10 @@ case $basic_machine in
                basic_machine=sh-hitachi
                os=-hms
                ;;
+       sparclite-wrs)
+               basic_machine=sparclite-wrs
+               os=-vxworks
+               ;;
        sps7)
                basic_machine=m68k-bull
                os=-sysv2
@@ -525,6 +703,13 @@ case $basic_machine in
        spur)
                basic_machine=spur-unknown
                ;;
+       st2000)
+               basic_machine=m68k-tandem
+               ;;
+       stratus)
+               basic_machine=i860-stratus
+               os=-sysv4
+               ;;
        sun2)
                basic_machine=m68000-sun
                ;;
@@ -565,10 +750,18 @@ case $basic_machine in
        sun386 | sun386i | roadrunner)
                basic_machine=i386-sun
                ;;
+       sv1)
+               basic_machine=sv1-cray
+               os=-unicos
+               ;;
        symmetry)
                basic_machine=i386-sequent
                os=-dynix
                ;;
+       t3e)
+               basic_machine=t3e-cray
+               os=-unicos
+               ;;
        tx39)
                basic_machine=mipstx39-unknown
                ;;
@@ -586,6 +779,10 @@ case $basic_machine in
                basic_machine=a29k-nyu
                os=-sym1
                ;;
+       v810 | necv810)
+               basic_machine=v810-nec
+               os=-none
+               ;;
        vaxv)
                basic_machine=vax-dec
                os=-sysv
@@ -609,6 +806,14 @@ case $basic_machine in
                basic_machine=a29k-wrs
                os=-vxworks
                ;;
+       w65*)
+               basic_machine=w65-wdc
+               os=-none
+               ;;
+       w89k-*)
+               basic_machine=hppa1.1-winbond
+               os=-proelf
+               ;;
        xmp)
                basic_machine=xmp-cray
                os=-unicos
@@ -616,6 +821,10 @@ case $basic_machine in
         xps | xps100)
                basic_machine=xps100-honeywell
                ;;
+       z8k-*-coff)
+               basic_machine=z8k-unknown
+               os=-sim
+               ;;
        none)
                basic_machine=none-none
                os=-none
@@ -623,6 +832,15 @@ case $basic_machine in
 
 # Here we handle the default manufacturer of certain CPU types.  It is in
 # some cases the only manufacturer, in others, it is the most popular.
+       w89k)
+               basic_machine=hppa1.1-winbond
+               ;;
+       op50n)
+               basic_machine=hppa1.1-oki
+               ;;
+       op60c)
+               basic_machine=hppa1.1-oki
+               ;;
        mips)
                if [ x$os = x-linux-gnu ]; then
                        basic_machine=mips-unknown
@@ -645,7 +863,7 @@ case $basic_machine in
        we32k)
                basic_machine=we32k-att
                ;;
-       sparc)
+       sparc | sparcv9)
                basic_machine=sparc-sun
                ;;
         cydra)
@@ -657,6 +875,16 @@ case $basic_machine in
        orion105)
                basic_machine=clipper-highlevel
                ;;
+       mac | mpw | mac-mpw)
+               basic_machine=m68k-apple
+               ;;
+       pmac | pmac-mpw)
+               basic_machine=powerpc-apple
+               ;;
+       c4x*)
+               basic_machine=c4x-none
+               os=-coff
+               ;;
        *)
                echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
                exit 1
@@ -710,13 +938,34 @@ case $os in
              | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
              | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
              | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
-             | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
+             | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
              | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
              | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
              | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-             | -mingw32* | -linux-gnu* | -uxpv* | -beos*)
+             | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
+             | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
+             | -openstep* | -oskit*)
        # Remember, each alternative MUST END IN *, to match a version number.
                ;;
+       -qnx*)
+               case $basic_machine in
+                   x86-* | i[34567]86-*)
+                       ;;
+                   *)
+                       os=-nto$os
+                       ;;
+               esac
+               ;;
+       -nto*)
+               os=-nto-qnx
+               ;;
+       -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+             | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+             | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+               ;;
+       -mac*)
+               os=`echo $os | sed -e 's|mac|macos|'`
+               ;;
        -linux*)
                os=`echo $os | sed -e 's|linux|linux-gnu|'`
                ;;
@@ -726,6 +975,12 @@ case $os in
        -sunos6*)
                os=`echo $os | sed -e 's|sunos6|solaris3|'`
                ;;
+       -opened*)
+               os=-openedition
+               ;;
+       -wince*)
+               os=-wince
+               ;;
        -osfrose*)
                os=-osfrose
                ;;
@@ -741,12 +996,18 @@ case $os in
        -acis*)
                os=-aos
                ;;
+       -386bsd)
+               os=-bsd
+               ;;
        -ctix* | -uts*)
                os=-sysv
                ;;
        -ns2 )
                os=-nextstep2
                ;;
+       -nsk)
+               os=-nsk
+               ;;
        # Preserve the version number of sinix5.
        -sinix5.*)
                os=`echo $os | sed -e 's|sinix|sysv|'`
@@ -772,9 +1033,18 @@ case $os in
        # This must come after -sysvr4.
        -sysv*)
                ;;
+       -ose*)
+               os=-ose
+               ;;
+       -es1800*)
+               os=-ose
+               ;;
        -xenix)
                os=-xenix
                ;;
+        -*mint | -*MiNT)
+               os=-mint
+               ;;
        -none)
                ;;
        *)
@@ -800,6 +1070,9 @@ case $basic_machine in
        *-acorn)
                os=-riscix1.2
                ;;
+       arm*-rebel)
+               os=-linux
+               ;;
        arm*-semi)
                os=-aout
                ;;
@@ -821,6 +1094,15 @@ case $basic_machine in
                # default.
                # os=-sunos4
                ;;
+       m68*-cisco)
+               os=-aout
+               ;;
+       mips*-cisco)
+               os=-elf
+               ;;
+       mips*-*)
+               os=-elf
+               ;;
        *-tti)  # must be before sparc entry or we get the wrong os.
                os=-sysv3
                ;;
@@ -833,6 +1115,15 @@ case $basic_machine in
        *-ibm)
                os=-aix
                ;;
+       *-wec)
+               os=-proelf
+               ;;
+       *-winbond)
+               os=-proelf
+               ;;
+       *-oki)
+               os=-proelf
+               ;;
        *-hp)
                os=-hpux
                ;;
@@ -896,6 +1187,18 @@ case $basic_machine in
        f301-fujitsu)
                os=-uxpv
                ;;
+       *-rom68k)
+               os=-coff
+               ;;
+       *-*bug)
+               os=-coff
+               ;;
+       *-apple)
+               os=-macos
+               ;;
+       *-atari*)
+               os=-mint
+               ;;
        *)
                os=-none
                ;;
@@ -917,9 +1220,15 @@ case $basic_machine in
                        -aix*)
                                vendor=ibm
                                ;;
+                       -beos*)
+                               vendor=be
+                               ;;
                        -hpux*)
                                vendor=hp
                                ;;
+                       -mpeix*)
+                               vendor=hp
+                               ;;
                        -hiux*)
                                vendor=hitachi
                                ;;
@@ -935,7 +1244,7 @@ case $basic_machine in
                        -genix*)
                                vendor=ns
                                ;;
-                       -mvs*)
+                       -mvs* | -opened*)
                                vendor=ibm
                                ;;
                        -ptx*)
@@ -947,6 +1256,15 @@ case $basic_machine in
                        -aux*)
                                vendor=apple
                                ;;
+                       -hms*)
+                               vendor=hitachi
+                               ;;
+                       -mpw* | -macos*)
+                               vendor=apple
+                               ;;
+                       -*mint | -*MiNT)
+                               vendor=atari
+                               ;;
                esac
                basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
                ;;
diff --git a/ghc/rts/gmp/config/mt-linux b/ghc/rts/gmp/config/mt-linux
deleted file mode 100644 (file)
index 476d8b5..0000000
+++ /dev/null
@@ -1 +0,0 @@
-AR_FLAGS = qc
diff --git a/ghc/rts/gmp/config/mt-m88110 b/ghc/rts/gmp/config/mt-m88110
deleted file mode 100644 (file)
index 071f8fa..0000000
+++ /dev/null
@@ -1 +0,0 @@
-XCFLAGS = -m88110
diff --git a/ghc/rts/gmp/config/mt-sprc8-gcc b/ghc/rts/gmp/config/mt-sprc8-gcc
deleted file mode 100644 (file)
index bc706a9..0000000
+++ /dev/null
@@ -1 +0,0 @@
-XCFLAGS = -mv8
diff --git a/ghc/rts/gmp/config/mt-supspc-gcc b/ghc/rts/gmp/config/mt-supspc-gcc
deleted file mode 100644 (file)
index 92a0924..0000000
+++ /dev/null
@@ -1 +0,0 @@
-XCFLAGS = -mv8 -DSUPERSPARC
diff --git a/ghc/rts/gmp/configure b/ghc/rts/gmp/configure
new file mode 100644 (file)
index 0000000..1375a73
--- /dev/null
@@ -0,0 +1,5176 @@
+#! /bin/sh
+# From configure.in Revision: 1.129
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using Autoconf version 2.14a.
+# Copyright (C) 1992, 93, 94, 95, 96, 98, 99, 2000
+# Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+
+# Initialize some variables set by options.
+ac_init_help=false
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+: ${ac_max_here_lines=48}
+# Sed expression to map a string onto a valid sh and CPP variable names.
+ac_tr_sh='sed -e y%*+%pp%;s%[^a-zA-Z0-9_]%_%g'
+ac_tr_cpp='sed -e y%*abcdefghijklmnopqrstuvwxyz%PABCDEFGHIJKLMNOPQRSTUVWXYZ%;s%[^A-Z0-9_]%_%g'
+
+ac_prev=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval "$ac_prev=\$ac_option"
+    ac_prev=
+    continue
+  fi
+
+  ac_optarg=`echo "$ac_option" | sed -n 's/^[^=]*=//p'`
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case "$ac_option" in
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir="$ac_optarg" ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build="$ac_optarg" ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file="$ac_optarg" ;;
+
+  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+  | --da=*)
+    datadir="$ac_optarg" ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`echo "$ac_option"|sed -e 's/-*disable-//'`
+    # Reject names that are not valid shell variable names.
+    if echo "$ac_feature" | grep '[^-a-zA-Z0-9_]' >/dev/null 2>&1; then
+      { echo "configure: error: invalid feature: $ac_feature" 1>&2; exit 1; }
+    fi
+    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+    eval "enable_${ac_feature}=no" ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`echo "$ac_option"|sed -e 's/-*enable-//' -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+    if echo "$ac_feature" | grep '[^-a-zA-Z0-9_]' >/dev/null 2>&1; then
+      { echo "configure: error: invalid feature: $ac_feature" 1>&2; exit 1; }
+    fi
+    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+    case "$ac_option" in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix="$ac_optarg" ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=: ;;
+  -host | --host | --hos | --ho)
+    ac_prev=host ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host="$ac_optarg" ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir="$ac_optarg" ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir="$ac_optarg" ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir="$ac_optarg" ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir="$ac_optarg" ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+    localstatedir="$ac_optarg" ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir="$ac_optarg" ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir="$ac_optarg" ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix="$ac_optarg" ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix="$ac_optarg" ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix="$ac_optarg" ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name="$ac_optarg" ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir="$ac_optarg" ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir="$ac_optarg" ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site="$ac_optarg" ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir="$ac_optarg" ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir="$ac_optarg" ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target="$ac_optarg" ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_package=`echo "$ac_option"|sed -e 's/-*with-//' -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+    if echo "$ac_package" | grep '[^-a-zA-Z0-9_]' >/dev/null 2>&1; then
+      { echo "configure: error: invalid package: $ac_package" 1>&2; exit 1; }
+    fi
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    case "$ac_option" in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "with_${ac_package}='$ac_optarg'" ;;
+
+  -without-* | --without-*)
+    ac_package=`echo "$ac_option"|sed -e 's/-*without-//'`
+    # Reject names that are not valid shell variable names.
+    if echo "$ac_package" | grep '[^-a-zA-Z0-9_]' >/dev/null 2>&1; then
+      { echo "configure: error: invalid package: $ac_package" 1>&2; exit 1; }
+    fi
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    eval "with_${ac_package}=no" ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes="$ac_optarg" ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries="$ac_optarg" ;;
+
+  -*) { echo "configure: error: unrecognized option: $ac_option
+Try \`configure --help' for more information." 1>&2; exit 1; }
+    ;;
+
+  *=*)
+    ac_envvar=`echo "$ac_option" | sed -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+    if echo "$ac_envvar" | grep '[^a-zA-Z0-9_]' >/dev/null 2>&1; then
+      { echo "configure: error: invalid variable name: $ac_envvar" 1>&2; exit 1; }
+    fi
+    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+    eval "$ac_envvar='$ac_optarg'"
+    export $ac_envvar ;;
+
+  *)
+    if echo "$ac_option" | grep '[^-a-zA-Z0-9.]' >/dev/null 2>&1; then
+      echo "configure: warning: invalid host type: $ac_option" 1>&2
+    fi
+    if test "x$nonopt" != xNONE; then
+      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+    fi
+    nonopt="$ac_option"
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  { echo "configure: error: missing argument to --\`echo $ac_prev | sed 's/_/-/g'\`" 1>&2; exit 1; }
+fi
+if $ac_init_help; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<\EOF
+`configure' configures software source code packages to adapt to many kinds
+of systems.
+
+Usage: configure [OPTION]... [VAR=VALUE]... [HOST]
+
+To safely assign special values to environment variables (e.g., CC,
+CFLAGS...), give to `configure' the definition as VAR=VALUE.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              print this message
+  -V, --version           print the version of autoconf that created configure
+  -q, --quiet, --silent   do not print `checking...' messages
+      --cache-file=FILE   cache test results in FILE
+  -n, --no-create         do not create output files
+
+EOF
+
+  cat <<EOF
+Directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [same as prefix]
+  --bindir=DIR            user executables in DIR [EPREFIX/bin]
+  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
+  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
+  --datadir=DIR           read-only architecture-independent data in DIR
+                          [PREFIX/share]
+  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
+                          [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
+  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
+  --includedir=DIR        C header files in DIR [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
+  --infodir=DIR           info documentation in DIR [PREFIX/info]
+  --mandir=DIR            man documentation in DIR [PREFIX/man]
+  --srcdir=DIR            find the sources in DIR [configure dir or ..]
+EOF
+
+  cat <<\EOF
+
+Host type:
+  --build=BUILD      configure for building on BUILD [BUILD=HOST]
+  --host=HOST        configure for HOST [guessed]
+  --target=TARGET    configure for TARGET [TARGET=HOST]
+EOF
+
+  cat <<\EOF
+
+Program names:
+  --program-prefix=PREFIX            prepend PREFIX to installed program names
+  --program-suffix=SUFFIX            append SUFFIX to installed program names
+  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
+
+Optional Features:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE=ARG  include FEATURE ARG=yes
+  --disable-dependency-tracking Speeds up one-time builds
+  --enable-dependency-tracking  Do not reject slow dependency extractors
+  --enable-maintainer-mode enable make rules and dependencies not useful
+                          (and sometimes confusing) to the casual installer
+  --enable-assert         enable ASSERT checking default=no
+  --enable-alloca         use alloca for temp space default=yes
+  --enable-fft            enable FFTs for multiplication default=no
+  --enable-mpbsd          build Berkley MP compatibility library default=no
+  --enable-mpfr           build MPFR default=no
+  --enable-shared=PKGS  build shared libraries default=yes
+  --enable-static=PKGS  build static libraries default=yes
+  --enable-fast-install=PKGS  optimize for fast installation default=yes
+  --disable-libtool-lock  avoid locking (might break parallel builds)
+
+Optional Packages:
+  --with-PACKAGE=ARG    use PACKAGE ARG=yes
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-gnu-ld           assume the C compiler uses GNU ld default=no
+  --with-pic              try to use only PIC/non-PIC objects default=use both
+EOF
+  exit 0
+fi
+if $ac_init_version; then
+  cat <<\EOF
+Generated automatically using Autoconf version 2.14a.
+Copyright (C) 1992, 93, 94, 95, 96, 98, 99, 2000
+Free Software Foundation, Inc.
+
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+EOF
+  exit 0
+fi
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell meta-characters.
+ac_configure_args=
+for ac_arg
+do
+  case "$ac_arg" in
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c) ;;
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+  *" "*|*"     "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+  ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
+  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+  esac
+done
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+  exec 6>/dev/null
+else
+  exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by configure version 2.14a, executed with
+ > $0 $ac_configure_args
+" 1>&5
+
+# NLS nuisances.
+# Only set these to C if already set.  These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then its parent.
+  ac_prog=$0
+  ac_confdir=`echo "$ac_prog" | sed 's%/[^/][^/]*$%%'`
+  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+  srcdir=$ac_confdir
+  if test ! -r $srcdir/$ac_unique_file; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+  if test "$ac_srcdir_defaulted" = yes; then
+    { echo "configure: error: cannot find sources in $ac_confdir or .." 1>&2; exit 1; }
+  else
+    { echo "configure: error: cannot find sources in $srcdir" 1>&2; exit 1; }
+  fi
+fi
+srcdir=`echo "$srcdir" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+  if test "x$prefix" != xNONE; then
+    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+  else
+    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+  fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+  if test -r "$ac_site_file"; then
+    echo "loading site script $ac_site_file"
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  echo "loading cache $cache_file"
+      test -f "$cache_file" && . $cache_file
+else
+  echo "creating cache $cache_file"
+  >$cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ac_exeext=
+ac_objext=o
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#include <sys/types.h>
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#else
+# if HAVE_STRINGS_H
+#  include <strings.h>
+# endif
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+  # Stardent Vistra SVR4 grep lacks -e, says Kaveh R. Ghazi.
+  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+    ECHO_N= ECHO_C='
+' ECHO_T='     '
+  else
+    ECHO_N=-n ECHO_C= ECHO_T=
+  fi
+else
+  ECHO_N= ECHO_C='\c' ECHO_T=
+fi
+
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+  if test -f $ac_dir/install-sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f $ac_dir/install.sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f $ac_dir/shtool; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { echo "configure: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
+fi
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+echo $ECHO_N "checking host system type... $ECHO_C" 1>&6
+echo "configure:636: checking host system type" 1>&5
+if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
+
+  # Make sure we can run config.sub.
+  if $ac_config_sub sun4 >/dev/null 2>&1; then :; else
+    { echo "configure: error: cannot run $ac_config_sub" 1>&2; exit 1; }
+  fi
+
+  ac_cv_host_alias=$host
+  case "$ac_cv_host_alias" in
+  NONE)
+    case $nonopt in
+    NONE)
+      if ac_cv_host_alias=`$ac_config_guess`; then :
+      else { echo "configure: error: cannot guess host type; you must specify one" 1>&2; exit 1; }
+      fi ;;    *) ac_cv_host_alias=$nonopt ;;
+    esac ;;
+  esac
+
+  ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || exit 1
+  ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+  ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+  ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+else
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+fi
+
+echo "$ECHO_T""$ac_cv_host" 1>&6
+
+host=$ac_cv_host
+host_alias=$ac_cv_host_alias
+host_cpu=$ac_cv_host_cpu
+host_vendor=$ac_cv_host_vendor
+host_os=$ac_cv_host_os
+
+echo $ECHO_N "checking target system type... $ECHO_C" 1>&6
+echo "configure:672: checking target system type" 1>&5
+if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then
+
+  # Make sure we can run config.sub.
+  if $ac_config_sub sun4 >/dev/null 2>&1; then :; else
+    { echo "configure: error: cannot run $ac_config_sub" 1>&2; exit 1; }
+  fi
+
+  ac_cv_target_alias=$target
+  case "$ac_cv_target_alias" in
+  NONE)
+    case $nonopt in
+    NONE)
+      ac_cv_target_alias=$host_alias ;;
+    *) ac_cv_target_alias=$nonopt ;;
+    esac ;;
+  esac
+
+  ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || exit 1
+  ac_cv_target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+  ac_cv_target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+  ac_cv_target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+else
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+fi
+
+echo "$ECHO_T""$ac_cv_target" 1>&6
+
+target=$ac_cv_target
+target_alias=$ac_cv_target_alias
+target_cpu=$ac_cv_target_cpu
+target_vendor=$ac_cv_target_vendor
+target_os=$ac_cv_target_os
+
+echo $ECHO_N "checking build system type... $ECHO_C" 1>&6
+echo "configure:707: checking build system type" 1>&5
+if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
+
+  # Make sure we can run config.sub.
+  if $ac_config_sub sun4 >/dev/null 2>&1; then :; else
+    { echo "configure: error: cannot run $ac_config_sub" 1>&2; exit 1; }
+  fi
+
+  ac_cv_build_alias=$build
+  case "$ac_cv_build_alias" in
+  NONE)
+    case $nonopt in
+    NONE)
+      ac_cv_build_alias=$host_alias ;;
+    *) ac_cv_build_alias=$nonopt ;;
+    esac ;;
+  esac
+
+  ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || exit 1
+  ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+  ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+  ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+else
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+fi
+
+echo "$ECHO_T""$ac_cv_build" 1>&6
+
+build=$ac_cv_build
+build_alias=$ac_cv_build_alias
+build_cpu=$ac_cv_build_cpu
+build_vendor=$ac_cv_build_vendor
+build_os=$ac_cv_build_os
+
+# Do some error checking and defaulting for the host and target type.
+# The inputs are:
+#    configure --host=HOST --target=TARGET --build=BUILD NONOPT
+#
+# The rules are:
+# 1. You are not allowed to specify --host, --target, and nonopt at the
+#    same time.
+# 2. Host defaults to nonopt.
+# 3. If nonopt is not specified, then host defaults to the current host,
+#    as determined by config.guess.
+# 4. Target and build default to nonopt.
+# 5. If nonopt is not specified, then target and build default to host.
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+case $host---$target---$nonopt in
+NONE---*---* | *---NONE---* | *---*---NONE) ;;
+*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+esac
+
+test "$host_alias" != "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_prefix=${target_alias}-
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" 1>&6
+echo "configure:778: checking for a BSD compatible install" 1>&5
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+    IFS="${IFS=        }"; ac_save_IFS="$IFS"; IFS=":"
+  for ac_dir in $PATH; do
+    # Account for people who put trailing slashes in PATH elements.
+    case "$ac_dir/" in
+    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+    *)
+      # OSF1 and SCO ODT 3.0 have their own names for install.
+      # Don't use installbsd from OSF since it installs stuff as root
+      # by default.
+      for ac_prog in ginstall scoinst install; do
+        if test -f $ac_dir/$ac_prog; then
+         if test $ac_prog = install &&
+            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+           # AIX install.  It has an incompatible calling convention.
+           :
+         elif test $ac_prog = install &&
+           grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
+           # program-specific install script used by HP pwplus--don't use.
+           :
+         else
+           ac_cv_path_install="$ac_dir/$ac_prog -c"
+           break 2
+         fi
+       fi
+      done
+      ;;
+    esac
+  done
+  IFS="$ac_save_IFS"
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL="$ac_cv_path_install"
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL="$ac_install_sh"
+  fi
+fi
+echo "$ECHO_T""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo $ECHO_N "checking whether build environment is sane... $ECHO_C" 1>&6
+echo "configure:835: checking whether build environment is sane" 1>&5
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftestfile`
+   fi
+   if test "$*" != "X $srcdir/configure conftestfile" \
+      && test "$*" != "X conftestfile $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" 1>&2; exit 1; }
+   fi
+
+   test "$2" = conftestfile
+   )
+then
+   # Ok.
+   :
+else
+   { echo "configure: error: newly created file is older than distributed files!
+Check your system clock" 1>&2; exit 1; }
+fi
+rm -f conftest*
+echo "$ECHO_T""yes" 1>&6
+if test "$program_transform_name" = s,x,x,; then
+  program_transform_name=
+else
+  # Double any \ or $.  echo might interpret backslashes.
+  cat <<\EOF >conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF
+  program_transform_name=`echo $program_transform_name | sed -f conftestsed`
+  rm -f conftestsed
+fi
+test "$program_prefix" != NONE &&
+  program_transform_name="s,^,${program_prefix},;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s,\$\$,${program_suffix},;$program_transform_name"
+
+# sed with no file args requires a program.
+test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+
+test x"${MISSING+set}" = xset || \
+  MISSING="\${SHELL} `CDPATH=: && cd $ac_aux_dir && pwd`/missing"
+if eval "$MISSING --run :"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  am_backtick='`'
+  echo "configure: warning: ${am_backtick}missing' script is too old or missing" 1>&2
+fi
+
+for ac_prog in mawk gawk nawk awk
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
+echo "configure:906: checking for $ac_word" 1>&5
+if test "${ac_cv_prog_AWK+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+  for ac_path in `IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  test -z "$ac_dir" && ac_dir=.
+  if test -f $ac_dir/$ac_word; then
+    echo "$ac_dir/$ac_word"
+  fi
+done
+IFS="$ac_save_ifs"
+`; do
+    ac_cv_prog_AWK="$ac_prog"
+    break
+  done
+fi
+fi
+AWK="$ac_cv_prog_AWK"
+if test -n "$AWK"; then
+  echo "$ECHO_T""$AWK" 1>&6
+else
+  echo "$ECHO_T""no" 1>&6
+fi
+
+test -n "$AWK" && break
+done
+
+echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" 1>&6
+echo "configure:939: checking whether ${MAKE-make} sets \${MAKE}" 1>&5
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  cat >conftestmake <<\EOF
+all:
+       @echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+  eval ac_cv_prog_make_${ac_make}_set=yes
+else
+  eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftestmake
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+  echo "$ECHO_T""yes" 1>&6
+  SET_MAKE=
+else
+  echo "$ECHO_T""no" 1>&6
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+  enableval="$enable_dependency_tracking"
+
+fi
+if test "x$enable_dependency_tracking" = xno; then
+  AMDEP="#"
+else
+  am_depcomp="$ac_aux_dir/depcomp"
+  if test ! -f "$am_depcomp"; then
+    AMDEP="#"
+  else
+    AMDEP=
+  fi
+fi
+
+if test -z "$AMDEP"; then
+  AMDEPBACKSLASH='\'
+else
+  AMDEPBACKSLASH=
+fi
+
+if test -d .deps || mkdir .deps 2> /dev/null || test -d .deps; then
+  DEPDIR=.deps
+else
+  DEPDIR=_deps
+fi
+
+PACKAGE=gmp
+
+VERSION=3.1
+
+if test "`CDPATH=: && cd $srcdir && pwd`" != "`pwd`" &&
+   test -f $srcdir/config.status; then
+  { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
+fi
+cat >>confdefs.h <<EOF
+#define PACKAGE "$PACKAGE"
+EOF
+
+cat >>confdefs.h <<EOF
+#define VERSION "$VERSION"
+EOF
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal"}
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake"}
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+if test -z "$install_sh"; then
+   install_sh="$ac_aux_dir/install-sh"
+   test -f "$install_sh" || install_sh="$ac_aux_dir/install.sh"
+   test -f "$install_sh" || install_sh="${am_missing_run}${ac_auxdir}/install-sh"
+         install_sh="`echo $install_sh | sed -e 's/\${SHELL}//'`"
+fi
+
+echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" 1>&6
+echo "configure:1029: checking whether to enable maintainer-specific portions of Makefiles" 1>&5
+    # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then
+  enableval="$enable_maintainer_mode"
+  USE_MAINTAINER_MODE=$enableval
+else
+  USE_MAINTAINER_MODE=no
+fi
+  echo "$ECHO_T""$USE_MAINTAINER_MODE" 1>&6
+
+if test $USE_MAINTAINER_MODE = yes; then
+  MAINTAINER_MODE_TRUE=
+  MAINTAINER_MODE_FALSE='#'
+else
+  MAINTAINER_MODE_TRUE='#'
+  MAINTAINER_MODE_FALSE=
+fi
+  MAINT=$MAINTAINER_MODE_TRUE
+
+gmp_configm4="config.m4"
+gmp_tmpconfigm4=cnfm4.tmp
+gmp_tmpconfigm4i=cnfm4i.tmp
+gmp_tmpconfigm4p=cnfm4p.tmp
+test -f $gmp_tmpconfigm4 && rm $gmp_tmpconfigm4
+test -f $gmp_tmpconfigm4i && rm $gmp_tmpconfigm4i
+test -f $gmp_tmpconfigm4p && rm $gmp_tmpconfigm4p
+
+# Check whether --enable-assert or --disable-assert was given.
+if test "${enable_assert+set}" = set; then
+  enableval="$enable_assert"
+  case "${enableval}" in
+yes|no) ;;
+*) { echo "configure: error: bad value ${enableval} for --enable-assert, need yes or no" 1>&2; exit 1; } ;;
+esac
+else
+  enable_assert=no
+fi
+
+if test "$enable_assert" = "yes"; then
+  cat >>confdefs.h <<\EOF
+#define WANT_ASSERT 1
+EOF
+
+fi
+
+# Check whether --enable-alloca or --disable-alloca was given.
+if test "${enable_alloca+set}" = set; then
+  enableval="$enable_alloca"
+  case "${enableval}" in
+yes|no) ;;
+*) { echo "configure: error: bad value ${enableval} for --enable-alloca, need yes or no" 1>&2; exit 1; } ;;
+esac
+else
+  enable_alloca=yes
+fi
+
+if test "$enable_alloca" = "no"; then
+  cat >>confdefs.h <<\EOF
+#define USE_STACK_ALLOC 1
+EOF
+
+fi
+
+# Check whether --enable-fft or --disable-fft was given.
+if test "${enable_fft+set}" = set; then
+  enableval="$enable_fft"
+  case "${enableval}" in
+yes|no) ;;
+*) { echo "configure: error: bad value ${enableval} for --enable-fft, need yes or no" 1>&2; exit 1; } ;;
+esac
+else
+  enable_fft=no
+fi
+
+if test "$enable_fft" = "yes"; then
+  cat >>confdefs.h <<\EOF
+#define WANT_FFT 1
+EOF
+
+fi
+
+# Check whether --enable-mpbsd or --disable-mpbsd was given.
+if test "${enable_mpbsd+set}" = set; then
+  enableval="$enable_mpbsd"
+  case "${enableval}" in
+yes|no) ;;
+*) { echo "configure: error: bad value ${enableval} for --enable-mpbsd, need yes or no" 1>&2; exit 1; } ;;
+esac
+else
+  enable_mpbsd=no
+fi
+
+if test "$enable_mpbsd" = "yes"; then
+  WANT_MPBSD_TRUE=
+  WANT_MPBSD_FALSE='#'
+else
+  WANT_MPBSD_TRUE='#'
+  WANT_MPBSD_FALSE=
+fi
+
+# Check whether --enable-mpfr or --disable-mpfr was given.
+if test "${enable_mpfr+set}" = set; then
+  enableval="$enable_mpfr"
+  case "${enableval}" in
+yes|no) ;;
+*) { echo "configure: error: bad value ${enableval} for --enable-mpfr, need yes or no" 1>&2; exit 1; } ;;
+esac
+else
+  enable_mpfr=no
+fi
+
+if test "$enable_mpfr" = "yes"; then
+  WANT_MPFR_TRUE=
+  WANT_MPFR_FALSE='#'
+else
+  WANT_MPFR_TRUE='#'
+  WANT_MPFR_FALSE=
+fi
+
+os_64bit="no"
+cclist="gcc cc"                # FIXME: Prefer c89 to cc.
+gmp_cflags_gcc="-g -O2"
+gmp_cflags64_gcc="-g -O2"
+gmp_cflags_cc="-g"
+gmp_cflags64_cc="-g"
+
+case "$target" in
+  # Alpha
+  alpha*-cray-unicos*)
+    # Don't perform any assembly syntax tests on this beast.
+    gmp_no_asm_syntax_testing=yes
+    cclist=cc
+    gmp_cflags_cc="$gmp_cflags_cc -O"
+    ;;
+  alpha*-*-osf*)
+    flavour=`echo $target_cpu | sed 's/^alpha//g'`
+    if test -n "$flavour"; then
+      case $flavour in    # compilers don't seem to understand `ev67' and such.
+       ev6? | ev7*) flavour=ev6;;
+      esac
+      gmp_optcflags_gcc="-mcpu=$flavour"
+      # FIXME: We shouldn't fail fatally if none of these work, but that's
+      # how xoptcflags work and we don't have any other mechanism right now.
+      # Why do we need this here and not for alpha*-*-* below?
+      gmp_xoptcflags_gcc="-Wa,-arch,${flavour} -Wa,-m${flavour}"
+      gmp_optcflags_cc="-arch $flavour -tune $flavour"
+    fi
+    ;;
+  alpha*-*-*)
+    cclist="gcc"
+    flavour=`echo $target_cpu | sed 's/^alpha//g'`
+    if test -n "$flavour"; then
+      case $flavour in
+       ev6? | ev7*) flavour=ev6;;
+      esac
+      gmp_optcflags_gcc="-mcpu=$flavour"
+    fi
+    ;;
+  # Cray vector machines.  This must come after alpha* so that we can
+  # recognize present and future vector processors with a wildcard.
+  *-cray-unicos*)
+    # Don't perform any assembly syntax tests on this beast.
+    gmp_no_asm_syntax_testing=yes
+    cclist=cc
+    # Don't inherit default gmp_cflags_cc value; it comes with -g which
+    # disables all optimization on Cray vector systems
+    gmp_cflags_cc="-O"
+    ;;
+
+  # AMD and Intel x86 configurations
+  i?86*-*-* | k[5-8]*-*-* | pentium*-*-* | athlon-*-*)
+    # Rumour has it -O2 used to give worse register allocation than just -O.
+    gmp_cflags_gcc="-g -O -fomit-frame-pointer"
+
+    case "${target}" in
+      i386*-*-*)    gmp_optcflags_gcc="-mcpu=i386 -march=i386";;
+      i486*-*-*)    gmp_optcflags_gcc="-mcpu=i486 -march=i486";;
+      i586*-*-* | pentium-*-* | pentiummmx-*-*)
+                    gmp_optcflags_gcc="-mcpu=pentium -march=pentium";;
+
+      # -march=pentiumpro not used because mpz/powm.c (swox cvs rev 1.4)
+      # tickles a bug in gcc 2.95.2 (believed fixed in 2.96).
+      i686*-*-* | pentiumpro-*-* | pentium[23]-*-*)
+                    gmp_optcflags_gcc="-mcpu=pentiumpro";;
+
+      k6*-*-*)      gmp_optcflags_gcc="-mcpu=k6 -march=k6";;
+
+      # Athlon instruction costs are close to p6: 3 cycle load latency, 4-6
+      # cycle mul, 40 cycle div, pairable adc, ...
+      # FIXME: Change this when gcc gets something specific for Athlon.
+      # -march=pentiumpro not used, per i686 above.
+      athlon-*-*)   gmp_optcflags_gcc="-mcpu=pentiumpro";;
+    esac
+    ;;
+
+  # Sparc
+  ultrasparc*-*-solaris2.[7-9] | sparcv9-*-solaris2.[7-9])
+    os_64bit=yes
+    gmp_cflags_gcc="$gmp_cflags_gcc -Wa,-xarch=v8plus"
+    gmp_xoptcflags_gcc="-mcpu=v9 -mcpu=v8 -mv8"
+    gmp_cflags64_gcc="$gmp_cflags64_gcc -m64 -mptr64 -Wa,-xarch=v9 -mcpu=v9"
+    gmp_cflags_cc="-xtarget=native -xarch=v8 -xO4"
+    gmp_cflags64_cc="-xtarget=native -xarch=v9 -xO4"
+    ;;
+  sparc64-*-linux*)
+    os_64bit=yes
+    gmp_cflags64_gcc="$gmp_cflags64_gcc -m64 -mptr64 -Wa,-xarch=v9 -mcpu=v9"
+    gmp_cflags_gcc="$gmp_cflags_gcc -m32"
+    gmp_xoptflags_gcc="-mcpu=ultrasparc -mvis"
+    ;;
+  ultrasparc*-*-* | sparcv9-*-*)
+    gmp_cflags_gcc="$gmp_cflags_gcc -Wa,-xarch=v8plus"
+    gmp_xoptcflags_gcc="-mcpu=v9 -mcpu=v8 -mv8"
+    gmp_cflags_cc="-xtarget=native -xarch=v8 -xO4"
+    ;;
+  sparcv8*-*-solaris2.* | microsparc*-*-solaris2.*)
+    gmp_cflags_gcc="$gmp_cflags_gcc"
+    gmp_xoptcflags_gcc="-mcpu=v8 -mv8"
+    gmp_cflags_cc="-xtarget=native -xarch=v8 -xO4"
+    ;;
+  sparcv8*-*-* | microsparc*-*-*)              # SunOS, Linux, *BSD
+    cclist="gcc acc cc"
+    gmp_cflags_gcc="$gmp_cflags_gcc"
+    gmp_xoptcflags_gcc="-mcpu=v8 -mv8"
+    gmp_cflags_acc="-g -O2 -cg92"
+    gmp_cflags_cc="-O2"                # FIXME: Flag for v8?
+    ;;
+  supersparc*-*-solaris2.*)
+    gmp_cflags_gcc="$gmp_cflags_gcc -DSUPERSPARC"
+    gmp_xoptcflags_gcc="-mcpu=v8 -mv8"
+    gmp_cflags_cc="-xtarget=native -xarch=v8 -xO4 -DSUPERSPARC"
+    ;;
+  supersparc*-*-*)             # SunOS, Linux, *BSD
+    cclist="gcc acc cc"
+    gmp_cflags_gcc="$gmp_cflags_gcc -DSUPERSPARC"
+    gmp_xoptcflags_gcc="-mcpu=v8 -mv8"
+    gmp_cflags_acc="-g -O2 -cg92 -DSUPERSPARC"
+    gmp_cflags_cc="-O2 -DSUPERSPARC"   # FIXME: Flag for v8?
+    ;;
+  *sparc*-*-*)
+    cclist="gcc acc cc"
+    gmp_cflags_acc="-g -O2"
+    gmp_cflags_cc="-g -O2"
+    ;;
+
+  # POWER/PowerPC
+  powerpc64-*-aix*)
+    cclist="gcc xlc"
+    gmp_cflags_gcc="$gmp_cflags_gcc -maix64 -mpowerpc64"
+    gmp_cflags_xlc="-g -O2 -q64 -qtune=pwr3"
+    ;;
+  powerpc*-*-aix*)
+    cclist="gcc xlc"
+    gmp_cflags_gcc="$gmp_cflags_gcc -mpowerpc"
+    gmp_cflags_xlc="$gmp_cflags_cc -qarch=ppc -O2"
+    ;;
+  power-*-aix*)
+    cclist="gcc xlc"
+    gmp_cflags_gcc="$gmp_cflags_gcc -mpower"
+    gmp_cflags_xlc="$gmp_cflags_cc -qarch=pwr -O2"
+    ;;
+  powerpc64*-*-*)
+    gmp_cflags_gcc="$gmp_cflags_gcc -mpowerpc64"
+    cat >>confdefs.h <<\EOF
+#define _LONG_LONG_LIMB 1
+EOF
+           ;;
+  powerpc*-*-*)
+    gmp_cflags_gcc="$gmp_cflags_gcc -mpowerpc"
+    ;;
+
+  # MIPS
+  mips-sgi-irix6.*)
+    os_64bit=yes
+    gmp_cflags64_gcc="-g -O2 -mabi=n32"
+    gmp_cflags64_cc="$gmp_cflags64_cc -O2 -n32"
+    ;;
+
+  # Motorola 68k family
+  m88110*-*-*)
+    gmp_cflags_gcc="-g -O -m88110"         ;;
+  m68*-*-*)
+    gmp_cflags_gcc="$gmp_cflags_gcc -fomit-frame-pointer"
+    ;;
+
+  # HP
+  hppa1.0*-*-*)
+    cclist="gcc c89 cc"
+    gmp_cflags_c89="$gmp_cflags_cc +O2"
+    gmp_cflags_cc="$gmp_cflags_cc +O2"
+    ;;
+  hppa2.0w*-*-*)
+    cclist="c89 cc"
+    gmp_cflags_c89="+DD64 +O3"
+    gmp_cflags_cc="+DD64 +O3"
+    ;;
+  hppa2.0*-*-*)
+    os_64bit=yes
+    cclist="gcc c89 cc"
+    gmp_cflags64_gcc="$gmp_cflags64_gcc -mWHAT -D_LONG_LONG_LIMB"
+    # +O2 to cc triggers bug in mpz/powm.c (1.4)
+    gmp_cflags64_c89="+DA2.0 +e +O3 -D_LONG_LONG_LIMB"
+    gmp_cflags64_cc="+DA2.0 +e +O3 -D_LONG_LONG_LIMB"
+    gmp_cflags_c89="$gmp_cflags_cc +O2"
+    gmp_cflags_cc="$gmp_cflags_cc +O2"
+    ;;
+
+  # VAX
+  vax*-*-*)
+    gmp_cflags_gcc="$gmp_cflags_gcc -fomit-frame-pointer"
+    ;;
+
+  # Fujitsu
+  f30[01]-fujitsu-sysv*)
+    cclist="gcc vcc"
+    gmp_cflags_vcc="-g"                # FIXME: flags for vcc?
+    ;;
+esac
+
+echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" 1>&6
+echo "configure:1349: checking for BSD-compatible nm" 1>&5
+if test "${ac_cv_path_NM+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  if test -n "$NM"; then
+  # Let the user override the test.
+  ac_cv_path_NM="$NM"
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
+      # Check to see if the nm accepts a BSD-compat flag.
+      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+      #   nm: unknown option "B" ignored
+      if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+       ac_cv_path_NM="$ac_dir/nm -B"
+       break
+      elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+       ac_cv_path_NM="$ac_dir/nm -p"
+       break
+      else
+       ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
+       continue # so that we can try to find one that supports BSD flags
+      fi
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
+fi
+fi
+
+NM="$ac_cv_path_NM"
+echo "$ECHO_T""$NM" 1>&6
+       # nm on 64-bit AIX needs to know the object file format
+case "$target" in
+  powerpc64*-*-aix*)
+    NM="$NM -X 64"
+    ;;
+esac
+
+# Save CFLAGS given on command line.
+gmp_user_CFLAGS="$CFLAGS"
+
+if test -z "$CC"; then
+  # Find compiler.
+
+if test $host != $build; then
+  ac_tool_prefix=${host_alias}-
+else
+  ac_tool_prefix=
+fi
+
+gmp_cc_list="$cclist"
+gmp_req_64bit_cc="$os_64bit"
+
+CC32=
+CC64=
+for c in $gmp_cc_list; do
+  # Avoid cache hits.
+  unset CC
+  unset ac_cv_prog_CC
+
+# Extract the first word of "${ac_tool_prefix}$c", so it can be a program name with args.
+set dummy ${ac_tool_prefix}$c; ac_word=$2
+echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
+echo "configure:1415: checking for $ac_word" 1>&5
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  for ac_path in `IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  test -z "$ac_dir" && ac_dir=.
+  if test -f $ac_dir/$ac_word; then
+    echo "$ac_dir/$ac_word"
+  fi
+done
+IFS="$ac_save_ifs"
+`; do
+    ac_cv_prog_CC="${ac_tool_prefix}$c"
+    break
+  done
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ECHO_T""$CC" 1>&6
+else
+  echo "$ECHO_T""no" 1>&6
+fi
+
+if test -z "$ac_cv_prog_CC"; then
+  if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "$c", so it can be a program name with args.
+set dummy $c; ac_word=$2
+echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
+echo "configure:1449: checking for $ac_word" 1>&5
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  for ac_path in `IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  test -z "$ac_dir" && ac_dir=.
+  if test -f $ac_dir/$ac_word; then
+    echo "$ac_dir/$ac_word"
+  fi
+done
+IFS="$ac_save_ifs"
+`; do
+    ac_cv_prog_CC="$c"
+    break
+  done
+  test -z "$ac_cv_prog_CC" && ac_cv_prog_CC="$c"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ECHO_T""$CC" 1>&6
+else
+  echo "$ECHO_T""no" 1>&6
+fi
+
+  else
+    CC="$c"
+  fi
+fi
+
+  if test -n "$CC"; then
+    eval c_flags=\$gmp_cflags_$c
+    ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+       CC="$CC"
+CFLAGS="$c_flags"
+echo $ECHO_N "checking if the C compiler ($CC) works with flags $CFLAGS... $ECHO_C" 1>&6
+echo "configure:1495: checking if the C compiler ($CC) works with flags $CFLAGS" 1>&5
+
+# Simple test for all targets.
+cat >conftest.$ac_ext <<EOF
+
+#line 1500 "configure"
+#include "confdefs.h"
+
+int main(){return(0);}
+EOF
+if { (eval echo configure:1505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  tmp_works=yes
+  # If we can't run a trivial program, we are probably using a cross compiler.
+  if (./conftest; exit) 2>/dev/null; then
+    tmp_cross=no
+  else
+    tmp_cross=yes
+  fi
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  tmp_works=no
+fi
+rm -fr conftest*
+
+# Target specific tests.
+if test "$tmp_works" = "yes"; then
+  case "$target" in
+    *-*-aix*)  # Returning a funcptr.
+      cat >conftest.$ac_ext <<EOF
+#line 1525 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+} void *g(); void *f() { return g(); } int bar(){
+  ;
+  return 0;
+}
+EOF
+if { (eval echo configure:1536: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  tmp_works=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  tmp_works=no
+fi
+rm -f conftest*
+      ;;
+  esac
+fi
+
+if test "$tmp_works" = "yes"; then
+  gmp_prog_cc_works=yes
+else
+  gmp_prog_cc_works=no
+fi
+
+echo "$ECHO_T""$tmp_works" 1>&6
+
+    if test "$gmp_prog_cc_works" != "yes"; then
+      continue
+    fi
+
+    # Save first working compiler, whether 32- or 64-bit capable.
+    if test -z "$CC32"; then
+      CC32="$CC"
+    fi
+    if test "$gmp_req_64bit_cc" = "yes"; then
+      eval c_flags=\$gmp_cflags64_$c
+
+      # Verify that the compiler works in 64-bit mode as well.
+      # /usr/ucb/cc on Solaris 7 can *compile* in 64-bit mode, but not link.
+      ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+       CC="$c"
+CFLAGS="$c_flags"
+echo $ECHO_N "checking if the C compiler ($CC) works with flags $CFLAGS... $ECHO_C" 1>&6
+echo "configure:1580: checking if the C compiler ($CC) works with flags $CFLAGS" 1>&5
+
+# Simple test for all targets.
+cat >conftest.$ac_ext <<EOF
+
+#line 1585 "configure"
+#include "confdefs.h"
+
+int main(){return(0);}
+EOF
+if { (eval echo configure:1590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  tmp_works=yes
+  # If we can't run a trivial program, we are probably using a cross compiler.
+  if (./conftest; exit) 2>/dev/null; then
+    tmp_cross=no
+  else
+    tmp_cross=yes
+  fi
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  tmp_works=no
+fi
+rm -fr conftest*
+
+# Target specific tests.
+if test "$tmp_works" = "yes"; then
+  case "$target" in
+    *-*-aix*)  # Returning a funcptr.
+      cat >conftest.$ac_ext <<EOF
+#line 1610 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+} void *g(); void *f() { return g(); } int bar(){
+  ;
+  return 0;
+}
+EOF
+if { (eval echo configure:1621: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  tmp_works=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  tmp_works=no
+fi
+rm -f conftest*
+      ;;
+  esac
+fi
+
+if test "$tmp_works" = "yes"; then
+  gmp_prog_cc_works=yes
+else
+  gmp_prog_cc_works=no
+fi
+
+echo "$ECHO_T""$tmp_works" 1>&6
+
+      if test "$gmp_prog_cc_works" = "yes"; then
+
+  gmp_tmp_CC_save="$CC"
+  CC="$c"
+  echo $ECHO_N "checking whether the C compiler ($CC) is 64-bit capable... $ECHO_C" 1>&6
+echo "configure:1648: checking whether the C compiler ($CC) is 64-bit capable" 1>&5
+  if test -z "$NM"; then
+    echo; echo "configure: GMP_CHECK_CC_64BIT: fatal: need nm"
+    exit 1
+  fi
+  gmp_tmp_CFLAGS_save="$CFLAGS"
+  CFLAGS="$c_flags"
+
+  case "$target" in
+    hppa2.0*-*-*)
+      # FIXME: If gcc is installed under another name than "gcc", we will
+      # test the wrong thing.
+      if test "$CC" != "gcc"; then
+                                                echo >conftest.c
+        gmp_tmp_vs=`$CC $CFLAGS -V -c -o conftest.o conftest.c 2>&1 | grep "^ccom:"`
+        rm conftest*
+        gmp_tmp_v1=`echo $gmp_tmp_vs | sed 's/.* .\.\(.*\)\..*\..* HP C.*/\1/'`
+        gmp_tmp_v2=`echo $gmp_tmp_vs | sed 's/.* .\..*\.\(.*\)\..* HP C.*/\1/'`
+        gmp_tmp_v3=`echo $gmp_tmp_vs | sed 's/.* .\..*\..*\.\(.*\) HP C.*/\1/'`
+       gmp_cv_cc_64bit=no
+       test -n "$gmp_tmp_v1" && test "$gmp_tmp_v1" -ge "10" \
+         && test -n "$gmp_tmp_v2" && test "$gmp_tmp_v2" -ge "32" \
+         && test -n "$gmp_tmp_v3" && test "$gmp_tmp_v3" -ge "30" \
+         && gmp_cv_cc_64bit=yes
+      else     # gcc
+       # FIXME: Compile a minimal file and determine if the resulting object
+       # file is an ELF file.  If so, gcc can produce 64-bit code.
+       # Do we have file(1) for target?
+       gmp_cv_cc_64bit=no
+      fi
+      ;;
+    mips-sgi-irix6.*)
+      # We use `-n32' to cc and `-mabi=n32' to gcc, resulting in 64-bit
+      # arithmetic but not 64-bit pointers, so the general test for sizeof
+      # (void *) is not valid.
+      # Simply try to compile an empty main.  If that succeeds return
+      # true.
+      cat >conftest.$ac_ext <<EOF
+#line 1686 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+EOF
+if { (eval echo configure:1697: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  gmp_cv_cc_64bit=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  gmp_cv_cc_64bit=no
+fi
+rm -f conftest*
+      ;;
+    *-*-*)
+      # Allocate an array of size sizeof (void *) and use nm to determine its
+      # size.  We depend on the first declared variable being put at address 0.
+      cat >conftest.c <<EOF
+char arr[sizeof (void *)]={0};
+char post=0;
+EOF
+      gmp_compile="$CC $CFLAGS -c conftest.c 1>&5"
+      if { (eval echo configure:1716: \"$gmp_compile\") 1>&5; (eval $gmp_compile) 2>&5; }; then
+               gmp_tmp_val=`$NM conftest.o | grep post | sed -e 's;[[][0-9][]]\(.*\);\1;' \
+          -e 's;[^1-9]*\([0-9]*\).*;\1;'`
+                if test "$gmp_tmp_val" = "8"; then
+         gmp_cv_cc_64bit=yes
+       else
+         gmp_cv_cc_64bit=no
+        fi
+      else
+        echo "configure: failed program was:" >&5
+        cat conftest.$ac_ext >&5
+        gmp_cv_cc_64bit=no
+      fi
+      rm -f conftest*
+      ;;
+  esac
+
+  CC="$gmp_tmp_CC_save"
+  CFLAGS="$gmp_tmp_CFLAGS_save"
+  echo "$ECHO_T""$gmp_cv_cc_64bit" 1>&6
+
+        if test "$gmp_cv_cc_64bit" = "yes"; then
+          test -z "$CC64" && CC64="$c"
+          test -z "$CFLAGS64" && CFLAGS64="$c_flags"
+         # We have CC64 so we're done.
+          break
+        fi
+      fi
+    else
+      # We have CC32, and we don't need a 64-bit compiler so we're done.
+      break
+    fi
+  fi
+done
+CC="$CC32"
+
+  # If 64-bit OS and we have a 64-bit compiler, use it.
+  if test -n "$os_64bit" && test -n "$CC64"; then
+    CC=$CC64
+    CFLAGS=$CFLAGS64
+  else
+    eval CFLAGS=\$gmp_cflags_$CC
+  fi
+
+  # Try compiler flags that may work with only some compiler versions.
+  # gmp_optcflags: All or nothing.
+  eval optcflags=\$gmp_optcflags_$CC
+  if test -n "$optcflags"; then
+    CFLAGS_save="$CFLAGS"
+    CFLAGS="$CFLAGS $optcflags"
+    echo $ECHO_N "checking whether $CC accepts $optcflags... $ECHO_C" 1>&6
+echo "configure:1767: checking whether $CC accepts $optcflags" 1>&5
+    ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+    cat >conftest.$ac_ext <<EOF
+
+#line 1777 "configure"
+#include "confdefs.h"
+
+int main(){return(0);}
+EOF
+if { (eval echo configure:1782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  optok=yes
+  # If we can't run a trivial program, we are probably using a cross compiler.
+  if (./conftest; exit) 2>/dev/null; then
+    cross=no
+  else
+    cross=yes
+  fi
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  optok=no
+fi
+rm -fr conftest*
+    if test "$optok" = "yes"; then
+      echo "$ECHO_T""yes" 1>&6
+    else
+      echo "$ECHO_T""no" 1>&6
+      CFLAGS="$CFLAGS_save"
+    fi
+  fi
+  # gmp_xoptcflags: First is best, one has to work.
+  eval xoptcflags=\$gmp_xoptcflags_$CC
+  if test -n "$xoptcflags"; then
+    gmp_found="no"
+    for xopt in $xoptcflags; do
+      CFLAGS_save="$CFLAGS"
+      CFLAGS="$CFLAGS $xopt"
+      echo $ECHO_N "checking whether $CC accepts $xopt... $ECHO_C" 1>&6
+echo "configure:1811: checking whether $CC accepts $xopt" 1>&5
+      ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+      cat >conftest.$ac_ext <<EOF
+
+#line 1821 "configure"
+#include "confdefs.h"
+
+int main(){return(0);}
+EOF
+if { (eval echo configure:1826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  optok=yes
+  # If we can't run a trivial program, we are probably using a cross compiler.
+  if (./conftest; exit) 2>/dev/null; then
+    cross=no
+  else
+    cross=yes
+  fi
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  optok=no
+fi
+rm -fr conftest*
+      if test "$optok" = "yes"; then
+        echo "$ECHO_T""yes" 1>&6
+        gmp_found="yes"
+        break
+      else
+        echo "$ECHO_T""no" 1>&6
+        CFLAGS="$CFLAGS_save"
+      fi
+    done
+    if test "$gmp_found" = "no"; then
+      echo "$0: fatal: need a compiler that understands one of $xoptcflags"
+      exit 1
+    fi
+  fi
+fi
+
+# Restore CFLAGS given on command line.
+# FIXME: We've run through quite some unnecessary code looking for a
+# nice compiler and working flags for it, just to spoil that with user
+# supplied flags.
+test -n "$gmp_user_CFLAGS" && CFLAGS="$gmp_user_CFLAGS"
+
+# Select chosen compiler.
+
+echo $ECHO_N "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works... $ECHO_C" 1>&6
+echo "configure:1865: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" 1>&5
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat >conftest.$ac_ext <<EOF
+
+#line 1876 "configure"
+#include "confdefs.h"
+
+int main(){return(0);}
+EOF
+if { (eval echo configure:1881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  ac_cv_prog_cc_works=yes
+  # If we can't run a trivial program, we are probably using a cross compiler.
+  if (./conftest; exit) 2>/dev/null; then
+    ac_cv_prog_cc_cross=no
+  else
+    ac_cv_prog_cc_cross=yes
+  fi
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_cv_prog_cc_works=no
+fi
+rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo "$ECHO_T""$ac_cv_prog_cc_works" 1>&6
+if test $ac_cv_prog_cc_works = no; then
+  { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 77; }
+fi
+echo $ECHO_N "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler... $ECHO_C" 1>&6
+echo "configure:1907: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" 1>&5
+echo "$ECHO_T""$ac_cv_prog_cc_cross" 1>&6
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo $ECHO_N "checking whether we are using GNU C... $ECHO_C" 1>&6
+echo "configure:1912: checking whether we are using GNU C" 1>&5
+if test "${ac_cv_prog_gcc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  cat >conftest.c <<EOF
+#ifdef __GNUC__
+  yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1921: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+  ac_cv_prog_gcc=yes
+else
+  ac_cv_prog_gcc=no
+fi
+fi
+echo "$ECHO_T""$ac_cv_prog_gcc" 1>&6
+
+if test "$ac_cv_prog_gcc" = "yes"; then
+  GCC=yes
+else
+  GCC=
+fi
+
+# Set CFLAGS if not already set.
+if test -z "$CFLAGS"; then
+  CFLAGS="-g"
+  if test "$GCC" = "yes"; then
+    CFLAGS="$CFLAGS -O2"
+  fi
+fi
+
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  ac_cv_prog_CC="$CC"
+fi
+
+# How to assemble.
+CCAS="$CC -c"
+
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" 1>&6
+echo "configure:1953: checking how to run the C preprocessor" 1>&5
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+if test "${ac_cv_prog_CPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+    # This must be in double quotes, not single quotes, because CPP may get
+  # substituted into the Makefile and "${CC-cc}" will confuse make.
+  CPP="${CC-cc} -E"
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp.
+
+cat >conftest.$ac_ext <<EOF
+#line 1969 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1975: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP="${CC-cc} -E -traditional-cpp"
+
+cat >conftest.$ac_ext <<EOF
+#line 1987 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1993: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP="${CC-cc} -nologo -E"
+
+cat >conftest.$ac_ext <<EOF
+#line 2005 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2011: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP=/lib/cpp
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+  ac_cv_prog_CPP="$CPP"
+fi
+  CPP="$ac_cv_prog_CPP"
+else
+  ac_cv_prog_CPP="$CPP"
+fi
+echo "$ECHO_T""$CPP" 1>&6
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" 1>&6
+echo "configure:2047: checking for a BSD compatible install" 1>&5
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+    IFS="${IFS=        }"; ac_save_IFS="$IFS"; IFS=":"
+  for ac_dir in $PATH; do
+    # Account for people who put trailing slashes in PATH elements.
+    case "$ac_dir/" in
+    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+    *)
+      # OSF1 and SCO ODT 3.0 have their own names for install.
+      # Don't use installbsd from OSF since it installs stuff as root
+      # by default.
+      for ac_prog in ginstall scoinst install; do
+        if test -f $ac_dir/$ac_prog; then
+         if test $ac_prog = install &&
+            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+           # AIX install.  It has an incompatible calling convention.
+           :
+         elif test $ac_prog = install &&
+           grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
+           # program-specific install script used by HP pwplus--don't use.
+           :
+         else
+           ac_cv_path_install="$ac_dir/$ac_prog -c"
+           break 2
+         fi
+       fi
+      done
+      ;;
+    esac
+  done
+  IFS="$ac_save_IFS"
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL="$ac_cv_path_install"
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL="$ac_install_sh"
+  fi
+fi
+echo "$ECHO_T""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" 1>&6
+echo "configure:2104: checking whether ln -s works" 1>&5
+if test "${ac_cv_prog_LN_S+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  rm -f conftestdata
+if ln -s X conftestdata 2>/dev/null
+then
+  rm -f conftestdata
+  ac_cv_prog_LN_S="ln -s"
+else
+  ac_cv_prog_LN_S=ln
+fi
+fi
+LN_S="$ac_cv_prog_LN_S"
+if test "$ac_cv_prog_LN_S" = "ln -s"; then
+  echo "$ECHO_T""yes" 1>&6
+else
+  echo "$ECHO_T""no" 1>&6
+fi
+
+echo $ECHO_N "checking for suitable m4... $ECHO_C" 1>&6
+echo "configure:2125: checking for suitable m4" 1>&5
+if test "${gmp_cv_prog_m4+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  if test -n "$M4"; then
+  gmp_cv_prog_m4="$M4"
+else
+  cat >conftest.m4 <<\EOF
+define(dollarhash,``$#'')dnl
+ifelse(dollarhash(x),1,`define(t1,Y)',
+``bad: $# not supported (SunOS /usr/bin/m4)
+'')dnl
+ifelse(eval(89),89,`define(t2,Y)',
+`bad: eval() doesnt support 8 or 9 in a constant (OpenBSD 2.6 m4)
+')dnl
+ifelse(t1`'t2,YY,`good
+')dnl
+EOF
+  echo "trying m4" 1>&5
+  gmp_tmp_val="`(m4 conftest.m4) 2>&5`"
+  echo "$gmp_tmp_val" 1>&5
+  if test "$gmp_tmp_val" = good; then
+    gmp_cv_prog_m4="m4"
+  else
+    IFS="${IFS=        }"; ac_save_ifs="$IFS"; IFS=":"
+    ac_dummy="$PATH:/usr/5bin"
+    for ac_dir in $ac_dummy; do
+      test -z "$ac_dir" && ac_dir=.
+      echo "trying $ac_dir/m4" 1>&5
+      gmp_tmp_val="`($ac_dir/m4 conftest.m4) 2>&5`"
+      echo "$gmp_tmp_val" 1>&5
+      if test "$gmp_tmp_val" = good; then
+        gmp_cv_prog_m4="$ac_dir/m4"
+        break
+      fi
+    done
+    IFS="$ac_save_ifs"
+    if test -z "$gmp_cv_prog_m4"; then
+      { echo "configure: error: No usable m4 in \$PATH or /usr/5bin (see config.log for reasons)." 1>&2; exit 1; }
+    fi
+  fi
+  rm -f conftest.m4
+fi
+fi
+echo "$ECHO_T""$gmp_cv_prog_m4" 1>&6
+M4="$gmp_cv_prog_m4"
+
+# Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
+echo "configure:2175: checking for $ac_word" 1>&5
+if test "${ac_cv_prog_AR+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+  for ac_path in `IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  test -z "$ac_dir" && ac_dir=.
+  if test -f $ac_dir/$ac_word; then
+    echo "$ac_dir/$ac_word"
+  fi
+done
+IFS="$ac_save_ifs"
+`; do
+    ac_cv_prog_AR="ar"
+    break
+  done
+fi
+fi
+AR="$ac_cv_prog_AR"
+if test -n "$AR"; then
+  echo "$ECHO_T""$AR" 1>&6
+else
+  echo "$ECHO_T""no" 1>&6
+fi
+
+# ar on AIX needs to know the object file format
+case "$target" in
+  powerpc64*-*-aix*)
+    AR="$AR -X 64"
+    ;;
+esac
+
+if test "$gmp_no_asm_syntax_testing" != "yes"; then
+  echo $ECHO_N "checking how to switch to text section... $ECHO_C" 1>&6
+echo "configure:2213: checking how to switch to text section" 1>&5
+if test "${gmp_cv_check_asm_text+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  case "$target" in
+  *-*-aix*)
+
+    gmp_cv_check_asm_text=".csect .text[PR]"
+
+    ;;
+  *-*-hpux*) gmp_cv_check_asm_text=".code" ;;
+  *) gmp_cv_check_asm_text=".text" ;;
+esac
+
+fi
+echo "$ECHO_T""$gmp_cv_check_asm_text" 1>&6
+echo "define(<TEXT>, <$gmp_cv_check_asm_text>)" >> $gmp_tmpconfigm4
+
+  echo $ECHO_N "checking how to switch to data section... $ECHO_C" 1>&6
+echo "configure:2232: checking how to switch to data section" 1>&5
+if test "${gmp_cv_check_asm_data+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  case "$target" in
+  *-*-aix*)
+
+    gmp_cv_check_asm_data=".csect .data[RW]"
+
+    ;;
+  *) gmp_cv_check_asm_data=".data" ;;
+esac
+
+fi
+echo "$ECHO_T""$gmp_cv_check_asm_data" 1>&6
+echo "define(<DATA>, <$gmp_cv_check_asm_data>)" >> $gmp_tmpconfigm4
+
+  echo $ECHO_N "checking how to export a symbol... $ECHO_C" 1>&6
+echo "configure:2250: checking how to export a symbol" 1>&5
+if test "${gmp_cv_check_asm_globl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  case "$target" in
+  *-*-hpux*) gmp_cv_check_asm_globl=".export" ;;
+  *) gmp_cv_check_asm_globl=".globl" ;;
+esac
+
+fi
+echo "$ECHO_T""$gmp_cv_check_asm_globl" 1>&6
+echo "define(<GLOBL>, <$gmp_cv_check_asm_globl>)" >> $gmp_tmpconfigm4
+
+  echo $ECHO_N "checking what assembly label suffix to use... $ECHO_C" 1>&6
+echo "configure:2264: checking what assembly label suffix to use" 1>&5
+if test "${gmp_cv_check_asm_label_suffix+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  case "$target" in
+  *-*-hpux*) gmp_cv_check_asm_label_suffix="" ;;
+  *) gmp_cv_check_asm_label_suffix=":" ;;
+esac
+
+fi
+echo "$ECHO_T""$gmp_cv_check_asm_label_suffix" 1>&6
+echo "define(<LABEL_SUFFIX>, <\$1$gmp_cv_check_asm_label_suffix>)" >> $gmp_tmpconfigm4
+
+  echo $ECHO_N "checking how the .type assembly directive should be used... $ECHO_C" 1>&6
+echo "configure:2278: checking how the .type assembly directive should be used" 1>&5
+if test "${gmp_cv_check_asm_type+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  ac_assemble="$CCAS $CFLAGS conftest.s 1>&5"
+for gmp_tmp_prefix in @ \# %; do
+  echo "       .type   sym,${gmp_tmp_prefix}function" > conftest.s
+  if { (eval echo configure:2285: \"$ac_assemble\") 1>&5; (eval $ac_assemble) 2>&5; }; then
+    gmp_cv_check_asm_type=".type       \$1,${gmp_tmp_prefix}\$2"
+    break
+  fi
+done
+if test -z "$gmp_cv_check_asm_type"; then
+  gmp_cv_check_asm_type="dnl"
+fi
+
+fi
+echo "$ECHO_T""$gmp_cv_check_asm_type" 1>&6
+echo "define(<TYPE>, <$gmp_cv_check_asm_type>)" >> $gmp_tmpconfigm4
+
+  echo $ECHO_N "checking if the .size assembly directive works... $ECHO_C" 1>&6
+echo "configure:2299: checking if the .size assembly directive works" 1>&5
+if test "${gmp_cv_check_asm_size+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  ac_assemble="$CCAS $CFLAGS conftest.s 1>&5"
+echo ' .size   sym,1' > conftest.s
+if { (eval echo configure:2305: \"$ac_assemble\") 1>&5; (eval $ac_assemble) 2>&5; }; then
+  gmp_cv_check_asm_size=".size \$1,\$2"
+else
+  gmp_cv_check_asm_size="dnl"
+fi
+
+fi
+echo "$ECHO_T""$gmp_cv_check_asm_size" 1>&6
+echo "define(<SIZE>, <$gmp_cv_check_asm_size>)" >> $gmp_tmpconfigm4
+
+echo $ECHO_N "checking what prefix to use for a local label... $ECHO_C" 1>&6
+echo "configure:2316: checking what prefix to use for a local label" 1>&5
+if test "${gmp_cv_check_asm_lsym_prefix+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  if test -z "$NM"; then
+  echo; echo "GMP_CHECK_ASM_LSYM_PREFIX: fatal: need nm"
+  exit 1
+fi
+ac_assemble="$CCAS $CFLAGS conftest.s 1>&5"
+gmp_cv_check_asm_lsym_prefix="L"
+for gmp_tmp_pre in L .L $ L$; do
+  cat > conftest.s <<EOF
+dummy${gmp_cv_check_asm_label_suffix}
+${gmp_tmp_pre}gurkmacka${gmp_cv_check_asm_label_suffix}
+       .byte 0
+EOF
+  if { (eval echo configure:2332: \"$ac_assemble\") 1>&5; (eval $ac_assemble) 2>&5; }; then
+    $NM conftest.o >/dev/null 2>&1
+    gmp_rc=$?
+    if test "$gmp_rc" != "0"; then
+      echo "configure: $NM failure, using default"
+      break
+    fi
+    if $NM conftest.o | grep gurkmacka >/dev/null; then true; else
+      gmp_cv_check_asm_lsym_prefix="$gmp_tmp_pre"
+      break
+    fi
+  else
+    echo "configure: failed program was:" >&5
+    cat conftest.s >&5
+    # Use default.
+  fi
+done
+rm -f conftest*
+
+fi
+echo "$ECHO_T""$gmp_cv_check_asm_lsym_prefix" 1>&6
+echo "define(<LSYM_PREFIX>, <${gmp_cv_check_asm_lsym_prefix}>)" >> $gmp_tmpconfigm4
+
+echo $ECHO_N "checking how to define a 32-bit word... $ECHO_C" 1>&6
+echo "configure:2356: checking how to [define] a 32-bit word" 1>&5
+if test "${gmp_cv_check_asm_w32+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  if test -z "$NM"; then
+  echo; echo "configure: GMP_CHECK_ASM_W32: fatal: need nm"
+  exit 1
+fi
+
+# FIXME: HPUX puts first symbol at 0x40000000, breaking our assumption
+# that it's at 0x0.  We'll have to declare another symbol before the
+# .long/.word and look at the distance between the two symbols.  The
+# only problem is that the sed expression(s) barfs (on Solaris, for
+# example) for the symbol with value 0.  For now, HPUX uses .word.
+
+case "$target" in
+  *-*-hpux*)
+    gmp_cv_check_asm_w32=".word"
+    ;;
+  *-*-*)
+    ac_assemble="$CCAS $CFLAGS conftest.s 1>&5"
+    for gmp_tmp_op in .long .word; do
+      cat > conftest.s <<EOF
+       $gmp_cv_check_asm_data
+       $gmp_cv_check_asm_globl foo
+       $gmp_tmp_op     0
+foo${gmp_cv_check_asm_label_suffix}
+       .byte   0
+EOF
+      if { (eval echo configure:2385: \"$ac_assemble\") 1>&5; (eval $ac_assemble) 2>&5; }; then
+
+        gmp_tmp_val=`$NM conftest.o | grep foo | sed -e 's;[[][0-9][]]\(.*\);\1;' \
+             -e 's;[^1-9]*\([0-9]*\).*;\1;'`
+                if test "$gmp_tmp_val" = "4"; then
+          gmp_cv_check_asm_w32="$gmp_tmp_op"
+          break
+        fi
+      fi
+    done
+    ;;
+esac
+
+if test -z "$gmp_cv_check_asm_w32"; then
+  echo; echo "configure: GMP_CHECK_ASM_W32: fatal: do not know how to define a 32-bit word"
+  exit 1
+fi
+rm -f conftest*
+
+fi
+echo "$ECHO_T""$gmp_cv_check_asm_w32" 1>&6
+echo "define(<W32>, <$gmp_cv_check_asm_w32>)" >> $gmp_tmpconfigm4
+
+  echo $ECHO_N "checking if symbols are prefixed by underscore... $ECHO_C" 1>&6
+echo "configure:2409: checking if symbols are prefixed by underscore" 1>&5
+if test "${gmp_cv_check_asm_underscore+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2414 "configure"
+#include "confdefs.h"
+int underscore_test() {
+return; }
+EOF
+if { (eval echo configure:2419: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  if grep _underscore_test conftest* >/dev/null; then
+    gmp_cv_check_asm_underscore=yes
+  else
+    gmp_cv_check_asm_underscore=no
+  fi
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+
+fi
+echo "$ECHO_T""$gmp_cv_check_asm_underscore" 1>&6
+if test "$gmp_cv_check_asm_underscore" = "yes"; then
+
+echo 'define(<GSYM_PREFIX>, <_>)' >> $gmp_tmpconfigm4
+
+  underscore=yes
+else
+
+echo 'define(<GSYM_PREFIX>, <>)' >> $gmp_tmpconfigm4
+
+  underscore=no
+fi
+
+echo $ECHO_N "checking if .align assembly directive is logarithmic... $ECHO_C" 1>&6
+echo "configure:2446: checking if .align assembly directive is logarithmic" 1>&5
+if test "${gmp_cv_check_asm_align_log+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  if test -z "$NM"; then
+  echo; echo "configure: GMP_CHECK_ASM_ALIGN_LOG: fatal: need nm"
+  exit 1
+fi
+cat > conftest.s <<EOF
+       $gmp_cv_check_asm_data
+       .align  4
+       $gmp_cv_check_asm_globl foo
+       .byte   1
+       .align  4
+foo$gmp_cv_check_asm_label_suffix
+       .byte   2
+EOF
+ac_assemble="$CCAS $CFLAGS conftest.s 1>&5"
+if { (eval echo configure:2464: \"$ac_assemble\") 1>&5; (eval $ac_assemble) 2>&5; }; then
+
+  gmp_tmp_val=`$NM conftest.o | grep foo | sed -e 's;[[][0-9][]]\(.*\);\1;' \
+       -e 's;[^1-9]*\([0-9]*\).*;\1;'`
+    if test "$gmp_tmp_val" = "10" || test "$gmp_tmp_val" = "16"; then
+    gmp_cv_check_asm_align_log=yes
+  else
+    gmp_cv_check_asm_align_log=no
+  fi
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.s >&5
+fi
+rm -f conftest*
+
+fi
+echo "$ECHO_T""$gmp_cv_check_asm_align_log" 1>&6
+
+echo "define(<ALIGN_LOGARITHMIC>,<$gmp_cv_check_asm_align_log>)" >> $gmp_tmpconfigm4
+
+if test "$gmp_cv_check_asm_align_log" = "yes"; then
+  asm_align=log
+else
+  asm_align=nolog
+fi
+
+fi
+
+family=generic
+
+case ${target} in
+  arm*-*-*)
+    path="arm"
+    ;;
+  sparcv9*-*-solaris2.[789]* | sparc64*-*-solaris2.[789]* | ultrasparc*-*-solaris2.[789]*)
+    if test -n "$CC64"; then
+      path="sparc64"
+    else
+      path="sparc32/v9 sparc32/v8 sparc32"
+    fi
+    ;;
+  sparc64-*-linux*)
+    path="sparc64"
+    ;;
+  sparcv8*-*-* | microsparc*-*-*)
+       path="sparc32/v8 sparc32"
+       if test x${floating_point} = xno
+         then extra_functions="udiv_nfp"
+         else extra_functions="udiv_fp"
+       fi
+       ;;
+  sparcv9*-*-* | ultrasparc*-*-*)
+       path="sparc32/v9 sparc32/v8 sparc32"
+       extra_functions="udiv_fp"
+       ;;
+  supersparc*-*-*)
+       path="sparc32/v8/supersparc sparc32/v8 sparc32"
+       extra_functions="udiv"
+       ;;
+  sparc*-*-*) path="sparc32"
+       if test x${floating_point} = xno
+         then extra_functions="udiv_nfp"
+         else extra_functions="udiv_fp"
+       fi
+       ;;
+  hppa7000*-*-*)
+    path="hppa/hppa1_1 hppa"
+    extra_functions="udiv_qrnnd"
+    ;;
+  hppa1.0*-*-*)
+    path="hppa"
+    extra_functions="udiv_qrnnd"
+    ;;
+  hppa2.0w-*-*)
+    path="pa64w"
+    extra_functions="umul_ppmm udiv_qrnnd"
+    ;;
+  hppa2.0*-*-*)
+    if test -n "$CC64"; then
+      path="pa64"
+      extra_functions="umul_ppmm udiv_qrnnd"
+      # We need to use the system compiler, or actually the system assembler,
+      # since GAS has not been ported to understand the 2.0 instructions.
+      CCAS="$CC64 -c"
+    else
+      # FIXME: path should be "hppa/hppa2_0 hppa/hppa1_1 hppa"
+      path="hppa/hppa1_1 hppa"
+      extra_functions="udiv_qrnnd"
+    fi
+    ;;
+  hppa*-*-*)                                   #assume pa7100
+    path="hppa/hppa1_1/pa7100 hppa/hppa1_1 hppa"
+    extra_functions="udiv_qrnnd";;
+  f30[01]-fujitsu-sysv*)
+    path=fujitsu;;
+  alphaev6*-*-*) path="alpha/ev6 alpha"; extra_functions="invert_limb cntlz";;
+  alphaev5*-*-*) path="alpha/ev5 alpha"; extra_functions="invert_limb cntlz";;
+  alpha*-*-*) path="alpha"; extra_functions="invert_limb cntlz";;
+  # Cray vector machines.  This must come after alpha* so that we can
+  # recognize present and future vector processors with a wildcard.
+  *-cray-unicos*)
+    path="cray"
+    extra_functions="mulww";;
+  am29000*-*-*) path="a29k";;
+  a29k*-*-*) path="a29k";;
+
+  # AMD and Intel x86 configurations
+
+  i?86*-*-* | k[5-8]*-*-* | pentium*-*-* | athlon-*-*)
+    gmp_m4postinc="x86/x86-defs.m4"
+    extra_functions="udiv umul"
+    CALLING_CONVENTIONS_OBJS="x86call.o x86check.o"
+
+echo $ECHO_N "checking if the assembler takes cl with shldl... $ECHO_C" 1>&6
+echo "configure:2578: checking if the assembler takes cl with shldl" 1>&5
+if test "${gmp_cv_check_asm_shldl_cl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  cat > conftest.s <<EOF
+       $gmp_cv_check_asm_text
+       shldl   %cl, %eax, %ebx
+EOF
+ac_assemble="$CCAS $CFLAGS conftest.s 1>&5"
+if { (eval echo configure:2587: \"$ac_assemble\") 1>&5; (eval $ac_assemble) 2>&5; }; then
+  gmp_cv_check_asm_shldl_cl=yes
+else
+  gmp_cv_check_asm_shldl_cl=no
+fi
+rm -f conftest*
+
+fi
+echo "$ECHO_T""$gmp_cv_check_asm_shldl_cl" 1>&6
+if test "$gmp_cv_check_asm_shldl_cl" = "yes"; then
+
+echo 'define(<WANT_SHLDL_CL>, <1>)' >> $gmp_tmpconfigm4
+
+else
+
+echo 'define(<WANT_SHLDL_CL>, <0>)' >> $gmp_tmpconfigm4
+
+fi
+
+    echo $ECHO_N "checking if the .align directive accepts an 0x90 fill in .text... $ECHO_C" 1>&6
+echo "configure:2607: checking if the .align directive accepts an 0x90 fill in .text" 1>&5
+if test "${gmp_cv_check_asm_align_fill_0x90+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+
+cat > conftest.s <<EOF
+       $gmp_cv_check_asm_text
+       .align  4, 0x90
+       .byte   0
+       .align  4, 0x90
+EOF
+gmp_tmp_val="`$CCAS $CFLAGS conftest.s 2>&1`"
+if test $? = 0; then
+  echo "$gmp_tmp_val" 1>&5
+  if echo "$gmp_tmp_val" | grep "Warning: Fill parameter ignored for executable section"; then
+    echo "Supressing this warning by omitting 0x90" 1>&5
+    gmp_cv_check_asm_align_fill_0x90=no
+  else
+    gmp_cv_check_asm_align_fill_0x90=yes
+  fi
+else
+  echo "Non-zero exit code" 1>&5
+  echo "$gmp_tmp_val" 1>&5
+  gmp_cv_check_asm_align_fill_0x90=no
+fi
+rm -f conftest*
+
+fi
+echo "$ECHO_T""$gmp_cv_check_asm_align_fill_0x90" 1>&6
+
+echo "define(<ALIGN_FILL_0x90>,<$gmp_cv_check_asm_align_fill_0x90>)" >> $gmp_tmpconfigm4
+
+    # the CPUs below wanting to know about mmx
+    case ${target} in
+      pentiummmx-*-* | pentium[23]-*-* | k6*-*-* | athlon-*-*)
+
+echo $ECHO_N "checking if the assembler knows about MMX instructions... $ECHO_C" 1>&6
+echo "configure:2644: checking if the assembler knows about MMX instructions" 1>&5
+if test "${gmp_cv_check_asm_mmx+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  cat > conftest.s <<EOF
+       $gmp_cv_check_asm_text
+       por     %mm0, %mm0
+EOF
+ac_assemble="$CCAS $CFLAGS conftest.s 1>&5"
+if { (eval echo configure:2653: \"$ac_assemble\") 1>&5; (eval $ac_assemble) 2>&5; }; then
+  gmp_cv_check_asm_mmx=yes
+else
+  gmp_cv_check_asm_mmx=no
+fi
+rm -f conftest*
+
+fi
+echo "$ECHO_T""$gmp_cv_check_asm_mmx" 1>&6
+if test "$gmp_cv_check_asm_mmx" = "yes"; then
+  tmp_mmx=yes
+else
+  echo "configure: warning: +----------------------------------------------------------" 1>&2
+  echo "configure: warning: | WARNING WARNING WARNING" 1>&2
+  echo "configure: warning: | Target CPU has MMX code, but it can't be assembled by" 1>&2
+  echo "configure: warning: |     $CCAS $CFLAGS" 1>&2
+  echo "configure: warning: | Non-MMX replacements will be used." 1>&2
+  echo "configure: warning: | This will be an inferior build." 1>&2
+  echo "configure: warning: +----------------------------------------------------------" 1>&2
+  tmp_mmx=no
+fi
+
+        ;;
+    esac
+
+    # default for anything not otherwise mentioned
+    path="x86"
+
+    case ${target} in
+      i[34]86*-*-*)
+        path="x86"
+        ;;
+      k5*-*-*)
+        # don't know what best suits k5
+        path="x86"
+        ;;
+      i586*-*-* | pentium-*-*)
+       path="x86/pentium x86"
+        ;;
+      pentiummmx-*-*)
+       path="x86/pentium x86"
+       if test "$tmp_mmx" = yes; then
+          path="x86/pentium/mmx $path"
+        fi
+        ;;
+      i686*-*-* | pentiumpro-*-*)
+       path="x86/p6 x86"
+        ;;
+      pentium2-*-*)
+       path="x86/p6 x86"
+       # The pentium/mmx lshift and rshift are good on p6 and can be used
+        # until there's something specific for p6.
+       if test "$tmp_mmx" = yes; then
+          path="x86/p6/mmx x86/pentium/mmx $path"
+        fi
+        ;;
+      pentium3-*-*)
+       path="x86/p6 x86"
+       # The pentium/mmx lshift and rshift are good on p6 and can be used
+        # until there's something specific for p6.
+       if test "$tmp_mmx" = yes; then
+          path="x86/p6/p3mmx x86/p6/mmx x86/pentium/mmx $path"
+        fi
+        ;;
+      k6[23]*-*-*)
+       path="x86/k6 x86"
+       if test "$tmp_mmx" = yes; then
+          path="x86/k6/k62mmx x86/k6/mmx $path"
+        fi
+        ;;
+      k6*-*-*)
+       path="x86/k6 x86"
+       if test "$tmp_mmx" = yes; then
+          path="x86/k6/mmx $path"
+        fi
+        ;;
+      athlon-*-*)
+       path="x86/k7 x86"
+       if test "$tmp_mmx" = yes; then
+          path="x86/k7/mmx $path"
+        fi
+        ;;
+    esac
+    ;;
+
+  i960*-*-*) path="i960";;
+
+  ia64*-*-*) path="ia64";;
+
+# Motorola 68k configurations.  Let m68k mean 68020-68040.
+  m680[234]0*-*-* | m68k*-*-* | \
+  m68*-next-nextstep*)         # Nexts are at least '020
+    path="m68k/mc68020 m68k"
+    family=m68k
+    ;;
+  m68000*-*-*)
+    path="m68k"
+    family=m68k
+    ;;
+
+  m88k*-*-* | m88k*-*-*) path="m88k";;
+  m88110*-*-*) path="m88k/mc88110 m88k";;
+  ns32k*-*-*) path="ns32k";;
+
+  pyramid-*-*) path="pyr";;
+
+  ppc601-*-*) path="power powerpc32";;
+  powerpc64*-*-*) path="powerpc64";;
+  powerpc*-*-*) path="powerpc32";;
+  rs6000-*-* | power-*-* | power2-*-*)
+    path="power"
+    extra_functions="udiv_w_sdiv"
+    ;;
+
+  sh-*-*) path="sh";;
+  sh2-*-*) path="sh/sh2 sh";;
+
+  mips[34]*-*-*) path="mips3";;
+  mips*-*-irix6*) path="mips3";;
+  mips*-*-*) path="mips2";;
+
+  vax*-*-*) path="vax"; extra_functions="udiv_w_sdiv";;
+
+  z8000x*-*-*) path="z8000x"; extra_functions="udiv_w_sdiv";;
+  z8000*-*-*) path="z8000"; extra_functions="udiv_w_sdiv";;
+
+  clipper*-*-*) path="clipper";;
+esac
+
+if test -n "$CALLING_CONVENTIONS_OBJS"; then
+  cat >>confdefs.h <<\EOF
+#define HAVE_CALLING_CONVENTIONS 1
+EOF
+
+fi
+
+case ${target} in
+  i[5-8]86*-*-* | k[5-8]*-*-* | pentium*-*-* | athlon-*-*)
+    # rdtsc is in pentium and up, not in i386 and i486
+    SPEED_CYCLECOUNTER_OBJS=pentium.lo
+    ;;
+  alpha*-*-*)
+    SPEED_CYCLECOUNTER_OBJS=alpha.lo
+    ;;
+  sparcv9*-*-* | ultrasparc*-*-* | sparc64*-*-*)
+    SPEED_CYCLECOUNTER_OBJS=sparcv9.lo
+    ;;
+  hppa2*-*-*)
+    SPEED_CYCLECOUNTER_OBJS=hppa2.lo
+    ;;
+  hppa*-*-*)
+    SPEED_CYCLECOUNTER_OBJS=hppa.lo
+    ;;
+esac
+
+if test -n "$SPEED_CYCLECOUNTER_OBJS"
+then
+  cat >>confdefs.h <<\EOF
+#define HAVE_SPEED_CYCLECOUNTER 1
+EOF
+
+fi
+
+echo $ECHO_N "checking for Cygwin environment... $ECHO_C" 1>&6
+echo "configure:2817: checking for Cygwin environment" 1>&5
+if test "${ac_cv_cygwin+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  cat >conftest.$ac_ext <<EOF
+#line 2822 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+#ifndef __CYGWIN__
+# define __CYGWIN__ __CYGWIN32__
+#endif
+return __CYGWIN__;
+  ;
+  return 0;
+}
+EOF
+if { (eval echo configure:2836: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_cygwin=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_cygwin=no
+fi
+rm -f conftest*
+fi
+echo "$ECHO_T""$ac_cv_cygwin" 1>&6
+CYGWIN=
+test "$ac_cv_cygwin" = yes && CYGWIN=yes
+echo $ECHO_N "checking for mingw32 environment... $ECHO_C" 1>&6
+echo "configure:2851: checking for mingw32 environment" 1>&5
+if test "${ac_cv_mingw32+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  cat >conftest.$ac_ext <<EOF
+#line 2856 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+return __MINGW32__;
+  ;
+  return 0;
+}
+EOF
+if { (eval echo configure:2867: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_mingw32=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_mingw32=no
+fi
+rm -f conftest*
+fi
+echo "$ECHO_T""$ac_cv_mingw32" 1>&6
+MINGW32=
+test "$ac_cv_mingw32" = yes && MINGW32=yes
+echo $ECHO_N "checking for EMX OS/2 environment... $ECHO_C" 1>&6
+echo "configure:2882: checking for EMX OS/2 environment" 1>&5
+if test "${ac_cv_emxos2+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  cat >conftest.$ac_ext <<EOF
+#line 2887 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+return __EMX__;
+  ;
+  return 0;
+}
+EOF
+if { (eval echo configure:2898: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_emxos2=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_emxos2=no
+fi
+rm -f conftest*
+fi
+echo "$ECHO_T""$ac_cv_emxos2" 1>&6
+EMXOS2=
+test "$ac_cv_emxos2" = yes && EMXOS2=yes
+
+echo $ECHO_N "checking for executable suffix... $ECHO_C" 1>&6
+echo "configure:2914: checking for executable suffix" 1>&5
+if test "${ac_cv_exeext+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
+  ac_cv_exeext=.exe
+else
+  rm -f conftest*
+  echo 'int main () { return 0; }' >conftest.$ac_ext
+  ac_cv_exeext=
+  if { (eval echo configure:2924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+    for ac_file in conftest.*; do
+      case $ac_file in
+      *.c | *.C | *.o | *.obj | *.xcoff) ;;
+      *) ac_cv_exeext=`echo $ac_file | sed -e s/conftest//` ;;
+      esac
+    done
+  else
+    { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
+  fi
+  rm -f conftest*
+  test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
+fi
+fi
+
+EXEEXT=""
+test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
+echo "$ECHO_T""${ac_cv_exeext}" 1>&6
+ac_exeext=$EXEEXT
+
+echo $ECHO_N "checking for object suffix... $ECHO_C" 1>&6
+echo "configure:2945: checking for object suffix" 1>&5
+if test "${ac_cv_objext+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  rm -f conftest*
+echo 'int i = 1;' >conftest.$ac_ext
+if { (eval echo configure:2951: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  for ac_file in conftest.*; do
+    case $ac_file in
+    *.c) ;;
+    *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
+    esac
+  done
+else
+  { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
+fi
+rm -f conftest*
+fi
+
+echo "$ECHO_T""$ac_cv_objext" 1>&6
+OBJEXT=$ac_cv_objext
+ac_objext=$ac_cv_objext
+
+case "$target" in
+  *-*-aix4.[3-9]*) enable_shared=no ;;
+esac
+# Check whether --enable-shared or --disable-shared was given.
+if test "${enable_shared+set}" = set; then
+  enableval="$enable_shared"
+  p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_shared=yes ;;
+no) enable_shared=no ;;
+*)
+  enable_shared=no
+  # Look at the argument we got.  We use all the common list separators.
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+  for pkg in $enableval; do
+    if test "X$pkg" = "X$p"; then
+      enable_shared=yes
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac
+else
+  enable_shared=yes
+fi
+# Check whether --enable-static or --disable-static was given.
+if test "${enable_static+set}" = set; then
+  enableval="$enable_static"
+  p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_static=yes ;;
+no) enable_static=no ;;
+*)
+  enable_static=no
+  # Look at the argument we got.  We use all the common list separators.
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+  for pkg in $enableval; do
+    if test "X$pkg" = "X$p"; then
+      enable_static=yes
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac
+else
+  enable_static=yes
+fi
+# Check whether --enable-fast-install or --disable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+  enableval="$enable_fast_install"
+  p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_fast_install=yes ;;
+no) enable_fast_install=no ;;
+*)
+  enable_fast_install=no
+  # Look at the argument we got.  We use all the common list separators.
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+  for pkg in $enableval; do
+    if test "X$pkg" = "X$p"; then
+      enable_fast_install=yes
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac
+else
+  enable_fast_install=yes
+fi
+
+echo $ECHO_N "checking build system type... $ECHO_C" 1>&6
+echo "configure:3039: checking build system type" 1>&5
+if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
+
+  # Make sure we can run config.sub.
+  if $ac_config_sub sun4 >/dev/null 2>&1; then :; else
+    { echo "configure: error: cannot run $ac_config_sub" 1>&2; exit 1; }
+  fi
+
+  ac_cv_build_alias=$build
+  case "$ac_cv_build_alias" in
+  NONE)
+    case $nonopt in
+    NONE)
+      ac_cv_build_alias=$host_alias ;;
+    *) ac_cv_build_alias=$nonopt ;;
+    esac ;;
+  esac
+
+  ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || exit 1
+  ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+  ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+  ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+else
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+fi
+
+echo "$ECHO_T""$ac_cv_build" 1>&6
+
+build=$ac_cv_build
+build_alias=$ac_cv_build_alias
+build_cpu=$ac_cv_build_cpu
+build_vendor=$ac_cv_build_vendor
+build_os=$ac_cv_build_os
+
+# Check whether --with-gnu-ld or --without-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+  withval="$with_gnu_ld"
+  test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$ac_cv_prog_gcc" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  echo $ECHO_N "checking for ld used by GCC... $ECHO_C" 1>&6
+echo "configure:3085: checking for ld used by GCC" 1>&5
+  case $lt_target in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case "$ac_prog" in
+    # Accept absolute paths.
+    [\\/]* | [A-Za-z]:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the path of ld
+      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+       ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  echo $ECHO_N "checking for GNU ld... $ECHO_C" 1>&6
+echo "configure:3115: checking for GNU ld" 1>&5
+else
+  echo $ECHO_N "checking for non-GNU ld... $ECHO_C" 1>&6
+echo "configure:3118: checking for non-GNU ld" 1>&5
+fi
+if test "${ac_cv_path_LD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  if test -z "$LD"; then
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      ac_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some GNU ld's only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+       test "$with_gnu_ld" != no && break
+      else
+       test "$with_gnu_ld" != yes && break
+      fi
+    fi
+  done
+  IFS="$ac_save_ifs"
+else
+  ac_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$ac_cv_path_LD"
+if test -n "$LD"; then
+  echo "$ECHO_T""$LD" 1>&6
+else
+  echo "$ECHO_T""no" 1>&6
+fi
+test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" 1>&6
+echo "configure:3153: checking if the linker ($LD) is GNU ld" 1>&5
+if test "${ac_cv_prog_gnu_ld+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+  ac_cv_prog_gnu_ld=yes
+else
+  ac_cv_prog_gnu_ld=no
+fi
+fi
+echo "$ECHO_T""$ac_cv_prog_gnu_ld" 1>&6
+with_gnu_ld=$ac_cv_prog_gnu_ld
+
+echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" 1>&6
+echo "configure:3168: checking for $LD option to reload object files" 1>&5
+if test "${lt_cv_ld_reload_flag+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  lt_cv_ld_reload_flag='-r'
+fi
+echo "$ECHO_T""$lt_cv_ld_reload_flag" 1>&6
+reload_flag=$lt_cv_ld_reload_flag
+test -n "$reload_flag" && reload_flag=" $reload_flag"
+
+echo $ECHO_N "checking how to recognise dependant libraries... $ECHO_C" 1>&6
+echo "configure:3179: checking how to recognise dependant libraries" 1>&5
+if test "${lt_cv_deplibs_check_method+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  lt_cv_file_magic_cmd='${MAGIC}'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [regex]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given egrep regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case "$host_os" in
+aix4* | beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi4*)
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+    lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin* | mingw*)
+  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+  lt_cv_file_magic_cmd='${OBJDUMP} -f'
+  ;;
+
+freebsd*)
+  case "$version_type" in
+  freebsd-elf*)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+
+gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+irix5* | irix6*)
+  case "$host_os" in
+  irix5*)
+    # this will be overridden with pass_all, but let us keep it just in case
+    lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
+    ;;
+  *)
+    case "$LD" in
+    *-32|*"-32 ") libmagic=32-bit;;
+    *-n32|*"-n32 ") libmagic=N32;;
+    *-64|*"-64 ") libmagic=64-bit;;
+    *) libmagic=never-match;;
+    esac
+    # this will be overridden with pass_all, but let us keep it just in case
+        lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
+        ;;
+  esac
+  lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be Linux ELF.
+linux-gnu*)
+  case "$host_cpu" in
+  alpha* | i*86 | powerpc* | sparc* )
+    lt_cv_deplibs_check_method=pass_all ;;
+  *)
+    # glibc up to 2.1.1 does not perform some relocations on ARM
+        lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
+      esac
+  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+  ;;
+
+osf3* | osf4* | osf5*)
+  # this will be overridden with pass_all, but let us keep it just in case
+  lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sco3.2v5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  lt_cv_file_magic_test_file=/lib/libc.so
+  ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  case "$host_vendor" in
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  motorola)
+        lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+        lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  esac
+  ;;
+esac
+
+fi
+echo "$ECHO_T""$lt_cv_deplibs_check_method" 1>&6
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+
+if test $host != $build; then
+  ac_tool_prefix=${host_alias}-
+else
+  ac_tool_prefix=
+fi
+
+# Only perform the check for file, if the check method requires it
+case "$deplibs_check_method" in
+file_magic*)
+  if test "$file_magic_cmd" = '${MAGIC}'; then
+
+echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" 1>&6
+echo "configure:3303: checking for ${ac_tool_prefix}file" 1>&5
+if test "${lt_cv_path_MAGIC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  case "$MAGIC" in
+  /*)
+  lt_cv_path_MAGIC="$MAGIC" # Let the user override the test with a path.
+  ;;
+  ?:/*)
+  ac_cv_path_MAGIC="$MAGIC" # Let the user override the test with a dos path.
+  ;;
+  *)
+  ac_save_MAGIC="$MAGIC"
+  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="/usr/bin:$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/${ac_tool_prefix}file; then
+      lt_cv_path_MAGIC="$ac_dir/${ac_tool_prefix}file"
+      if test -n "$file_magic_test_file"; then
+       case "$deplibs_check_method" in
+       "file_magic "*)
+         file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+         MAGIC="$lt_cv_path_MAGIC"
+         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+           egrep "$file_magic_regex" > /dev/null; then
+           :
+         else
+           cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+EOF
+         fi ;;
+       esac
+      fi
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  MAGIC="$ac_save_MAGIC"
+  ;;
+esac
+fi
+
+MAGIC="$lt_cv_path_MAGIC"
+if test -n "$MAGIC"; then
+  echo "$ECHO_T""$MAGIC" 1>&6
+else
+  echo "$ECHO_T""no" 1>&6
+fi
+
+if test -z "$lt_cv_path_MAGIC"; then
+  if test -n "$ac_tool_prefix"; then
+    echo $ECHO_N "checking for file... $ECHO_C" 1>&6
+echo "configure:3365: checking for file" 1>&5
+if test "${lt_cv_path_MAGIC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  case "$MAGIC" in
+  /*)
+  lt_cv_path_MAGIC="$MAGIC" # Let the user override the test with a path.
+  ;;
+  ?:/*)
+  ac_cv_path_MAGIC="$MAGIC" # Let the user override the test with a dos path.
+  ;;
+  *)
+  ac_save_MAGIC="$MAGIC"
+  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="/usr/bin:$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/file; then
+      lt_cv_path_MAGIC="$ac_dir/file"
+      if test -n "$file_magic_test_file"; then
+       case "$deplibs_check_method" in
+       "file_magic "*)
+         file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+         MAGIC="$lt_cv_path_MAGIC"
+         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+           egrep "$file_magic_regex" > /dev/null; then
+           :
+         else
+           cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+EOF
+         fi ;;
+       esac
+      fi
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  MAGIC="$ac_save_MAGIC"
+  ;;
+esac
+fi
+
+MAGIC="$lt_cv_path_MAGIC"
+if test -n "$MAGIC"; then
+  echo "$ECHO_T""$MAGIC" 1>&6
+else
+  echo "$ECHO_T""no" 1>&6
+fi
+
+  else
+    MAGIC=:
+  fi
+fi
+
+  fi
+  ;;
+esac
+
+case "$target" in
+NONE) lt_target="$host" ;;
+*) lt_target="$target" ;;
+esac
+
+# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
+echo "configure:3441: checking for $ac_word" 1>&5
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+  for ac_path in `IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  test -z "$ac_dir" && ac_dir=.
+  if test -f $ac_dir/$ac_word; then
+    echo "$ac_dir/$ac_word"
+  fi
+done
+IFS="$ac_save_ifs"
+`; do
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    break
+  done
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+  echo "$ECHO_T""$RANLIB" 1>&6
+else
+  echo "$ECHO_T""no" 1>&6
+fi
+
+if test -z "$ac_cv_prog_RANLIB"; then
+  if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
+echo "configure:3475: checking for $ac_word" 1>&5
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+  for ac_path in `IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  test -z "$ac_dir" && ac_dir=.
+  if test -f $ac_dir/$ac_word; then
+    echo "$ac_dir/$ac_word"
+  fi
+done
+IFS="$ac_save_ifs"
+`; do
+    ac_cv_prog_RANLIB="ranlib"
+    break
+  done
+  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+  echo "$ECHO_T""$RANLIB" 1>&6
+else
+  echo "$ECHO_T""no" 1>&6
+fi
+
+  else
+    RANLIB=":"
+  fi
+fi
+
+# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
+echo "configure:3513: checking for $ac_word" 1>&5
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+  for ac_path in `IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  test -z "$ac_dir" && ac_dir=.
+  if test -f $ac_dir/$ac_word; then
+    echo "$ac_dir/$ac_word"
+  fi
+done
+IFS="$ac_save_ifs"
+`; do
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    break
+  done
+fi
+fi
+STRIP="$ac_cv_prog_STRIP"
+if test -n "$STRIP"; then
+  echo "$ECHO_T""$STRIP" 1>&6
+else
+  echo "$ECHO_T""no" 1>&6
+fi
+
+if test -z "$ac_cv_prog_STRIP"; then
+  if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
+echo "configure:3547: checking for $ac_word" 1>&5
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+  for ac_path in `IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  test -z "$ac_dir" && ac_dir=.
+  if test -f $ac_dir/$ac_word; then
+    echo "$ac_dir/$ac_word"
+  fi
+done
+IFS="$ac_save_ifs"
+`; do
+    ac_cv_prog_STRIP="strip"
+    break
+  done
+  test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":"
+fi
+fi
+STRIP="$ac_cv_prog_STRIP"
+if test -n "$STRIP"; then
+  echo "$ECHO_T""$STRIP" 1>&6
+else
+  echo "$ECHO_T""no" 1>&6
+fi
+
+  else
+    STRIP=":"
+  fi
+fi
+
+# Check for any special flags to pass to ltconfig.
+libtool_flags="--cache-file=$cache_file"
+test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
+test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
+test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
+test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+  enableval="$enable_libtool_lock"
+
+fi
+test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
+test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
+
+# Check whether --with-pic or --without-pic was given.
+if test "${with_pic+set}" = set; then
+  withval="$with_pic"
+  pic_mode="$withval"
+else
+  pic_mode=default
+fi
+test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
+test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case "$lt_target" in
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '#line 3613 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:3614: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+    case "`/usr/bin/file conftest.o`" in
+    *32-bit*)
+      LD="${LD-ld} -32"
+      ;;
+    *N32*)
+      LD="${LD-ld} -n32"
+      ;;
+    *64-bit*)
+      LD="${LD-ld} -64"
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" 1>&6
+echo "configure:3635: checking whether the C compiler needs -belf" 1>&5
+if test "${lt_cv_cc_needs_belf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+
+     ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+     cat >conftest.$ac_ext <<EOF
+#line 3648 "configure"
+#include "confdefs.h"
+
+int
+main()
+{
+
+  ;
+  return 0;
+}
+EOF
+if { (eval echo configure:3659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  lt_cv_cc_needs_belf=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  lt_cv_cc_needs_belf=no
+fi
+rm -f conftest*
+
+     ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+fi
+echo "$ECHO_T""$lt_cv_cc_needs_belf" 1>&6
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+
+esac
+
+# Save cache, so that ltconfig can load it
+cat >confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs.  It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already.  You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+  case `(ac_space=' '; set | grep ac_space) 2>&1` in
+  *ac_space=\ *)
+    # `set' does not quote correctly, so add quotes (double-quote substitution
+    # turns \\\\ into \\, and sed turns \\ into \).
+    sed -n \
+      -e "s/'/'\\\\''/g" \
+      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+    ;;
+  *)
+    # `set' quotes correctly as required by POSIX, so do not add quotes.
+    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+    ;;
+  esac >>confcache
+if cmp -s $cache_file confcache; then :; else
+  if test -w $cache_file; then
+    echo "updating cache $cache_file"
+    cat confcache >$cache_file
+  else
+    echo "not updating unwritable cache $cache_file"
+  fi
+fi
+rm -f confcache
+
+# Actually configure libtool.  ac_aux_dir is where install-sh is found.
+AR="$AR" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+MAGIC="$MAGIC" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
+AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
+objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
+deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
+$libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $lt_target \
+|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
+
+# Reload cache, that may have been modified by ltconfig
+if test -r "$cache_file"; then
+  echo "loading cache $cache_file"
+      test -f "$cache_file" && . $cache_file
+else
+  echo "creating cache $cache_file"
+  >$cache_file
+fi
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+# Redirect the config.log output again, so that the ltconfig log is not
+# clobbered by the next message.
+exec 5>>./config.log
+
+echo $ECHO_N "checking whether optarg is declared... $ECHO_C" 1>&6
+echo "configure:3764: checking whether optarg is declared" 1>&5
+if test "${ac_cv_have_decl_optarg+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  cat >conftest.$ac_ext <<EOF
+#line 3769 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+#ifndef optarg
+  char *p = (char *) optarg;
+#endif
+
+  ;
+  return 0;
+}
+EOF
+if { (eval echo configure:3783: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_have_decl_optarg=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_have_decl_optarg=no
+fi
+rm -f conftest*
+fi
+echo "$ECHO_T""$ac_cv_have_decl_optarg" 1>&6
+if test $ac_cv_have_decl_optarg = yes; then
+  cat >>confdefs.h <<EOF
+#define HAVE_DECL_OPTARG 1
+EOF
+
+else
+  cat >>confdefs.h <<EOF
+#define HAVE_DECL_OPTARG 0
+EOF
+
+fi
+
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" 1>&6
+echo "configure:3808: checking for ANSI C header files" 1>&5
+if test "${ac_cv_header_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+
+cat >conftest.$ac_ext <<EOF
+#line 3814 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3823: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  ac_cv_header_stdc=yes
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+
+cat >conftest.$ac_ext <<EOF
+#line 3841 "configure"
+#include "confdefs.h"
+#include <string.h>
+
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "memchr" >/dev/null 2>&1; then
+  :
+else
+  rm -rf conftest*
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+
+cat >conftest.$ac_ext <<EOF
+#line 3861 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "free" >/dev/null 2>&1; then
+  :
+else
+  rm -rf conftest*
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<EOF
+#line 3883 "configure"
+#include "confdefs.h"
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
+                     || ('j' <= (c) && (c) <= 'r') \
+                     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+        || toupper (i) != TOUPPER (i))
+      exit(2);
+  exit (0);
+}
+EOF
+if { (eval echo configure:3908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  :
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  ac_cv_header_stdc=no
+fi
+rm -fr conftest*
+
+fi
+
+fi
+fi
+echo "$ECHO_T""$ac_cv_header_stdc" 1>&6
+if test $ac_cv_header_stdc = yes; then
+  cat >>confdefs.h <<\EOF
+#define STDC_HEADERS 1
+EOF
+
+fi
+
+for ac_header in getopt.h unistd.h sys/sysctl.h sys/time.h
+do
+ac_ac_Header=`echo "ac_cv_header_$ac_header" | $ac_tr_sh`
+echo $ECHO_N "checking for $ac_header... $ECHO_C" 1>&6
+echo "configure:3935: checking for $ac_header" 1>&5
+if eval "test \"\${$ac_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+
+cat >conftest.$ac_ext <<EOF
+#line 3941 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3947: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "$ac_ac_Header=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "$ac_ac_Header=no"
+fi
+rm -f conftest*
+fi
+echo "$ECHO_T""`eval echo '${'$ac_ac_Header'}'`" 1>&6
+if test `eval echo '${'$ac_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $ac_tr_cpp` 1
+EOF
+
+fi
+done
+
+echo $ECHO_N "checking for void... $ECHO_C" 1>&6
+echo "configure:3971: checking for void" 1>&5
+if test "${ac_cv_type_void+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  cat >conftest.$ac_ext <<EOF
+#line 3976 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+if ((void *) 0)
+  return 0;
+if (sizeof (void))
+  return 0;
+  ;
+  return 0;
+}
+EOF
+if { (eval echo configure:3990: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_type_void=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_type_void=no
+fi
+rm -f conftest*
+fi
+echo "$ECHO_T""$ac_cv_type_void" 1>&6
+if test $ac_cv_type_void = yes; then
+  cat >>confdefs.h <<EOF
+#define HAVE_VOID 1
+EOF
+
+fi
+
+echo $ECHO_N "checking for preprocessor stringizing operator... $ECHO_C" 1>&6
+echo "configure:4010: checking for preprocessor stringizing operator" 1>&5
+if test "${ac_cv_c_stringize+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+
+cat >conftest.$ac_ext <<EOF
+#line 4016 "configure"
+#include "confdefs.h"
+
+#define x(y) #y
+
+char *s = x(teststring);
+
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "#teststring" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ac_cv_c_stringize=no
+else
+  rm -rf conftest*
+  ac_cv_c_stringize=yes
+fi
+rm -f conftest*
+
+fi
+
+if test "${ac_cv_c_stringize}" = yes; then
+  cat >>confdefs.h <<\EOF
+#define HAVE_STRINGIZE 1
+EOF
+
+fi
+echo "$ECHO_T""${ac_cv_c_stringize}" 1>&6
+
+for ac_func in getopt_long getpagesize popen processor_info strtoul sysconf sysctlbyname
+do
+ac_ac_var=`echo "ac_cv_func_$ac_func" | $ac_tr_sh`
+echo $ECHO_N "checking for $ac_func... $ECHO_C" 1>&6
+echo "configure:4048: checking for $ac_func" 1>&5
+if eval "test \"\${$ac_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  cat >conftest.$ac_ext <<EOF
+#line 4053 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char $ac_func();
+char (*f)();
+
+int
+main()
+{
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+f = $ac_func;
+#endif
+
+  ;
+  return 0;
+}
+EOF
+if { (eval echo configure:4081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "$ac_ac_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "$ac_ac_var=no"
+fi
+rm -f conftest*
+
+fi
+echo "$ECHO_T""`eval echo '${'$ac_ac_var'}'`" 1>&6
+if test `eval echo '${'$ac_ac_var'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $ac_tr_cpp` 1
+EOF
+
+fi
+done
+
+echo $ECHO_N "checking if ansi2knr should be used... $ECHO_C" 1>&6
+echo "configure:4103: checking if ansi2knr should be used" 1>&5
+if test "${gmp_cv_c_ansi2knr+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+  cat >conftest.c <<EOF
+int main (int argc, char *argv) { return 0; }
+EOF
+if { (eval echo configure:4110: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  gmp_cv_c_ansi2knr=no
+else
+  gmp_cv_c_ansi2knr=yes
+fi
+rm -f conftest.*
+
+fi
+echo "$ECHO_T""$gmp_cv_c_ansi2knr" 1>&6
+if test $gmp_cv_c_ansi2knr = no; then
+  U= ANSI2KNR=
+else
+  U=_ ANSI2KNR=./ansi2knr
+  # Ensure some checks needed by ansi2knr itself.
+
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" 1>&6
+echo "configure:4126: checking for ANSI C header files" 1>&5
+if test "${ac_cv_header_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+
+cat >conftest.$ac_ext <<EOF
+#line 4132 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4141: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  ac_cv_header_stdc=yes
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+
+cat >conftest.$ac_ext <<EOF
+#line 4159 "configure"
+#include "confdefs.h"
+#include <string.h>
+
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "memchr" >/dev/null 2>&1; then
+  :
+else
+  rm -rf conftest*
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+
+cat >conftest.$ac_ext <<EOF
+#line 4179 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "free" >/dev/null 2>&1; then
+  :
+else
+  rm -rf conftest*
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<EOF
+#line 4201 "configure"
+#include "confdefs.h"
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
+                     || ('j' <= (c) && (c) <= 'r') \
+                     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+        || toupper (i) != TOUPPER (i))
+      exit(2);
+  exit (0);
+}
+EOF
+if { (eval echo configure:4226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  :
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  ac_cv_header_stdc=no
+fi
+rm -fr conftest*
+
+fi
+
+fi
+fi
+echo "$ECHO_T""$ac_cv_header_stdc" 1>&6
+if test $ac_cv_header_stdc = yes; then
+  cat >>confdefs.h <<\EOF
+#define STDC_HEADERS 1
+EOF
+
+fi
+
+  for ac_header in string.h
+do
+ac_ac_Header=`echo "ac_cv_header_$ac_header" | $ac_tr_sh`
+echo $ECHO_N "checking for $ac_header... $ECHO_C" 1>&6
+echo "configure:4253: checking for $ac_header" 1>&5
+if eval "test \"\${$ac_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" 1>&6
+else
+
+cat >conftest.$ac_ext <<EOF
+#line 4259 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4265: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "$ac_ac_Header=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "$ac_ac_Header=no"
+fi
+rm -f conftest*
+fi
+echo "$ECHO_T""`eval echo '${'$ac_ac_Header'}'`" 1>&6
+if test `eval echo '${'$ac_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $ac_tr_cpp` 1
+EOF
+
+fi
+done
+
+fi
+
+syntax=
+# For now, we use the old switch for setting syntax.
+# FIXME: Remove when conversion to .asm is completed.
+case "${target}" in
+  m680[234]0*-*-linuxaout* | m68k*-*-linuxaout* | \
+  m68k-next-nextstep* | \
+  m68000*-*-*)
+    syntax=mit
+    ;;
+  m680[234]0*-*-linux* | m68k*-*-linux*)
+    syntax=elf
+    ;;
+  m680[234]0*-*-* | m68k*-*-*)
+    syntax=mit
+    ;;
+esac
+
+# Now build an asm-syntax.h file for targets that include that from the
+# assembly files.
+# FIXME: Remove when conversion to .asm is completed.
+case "${family}-${underscore}-${asm_align}-${syntax}" in
+  m68k-yes-log-mit)
+    echo '#define MIT_SYNTAX' >asm-syntax.h
+    cat $srcdir/mpn/underscore.h >>asm-syntax.h
+    echo '#include "'$srcdir'/mpn/m68k/syntax.h"' >>asm-syntax.h;;
+  m68k-no-nolog-elf)
+    echo '#define ELF_SYNTAX' >asm-syntax.h
+    echo '#define C_SYMBOL_NAME(name) name' >>asm-syntax.h
+    echo '#include "'$srcdir'/mpn/m68k/syntax.h"' >>asm-syntax.h;;
+esac
+
+# The pattern here tests for an absolute path the same way as
+# _AC_OUTPUT_FILES in autoconf acgeneral.m4.
+
+echo "dnl  CONFIG_TOP_SRCDIR is a path from the mpn builddir to the top srcdir" >> $gmp_tmpconfigm4
+
+case "$srcdir" in
+[\\/]* | ?:[\\/]* )
+
+echo "define(<CONFIG_TOP_SRCDIR>,<\`$srcdir'>)" >> $gmp_tmpconfigm4
+    ;;
+*)
+
+echo "define(<CONFIG_TOP_SRCDIR>,<\`../$srcdir'>)" >> $gmp_tmpconfigm4
+ ;;
+esac
+
+echo "include(CONFIG_TOP_SRCDIR\`/mpn/asm-defs.m4')" >> $gmp_tmpconfigm4p
+
+# Must be after asm-defs.m4
+
+echo "define_not_for_expansion(\`HAVE_TARGET_CPU_$target_cpu')" >> $gmp_tmpconfigm4p
+
+case "$target" in
+  alpha*-cray-unicos*)
+    gmp_m4postinc="alpha/unicos.m4"
+    ;;
+  alpha*-*-*)
+    gmp_m4postinc="alpha/default.m4"
+    ;;
+  power*-*-*)
+    case "$target" in
+      *-*-mach* | *-*-rhapsody* | *-*-nextstep*)
+        ;;     # these use non-conventional assembly syntax.
+      powerpc64-*-aix*)
+       gmp_m4postinc="powerpc32/regmap.m4 powerpc64/aix.m4"
+        ;;
+      *-*-aix*)
+       gmp_m4postinc="powerpc32/regmap.m4 powerpc32/aix.m4"
+        ;;
+      *)
+       gmp_m4postinc="powerpc32/regmap.m4"
+       ;;
+    esac
+    ;;
+esac
+
+for tmp_f in $gmp_m4postinc; do
+
+echo "include_mpn(\`$tmp_f')" >> $gmp_tmpconfigm4p
+
+done
+
+# Set up `gmp_links'.  It's a list of link:file pairs that configure will
+# process to create link -> file.
+gmp_links=
+
+# If the user specified `MPN_PATH', use that instead of the path we've
+# come up with.
+if test -z "$MPN_PATH"; then
+  path="$path generic"
+else
+  path="$MPN_PATH"
+fi
+
+# Pick the correct source files in $path and link them to mpn/.
+# $gmp_mpn_functions lists all functions we need.
+#
+# The rule is to find a file with the function name and a .asm, .S,
+# .s, or .c extension.  Certain multi-function files with special names
+# can provide some functions too.  (mpn/Makefile.am passes
+# -DOPERATION_<func> to get them to generate the right code.)
+
+# FIXME: udiv and umul aren't in $gmp_mpn_functions_optional yet since
+# there's some versions of those files which should be checked for bit
+# rot first.  Put them in $extra_functions for each target for now,
+# change to standard optionals when all are ready.
+
+# Note: The following lines defining $gmp_mpn_functions_optional
+#       and $gmp_mpn_functions are parsed by the "macos/configure"
+#       Perl script. So if you change the lines in a major way
+#       make sure to run and examine the output from
+#
+#           % (cd macos; perl configure)
+
+gmp_mpn_functions_optional="copyi copyd com_n          \
+  and_n andn_n nand_n ior_n iorn_n nior_n xor_n xnor_n"
+
+gmp_mpn_functions="${extra_functions} inlines add_n sub_n mul_1 addmul_1   \
+  submul_1 lshift rshift diveby3 divrem divrem_1 divrem_2                  \
+  mod_1 mod_1_rs pre_mod_1 dump                                            \
+  mul mul_fft mul_n mul_basecase sqr_basecase random                       \
+  random2 sqrtrem get_str set_str scan0 scan1 popcount hamdist cmp perfsqr \
+  bdivmod gcd_1 gcd gcdext tdiv_qr bz_divrem_n sb_divrem_mn jacbase        \
+  $gmp_mpn_functions_optional"
+
+# the list of all object files used by mpn/Makefile.in and the
+# top-level Makefile.in, respectively
+mpn_objects=
+mpn_objs_in_libgmp="mpn/mp_bases.lo"
+
+for tmp_fn in ${gmp_mpn_functions} ; do
+  rm -f mpn/${tmp_fn}.[Ssc] mpn/${tmp_fn}.asm
+
+  # functions that can be provided by multi-function files
+  tmp_mulfunc=
+  case $tmp_fn in
+  add_n|sub_n)       tmp_mulfunc="aors_n"    ;;
+  addmul_1|submul_1) tmp_mulfunc="aorsmul_1" ;;
+  popcount|hamdist)  tmp_mulfunc="popham"    ;;
+  and_n|andn_n|nand_n | ior_n|iorn_n|nior_n | xor_n|xnor_n)
+                     tmp_mulfunc="logops_n"  ;;
+  esac
+
+  found=no
+  for tmp_dir in $path; do
+    for tmp_base in $tmp_fn $tmp_mulfunc; do
+      for tmp_ext in asm S s c; do
+        tmp_file=$srcdir/mpn/$tmp_dir/$tmp_base.$tmp_ext
+        if test -f $tmp_file; then
+          found=yes
+
+          mpn_objects="$mpn_objects ${tmp_fn}.lo"
+          mpn_objs_in_libgmp="$mpn_objs_in_libgmp mpn/${tmp_fn}.lo"
+          gmp_links="$gmp_links mpn/$tmp_fn.$tmp_ext:mpn/$tmp_dir/$tmp_base.$tmp_ext"
+
+          # duplicate AC_DEFINEs are harmless, so it doesn't matter
+          # that multi-function files get grepped here repeatedly
+          gmp_ep="`
+            sed -n 's/^[       ]*MULFUNC_PROLOGUE(\(.*\))/\1/p' $tmp_file ;
+            sed -n 's/^[       ]*PROLOGUE(\(.*\))/\1/p' $tmp_file
+          `"
+          for gmp_tmp in $gmp_ep; do
+            cat >>confdefs.h <<EOF
+#define HAVE_NATIVE_${gmp_tmp} 1
+EOF
+
+          done
+
+          break
+        fi
+      done
+      if test $found = yes; then break ; fi
+    done
+    if test $found = yes; then break ; fi
+  done
+
+  if test $found = no; then
+    for tmp_optional in $gmp_mpn_functions_optional; do
+      if test $tmp_optional = $tmp_fn; then
+        found=yes
+      fi
+    done
+    if test $found = no; then
+      { echo "configure: error: no version of $tmp_fn found in path: $path" 1>&2; exit 1; }
+    fi
+  fi
+done
+
+# Create link for gmp-mparam.h.
+for tmp_dir in $path ; do
+  rm -f gmp-mparam.h
+  if test -f $srcdir/mpn/${tmp_dir}/gmp-mparam.h ; then
+    gmp_links="$gmp_links gmp-mparam.h:mpn/${tmp_dir}/gmp-mparam.h"
+
+    # Copy any KARATSUBA_SQR_THRESHOLD in gmp-mparam.h to config.m4.
+    # Some versions of sqr_basecase.asm use this.
+    tmp_gmp_karatsuba_sqr_threshold="`sed -n 's/^#define KARATSUBA_SQR_THRESHOLD[      ]*\([0-9][0-9]*\).*$/\1/p' $srcdir/mpn/${tmp_dir}/gmp-mparam.h`"
+    if test -n "$tmp_gmp_karatsuba_sqr_threshold"; then
+
+echo "define(<KARATSUBA_SQR_THRESHOLD>,<$tmp_gmp_karatsuba_sqr_threshold>)" >> $gmp_tmpconfigm4
+
+    fi
+
+    break
+  fi
+done
+
+# Dig out the links from `gmp_links' for inclusion in DISTCLEANFILES.
+gmp_srclinks=
+for f in $gmp_links; do
+  gmp_srclinks="$gmp_srclinks `echo $f | sed 's/\(.*\):.*/\1/'`"
+done
+
+echo "creating $gmp_configm4"
+echo "dnl $gmp_configm4.  Generated automatically by configure." > $gmp_configm4
+if test -f $gmp_tmpconfigm4; then
+  echo "changequote(<,>)dnl" >> $gmp_configm4
+  echo "ifdef(<__CONFIG_M4_INCLUDED__>,,<" >> $gmp_configm4
+  cat $gmp_tmpconfigm4 >> $gmp_configm4
+  echo ">)" >> $gmp_configm4
+  echo "changequote(\`,')dnl" >> $gmp_configm4
+  rm $gmp_tmpconfigm4
+fi
+echo "ifdef(\`__CONFIG_M4_INCLUDED__',,\`" >> $gmp_configm4
+if test -f $gmp_tmpconfigm4i; then
+  cat $gmp_tmpconfigm4i >> $gmp_configm4
+  rm $gmp_tmpconfigm4i
+fi
+if test -f $gmp_tmpconfigm4p; then
+  cat $gmp_tmpconfigm4p >> $gmp_configm4
+  rm $gmp_tmpconfigm4p
+fi
+echo "')" >> $gmp_configm4
+echo "define(\`__CONFIG_M4_INCLUDED__')" >> $gmp_configm4
+
+trap '' 1 2 15
+cat >confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs.  It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already.  You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+  case `(ac_space=' '; set | grep ac_space) 2>&1` in
+  *ac_space=\ *)
+    # `set' does not quote correctly, so add quotes (double-quote substitution
+    # turns \\\\ into \\, and sed turns \\ into \).
+    sed -n \
+      -e "s/'/'\\\\''/g" \
+      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+    ;;
+  *)
+    # `set' quotes correctly as required by POSIX, so do not add quotes.
+    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+    ;;
+  esac >>confcache
+if cmp -s $cache_file confcache; then :; else
+  if test -w $cache_file; then
+    echo "updating cache $cache_file"
+    cat confcache >$cache_file
+  else
+    echo "not updating unwritable cache $cache_file"
+  fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[        ]*VPATH[        ]*=[^:]*$/d'
+fi
+
+DEFS=-DHAVE_CONFIG_H
+
+: ${CONFIG_STATUS=./config.status}
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+echo creating $CONFIG_STATUS
+cat >$CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+# Files that config.status was made for.
+config_files="\\
+  Makefile mpf/Makefile mpz/Makefile mpn/Makefile mpq/Makefile
+  mpf/tests/Makefile mpz/tests/Makefile mpq/tests/Makefile mpn/tests/Makefile
+  tests/Makefile tests/rand/Makefile demos/Makefile tune/Makefile
+  mpbsd/Makefile mpbsd/tests/Makefile mpfr/Makefile mpfr/tests/Makefile"
+config_headers="\\
+  config.h:config.in"
+config_links="\\
+  $gmp_links"
+config_commands="\\
+  default-1"
+
+ac_cs_usage="\\
+\\\`$CONFIG_STATUS' instantiates files from templates according to the
+current configuration.
+
+Usage: $CONFIG_STATUS [OPTIONS] FILE...
+
+  --recheck    Update $CONFIG_STATUS by reconfiguring in the same conditions
+  --version    Print the version of Autoconf and exit
+  --help       Display this help and exit
+  --file=FILE[:TEMPLATE]
+               Instantiate the configuration file FILE
+  --header=FILE[:TEMPLATE]
+               Instantiate the configuration header FILE
+
+Configuration files:
+\$config_files
+
+Configuration headers:
+\$config_headers
+
+Configuration links:
+\$config_links
+
+Configuration commands:
+\$config_commands
+
+Report bugs to <bug-autoconf@gnu.org>."
+
+ac_cs_version="\\
+$CONFIG_STATUS generated by autoconf version 2.14a.
+Configured on host `(hostname || uname -n) 2>/dev/null | sed 1q` by
+  `echo "$0 $ac_configure_args" | sed 's/[\\"\`\$]/\\\\&/g'`"
+
+# Root of the tmp file names.  Use pid to allow concurrent executions.
+ac_cs_root=cs\$\$
+ac_given_srcdir=$srcdir
+ac_given_INSTALL="$INSTALL"
+
+# If no file are specified by the user, then we need to provide default
+# value.  By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test \$# != 0
+do
+  case "\$1" in
+  --*=*)
+    ac_option=\`echo "\$1" | sed -e 's/=.*//'\`
+    ac_optarg=\`echo "\$1" | sed -e 's/[^=]*=//'\`
+    shift
+    set dummy "\$ac_option" "\$ac_optarg" \${1+"\$@"}
+    shift
+    ;;
+  -*);;
+  *) # This is not an option, so the user has probably given explicit
+     # arguments.
+     ac_need_defaults=false;;
+  esac
+
+  case "\$1" in
+
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    echo "running \${CONFIG_SHELL-/bin/sh} $0 `echo "$ac_configure_args" | sed 's/[\\"\`\$]/\\\\&/g'` --no-create --no-recursion"
+    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+    echo "\$ac_cs_version"; exit 0 ;;
+  --he | --h)
+    # Conflict between --help and --header
+    echo "$CONFIG_STATUS: ambiguous option: \$ac_option
+Try \\\`$CONFIG_STATUS --help' for more information."; exit 1 ;;
+  -help | --help | --hel )
+    echo "\$ac_cs_usage"; exit 0 ;;
+  --file | --fil | --fi | --f )
+    shift
+    CONFIG_FILES="\$CONFIG_FILES \$1"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    shift
+    CONFIG_HEADERS="\$CONFIG_FILES \$1"
+    ac_need_defaults=false;;
+
+  # Handling of arguments.
+  'Makefile' ) CONFIG_FILES="\$CONFIG_FILES Makefile" ;;
+  'mpf/Makefile' ) CONFIG_FILES="\$CONFIG_FILES mpf/Makefile" ;;
+  'mpz/Makefile' ) CONFIG_FILES="\$CONFIG_FILES mpz/Makefile" ;;
+  'mpn/Makefile' ) CONFIG_FILES="\$CONFIG_FILES mpn/Makefile" ;;
+  'mpq/Makefile' ) CONFIG_FILES="\$CONFIG_FILES mpq/Makefile" ;;
+  'mpf/tests/Makefile' ) CONFIG_FILES="\$CONFIG_FILES mpf/tests/Makefile" ;;
+  'mpz/tests/Makefile' ) CONFIG_FILES="\$CONFIG_FILES mpz/tests/Makefile" ;;
+  'mpq/tests/Makefile' ) CONFIG_FILES="\$CONFIG_FILES mpq/tests/Makefile" ;;
+  'mpn/tests/Makefile' ) CONFIG_FILES="\$CONFIG_FILES mpn/tests/Makefile" ;;
+  'tests/Makefile' ) CONFIG_FILES="\$CONFIG_FILES tests/Makefile" ;;
+  'tests/rand/Makefile' ) CONFIG_FILES="\$CONFIG_FILES tests/rand/Makefile" ;;
+  'demos/Makefile' ) CONFIG_FILES="\$CONFIG_FILES demos/Makefile" ;;
+  'tune/Makefile' ) CONFIG_FILES="\$CONFIG_FILES tune/Makefile" ;;
+  'mpbsd/Makefile' ) CONFIG_FILES="\$CONFIG_FILES mpbsd/Makefile" ;;
+  'mpbsd/tests/Makefile' ) CONFIG_FILES="\$CONFIG_FILES mpbsd/tests/Makefile" ;;
+  'mpfr/Makefile' ) CONFIG_FILES="\$CONFIG_FILES mpfr/Makefile" ;;
+  'mpfr/tests/Makefile' ) CONFIG_FILES="\$CONFIG_FILES mpfr/tests/Makefile" ;;
+  '$gmp_links' ) CONFIG_LINKS="\$CONFIG_LINKS $gmp_links" ;;
+  'default-1' ) CONFIG_COMMANDS="\$CONFIG_COMMANDS default-1" ;;
+  'config.h' ) CONFIG_HEADERS="\$CONFIG_HEADERS config.h:config.in" ;;
+
+  # This is an error.
+  -*) echo "$CONFIG_STATUS: unrecognized option: \$1
+Try \\\`$CONFIG_STATUS --help' for more information."; exit 1 ;;
+  *) echo "$CONFIG_STATUS: invalid argument: \$1"; exit 1 ;;
+  esac
+  shift
+done
+
+EOF
+
+cat >>$CONFIG_STATUS <<\EOF
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+if $ac_need_defaults; then
+  : ${CONFIG_FILES=$config_files}
+  : ${CONFIG_HEADERS=$config_headers}
+  : ${CONFIG_LINKS=$config_links}
+  : ${CONFIG_COMMANDS=$config_commands}
+fi
+
+# Trap to remove the temp files.
+trap 'rm -fr $ac_cs_root*; exit 1' 1 2 15
+
+EOF
+
+cat >>$CONFIG_STATUS <<EOF
+#
+# INIT-COMMANDS section.
+#
+
+EOF
+
+cat >>$CONFIG_STATUS <<EOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+  # Protect against being on the right side of a sed subst in config.status.
+  sed 's/%@/@@/; s/@%/@@/; s/%;t t\$/@;t t/; /@;t t\$/s/[\\\\&%]/\\\\&/g;
+   s/@@/%@/; s/@@/@%/; s/@;t t\$/%;t t/' >\$ac_cs_root.subs <<\\CEOF
+s%@exec_prefix@%$exec_prefix%;t t
+s%@prefix@%$prefix%;t t
+s%@program_transform_name@%$program_transform_name%;t t
+s%@bindir@%$bindir%;t t
+s%@sbindir@%$sbindir%;t t
+s%@libexecdir@%$libexecdir%;t t
+s%@datadir@%$datadir%;t t
+s%@sysconfdir@%$sysconfdir%;t t
+s%@sharedstatedir@%$sharedstatedir%;t t
+s%@localstatedir@%$localstatedir%;t t
+s%@libdir@%$libdir%;t t
+s%@includedir@%$includedir%;t t
+s%@oldincludedir@%$oldincludedir%;t t
+s%@infodir@%$infodir%;t t
+s%@mandir@%$mandir%;t t
+s%@SHELL@%$SHELL%;t t
+s%@ECHO_C@%$ECHO_C%;t t
+s%@ECHO_N@%$ECHO_N%;t t
+s%@ECHO_T@%$ECHO_T%;t t
+s%@CFLAGS@%$CFLAGS%;t t
+s%@CPPFLAGS@%$CPPFLAGS%;t t
+s%@CXXFLAGS@%$CXXFLAGS%;t t
+s%@FFLAGS@%$FFLAGS%;t t
+s%@DEFS@%$DEFS%;t t
+s%@LDFLAGS@%$LDFLAGS%;t t
+s%@LIBS@%$LIBS%;t t
+s%@host@%$host%;t t
+s%@host_alias@%$host_alias%;t t
+s%@host_cpu@%$host_cpu%;t t
+s%@host_vendor@%$host_vendor%;t t
+s%@host_os@%$host_os%;t t
+s%@target@%$target%;t t
+s%@target_alias@%$target_alias%;t t
+s%@target_cpu@%$target_cpu%;t t
+s%@target_vendor@%$target_vendor%;t t
+s%@target_os@%$target_os%;t t
+s%@build@%$build%;t t
+s%@build_alias@%$build_alias%;t t
+s%@build_cpu@%$build_cpu%;t t
+s%@build_vendor@%$build_vendor%;t t
+s%@build_os@%$build_os%;t t
+s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%;t t
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%;t t
+s%@INSTALL_DATA@%$INSTALL_DATA%;t t
+s%@PACKAGE@%$PACKAGE%;t t
+s%@VERSION@%$VERSION%;t t
+s%@ACLOCAL@%$ACLOCAL%;t t
+s%@AUTOCONF@%$AUTOCONF%;t t
+s%@AUTOMAKE@%$AUTOMAKE%;t t
+s%@AUTOHEADER@%$AUTOHEADER%;t t
+s%@MAKEINFO@%$MAKEINFO%;t t
+s%@AMTAR@%$AMTAR%;t t
+s%@install_sh@%$install_sh%;t t
+s%@AWK@%$AWK%;t t
+s%@SET_MAKE@%$SET_MAKE%;t t
+s%@AMDEP@%$AMDEP%;t t
+s%@AMDEPBACKSLASH@%$AMDEPBACKSLASH%;t t
+s%@DEPDIR@%$DEPDIR%;t t
+s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%;t t
+s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%;t t
+s%@MAINT@%$MAINT%;t t
+s%@WANT_MPBSD_TRUE@%$WANT_MPBSD_TRUE%;t t
+s%@WANT_MPBSD_FALSE@%$WANT_MPBSD_FALSE%;t t
+s%@WANT_MPFR_TRUE@%$WANT_MPFR_TRUE%;t t
+s%@WANT_MPFR_FALSE@%$WANT_MPFR_FALSE%;t t
+s%@CC@%$CC%;t t
+s%@CCAS@%$CCAS%;t t
+s%@CPP@%$CPP%;t t
+s%@LN_S@%$LN_S%;t t
+s%@M4@%$M4%;t t
+s%@AR@%$AR%;t t
+s%@CALLING_CONVENTIONS_OBJS@%$CALLING_CONVENTIONS_OBJS%;t t
+s%@SPEED_CYCLECOUNTER_OBJS@%$SPEED_CYCLECOUNTER_OBJS%;t t
+s%@EXEEXT@%$EXEEXT%;t t
+s%@OBJEXT@%$OBJEXT%;t t
+s%@RANLIB@%$RANLIB%;t t
+s%@STRIP@%$STRIP%;t t
+s%@LIBTOOL@%$LIBTOOL%;t t
+s%@U@%$U%;t t
+s%@ANSI2KNR@%$ANSI2KNR%;t t
+s%@mpn_objects@%$mpn_objects%;t t
+s%@mpn_objs_in_libgmp@%$mpn_objs_in_libgmp%;t t
+s%@gmp_srclinks@%$gmp_srclinks%;t t
+CEOF
+
+EOF
+
+  cat >>$CONFIG_STATUS <<\EOF
+  # Split the substitutions into bite-sized pieces for seds with
+  # small command number limits, like on Digital OSF/1 and HP-UX.
+  ac_max_sed_lines=48
+  ac_sed_frag=1 # Number of current file.
+  ac_beg=1 # First line for current file.
+  ac_end=$ac_max_sed_lines # Line after last line for current file.
+  ac_more_lines=:
+  ac_sed_cmds=""
+  while $ac_more_lines; do
+    if test $ac_beg -gt 1; then
+      sed "1,${ac_beg}d; ${ac_end}q" $ac_cs_root.subs >$ac_cs_root.sfrag
+    else
+      sed "${ac_end}q" $ac_cs_root.subs >$ac_cs_root.sfrag
+    fi
+    if test ! -s $ac_cs_root.sfrag; then
+      ac_more_lines=false
+      rm -f $ac_cs_root.sfrag
+    else
+      # The purpose of the label and of the branching condition is to
+      # speed up the sed processing (if there are no `@' at all, there
+      # is no need to browse any of the substitutions).
+      # These are the two extra sed commands mentioned above.
+      (echo ':t
+  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $ac_cs_root.sfrag) >$ac_cs_root.s$ac_sed_frag
+      if test -z "$ac_sed_cmds"; then
+       ac_sed_cmds="sed -f $ac_cs_root.s$ac_sed_frag"
+      else
+       ac_sed_cmds="$ac_sed_cmds | sed -f $ac_cs_root.s$ac_sed_frag"
+      fi
+      ac_sed_frag=`expr $ac_sed_frag + 1`
+      ac_beg=$ac_end
+      ac_end=`expr $ac_end + $ac_max_sed_lines`
+    fi
+  done
+  if test -z "$ac_sed_cmds"; then
+    ac_sed_cmds=cat
+  fi
+fi # test -n "$CONFIG_FILES"
+
+EOF
+cat >>$CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case "$ac_file" in
+  *:*) ac_file_in=`echo "$ac_file" | sed 's%[^:]*:%%'`
+       ac_file=`echo "$ac_file" | sed 's%:.*%%'` ;;
+  *) ac_file_in="${ac_file}.in" ;;
+  esac
+
+  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+  # Remove last slash and all that follows it.  Not all systems have dirname.
+  ac_dir=`echo "$ac_file" | sed 's%/[^/][^/]*$%%'`
+  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+    # The file is in a subdirectory.
+    test ! -d "$ac_dir" && mkdir "$ac_dir"
+    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+    # A "../" for each directory in $ac_dir_suffix.
+    ac_dots=`echo "$ac_dir_suffix" | sed 's%/[^/]*%../%g'`
+  else
+    ac_dir_suffix= ac_dots=
+  fi
+
+  case "$ac_given_srcdir" in
+  .)  srcdir=.
+      if test -z "$ac_dots"; then top_srcdir=.
+      else top_srcdir=`echo $ac_dots | sed 's%/$%%'`; fi ;;
+  [\\/]* | ?:[\\/]* )
+      srcdir="$ac_given_srcdir$ac_dir_suffix";
+      top_srcdir=$ac_given_srcdir ;;
+  *) # Relative path.
+    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+    top_srcdir="$ac_dots$ac_given_srcdir" ;;
+  esac
+
+  case "$ac_given_INSTALL" in
+  [\\/$]* | ?:[\\/]* ) INSTALL="$ac_given_INSTALL" ;;
+  *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+  esac
+
+  echo creating "$ac_file"
+  rm -f "$ac_file"
+  configure_input="Generated automatically from `echo $ac_file_in |
+                                                 sed 's%.*/%%'` by configure."
+  case "$ac_file" in
+  *[Mm]akefile*) ac_comsub="1i\\
+# $configure_input" ;;
+  *) ac_comsub= ;;
+  esac
+
+  # Don't redirect the output to AC_FILE directly: use `mv' so that updating
+  # is atomic, and doesn't need trapping.
+  ac_file_inputs=`echo "$ac_file_in" |
+                  sed -e "s%:% $ac_given_srcdir/%g;s%^%$ac_given_srcdir/%"`
+  for ac_file_input in $ac_file_inputs;
+  do
+    test -f "$ac_file_input" ||
+        { echo "configure: error: cannot find input file \`$ac_file_input'" 1>&2; exit 1; }
+  done
+EOF
+cat >>$CONFIG_STATUS <<EOF
+  sed -e "$ac_comsub
+$ac_vpsub
+$extrasub
+EOF
+cat >>$CONFIG_STATUS <<\EOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s%@configure_input@%$configure_input%;t t
+s%@srcdir@%$srcdir%;t t
+s%@top_srcdir@%$top_srcdir%;t t
+s%@INSTALL@%$INSTALL%;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$ac_cs_root.out
+  mv $ac_cs_root.out $ac_file
+
+fi; done
+rm -f $ac_cs_root.s*
+EOF
+cat >>$CONFIG_STATUS <<\EOF
+
+#
+# CONFIG_HEADER section.
+#
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s%^\([  ]*\)#\([        ]*define[       ][      ]*\)'
+ac_dB='[       ].*$%\1#\2'
+ac_dC=' '
+ac_dD='%;t'
+# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_uA='s%^\([  ]*\)#\([        ]*\)undef\([    ][      ]*\)'
+ac_uB='$%\1#\2define\3'
+ac_uC=' '
+ac_uD='%;t'
+
+for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case "$ac_file" in
+  *:*) ac_file_in=`echo "$ac_file" | sed 's%[^:]*:%%'`
+       ac_file=`echo "$ac_file" | sed 's%:.*%%'` ;;
+  *) ac_file_in="${ac_file}.in" ;;
+  esac
+
+  echo creating $ac_file
+
+  rm -f $ac_cs_root.frag $ac_cs_root.in $ac_cs_root.out
+  ac_file_inputs=`echo "$ac_file_in" |
+                  sed -e "s%:% $ac_given_srcdir/%g;s%^%$ac_given_srcdir/%"`
+    for ac_file_input in $ac_file_inputs;
+  do
+    test -f "$ac_file_input" ||
+        { echo "configure: error: cannot find input file \`$ac_file_input'" 1>&2; exit 1; }
+  done
+  # Remove the trailing spaces.
+  sed -e 's/[  ]*$//' $ac_file_inputs >$ac_cs_root.in
+
+EOF
+
+# Transform confdefs.h into two sed scripts, `conftest.defines' and
+# `conftest.undefs', that substitutes the proper values into
+# config.h.in to produce config.h.  The first handles `#define'
+# templates, and the second `#undef' templates.
+# And first: Protect against being on the right side of a sed subst in
+# config.status.  Protect against being in an unquoted here document
+# in config.status.
+rm -f conftest.defines conftest.undefs
+ac_cs_root=conftest
+cat >$ac_cs_root.hdr <<\EOF
+s/[\\&%]/\\&/g
+s%[\\$`]%\\&%g
+t clear
+: clear
+s%^[   ]*#[    ]*define[       ][      ]*\(\([^        (][^    (]*\)([^)]*)\)[         ]*\(.*\)$%${ac_dA}\2${ac_dB}\1${ac_dC}\3${ac_dD}%gp
+t cleanup
+s%^[   ]*#[    ]*define[       ][      ]*\([^  ][^     ]*\)[   ]*\(.*\)$%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
+: cleanup
+EOF
+# If some macros were called several times there might be several times
+# the same #defines, which is useless.  Nevertheless, we may not want to
+# sort them, since we want the *last* AC_DEFINE to be honored.
+uniq confdefs.h | sed -n -f $ac_cs_root.hdr >conftest.defines
+sed -e 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
+rm -f $ac_cs_root.hdr
+
+# This sed command replaces #undef with comments.  This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >>conftest.undefs <<\EOF
+s%^[   ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
+EOF
+
+# Break up conftest.defines because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
+echo '  if egrep "^[   ]*#[    ]*define" $ac_cs_root.in >/dev/null; then' >>$CONFIG_STATUS
+echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
+echo '  :' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.defines >/dev/null
+do
+  # Write a limited-size here document to $ac_cs_root.frag.
+  echo '  cat >$ac_cs_root.frag <<CEOF' >>$CONFIG_STATUS
+  echo '/^[    ]*#[    ]*define/!b' >>$CONFIG_STATUS
+  sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+  echo 'CEOF
+  sed -f $ac_cs_root.frag $ac_cs_root.in >$ac_cs_root.out
+  rm -f $ac_cs_root.in
+  mv $ac_cs_root.out $ac_cs_root.in
+' >>$CONFIG_STATUS
+  sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+  rm -f conftest.defines
+  mv conftest.tail conftest.defines
+done
+rm -f conftest.defines
+echo '  fi # egrep' >>$CONFIG_STATUS
+echo >>$CONFIG_STATUS
+
+# Break up conftest.undefs because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo '  # Handle all the #undef templates' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.undefs >/dev/null
+do
+  # Write a limited-size here document to $ac_cs_root.frag.
+  echo '  cat >$ac_cs_root.frag <<CEOF' >>$CONFIG_STATUS
+  echo '/^[    ]*#[    ]*undef/!b' >>$CONFIG_STATUS
+  sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
+  echo 'CEOF
+  sed -f $ac_cs_root.frag $ac_cs_root.in >$ac_cs_root.out
+  rm -f $ac_cs_root.in
+  mv $ac_cs_root.out $ac_cs_root.in
+' >>$CONFIG_STATUS
+  sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
+  rm -f conftest.undefs
+  mv conftest.tail conftest.undefs
+done
+rm -f conftest.undefs
+
+cat >>$CONFIG_STATUS <<\EOF
+  rm -f $ac_cs_root.frag $ac_cs_root.h
+  echo "/* $ac_file.  Generated automatically by configure.  */" >$ac_cs_root.h
+  cat $ac_cs_root.in >>$ac_cs_root.h
+  rm -f $ac_cs_root.in
+  if cmp -s $ac_file $ac_cs_root.h 2>/dev/null; then
+    echo "$ac_file is unchanged"
+    rm -f $ac_cs_root.h
+  else
+    # Remove last slash and all that follows it.  Not all systems have dirname.
+    ac_dir=`echo "$ac_file" | sed 's%/[^/][^/]*$%%'`
+    if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+      # The file is in a subdirectory.
+      test ! -d "$ac_dir" && mkdir "$ac_dir"
+    fi
+    rm -f $ac_file
+    mv $ac_cs_root.h $ac_file
+  fi
+fi; done
+EOF
+cat >>$CONFIG_STATUS <<\EOF
+
+#
+# CONFIG_LINKS section.
+#
+srcdir=$ac_given_srcdir
+
+for ac_file in : $CONFIG_LINKS; do if test "x$ac_file" != x:; then
+  ac_dest=`echo "$ac_file" | sed 's%:.*%%'`
+  ac_source=`echo "$ac_file" | sed 's%[^:]*:%%'`
+
+  echo "linking $srcdir/$ac_source to $ac_dest"
+
+  if test ! -r $srcdir/$ac_source; then
+    { echo "configure: error: $srcdir/$ac_source: File not found" 1>&2; exit 1; }
+  fi
+  rm -f $ac_dest
+
+  # Make relative symlinks.
+  # Remove last slash and all that follows it.  Not all systems have dirname.
+  ac_dest_dir=`echo $ac_dest | sed 's%/[^/][^/]*$%%'`
+  if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
+    # The dest file is in a subdirectory.
+    test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
+    ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`"
+    # A "../" for each directory in $ac_dest_dir_suffix.
+    ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'`
+  else
+    ac_dest_dir_suffix= ac_dots=
+  fi
+
+  case "$srcdir" in
+  [\\/$]* | ?:[\\/]* ) ac_rel_source="$srcdir/$ac_source" ;;
+      *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;;
+  esac
+
+  # Make a symlink if possible; otherwise try a hard link.
+  if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
+     ln $srcdir/$ac_source $ac_dest; then :
+  else
+    { echo "configure: error: cannot link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; }
+  fi
+fi; done
+EOF
+cat >>$CONFIG_STATUS <<\EOF
+
+#
+# CONFIG_COMMANDS section.
+#
+for ac_file in .. $CONFIG_COMMANDS; do if test "x$ac_file" != x..; then
+  ac_dest=`echo "$ac_file" | sed 's%:.*%%'`
+  ac_source=`echo "$ac_file" | sed 's%[^:]*:%%'`
+
+  case "$ac_dest" in
+    default-1 ) test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h ;;
+  esac
+fi;done
+EOF
+
+cat >>$CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+trap 'exit 1' 1 2 15
+
+test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
index da30bfb..6204367 100644 (file)
-# This file is a shell script fragment that supplies the information
-# necessary for a configure script to process the program in
-# this directory.  For more information, look at ../configure.
-AC_INIT(Makefile.in)
+dnl  Process this file with autoconf to produce a configure script.
 
-AC_CONFIG_SUBDIRS(mpn mpz)
 
-srctrigger=gmp-impl.h
-srcname="GNU Multi-Precision library"
+dnl  Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+dnl
+dnl  This file is part of the GNU MP Library.
+dnl
+dnl  The GNU MP Library is free software; you can redistribute it and/or modify
+dnl  it under the terms of the GNU Lesser General Public License as published
+dnl  by the Free Software Foundation; either version 2.1 of the License, or (at
+dnl  your option) any later version.
+dnl
+dnl  The GNU MP Library is distributed in the hope that it will be useful, but
+dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+dnl  License for more details.
+dnl
+dnl  You should have received a copy of the GNU Lesser General Public License
+dnl  along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
+dnl  the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+dnl  MA 02111-1307, USA.
 
-CFLAGS="-O"
 
-# per-target:
+AC_REVISION($Revision: 1.4 $)dnl
+AC_PREREQ(2.14)dnl
+AC_INIT(gmp-impl.h)
 
-case "${target}" in
-  sparc8* | microsparc*)
-    if [ x$with_gcc != xno ]
-    then
-      target_makefile_frag=config/mt-sprc8-gcc
+dnl Check system.
+AC_CANONICAL_SYSTEM
+
+dnl  Automake
+AM_INIT_AUTOMAKE(gmp, GMP_VERSION)
+AM_CONFIG_HEADER(config.h:config.in)
+AM_MAINTAINER_MODE
+
+dnl  GMP specific
+GMP_INIT(config.m4)
+
+
+AC_ARG_ENABLE(assert,
+AC_HELP_STRING([--enable-assert],[enable ASSERT checking [default=no]]),
+[case "${enableval}" in
+yes|no) ;;
+*) AC_MSG_ERROR([bad value ${enableval} for --enable-assert, need yes or no]) ;;
+esac],
+[enable_assert=no])
+
+if test "$enable_assert" = "yes"; then
+  AC_DEFINE(WANT_ASSERT,1,
+  [./configure --enable-assert option, to enable some ASSERT()s])
+fi
+
+
+AC_ARG_ENABLE(alloca,
+AC_HELP_STRING([--enable-alloca],[use alloca for temp space [default=yes]]),
+[case "${enableval}" in
+yes|no) ;;
+*) AC_MSG_ERROR([bad value ${enableval} for --enable-alloca, need yes or no]) ;;
+esac],
+[enable_alloca=yes])
+
+if test "$enable_alloca" = "no"; then
+  AC_DEFINE(USE_STACK_ALLOC,1,
+  [./configure --disable-alloca option, to use stack-alloc.c, not alloca])
+fi
+
+
+AC_ARG_ENABLE(fft,
+AC_HELP_STRING([--enable-fft],[enable FFTs for multiplication [default=no]]),
+[case "${enableval}" in
+yes|no) ;;
+*) AC_MSG_ERROR([bad value ${enableval} for --enable-fft, need yes or no]) ;;
+esac],
+[enable_fft=no])
+
+if test "$enable_fft" = "yes"; then
+  AC_DEFINE(WANT_FFT,1,
+  [./configure --enable-fft option, to enable FFTs for multiplication])
+fi
+
+
+AC_ARG_ENABLE(mpbsd,
+AC_HELP_STRING([--enable-mpbsd],[build Berkley 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(mpfr,
+AC_HELP_STRING([--enable-mpfr],[build MPFR [default=no]]),
+[case "${enableval}" in
+yes|no) ;;
+*) AC_MSG_ERROR([bad value ${enableval} for --enable-mpfr, need yes or no]) ;;
+esac],
+[enable_mpfr=no])
+AM_CONDITIONAL(WANT_MPFR, test "$enable_mpfr" = "yes")
+
+
+dnl Switch on OS and determine what compiler to use.
+dnl
+dnl  os_64bit             Set to "yes" if OS is 64-bit capable.
+dnl                        FIXME: Rename to `check_64bit_compiler'!
+dnl  cclist               List of compilers, best first.
+dnl  gmp_cflags_{cc}      Flags for compiler named {cc}.
+dnl  gmp_cflags64_{cc}     Flags for compiler named {cc} for 64-bit code.
+dnl  gmp_optcflags_{cc}           Optional compiler flags.
+dnl  gmp_xoptcflags_{cc}   Exclusive optional compiler flags.
+dnl
+os_64bit="no"
+cclist="gcc cc"                # FIXME: Prefer c89 to cc.
+gmp_cflags_gcc="-g -O2"
+gmp_cflags64_gcc="-g -O2"
+gmp_cflags_cc="-g"
+gmp_cflags64_cc="-g"
+
+case "$target" in
+  # Alpha
+  alpha*-cray-unicos*)
+    # Don't perform any assembly syntax tests on this beast.
+    gmp_no_asm_syntax_testing=yes
+    cclist=cc
+    gmp_cflags_cc="$gmp_cflags_cc -O"
+    ;;
+  alpha*-*-osf*)
+    flavour=`echo $target_cpu | sed 's/^alpha//g'`
+    if test -n "$flavour"; then
+      case $flavour in    # compilers don't seem to understand `ev67' and such.
+       ev6? | ev7*) flavour=ev6;;
+      esac
+      gmp_optcflags_gcc="-mcpu=$flavour"
+      # FIXME: We shouldn't fail fatally if none of these work, but that's
+      # how xoptcflags work and we don't have any other mechanism right now.
+      # Why do we need this here and not for alpha*-*-* below?
+      gmp_xoptcflags_gcc="-Wa,-arch,${flavour} -Wa,-m${flavour}"
+      gmp_optcflags_cc="-arch $flavour -tune $flavour"
     fi
     ;;
-  supersparc*)
-    if [ x$with_gcc != xno ]
-    then
-      target_makefile_frag=config/mt-supspc-gcc
+  alpha*-*-*)
+    cclist="gcc"
+    flavour=`echo $target_cpu | sed 's/^alpha//g'`
+    if test -n "$flavour"; then
+      case $flavour in
+       ev6? | ev7*) flavour=ev6;;
+      esac
+      gmp_optcflags_gcc="-mcpu=$flavour"
     fi
     ;;
-  m888110*)
-    if [ x$with_gcc != xno ]
-    then
-      target_makefile_frag=config/mt-m88110
+  # Cray vector machines.  This must come after alpha* so that we can
+  # recognize present and future vector processors with a wildcard.
+  *-cray-unicos*)
+    # Don't perform any assembly syntax tests on this beast.
+    gmp_no_asm_syntax_testing=yes
+    cclist=cc
+    # Don't inherit default gmp_cflags_cc value; it comes with -g which
+    # disables all optimization on Cray vector systems
+    gmp_cflags_cc="-O"
+    ;;
+
+  # AMD and Intel x86 configurations
+  [i?86*-*-* | k[5-8]*-*-* | pentium*-*-* | athlon-*-*])
+    # Rumour has it -O2 used to give worse register allocation than just -O.
+    gmp_cflags_gcc="-g -O -fomit-frame-pointer"
+
+    case "${target}" in
+      i386*-*-*)    gmp_optcflags_gcc="-mcpu=i386 -march=i386";;
+      i486*-*-*)    gmp_optcflags_gcc="-mcpu=i486 -march=i486";;
+      i586*-*-* | pentium-*-* | pentiummmx-*-*)
+                    gmp_optcflags_gcc="-mcpu=pentium -march=pentium";;
+
+      # -march=pentiumpro not used because mpz/powm.c (swox cvs rev 1.4)
+      # tickles a bug in gcc 2.95.2 (believed fixed in 2.96).
+      [i686*-*-* | pentiumpro-*-* | pentium[23]-*-*])
+                    gmp_optcflags_gcc="-mcpu=pentiumpro";;
+
+      k6*-*-*)      gmp_optcflags_gcc="-mcpu=k6 -march=k6";;
+
+      # Athlon instruction costs are close to p6: 3 cycle load latency, 4-6
+      # cycle mul, 40 cycle div, pairable adc, ...
+      # FIXME: Change this when gcc gets something specific for Athlon.
+      # -march=pentiumpro not used, per i686 above.
+      athlon-*-*)   gmp_optcflags_gcc="-mcpu=pentiumpro";;
+    esac
+    ;;
+
+  # Sparc
+  [ultrasparc*-*-solaris2.[7-9] | sparcv9-*-solaris2.[7-9]])
+    os_64bit=yes
+    gmp_cflags_gcc="$gmp_cflags_gcc -Wa,-xarch=v8plus"
+    gmp_xoptcflags_gcc="-mcpu=v9 -mcpu=v8 -mv8"
+    gmp_cflags64_gcc="$gmp_cflags64_gcc -m64 -mptr64 -Wa,-xarch=v9 -mcpu=v9"
+    gmp_cflags_cc="-xtarget=native -xarch=v8 -xO4"
+    gmp_cflags64_cc="-xtarget=native -xarch=v9 -xO4"
+    ;;
+  sparc64-*-linux*)
+    os_64bit=yes
+    gmp_cflags64_gcc="$gmp_cflags64_gcc -m64 -mptr64 -Wa,-xarch=v9 -mcpu=v9"
+    gmp_cflags_gcc="$gmp_cflags_gcc -m32"
+    gmp_xoptflags_gcc="-mcpu=ultrasparc -mvis"
+    ;;
+  ultrasparc*-*-* | sparcv9-*-*)
+    gmp_cflags_gcc="$gmp_cflags_gcc -Wa,-xarch=v8plus"
+    gmp_xoptcflags_gcc="-mcpu=v9 -mcpu=v8 -mv8"
+    gmp_cflags_cc="-xtarget=native -xarch=v8 -xO4"
+    ;;
+  sparcv8*-*-solaris2.* | microsparc*-*-solaris2.*)
+    gmp_cflags_gcc="$gmp_cflags_gcc"
+    gmp_xoptcflags_gcc="-mcpu=v8 -mv8"
+    gmp_cflags_cc="-xtarget=native -xarch=v8 -xO4"
+    ;;
+  sparcv8*-*-* | microsparc*-*-*)              # SunOS, Linux, *BSD
+    cclist="gcc acc cc"
+    gmp_cflags_gcc="$gmp_cflags_gcc"
+    gmp_xoptcflags_gcc="-mcpu=v8 -mv8"
+    gmp_cflags_acc="-g -O2 -cg92"
+    gmp_cflags_cc="-O2"                # FIXME: Flag for v8?
+    ;;
+  supersparc*-*-solaris2.*)
+    gmp_cflags_gcc="$gmp_cflags_gcc -DSUPERSPARC"
+    gmp_xoptcflags_gcc="-mcpu=v8 -mv8"
+    gmp_cflags_cc="-xtarget=native -xarch=v8 -xO4 -DSUPERSPARC"
+    ;;
+  supersparc*-*-*)             # SunOS, Linux, *BSD
+    cclist="gcc acc cc"
+    gmp_cflags_gcc="$gmp_cflags_gcc -DSUPERSPARC"
+    gmp_xoptcflags_gcc="-mcpu=v8 -mv8"
+    gmp_cflags_acc="-g -O2 -cg92 -DSUPERSPARC"
+    gmp_cflags_cc="-O2 -DSUPERSPARC"   # FIXME: Flag for v8?
+    ;;
+  *sparc*-*-*)
+    cclist="gcc acc cc"
+    gmp_cflags_acc="-g -O2"
+    gmp_cflags_cc="-g -O2"
+    ;;
+
+  # POWER/PowerPC
+  powerpc64-*-aix*)
+    cclist="gcc xlc"
+    gmp_cflags_gcc="$gmp_cflags_gcc -maix64 -mpowerpc64"
+    gmp_cflags_xlc="-g -O2 -q64 -qtune=pwr3"
+    ;;
+  powerpc*-*-aix*)
+    cclist="gcc xlc"
+    gmp_cflags_gcc="$gmp_cflags_gcc -mpowerpc"
+    gmp_cflags_xlc="$gmp_cflags_cc -qarch=ppc -O2"
+    ;;
+  power-*-aix*)
+    cclist="gcc xlc"
+    gmp_cflags_gcc="$gmp_cflags_gcc -mpower"
+    gmp_cflags_xlc="$gmp_cflags_cc -qarch=pwr -O2"
+    ;;
+  powerpc64*-*-*)
+    gmp_cflags_gcc="$gmp_cflags_gcc -mpowerpc64"
+    AC_DEFINE(_LONG_LONG_LIMB) dnl FIXME: Remove.
+    ;;
+  powerpc*-*-*)
+    gmp_cflags_gcc="$gmp_cflags_gcc -mpowerpc"
+    ;;
+
+  # MIPS
+  mips-sgi-irix6.*)
+    os_64bit=yes
+    gmp_cflags64_gcc="-g -O2 -mabi=n32"
+    gmp_cflags64_cc="$gmp_cflags64_cc -O2 -n32"
+    ;;
+
+  # Motorola 68k family
+  m88110*-*-*)
+    gmp_cflags_gcc="-g -O -m88110"     dnl  FIXME: Use `-O2'?
+    ;;
+  m68*-*-*)
+    gmp_cflags_gcc="$gmp_cflags_gcc -fomit-frame-pointer"
+    ;;
+
+  # HP
+  hppa1.0*-*-*)
+    cclist="gcc c89 cc"
+    gmp_cflags_c89="$gmp_cflags_cc +O2"
+    gmp_cflags_cc="$gmp_cflags_cc +O2"
+    ;;
+  hppa2.0w*-*-*)
+    cclist="c89 cc"
+    gmp_cflags_c89="+DD64 +O3"
+    gmp_cflags_cc="+DD64 +O3"
+    ;;
+  hppa2.0*-*-*)
+    os_64bit=yes
+    cclist="gcc c89 cc"
+    gmp_cflags64_gcc="$gmp_cflags64_gcc -mWHAT -D_LONG_LONG_LIMB"
+    # +O2 to cc triggers bug in mpz/powm.c (1.4)
+    gmp_cflags64_c89="+DA2.0 +e +O3 -D_LONG_LONG_LIMB"
+    gmp_cflags64_cc="+DA2.0 +e +O3 -D_LONG_LONG_LIMB"
+    gmp_cflags_c89="$gmp_cflags_cc +O2"
+    gmp_cflags_cc="$gmp_cflags_cc +O2"
+    ;;
+
+  # VAX
+  vax*-*-*)
+    gmp_cflags_gcc="$gmp_cflags_gcc -fomit-frame-pointer"
+    ;;
+
+  # Fujitsu
+  [f30[01]-fujitsu-sysv*])
+    cclist="gcc vcc"
+    gmp_cflags_vcc="-g"                # FIXME: flags for vcc?
+    ;;
+esac
+
+dnl  Check for programs needed by macros for finding compiler.
+dnl  More programs are checked for below, when a compiler is found.
+AC_PROG_NM     dnl  Macro from Libtool.
+# nm on 64-bit AIX needs to know the object file format 
+case "$target" in
+  powerpc64*-*-aix*)
+    NM="$NM -X 64"
+    ;;
+esac   
+
+# Save CFLAGS given on command line.
+gmp_user_CFLAGS="$CFLAGS"
+
+if test -z "$CC"; then
+  # Find compiler.
+  GMP_PROG_CC_FIND($cclist, $os_64bit)
+
+  # If 64-bit OS and we have a 64-bit compiler, use it.
+  if test -n "$os_64bit" && test -n "$CC64"; then
+    CC=$CC64
+    CFLAGS=$CFLAGS64
+  else
+    eval CFLAGS=\$gmp_cflags_$CC  
+  fi
+
+  # Try compiler flags that may work with only some compiler versions.
+  # gmp_optcflags: All or nothing.
+  eval optcflags=\$gmp_optcflags_$CC
+  if test -n "$optcflags"; then
+    CFLAGS_save="$CFLAGS"
+    CFLAGS="$CFLAGS $optcflags"
+    AC_MSG_CHECKING([whether $CC accepts $optcflags])
+    AC_LANG_C
+    AC_TRY_COMPILER([int main(){return(0);}], optok, cross)
+    if test "$optok" = "yes"; then
+      AC_MSG_RESULT([yes])
+    else
+      AC_MSG_RESULT([no])
+      CFLAGS="$CFLAGS_save"
+    fi
+  fi
+  # gmp_xoptcflags: First is best, one has to work.
+  eval xoptcflags=\$gmp_xoptcflags_$CC
+  if test -n "$xoptcflags"; then
+    gmp_found="no"
+    for xopt in $xoptcflags; do
+      CFLAGS_save="$CFLAGS"
+      CFLAGS="$CFLAGS $xopt"
+      AC_MSG_CHECKING([whether $CC accepts $xopt])
+      AC_LANG_C
+      AC_TRY_COMPILER([int main(){return(0);}], optok, cross)
+      if test "$optok" = "yes"; then
+        AC_MSG_RESULT([yes])
+        gmp_found="yes"
+        break
+      else
+        AC_MSG_RESULT([no])
+        CFLAGS="$CFLAGS_save"
+      fi
+    done
+    if test "$gmp_found" = "no"; then
+      echo ["$0: fatal: need a compiler that understands one of $xoptcflags"]
+      exit 1
     fi
+  fi
+fi
+
+# Restore CFLAGS given on command line.
+# FIXME: We've run through quite some unnecessary code looking for a
+# nice compiler and working flags for it, just to spoil that with user
+# supplied flags.
+test -n "$gmp_user_CFLAGS" && CFLAGS="$gmp_user_CFLAGS"
+
+# Select chosen compiler.
+GMP_PROG_CC_SELECT
+
+# How to assemble.
+CCAS="$CC -c"
+AC_SUBST(CCAS)
+
+dnl Checks for programs.
+dnl --------------------
+AC_PROG_CPP
+AC_PROG_INSTALL
+AC_PROG_LN_S
+GMP_PROG_M4
+AC_CHECK_PROG(AR, ar, ar)
+# ar on AIX needs to know the object file format 
+case "$target" in
+  powerpc64*-*-aix*)
+    AR="$AR -X 64"
+    ;;
+esac   
+dnl  FIXME: Find good ld?  /usr/ucb/ld on Solaris won't work.
+
+dnl Checks for assembly syntax.
+if test "$gmp_no_asm_syntax_testing" != "yes"; then
+  GMP_CHECK_ASM_TEXT
+  GMP_CHECK_ASM_DATA
+  GMP_CHECK_ASM_GLOBL
+  GMP_CHECK_ASM_LABEL_SUFFIX
+  GMP_CHECK_ASM_TYPE
+  GMP_CHECK_ASM_SIZE
+  GMP_CHECK_ASM_LSYM_PREFIX
+  GMP_CHECK_ASM_W32
+  GMP_CHECK_ASM_UNDERSCORE(underscore=yes, underscore=no)
+  GMP_CHECK_ASM_ALIGN_LOG(asm_align=log, asm_align=nolog)
+fi
+
+dnl  FIXME: Check for FPU and set `floating_point' appropriately.
+
+dnl  ========================================
+dnl  Configuring mpn.
+dnl  ----------------------------------------
+dnl  Set the following target specific variables:
+dnl  path              where to search for source files
+dnl  family            processor family (Needed for building 
+dnl                    asm-syntax.h for now.  FIXME: Remove.)
+dnl  extra_functions   extra functions
+
+family=generic
+
+case ${target} in
+  arm*-*-*)
+    path="arm"
+    ;;
+  [sparcv9*-*-solaris2.[789]* | sparc64*-*-solaris2.[789]* | ultrasparc*-*-solaris2.[789]*])
+    if test -n "$CC64"; then
+      path="sparc64"
+    else
+      path="sparc32/v9 sparc32/v8 sparc32"
+    fi
+    ;;
+  sparc64-*-linux*)
+    path="sparc64"
+    ;;
+  sparcv8*-*-* | microsparc*-*-*)
+       path="sparc32/v8 sparc32"
+       if test x${floating_point} = xno
+         then extra_functions="udiv_nfp"
+         else extra_functions="udiv_fp"
+       fi
+       ;;
+  sparcv9*-*-* | ultrasparc*-*-*)
+       path="sparc32/v9 sparc32/v8 sparc32"
+       extra_functions="udiv_fp"
+       ;;
+  supersparc*-*-*)
+       path="sparc32/v8/supersparc sparc32/v8 sparc32"
+       extra_functions="udiv"
+       ;;
+  sparc*-*-*) path="sparc32"
+       if test x${floating_point} = xno
+         then extra_functions="udiv_nfp"
+         else extra_functions="udiv_fp"
+       fi
+       ;;
+  hppa7000*-*-*)
+    path="hppa/hppa1_1 hppa"
+    extra_functions="udiv_qrnnd"
+    ;;
+  hppa1.0*-*-*)
+    path="hppa"
+    extra_functions="udiv_qrnnd"
+    ;;
+  hppa2.0w-*-*)
+    path="pa64w"
+    extra_functions="umul_ppmm udiv_qrnnd"
+    ;;
+  hppa2.0*-*-*)
+    if test -n "$CC64"; then
+      path="pa64"
+      extra_functions="umul_ppmm udiv_qrnnd"
+      # We need to use the system compiler, or actually the system assembler,
+      # since GAS has not been ported to understand the 2.0 instructions.
+      CCAS="$CC64 -c"
+    else
+      # FIXME: path should be "hppa/hppa2_0 hppa/hppa1_1 hppa"
+      path="hppa/hppa1_1 hppa"
+      extra_functions="udiv_qrnnd"
+    fi
+    ;;
+  hppa*-*-*)                                   #assume pa7100
+    path="hppa/hppa1_1/pa7100 hppa/hppa1_1 hppa"
+    extra_functions="udiv_qrnnd";;
+  [f30[01]-fujitsu-sysv*])
+    path=fujitsu;;
+  alphaev6*-*-*) path="alpha/ev6 alpha"; extra_functions="invert_limb cntlz";;
+  alphaev5*-*-*) path="alpha/ev5 alpha"; extra_functions="invert_limb cntlz";;
+  alpha*-*-*) path="alpha"; extra_functions="invert_limb cntlz";;
+  # Cray vector machines.  This must come after alpha* so that we can
+  # recognize present and future vector processors with a wildcard.
+  *-cray-unicos*)
+    path="cray"
+    extra_functions="mulww";;
+  am29000*-*-*) path="a29k";;
+  a29k*-*-*) path="a29k";;
+
+  # AMD and Intel x86 configurations
+
+  [i?86*-*-* | k[5-8]*-*-* | pentium*-*-* | athlon-*-*])
+    gmp_m4postinc="x86/x86-defs.m4"
+    extra_functions="udiv umul"
+    CALLING_CONVENTIONS_OBJS="x86call.o x86check.o"
+
+    GMP_CHECK_ASM_SHLDL_CL(
+      [GMP_DEFINE(WANT_SHLDL_CL,1)],
+      [GMP_DEFINE(WANT_SHLDL_CL,0)])
+    GMP_CHECK_ASM_ALIGN_FILL_0x90
+
+    # the CPUs below wanting to know about mmx
+    case ${target} in
+      [pentiummmx-*-* | pentium[23]-*-* | k6*-*-* | athlon-*-*])
+       GMP_CHECK_ASM_MMX(tmp_mmx=yes, tmp_mmx=no)
+        ;;
+    esac
+
+    # default for anything not otherwise mentioned
+    path="x86"
+    case ${target} in
+      [i[34]86*-*-*])
+        path="x86"
+        ;;
+      k5*-*-*)
+        # don't know what best suits k5
+        path="x86"
+        ;;
+      i586*-*-* | pentium-*-*)
+       path="x86/pentium x86"
+        ;;
+      pentiummmx-*-*)
+       path="x86/pentium x86"
+       if test "$tmp_mmx" = yes; then
+          path="x86/pentium/mmx $path"
+        fi
+        ;;
+      i686*-*-* | pentiumpro-*-*)
+       path="x86/p6 x86"
+        ;;
+      pentium2-*-*)
+       path="x86/p6 x86"
+       # The pentium/mmx lshift and rshift are good on p6 and can be used
+        # until there's something specific for p6.
+       if test "$tmp_mmx" = yes; then
+          path="x86/p6/mmx x86/pentium/mmx $path"
+        fi
+        ;;
+      pentium3-*-*)
+       path="x86/p6 x86"
+       # The pentium/mmx lshift and rshift are good on p6 and can be used
+        # until there's something specific for p6.
+       if test "$tmp_mmx" = yes; then
+          path="x86/p6/p3mmx x86/p6/mmx x86/pentium/mmx $path"
+        fi
+        ;;
+      [k6[23]*-*-*])
+       path="x86/k6 x86"
+       if test "$tmp_mmx" = yes; then
+          path="x86/k6/k62mmx x86/k6/mmx $path"
+        fi
+        ;;
+      k6*-*-*)
+       path="x86/k6 x86"
+       if test "$tmp_mmx" = yes; then
+          path="x86/k6/mmx $path"
+        fi
+        ;;
+      athlon-*-*)
+       path="x86/k7 x86"
+       if test "$tmp_mmx" = yes; then
+          path="x86/k7/mmx $path"
+        fi
+        ;;
+    esac
+    ;;
+
+
+  i960*-*-*) path="i960";;
+
+  ia64*-*-*) path="ia64";;
+
+# Motorola 68k configurations.  Let m68k mean 68020-68040.
+  [m680[234]0*-*-* | m68k*-*-* | \
+  m68*-next-nextstep*])                # Nexts are at least '020
+    path="m68k/mc68020 m68k"
+    family=m68k
+    ;;
+  m68000*-*-*)
+    path="m68k"
+    family=m68k
+    ;;
+
+  m88k*-*-* | m88k*-*-*) path="m88k";;
+  m88110*-*-*) path="m88k/mc88110 m88k";;
+  ns32k*-*-*) path="ns32k";;
+
+  pyramid-*-*) path="pyr";;
+
+  ppc601-*-*) path="power powerpc32";;
+  powerpc64*-*-*) path="powerpc64";;
+  powerpc*-*-*) path="powerpc32";;
+  rs6000-*-* | power-*-* | power2-*-*)
+    path="power"
+    extra_functions="udiv_w_sdiv"
+    ;;
+
+  sh-*-*) path="sh";;
+  sh2-*-*) path="sh/sh2 sh";;
+
+  [mips[34]*-*-*]) path="mips3";;
+  mips*-*-irix6*) path="mips3";;
+  mips*-*-*) path="mips2";;
+
+  vax*-*-*) path="vax"; extra_functions="udiv_w_sdiv";;
+
+  z8000x*-*-*) path="z8000x"; extra_functions="udiv_w_sdiv";;
+  z8000*-*-*) path="z8000"; extra_functions="udiv_w_sdiv";;
+
+  clipper*-*-*) path="clipper";;
+esac
+
+AC_SUBST(CALLING_CONVENTIONS_OBJS)
+if test -n "$CALLING_CONVENTIONS_OBJS"; then
+  AC_DEFINE(HAVE_CALLING_CONVENTIONS,1,
+  [Define if mpn/tests has calling conventions checking for the CPU])
+fi
+
+
+case ${target} in
+  [i[5-8]86*-*-* | k[5-8]*-*-* | pentium*-*-* | athlon-*-*])
+    # rdtsc is in pentium and up, not in i386 and i486
+    SPEED_CYCLECOUNTER_OBJS=pentium.lo
+    ;;
+  alpha*-*-*)
+    SPEED_CYCLECOUNTER_OBJS=alpha.lo
+    ;;
+  sparcv9*-*-* | ultrasparc*-*-* | sparc64*-*-*)
+    SPEED_CYCLECOUNTER_OBJS=sparcv9.lo
+    ;;
+  hppa2*-*-*)
+    SPEED_CYCLECOUNTER_OBJS=hppa2.lo
     ;;
-  *-*-linux*)
-    target_makefile_frag=config/mt-linux ;;
-  *-*-mingw32)
-    CFLAGS="-mno-cygwin -O"
+  hppa*-*-*)
+    SPEED_CYCLECOUNTER_OBJS=hppa.lo
     ;;
 esac
 
-AC_SUBST(CFLAGS)
-AC_OUTPUT(Makefile)
+AC_SUBST(SPEED_CYCLECOUNTER_OBJS)
+
+if test -n "$SPEED_CYCLECOUNTER_OBJS"
+then
+  AC_DEFINE(HAVE_SPEED_CYCLECOUNTER, 1,
+  [Define if a speed_cyclecounter exists (for the tune programs)])
+fi
+
+
+dnl Extensions for executable and object files.
+dnl -------------------------------------------
+AC_EXEEXT
+AC_OBJEXT
+
+dnl Use Libtool.
+dnl ------------
+dnl  FIXME: Shared libs seem to fail on aix4.3.
+dnl  FIXME: Should invoke [AC_DISABLE_SHARED], but m4 recurses to death.
+case "$target" in
+  [*-*-aix4.[3-9]*]) enable_shared=no ;;
+esac
+AC_PROG_LIBTOOL
+
+dnl Checks for libraries.
+dnl ---------------------
+AC_CHECK_DECLS((optarg))
+
+dnl Checks for header files.
+dnl ------------------------
+AC_HEADER_STDC
+AC_CHECK_HEADERS(getopt.h unistd.h sys/sysctl.h sys/time.h)
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+dnl --------------------------------------------------------------
+AC_CHECK_TYPES((void))
+AC_C_STRINGIZE
+
+dnl Checks for library functions.
+dnl -----------------------------
+dnl Most of these are only for the benefit of supplementary programs.  The
+dnl library itself doesn't use anything weird.
+dnl AC_FUNC_MEMCMP
+dnl AC_TYPE_SIGNAL
+dnl AC_CHECK_FUNCS(strtol)
+AC_CHECK_FUNCS(getopt_long getpagesize popen processor_info strtoul sysconf sysctlbyname)
+
+dnl Trick automake into thinking we've run AM_C_PROTOTYPES which it wants
+dnl for ansi2knr, and instead use our own test.  (It's only a warning
+dnl automake prints, but it's good to suppress it.)
+ifelse(0,1,[
+AM_C_PROTOTYPES
+])
+GMP_C_ANSI2KNR
+
+
+dnl  Set `syntax' to one of <blank>, "mit", "elf", "aix", "macho".
+syntax=
+# For now, we use the old switch for setting syntax.  
+# FIXME: Remove when conversion to .asm is completed.
+changequote(,)dnl
+case "${target}" in
+  m680[234]0*-*-linuxaout* | m68k*-*-linuxaout* | \
+  m68k-next-nextstep* | \
+  m68000*-*-*)
+    syntax=mit
+    ;;
+  m680[234]0*-*-linux* | m68k*-*-linux*)
+    syntax=elf
+    ;;
+  m680[234]0*-*-* | m68k*-*-*)
+    syntax=mit
+    ;;
+esac
+changequote([,])dnl
+
+dnl  ----------------------------------------
+# Now build an asm-syntax.h file for targets that include that from the
+# assembly files.
+# FIXME: Remove when conversion to .asm is completed.
+case "${family}-${underscore}-${asm_align}-${syntax}" in
+  m68k-yes-log-mit)
+    echo '#define MIT_SYNTAX' >asm-syntax.h
+    cat $srcdir/mpn/underscore.h >>asm-syntax.h
+    echo '#include "'$srcdir'/mpn/m68k/syntax.h"' >>asm-syntax.h;;
+  m68k-no-nolog-elf)
+    echo '#define ELF_SYNTAX' >asm-syntax.h
+    echo '#define C_SYMBOL_NAME(name) name' >>asm-syntax.h
+    echo '#include "'$srcdir'/mpn/m68k/syntax.h"' >>asm-syntax.h;;
+esac
+
+
+# The pattern here tests for an absolute path the same way as
+# _AC_OUTPUT_FILES in autoconf acgeneral.m4.
+GMP_DEFINE_RAW(["dnl  CONFIG_TOP_SRCDIR is a path from the mpn builddir to the top srcdir"])
+case "$srcdir" in
+[[\\/]]* | ?:[[\\/]]* )
+     GMP_DEFINE_RAW(["define(<CONFIG_TOP_SRCDIR>,<\`$srcdir'>)"])    ;;
+*)   GMP_DEFINE_RAW(["define(<CONFIG_TOP_SRCDIR>,<\`../$srcdir'>)"]) ;;
+esac
+GMP_DEFINE_RAW(["include(CONFIG_TOP_SRCDIR\`/mpn/asm-defs.m4')"], POST)
+
+# Must be after asm-defs.m4
+GMP_DEFINE_RAW("define_not_for_expansion(\`HAVE_TARGET_CPU_$target_cpu')", POST)
+
+
+dnl  config.m4 post-includes
+dnl  -----------------------
+dnl  (Note x86 post include set with $path above.)
+changequote(,)dnl
+case "$target" in
+  alpha*-cray-unicos*)
+    gmp_m4postinc="alpha/unicos.m4"
+    ;;
+  alpha*-*-*)
+    gmp_m4postinc="alpha/default.m4"
+    ;;
+  power*-*-*)
+    case "$target" in
+      *-*-mach* | *-*-rhapsody* | *-*-nextstep*)
+        ;;     # these use non-conventional assembly syntax.
+      powerpc64-*-aix*)
+       gmp_m4postinc="powerpc32/regmap.m4 powerpc64/aix.m4"
+        ;;
+      *-*-aix*)
+       gmp_m4postinc="powerpc32/regmap.m4 powerpc32/aix.m4"
+        ;;
+      *)
+       gmp_m4postinc="powerpc32/regmap.m4"
+       ;;
+    esac
+    ;;
+esac
+changequote([, ])dnl
+
+for tmp_f in $gmp_m4postinc; do
+  GMP_DEFINE_RAW(["include_mpn(\`$tmp_f')"], POST)
+done
+
+
+# Set up `gmp_links'.  It's a list of link:file pairs that configure will
+# process to create link -> file.
+gmp_links=
+
+# If the user specified `MPN_PATH', use that instead of the path we've
+# come up with.
+if test -z "$MPN_PATH"; then
+  path="$path generic"
+else
+  path="$MPN_PATH"
+fi
+
+# Pick the correct source files in $path and link them to mpn/.
+# $gmp_mpn_functions lists all functions we need.
+#
+# The rule is to find a file with the function name and a .asm, .S,
+# .s, or .c extension.  Certain multi-function files with special names
+# can provide some functions too.  (mpn/Makefile.am passes
+# -DOPERATION_<func> to get them to generate the right code.)
+
+# FIXME: udiv and umul aren't in $gmp_mpn_functions_optional yet since
+# there's some versions of those files which should be checked for bit
+# rot first.  Put them in $extra_functions for each target for now,
+# change to standard optionals when all are ready.
+
+# Note: The following lines defining $gmp_mpn_functions_optional
+#       and $gmp_mpn_functions are parsed by the "macos/configure"
+#       Perl script. So if you change the lines in a major way
+#       make sure to run and examine the output from
+#       
+#           % (cd macos; perl configure)
+
+gmp_mpn_functions_optional="copyi copyd com_n          \
+  and_n andn_n nand_n ior_n iorn_n nior_n xor_n xnor_n"
+
+gmp_mpn_functions="${extra_functions} inlines add_n sub_n mul_1 addmul_1   \
+  submul_1 lshift rshift diveby3 divrem divrem_1 divrem_2                  \
+  mod_1 mod_1_rs pre_mod_1 dump                                            \
+  mul mul_fft mul_n mul_basecase sqr_basecase random                       \
+  random2 sqrtrem get_str set_str scan0 scan1 popcount hamdist cmp perfsqr \
+  bdivmod gcd_1 gcd gcdext tdiv_qr bz_divrem_n sb_divrem_mn jacbase        \
+  $gmp_mpn_functions_optional"
+
+# the list of all object files used by mpn/Makefile.in and the
+# top-level Makefile.in, respectively
+mpn_objects=
+mpn_objs_in_libgmp="mpn/mp_bases.lo"
+
+for tmp_fn in ${gmp_mpn_functions} ; do
+  [rm -f mpn/${tmp_fn}.[Ssc] mpn/${tmp_fn}.asm]
+
+  # functions that can be provided by multi-function files
+  tmp_mulfunc=
+  case $tmp_fn in
+  add_n|sub_n)       tmp_mulfunc="aors_n"    ;;
+  addmul_1|submul_1) tmp_mulfunc="aorsmul_1" ;;
+  popcount|hamdist)  tmp_mulfunc="popham"    ;;
+  and_n|andn_n|nand_n | ior_n|iorn_n|nior_n | xor_n|xnor_n)
+                     tmp_mulfunc="logops_n"  ;;
+  esac
+
+  found=no
+  for tmp_dir in $path; do
+    for tmp_base in $tmp_fn $tmp_mulfunc; do
+      for tmp_ext in asm S s c; do
+        tmp_file=$srcdir/mpn/$tmp_dir/$tmp_base.$tmp_ext
+        if test -f $tmp_file; then
+          found=yes
+
+          mpn_objects="$mpn_objects ${tmp_fn}.lo"
+          mpn_objs_in_libgmp="$mpn_objs_in_libgmp mpn/${tmp_fn}.lo"
+          gmp_links="$gmp_links mpn/$tmp_fn.$tmp_ext:mpn/$tmp_dir/$tmp_base.$tmp_ext"
+
+          # duplicate AC_DEFINEs are harmless, so it doesn't matter
+          # that multi-function files get grepped here repeatedly
+          gmp_ep=["`
+            sed -n 's/^[       ]*MULFUNC_PROLOGUE(\(.*\))/\1/p' $tmp_file ;
+            sed -n 's/^[       ]*PROLOGUE(\(.*\))/\1/p' $tmp_file
+          `"]
+          for gmp_tmp in $gmp_ep; do
+            AC_DEFINE_UNQUOTED(HAVE_NATIVE_${gmp_tmp})
+          done
+
+          break
+        fi
+      done
+      if test $found = yes; then break ; fi
+    done
+    if test $found = yes; then break ; fi
+  done
+
+  if test $found = no; then
+    for tmp_optional in $gmp_mpn_functions_optional; do
+      if test $tmp_optional = $tmp_fn; then
+        found=yes
+      fi
+    done
+    if test $found = no; then
+      AC_MSG_ERROR([no version of $tmp_fn found in path: $path])
+    fi
+  fi
+done
+
+# Create link for gmp-mparam.h.
+for tmp_dir in $path ; do
+  rm -f gmp-mparam.h
+  if test -f $srcdir/mpn/${tmp_dir}/gmp-mparam.h ; then
+    gmp_links="$gmp_links gmp-mparam.h:mpn/${tmp_dir}/gmp-mparam.h"
+
+    # Copy any KARATSUBA_SQR_THRESHOLD in gmp-mparam.h to config.m4.
+    # Some versions of sqr_basecase.asm use this.
+    tmp_gmp_karatsuba_sqr_threshold="`sed -n 's/^#define KARATSUBA_SQR_THRESHOLD[      ]*\([0-9][0-9]*\).*$/\1/p' $srcdir/mpn/${tmp_dir}/gmp-mparam.h`"
+    if test -n "$tmp_gmp_karatsuba_sqr_threshold"; then
+      GMP_DEFINE_RAW(["define(<KARATSUBA_SQR_THRESHOLD>,<$tmp_gmp_karatsuba_sqr_threshold>)"])
+    fi
+
+    break
+  fi
+done
+
+# Dig out the links from `gmp_links' for inclusion in DISTCLEANFILES.
+gmp_srclinks=
+for f in $gmp_links; do
+  gmp_srclinks="$gmp_srclinks `echo $f | sed 's/\(.*\):.*/\1/'`"
+done
+
+AC_SUBST(mpn_objects)
+AC_SUBST(mpn_objs_in_libgmp)
+AC_SUBST(gmp_srclinks)
+
+dnl  ----------------------------------------
+dnl  Make links.
+AC_CONFIG_LINKS($gmp_links)
+
+dnl  Create config.m4.
+GMP_FINISH
+
+dnl  Create Makefiles
+dnl  FIXME: Upcoming version of autoconf/automake may not like broken lines.
+AC_OUTPUT(Makefile mpf/Makefile mpz/Makefile mpn/Makefile mpq/Makefile \
+  mpf/tests/Makefile mpz/tests/Makefile mpq/tests/Makefile mpn/tests/Makefile \
+  tests/Makefile tests/rand/Makefile demos/Makefile tune/Makefile \
+  mpbsd/Makefile mpbsd/tests/Makefile mpfr/Makefile mpfr/tests/Makefile)
diff --git a/ghc/rts/gmp/cre-mparam.c b/ghc/rts/gmp/cre-mparam.c
deleted file mode 100644 (file)
index 2020c8a..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#include "gmp.h"
-
-main ()
-{
-printf ("/* gmp-mparam.h -- Compiler/machine parameter header file.\n\n");
-printf ("    *** CREATED BY A PROGRAM -- DO NOT EDIT ***\n\n");
-printf ("Copyright (C) 1996 Free Software Foundation, Inc.  */\n\n");
-
-printf ("#define BITS_PER_MP_LIMB %d\n", 8 * sizeof (mp_limb_t));
-printf ("#define BYTES_PER_MP_LIMB %d\n", sizeof (mp_limb_t));
-printf ("#define BITS_PER_LONGINT %d\n", 8 * sizeof (long));
-printf ("#define BITS_PER_INT %d\n", 8 * sizeof (int));
-printf ("#define BITS_PER_SHORTINT %d\n", 8 * sizeof (short));
-printf ("#define BITS_PER_CHAR 8\n");
-exit (0);
-}
diff --git a/ghc/rts/gmp/demos/factorize.c b/ghc/rts/gmp/demos/factorize.c
deleted file mode 100644 (file)
index 4a965d3..0000000
+++ /dev/null
@@ -1,233 +0,0 @@
-/* Factoring with Pollard's rho method.
-
-   Copyright (C) 1995 Free Software Foundation, Inc.
-
-This program is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version.
-
-This program 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
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License along
-with this program; see the file COPYING.  If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include <stdio.h>
-#include "gmp.h"
-
-int flag_mersenne = 0;
-
-static unsigned add[] = {4, 2, 4, 2, 4, 6, 2, 6};
-
-factor_using_division (t, limit)
-     mpz_t t;
-     unsigned int limit;
-{
-  mpz_t q, r;
-  unsigned long int f;
-  int i, ai;
-  unsigned *addv = add;
-
-  mpz_init (q);
-  mpz_init (r);
-
-  if (mpz_probab_prime_p (t, 50))
-    goto ready;
-
-  for (;;)
-    {
-      mpz_tdiv_qr_ui (q, r, t, 2);
-      if (mpz_cmp_ui (r, 0) != 0)
-       break;
-      mpz_set (t, q);
-      printf ("2 ");
-      fflush (stdout);
-      if (mpz_probab_prime_p (t, 50))
-       goto ready;
-    }
-
-  for (;;)
-    {
-      mpz_tdiv_qr_ui (q, r, t, 3);
-      if (mpz_cmp_ui (r, 0) != 0)
-       break;
-      mpz_set (t, q);
-      printf ("3 ");
-      fflush (stdout);
-      if (mpz_probab_prime_p (t, 50))
-       goto ready;
-    }
-
-  for (;;)
-    {
-      mpz_tdiv_qr_ui (q, r, t, 5);
-      if (mpz_cmp_ui (r, 0) != 0)
-       break;
-      mpz_set (t, q);
-      printf ("5 ");
-      fflush (stdout);
-      if (mpz_probab_prime_p (t, 50))
-       goto ready;
-    }
-
-  f = 7;
-  ai = 0;
-  for (;;)
-    {
-      mpz_tdiv_qr_ui (q, r, t, f);
-      if (mpz_cmp_ui (r, 0) != 0)
-       {
-         f += addv[ai];
-         if (f > limit)
-           goto ret;
-         ai = (ai + 1) & 7;
-       }
-      else
-       {
-         mpz_set (t, q);
-         printf ("%lu ", f);
-         fflush (stdout);
-         if (mpz_probab_prime_p (t, 50))
-           goto ready;
-       }
-    }
-
- ready:
-  mpz_out_str (stdout, 10, t);
-  fflush (stdout);
-  mpz_set_ui (t, 1);
-  fputc (' ', stdout);
- ret:
-  mpz_clear (q);
-  mpz_clear (r);
-}
-
-void
-factor_using_pollard_rho (m, a_int, x0, p)
-     mpz_t m;
-     long a_int;
-     long x0;
-     unsigned long p;
-{
-  mpz_t x, y, q;
-  mpz_t a;
-  mpz_t d;
-  mpz_t tmp;
-  mpz_t n;
-  int i = 1;
-  int j = 1;
-
-  mpz_init_set (n, m);
-
-  mpz_init (d);
-  mpz_init_set_ui (q, 1);
-  mpz_init (tmp);
-
-  mpz_init_set_si (a, a_int);
-  mpz_init_set_si (x, x0);
-  mpz_init_set_si (y, x0);
-
-  while (mpz_cmp_ui (n, 1) != 0)
-    {
-      if (flag_mersenne)
-       {
-         mpz_powm_ui (x, x, p, n);  mpz_add (x, x, a);
-         mpz_powm_ui (y, y, p, n);  mpz_add (y, y, a);
-         mpz_powm_ui (y, y, p, n);  mpz_add (y, y, a);
-       }
-      else
-       {
-         mpz_mul (x, x, x);  mpz_add (x, x, a); mpz_mod (x, x, n);
-         mpz_mul (y, y, y);  mpz_add (y, y, a); mpz_mod (y, y, n);
-         mpz_mul (y, y, y);  mpz_add (y, y, a); mpz_mod (y, y, n);
-       }
-
-      if (mpz_cmp (x, y) > 0)
-       mpz_sub (tmp, x, y);
-      else
-       mpz_sub (tmp, y, x);
-      mpz_mul (q, q, tmp);
-      mpz_mod (q, q, n);
-
-      if (++i % j == 0)
-       {
-         j += 1;
-         mpz_gcd (d, q, n);
-         if (mpz_cmp_ui (d, 1) != 0)
-           {
-             if (!mpz_probab_prime_p (d, 50))
-               factor_using_pollard_rho (d, (random () & 31) - 16,
-                                         (random () & 31), p);
-             else
-               {
-                 mpz_out_str (stdout, 10, d);
-                 fflush (stdout);
-                 fputc (' ', stdout);
-               }
-             mpz_div (n, n, d);
-             if (mpz_probab_prime_p (n, 50))
-               {
-                 mpz_out_str (stdout, 10, n);
-                 fflush (stdout);
-                 fputc (' ', stdout);
-                 break;
-               }
-           }
-       }
-    }
-
-  mpz_clear (n);
-  mpz_clear (d);
-  mpz_clear (q);
-  mpz_clear (tmp);
-  mpz_clear (a);
-  mpz_clear (x);
-  mpz_clear (y);
-}
-
-factor (t, a, x0, p)
-     mpz_t t;
-     long a;
-     long x0;
-     unsigned long p;
-{
-  factor_using_division (t, 1000000);
-  factor_using_pollard_rho (t, a, x0, p);
-}
-
-main (argc, argv)
-     int argc;
-     char *argv[];
-{
-  mpz_t t;
-  long x0, a;
-  unsigned long p;
-  int i;
-
-  for (i = 1; i < argc; i++)
-    {
-      if (!strncmp (argv[i], "-Mp", 3))
-       {
-         p = atoi (argv[i] + 3);
-         mpz_init_set_ui (t, 1);
-         mpz_mul_2exp (t, t, p);
-         mpz_sub_ui (t, t, 1);
-         flag_mersenne = 1;
-       }
-      else
-       {
-         p = 0;
-         mpz_init_set_str (t, argv[i], 0);
-       }
-
-      a = -1;
-      x0 = 3;
-
-      factor (t, a, x0, p);
-      puts ("");
-    }
-}
diff --git a/ghc/rts/gmp/extract-double.c b/ghc/rts/gmp/extract-double.c
deleted file mode 100644 (file)
index 052b1a9..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-/* __gmp_extract_double -- convert from double to array of mp_limb_t.
-
-Copyright (C) 1996 Free Software Foundation, Inc.
-
-This file is part of the GNU MP Library.
-
-The GNU MP Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Library General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at your
-option) any later version.
-
-The GNU MP 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 Library General Public
-License for more details.
-
-You should have received a copy of the GNU Library General Public License
-along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-MA 02111-1307, USA. */
-
-#include "gmp.h"
-#include "gmp-impl.h"
-
-#ifdef XDEBUG
-#undef _GMP_IEEE_FLOATS
-#endif
-
-#ifndef _GMP_IEEE_FLOATS
-#define _GMP_IEEE_FLOATS 0
-#endif
-
-#define MP_BASE_AS_DOUBLE (2.0 * ((mp_limb_t) 1 << (BITS_PER_MP_LIMB - 1)))
-
-/* Extract a non-negative double in d.  */
-
-int
-#if __STDC__
-__gmp_extract_double (mp_ptr rp, double d)
-#else
-__gmp_extract_double (rp, d)
-     mp_ptr rp;
-     double d;
-#endif
-{
-  long exp;
-  unsigned sc;
-  mp_limb_t manh, manl;
-
-  /* BUGS
-
-     1. Should handle Inf and NaN in IEEE specific code.
-     2. Handle Inf and NaN also in default code, to avoid hangs.
-     3. Generalize to handle all BITS_PER_MP_LIMB >= 32.
-     4. This lits is incomplete and misspelled.
-   */
-
-  if (d == 0.0)
-    {
-      rp[0] = 0;
-      rp[1] = 0;
-#if BITS_PER_MP_LIMB == 32
-      rp[2] = 0;
-#endif
-      return 0;
-    }
-
-#if _GMP_IEEE_FLOATS
-  {
-    union ieee_double_extract x;
-    x.d = d;
-
-    exp = x.s.exp;
-    sc = (unsigned) (exp + 2) % BITS_PER_MP_LIMB;
-#if BITS_PER_MP_LIMB == 64
-    manl = (((mp_limb_t) 1 << 63)
-           | ((mp_limb_t) x.s.manh << 43) | ((mp_limb_t) x.s.manl << 11));
-#else
-    manh = ((mp_limb_t) 1 << 31) | (x.s.manh << 11) | (x.s.manl >> 21);
-    manl = x.s.manl << 11;
-#endif
-  }
-#else
-  {
-    /* Unknown (or known to be non-IEEE) double format.  */
-    exp = 0;
-    if (d >= 1.0)
-      {
-       if (d * 0.5 == d)
-         abort ();
-
-       while (d >= 32768.0)
-         {
-           d *= (1.0 / 65536.0);
-           exp += 16;
-         }
-       while (d >= 1.0)
-         {
-           d *= 0.5;
-           exp += 1;
-         }
-      }
-    else if (d < 0.5)
-      {
-       while (d < (1.0 / 65536.0))
-         {
-           d *=  65536.0;
-           exp -= 16;
-         }
-       while (d < 0.5)
-         {
-           d *= 2.0;
-           exp -= 1;
-         }
-      }
-
-    sc = (unsigned) exp % BITS_PER_MP_LIMB;
-
-    d *= MP_BASE_AS_DOUBLE;
-#if BITS_PER_MP_LIMB == 64
-    manl = d;
-#else
-    manh = d;
-    manl = (d - manh) * MP_BASE_AS_DOUBLE;
-#endif
-
-    exp += 1022;
-  }
-#endif
-
-  exp = (unsigned) (exp + 1) / BITS_PER_MP_LIMB - 1024 / BITS_PER_MP_LIMB + 1;
-
-#if BITS_PER_MP_LIMB == 64
-  if (sc != 0)
-    {
-      rp[1] = manl >> (BITS_PER_MP_LIMB - sc);
-      rp[0] = manl << sc;
-    }
-  else
-    {
-      rp[1] = manl;
-      rp[0] = 0;
-    }
-#else
-  if (sc != 0)
-    {
-      rp[2] = manh >> (BITS_PER_MP_LIMB - sc);
-      rp[1] = (manl >> (BITS_PER_MP_LIMB - sc)) | (manh << sc);
-      rp[0] = manl << sc;
-    }
-  else
-    {
-      rp[2] = manh;
-      rp[1] = manl;
-      rp[0] = 0;
-    }
-#endif
-
-  return exp;
-}
index c637111..878b144 100644 (file)
@@ -1,24 +1,32 @@
 /* Include file for internal GNU MP types and definitions.
 
-Copyright (C) 1991, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
+   THE CONTENTS OF THIS FILE ARE FOR INTERNAL USE AND ARE ALMOST CERTAIN TO
+   BE SUBJECT TO INCOMPATIBLE CHANGES IN FUTURE GNU MP RELEASES.
+
+Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1999, 2000 Free Software
+Foundation, Inc.
 
 This file is part of the GNU MP Library.
 
 The GNU MP Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Library General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at your
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or (at your
 option) any later version.
 
 The GNU MP 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 Library General Public
+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 Library General Public License
+You should have received a copy of the GNU Lesser General Public License
 along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 MA 02111-1307, USA. */
 
+#include "config.h"
+#include "gmp-mparam.h"
+/* #include "longlong.h" */
+
 /* When using gcc, make sure to use its builtin alloca.  */
 #if ! defined (alloca) && defined (__GNUC__)
 #define alloca __builtin_alloca
@@ -48,6 +56,10 @@ MA 02111-1307, USA. */
 #endif
 #endif
 
+#if defined (alloca)
+#define HAVE_ALLOCA
+#endif
+
 #if ! defined (HAVE_ALLOCA) || USE_STACK_ALLOC
 #include "stack-alloc.h"
 #else
@@ -57,83 +69,287 @@ MA 02111-1307, USA. */
 #define TMP_FREE(m)
 #endif
 
-#ifndef NULL
-#define NULL ((void *) 0)
-#endif
+/* Allocating various types. */
+#define TMP_ALLOC_TYPE(n,type) ((type *) TMP_ALLOC ((n) * sizeof (type)))
+#define TMP_ALLOC_LIMBS(n)     TMP_ALLOC_TYPE(n,mp_limb_t)
+#define TMP_ALLOC_MP_PTRS(n)   TMP_ALLOC_TYPE(n,mp_ptr)
 
-#if ! defined (__GNUC__)
+
+#if ! defined (__GNUC__)       /* FIXME: Test for C++ compilers here,
+                                  __DECC understands __inline */
 #define inline                 /* Empty */
 #endif
 
 #define ABS(x) (x >= 0 ? x : -x)
 #define MIN(l,o) ((l) < (o) ? (l) : (o))
 #define MAX(h,i) ((h) > (i) ? (h) : (i))
+#define numberof(x)  (sizeof (x) / sizeof ((x)[0]))
 
 /* Field access macros.  */
 #define SIZ(x) ((x)->_mp_size)
 #define ABSIZ(x) ABS (SIZ (x))
 #define PTR(x) ((x)->_mp_d)
+#define LIMBS(x) ((x)->_mp_d)
 #define EXP(x) ((x)->_mp_exp)
 #define PREC(x) ((x)->_mp_prec)
 #define ALLOC(x) ((x)->_mp_alloc)
 
-#include "gmp-mparam.h"
-/* #include "longlong.h" */
+/* Extra casts because shorts are promoted to ints by "~" and "<<".  "-1"
+   rather than "1" in SIGNED_TYPE_MIN avoids warnings from some compilers
+   about arithmetic overflow.  */
+#define UNSIGNED_TYPE_MAX(type)      ((type) ~ (type) 0)
+#define UNSIGNED_TYPE_HIGHBIT(type)  ((type) ~ (UNSIGNED_TYPE_MAX(type) >> 1))
+#define SIGNED_TYPE_MIN(type)        (((type) -1) << (8*sizeof(type)-1))
+#define SIGNED_TYPE_MAX(type)        ((type) ~ SIGNED_TYPE_MIN(type))
+#define SIGNED_TYPE_HIGHBIT(type)    SIGNED_TYPE_MIN(type)
+
+#define MP_LIMB_T_MAX      UNSIGNED_TYPE_MAX (mp_limb_t)
+#define MP_LIMB_T_HIGHBIT  UNSIGNED_TYPE_HIGHBIT (mp_limb_t)
 
-#if defined (__STDC__)  || defined (__cplusplus)
-void *malloc (size_t);
-void *realloc (void *, size_t);
-void free (void *);
+#define MP_SIZE_T_MAX      SIGNED_TYPE_MAX (mp_size_t)
+
+#ifndef ULONG_MAX
+#define ULONG_MAX          UNSIGNED_TYPE_MAX (unsigned long)
+#endif
+#define ULONG_HIGHBIT      UNSIGNED_TYPE_HIGHBIT (unsigned long)
+#define LONG_HIGHBIT       SIGNED_TYPE_HIGHBIT (long)
+#ifndef LONG_MAX
+#define LONG_MAX           SIGNED_TYPE_MAX (long)
+#endif
 
-extern void *  (*_mp_allocate_func) (size_t);
-extern void *  (*_mp_reallocate_func) (void *, size_t, size_t);
-extern void    (*_mp_free_func) (void *, size_t);
+#ifndef USHORT_MAX
+#define USHORT_MAX         UNSIGNED_TYPE_MAX (unsigned short)
+#endif
+#define USHORT_HIGHBIT     UNSIGNED_TYPE_HIGHBIT (unsigned short)
+#define SHORT_HIGHBIT      SIGNED_TYPE_HIGHBIT (short)
+#ifndef SHORT_MAX
+#define SHORT_MAX          SIGNED_TYPE_MAX (short)
+#endif
+
+
+/* Swap macros. */
+
+#define MP_LIMB_T_SWAP(x, y)                    \
+  do {                                          \
+    mp_limb_t __mp_limb_t_swap__tmp = (x);      \
+    (x) = (y);                                  \
+    (y) = __mp_limb_t_swap__tmp;                \
+  } while (0)
+#define MP_SIZE_T_SWAP(x, y)                    \
+  do {                                          \
+    mp_size_t __mp_size_t_swap__tmp = (x);      \
+    (x) = (y);                                  \
+    (y) = __mp_size_t_swap__tmp;                \
+  } while (0)
+
+#define MP_PTR_SWAP(x, y)               \
+  do {                                  \
+    mp_ptr __mp_ptr_swap__tmp = (x);    \
+    (x) = (y);                          \
+    (y) = __mp_ptr_swap__tmp;           \
+  } while (0)
+#define MP_SRCPTR_SWAP(x, y)                    \
+  do {                                          \
+    mp_srcptr __mp_srcptr_swap__tmp = (x);      \
+    (x) = (y);                                  \
+    (y) = __mp_srcptr_swap__tmp;                \
+  } while (0)
+
+#define MPN_PTR_SWAP(xp,xs, yp,ys)      \
+  do {                                  \
+    MP_PTR_SWAP (xp, yp);               \
+    MP_SIZE_T_SWAP (xs, ys);            \
+  } while(0)
+#define MPN_SRCPTR_SWAP(xp,xs, yp,ys)   \
+  do {                                  \
+    MP_SRCPTR_SWAP (xp, yp);            \
+    MP_SIZE_T_SWAP (xs, ys);            \
+  } while(0)
+
+#define MPZ_PTR_SWAP(x, y)              \
+  do {                                  \
+    mpz_ptr __mpz_ptr_swap__tmp = (x);  \
+    (x) = (y);                          \
+    (y) = __mpz_ptr_swap__tmp;          \
+  } while (0)
+#define MPZ_SRCPTR_SWAP(x, y)                   \
+  do {                                          \
+    mpz_srcptr __mpz_srcptr_swap__tmp = (x);    \
+    (x) = (y);                                  \
+    (y) = __mpz_srcptr_swap__tmp;               \
+  } while (0)
 
-void *_mp_default_allocate (size_t);
-void *_mp_default_reallocate (void *, size_t, size_t);
-void _mp_default_free (void *, size_t);
+
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
+/* FIXME: These are purely internal, so do a search and replace to change
+   them to __gmp forms, rather than using these macros. */
+#define _mp_allocate_func      __gmp_allocate_func
+#define _mp_reallocate_func    __gmp_reallocate_func
+#define _mp_free_func          __gmp_free_func
+#define _mp_default_allocate   __gmp_default_allocate
+#define _mp_default_reallocate __gmp_default_reallocate
+#define _mp_default_free       __gmp_default_free
+
+extern void *  (*_mp_allocate_func) _PROTO ((size_t));
+extern void *  (*_mp_reallocate_func) _PROTO ((void *, size_t, size_t));
+extern void    (*_mp_free_func) _PROTO ((void *, size_t));
+
+void *_mp_default_allocate _PROTO ((size_t));
+void *_mp_default_reallocate _PROTO ((void *, size_t, size_t));
+void _mp_default_free _PROTO ((void *, size_t));
+
+#define _MP_ALLOCATE_FUNC_TYPE(n,type) \
+  ((type *) (*_mp_allocate_func) ((n) * sizeof (type)))
+#define _MP_ALLOCATE_FUNC_LIMBS(n)   _MP_ALLOCATE_FUNC_TYPE(n,mp_limb_t)
+
+#define _MP_FREE_FUNC_TYPE(p,n,type) (*_mp_free_func) (p, (n) * sizeof (type))
+#define _MP_FREE_FUNC_LIMBS(p,n)     _MP_FREE_FUNC_TYPE(p,n,mp_limb_t)
+
+
+#if (__STDC__-0) || defined (__cplusplus)
 
 #else
 
 #define const                  /* Empty */
 #define signed                 /* Empty */
 
-void *malloc ();
-void *realloc ();
-void free ();
+#endif
 
-extern void *  (*_mp_allocate_func) ();
-extern void *  (*_mp_reallocate_func) ();
-extern void    (*_mp_free_func) ();
+#if defined (__GNUC__) && defined (__i386__)
+#if 0                  /* check that these actually improve things */
+#define MPN_COPY_INCR(DST, SRC, N)                                     \
+  __asm__ ("cld\n\trep\n\tmovsl" : :                                   \
+          "D" (DST), "S" (SRC), "c" (N) :                              \
+          "cx", "di", "si", "memory")
+#define MPN_COPY_DECR(DST, SRC, N)                                     \
+  __asm__ ("std\n\trep\n\tmovsl" : :                                   \
+          "D" ((DST) + (N) - 1), "S" ((SRC) + (N) - 1), "c" (N) :      \
+          "cx", "di", "si", "memory")
+#define MPN_NORMALIZE_NOT_ZERO(P, N)                                   \
+  do {                                                                 \
+    __asm__ ("std\n\trepe\n\tscasl" : "=c" (N) :                       \
+            "a" (0), "D" ((P) + (N) - 1), "0" (N) :                    \
+            "cx", "di");                                               \
+    (N)++;                                                             \
+  } while (0)
+#endif
+#endif
 
-void *_mp_default_allocate ();
-void *_mp_default_reallocate ();
-void _mp_default_free ();
+#if HAVE_NATIVE_mpn_copyi
+#define mpn_copyi __MPN(copyi)
+void mpn_copyi _PROTO ((mp_ptr, mp_srcptr, mp_size_t));
 #endif
 
-/* Copy NLIMBS *limbs* from SRC to DST.  */
+/* Remap names of internal mpn functions.  */
+#define __clz_tab               __MPN(clz_tab)
+#define mpn_udiv_w_sdiv                __MPN(udiv_w_sdiv)
+#define mpn_reciprocal         __MPN(reciprocal)
+
+#define mpn_sb_divrem_mn       __MPN(sb_divrem_mn)
+#define mpn_bz_divrem_n                __MPN(bz_divrem_n)
+#define mpn_tdiv_qr            __MPN(tdiv_qr)
+/* #define mpn_tdiv_q          __MPN(tdiv_q) */
+
+#define mpn_kara_mul_n __MPN(kara_mul_n)
+void mpn_kara_mul_n _PROTO((mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_ptr));
+
+#define mpn_kara_sqr_n  __MPN(kara_sqr_n)
+void mpn_kara_sqr_n _PROTO ((mp_ptr, mp_srcptr, mp_size_t, mp_ptr));
+
+#define mpn_toom3_mul_n  __MPN(toom3_mul_n)
+void mpn_toom3_mul_n _PROTO ((mp_ptr, mp_srcptr, mp_srcptr, mp_size_t,mp_ptr));
+
+#define mpn_toom3_sqr_n  __MPN(toom3_sqr_n)
+void mpn_toom3_sqr_n _PROTO((mp_ptr, mp_srcptr, mp_size_t, mp_ptr));
+
+#define mpn_fft_best_k  __MPN(fft_best_k)
+int mpn_fft_best_k _PROTO ((mp_size_t n, int sqr));
+
+#define mpn_mul_fft  __MPN(mul_fft)
+void mpn_mul_fft _PROTO ((mp_ptr op, mp_size_t pl,
+                          mp_srcptr n, mp_size_t nl,
+                          mp_srcptr m, mp_size_t ml,
+                          int k));
+
+#define mpn_mul_fft_full  __MPN(mul_fft_full)
+void mpn_mul_fft_full _PROTO ((mp_ptr op,
+                               mp_srcptr n, mp_size_t nl,
+                               mp_srcptr m, mp_size_t ml));
+
+#define mpn_fft_next_size  __MPN(fft_next_size)
+mp_size_t mpn_fft_next_size _PROTO ((mp_size_t pl, int k));
+
+mp_limb_t mpn_sb_divrem_mn _PROTO ((mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t));
+mp_limb_t mpn_bz_divrem_n _PROTO ((mp_ptr, mp_ptr, mp_srcptr, mp_size_t));
+void mpn_tdiv_qr _PROTO ((mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t));
+/* void mpn_tdiv_q _PROTO ((mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t)); */
+
+/* Copy NLIMBS *limbs* from SRC to DST, NLIMBS==0 allowed.  */
+#ifndef MPN_COPY_INCR
+#if HAVE_NATIVE_mpn_copyi
+#define MPN_COPY_INCR(DST, SRC, NLIMBS)   mpn_copyi (DST, SRC, NLIMBS)
+#else
 #define MPN_COPY_INCR(DST, SRC, NLIMBS) \
   do {                                                                 \
     mp_size_t __i;                                                     \
     for (__i = 0; __i < (NLIMBS); __i++)                               \
       (DST)[__i] = (SRC)[__i];                                         \
   } while (0)
+#endif
+#endif
+
+#if HAVE_NATIVE_mpn_copyd
+#define mpn_copyd __MPN(copyd)
+void mpn_copyd _PROTO ((mp_ptr, mp_srcptr, mp_size_t));
+#endif
+
+/* NLIMBS==0 allowed */
+#ifndef MPN_COPY_DECR
+#if HAVE_NATIVE_mpn_copyd
+#define MPN_COPY_DECR(DST, SRC, NLIMBS)   mpn_copyd (DST, SRC, NLIMBS)
+#else
 #define MPN_COPY_DECR(DST, SRC, NLIMBS) \
   do {                                                                 \
     mp_size_t __i;                                                     \
     for (__i = (NLIMBS) - 1; __i >= 0; __i--)                          \
       (DST)[__i] = (SRC)[__i];                                         \
   } while (0)
+#endif
+#endif
+
+/* Define MPN_COPY for vector computers.  Since #pragma cannot be in a macro,
+   rely on function inlining. */
+#if defined (_CRAY) || defined (__uxp__)
+static inline void
+_MPN_COPY (d, s, n) mp_ptr d; mp_srcptr s; mp_size_t n;
+{
+  int i;                               /* Faster for Cray with plain int */
+#pragma _CRI ivdep                     /* Cray PVP systems */
+#pragma loop noalias d,s               /* Fujitsu VPP systems */
+  for (i = 0; i < n; i++)
+    d[i] = s[i];
+}
+#define MPN_COPY _MPN_COPY
+#endif
+
+#ifndef MPN_COPY
 #define MPN_COPY MPN_COPY_INCR
+#endif
 
 /* Zero NLIMBS *limbs* AT DST.  */
+#ifndef MPN_ZERO
 #define MPN_ZERO(DST, NLIMBS) \
   do {                                                                 \
     mp_size_t __i;                                                     \
     for (__i = 0; __i < (NLIMBS); __i++)                               \
       (DST)[__i] = 0;                                                  \
   } while (0)
+#endif
 
+#ifndef MPN_NORMALIZE
 #define MPN_NORMALIZE(DST, NLIMBS) \
   do {                                                                 \
     while (NLIMBS > 0)                                                 \
@@ -143,6 +359,8 @@ void _mp_default_free ();
        NLIMBS--;                                                       \
       }                                                                        \
   } while (0)
+#endif
+#ifndef MPN_NORMALIZE_NOT_ZERO
 #define MPN_NORMALIZE_NOT_ZERO(DST, NLIMBS) \
   do {                                                                 \
     while (1)                                                          \
@@ -152,12 +370,28 @@ void _mp_default_free ();
        NLIMBS--;                                                       \
       }                                                                        \
   } while (0)
+#endif
 
-/* Initialize the MP_INT X with space for NLIMBS limbs.
-   X should be a temporary variable, and it will be automatically
-   cleared out when the running function returns.
-   We use __x here to make it possible to accept both mpz_ptr and mpz_t
-   arguments.  */
+/* Strip least significant zero limbs from ptr,size by incrementing ptr and
+   decrementing size.  The number in ptr,size must be non-zero, ie. size!=0
+   and somewhere a non-zero limb.  */
+#define MPN_STRIP_LOW_ZEROS_NOT_ZERO(ptr, size) \
+  do                                            \
+    {                                           \
+      ASSERT ((size) != 0);                     \
+      while ((ptr)[0] == 0)                     \
+        {                                       \
+          (ptr)++;                              \
+          (size)--;                             \
+          ASSERT (size >= 0);                   \
+       }                                       \
+    }                                           \
+  while (0)
+
+/* Initialize X of type mpz_t with space for NLIMBS limbs.  X should be a
+   temporary variable; it will be automatically cleared out at function
+   return.  We use __x here to make it possible to accept both mpz_ptr and
+   mpz_t arguments.  */
 #define MPZ_TMP_INIT(X, NLIMBS) \
   do {                                                                 \
     mpz_ptr __x = (X);                                                 \
@@ -165,20 +399,231 @@ void _mp_default_free ();
     __x->_mp_d = (mp_ptr) TMP_ALLOC ((NLIMBS) * BYTES_PER_MP_LIMB);    \
   } while (0)
 
-#define MPN_MUL_N_RECURSE(prodp, up, vp, size, tspace) \
-  do {                                                                 \
-    if ((size) < KARATSUBA_THRESHOLD)                                  \
-      impn_mul_n_basecase (prodp, up, vp, size);                       \
-    else                                                               \
-      impn_mul_n (prodp, up, vp, size, tspace);                        \
-  } while (0);
-#define MPN_SQR_N_RECURSE(prodp, up, size, tspace) \
-  do {                                                                 \
-    if ((size) < KARATSUBA_THRESHOLD)                                  \
-      impn_sqr_n_basecase (prodp, up, size);                           \
-    else                                                               \
-      impn_sqr_n (prodp, up, size, tspace);                            \
-  } while (0);
+/* Realloc for an mpz_t WHAT if it has less thann NEEDED limbs.  */
+#define MPZ_REALLOC(what,needed) \
+  do {                                                         \
+    if ((needed) > ALLOC (what))                               \
+      _mpz_realloc (what, needed);                             \
+  } while (0)
+
+/* If KARATSUBA_MUL_THRESHOLD is not already defined, define it to a
+   value which is good on most machines.  */
+#ifndef KARATSUBA_MUL_THRESHOLD
+#define KARATSUBA_MUL_THRESHOLD 32
+#endif
+
+/* If TOOM3_MUL_THRESHOLD is not already defined, define it to a
+   value which is good on most machines.  */
+#ifndef TOOM3_MUL_THRESHOLD
+#define TOOM3_MUL_THRESHOLD 256
+#endif
+
+#ifndef KARATSUBA_SQR_THRESHOLD
+#define KARATSUBA_SQR_THRESHOLD (2*KARATSUBA_MUL_THRESHOLD)
+#endif
+
+#ifndef TOOM3_SQR_THRESHOLD
+#define TOOM3_SQR_THRESHOLD (2*TOOM3_MUL_THRESHOLD)
+#endif
+
+/* First k to use for an FFT modF multiply.  A modF FFT is an order
+   log(2^k)/log(2^(k-1)) algorithm, so k=3 is merely 1.5 like karatsuba,
+   whereas k=4 is 1.33 which is faster than toom3 at 1.485.    */
+#define FFT_FIRST_K  4
+
+/* Threshold at which FFT should be used to do a modF NxN -> N multiply. */
+#ifndef FFT_MODF_MUL_THRESHOLD
+#define FFT_MODF_MUL_THRESHOLD   (TOOM3_MUL_THRESHOLD * 3)
+#endif
+#ifndef FFT_MODF_SQR_THRESHOLD
+#define FFT_MODF_SQR_THRESHOLD   (TOOM3_SQR_THRESHOLD * 3)
+#endif
+
+/* Threshold at which FFT should be used to do an NxN -> 2N multiply.  This
+   will be a size where FFT is using k=7 or k=8, since an FFT-k used for an
+   NxN->2N multiply and not recursing into itself is an order
+   log(2^k)/log(2^(k-2)) algorithm, so it'll be at least k=7 at 1.39 which
+   is the first better than toom3.  */
+#ifndef FFT_MUL_THRESHOLD
+#define FFT_MUL_THRESHOLD   (FFT_MODF_MUL_THRESHOLD * 10)
+#endif
+#ifndef FFT_SQR_THRESHOLD
+#define FFT_SQR_THRESHOLD   (FFT_MODF_SQR_THRESHOLD * 10)
+#endif
+
+/* Table of thresholds for successive modF FFT "k"s.  The first entry is
+   where FFT_FIRST_K+1 should be used, the second FFT_FIRST_K+2,
+   etc.  See mpn_fft_best_k(). */
+#ifndef FFT_MUL_TABLE
+#define FFT_MUL_TABLE                           \
+  { TOOM3_MUL_THRESHOLD * 4,   /* k=5 */        \
+    TOOM3_MUL_THRESHOLD * 8,   /* k=6 */        \
+    TOOM3_MUL_THRESHOLD * 16,  /* k=7 */        \
+    TOOM3_MUL_THRESHOLD * 32,  /* k=8 */        \
+    TOOM3_MUL_THRESHOLD * 96,  /* k=9 */        \
+    TOOM3_MUL_THRESHOLD * 288, /* k=10 */       \
+    0 }
+#endif
+#ifndef FFT_SQR_TABLE
+#define FFT_SQR_TABLE                           \
+  { TOOM3_SQR_THRESHOLD * 4,   /* k=5 */        \
+    TOOM3_SQR_THRESHOLD * 8,   /* k=6 */        \
+    TOOM3_SQR_THRESHOLD * 16,  /* k=7 */        \
+    TOOM3_SQR_THRESHOLD * 32,  /* k=8 */        \
+    TOOM3_SQR_THRESHOLD * 96,  /* k=9 */        \
+    TOOM3_SQR_THRESHOLD * 288, /* k=10 */       \
+    0 }
+#endif
+
+#ifndef FFT_TABLE_ATTRS
+#define FFT_TABLE_ATTRS   static const
+#endif
+
+#define MPN_FFT_TABLE_SIZE  16
+
+
+/* Return non-zero if xp,xsize and yp,ysize overlap.
+   If xp+xsize<=yp there's no overlap, or if yp+ysize<=xp there's no
+   overlap.  If both these are false, there's an overlap. */
+#define MPN_OVERLAP_P(xp, xsize, yp, ysize) \
+  ((xp) + (xsize) > (yp) && (yp) + (ysize) > (xp))
+
+
+/* ASSERT() is a private assertion checking scheme, similar to <assert.h>.
+   ASSERT() does the check only if WANT_ASSERT is selected, ASSERT_ALWAYS()
+   does it always.  Generally assertions are meant for development, but
+   might help when looking for a problem later too.
+
+   ASSERT_NOCARRY() uses ASSERT() to check the expression is zero, but if
+   assertion checking is disabled, the expression is still evaluated.  This
+   is meant for use with routines like mpn_add_n() where the return value
+   represents a carry or whatever that shouldn't occur.  For example,
+   ASSERT_NOCARRY (mpn_add_n (rp, s1p, s2p, size)); */
+
+#ifdef __LINE__
+#define ASSERT_LINE  __LINE__
+#else
+#define ASSERT_LINE  -1
+#endif
+
+#ifdef __FILE__
+#define ASSERT_FILE  __FILE__
+#else
+#define ASSERT_FILE  ""
+#endif
+
+int __gmp_assert_fail _PROTO((const char *filename, int linenum,
+                              const char *expr));
+
+#if HAVE_STRINGIZE
+#define ASSERT_FAIL(expr)  __gmp_assert_fail (ASSERT_FILE, ASSERT_LINE, #expr)
+#else
+#define ASSERT_FAIL(expr)  __gmp_assert_fail (ASSERT_FILE, ASSERT_LINE, "expr")
+#endif
+
+#if HAVE_VOID
+#define CAST_TO_VOID        (void)
+#else
+#define CAST_TO_VOID
+#endif
+
+#define ASSERT_ALWAYS(expr) ((expr) ? 0 : ASSERT_FAIL (expr))
+
+#if WANT_ASSERT
+#define ASSERT(expr)           ASSERT_ALWAYS (expr)
+#define ASSERT_NOCARRY(expr)   ASSERT_ALWAYS ((expr) == 0)
+
+#else
+#define ASSERT(expr)           (CAST_TO_VOID 0)
+#define ASSERT_NOCARRY(expr)   (expr)
+#endif
+
+
+#if HAVE_NATIVE_mpn_com_n
+#define mpn_com_n __MPN(com_n)
+void mpn_com_n _PROTO ((mp_ptr, mp_srcptr, mp_size_t));
+#else
+#define mpn_com_n(d,s,n)        \
+  do                            \
+    {                           \
+      mp_ptr     __d = (d);     \
+      mp_srcptr  __s = (s);     \
+      mp_size_t  __n = (n);     \
+      do                        \
+        *__d++ = *__s++;        \
+      while (--__n);            \
+    }                           \
+  while (0)
+#endif
+
+#define MPN_LOGOPS_N_INLINE(d,s1,s2,n,dop,op,s2op)      \
+  do                                                    \
+    {                                                   \
+      mp_ptr     __d = (d);                             \
+      mp_srcptr  __s1 = (s1);                           \
+      mp_srcptr  __s2 = (s2);                           \
+      mp_size_t  __n = (n);                             \
+      do                                                \
+        *__d++ = dop (*__s1++ op s2op *__s2++);         \
+      while (--__n);                                    \
+    }                                                   \
+  while (0)
+
+#if HAVE_NATIVE_mpn_and_n
+#define mpn_and_n __MPN(and_n)
+void mpn_and_n _PROTO ((mp_ptr, mp_srcptr, mp_srcptr, mp_size_t));
+#else
+#define mpn_and_n(d,s1,s2,n)  MPN_LOGOPS_N_INLINE(d,s1,s2,n, ,&, )
+#endif
+
+#if HAVE_NATIVE_mpn_andn_n
+#define mpn_andn_n __MPN(andn_n)
+void mpn_andn_n _PROTO ((mp_ptr, mp_srcptr, mp_srcptr, mp_size_t));
+#else
+#define mpn_andn_n(d,s1,s2,n) MPN_LOGOPS_N_INLINE(d,s1,s2,n, ,&,~)
+#endif
+
+#if HAVE_NATIVE_mpn_nand_n
+#define mpn_nand_n __MPN(nand_n)
+void mpn_nand_n _PROTO ((mp_ptr, mp_srcptr, mp_srcptr, mp_size_t));
+#else
+#define mpn_nand_n(d,s1,s2,n) MPN_LOGOPS_N_INLINE(d,s1,s2,n,~,&, )
+#endif
+
+#if HAVE_NATIVE_mpn_ior_n
+#define mpn_ior_n __MPN(ior_n)
+void mpn_ior_n _PROTO ((mp_ptr, mp_srcptr, mp_srcptr, mp_size_t));
+#else
+#define mpn_ior_n(d,s1,s2,n)  MPN_LOGOPS_N_INLINE(d,s1,s2,n, ,|, )
+#endif
+
+#if HAVE_NATIVE_mpn_iorn_n
+#define mpn_iorn_n __MPN(iorn_n)
+void mpn_iorn_n _PROTO ((mp_ptr, mp_srcptr, mp_srcptr, mp_size_t));
+#else
+#define mpn_iorn_n(d,s1,s2,n) MPN_LOGOPS_N_INLINE(d,s1,s2,n, ,|,~)
+#endif
+
+#if HAVE_NATIVE_mpn_nior_n
+#define mpn_nior_n __MPN(nior_n)
+void mpn_nior_n _PROTO ((mp_ptr, mp_srcptr, mp_srcptr, mp_size_t));
+#else
+#define mpn_nior_n(d,s1,s2,n) MPN_LOGOPS_N_INLINE(d,s1,s2,n,~,|, )
+#endif
+
+#if HAVE_NATIVE_mpn_xor_n
+#define mpn_xor_n __MPN(xor_n)
+void mpn_xor_n _PROTO ((mp_ptr, mp_srcptr, mp_srcptr, mp_size_t));
+#else
+#define mpn_xor_n(d,s1,s2,n)  MPN_LOGOPS_N_INLINE(d,s1,s2,n, ,^, )
+#endif
+
+#if HAVE_NATIVE_mpn_xnor_n
+#define mpn_xnor_n __MPN(xnor_n)
+void mpn_xnor_n _PROTO ((mp_ptr, mp_srcptr, mp_srcptr, mp_size_t));
+#else
+#define mpn_xnor_n(d,s1,s2,n) MPN_LOGOPS_N_INLINE(d,s1,s2,n,~,^, )
+#endif
 
 /* Structure for conversion between internal binary format and
    strings in base 2..36.  */
@@ -190,7 +635,7 @@ struct bases
   int chars_per_limb;
 
   /* log(2)/log(conversion_base) */
-  float chars_per_bit_exactly;
+  double chars_per_bit_exactly;
 
   /* base**chars_per_limb, i.e. the biggest number that fits a word, built by
      factors of base.  Exception: For 2, 4, 8, etc, big_base is log2(base),
@@ -203,9 +648,34 @@ struct bases
   mp_limb_t big_base_inverted;
 };
 
+#define __mp_bases __MPN(mp_bases)
 extern const struct bases __mp_bases[];
 extern mp_size_t __gmp_default_fp_limb_precision;
 
+#if defined (__i386__)
+#define TARGET_REGISTER_STARVED 1
+#else
+#define TARGET_REGISTER_STARVED 0
+#endif
+
+/* Use a library function for invert_limb, if available. */
+#if ! defined (invert_limb) && HAVE_NATIVE_mpn_invert_limb
+#define mpn_invert_limb  __MPN(invert_limb)
+mp_limb_t mpn_invert_limb _PROTO ((mp_limb_t));
+#define invert_limb(invxl,xl)  (invxl = __MPN(invert_limb) (xl))
+#endif
+
+#ifndef invert_limb
+#define invert_limb(invxl,xl) \
+  do {                                                                 \
+    mp_limb_t dummy;                                                   \
+    if (xl << 1 == 0)                                                  \
+      invxl = ~(mp_limb_t) 0;                                          \
+    else                                                               \
+      udiv_qrnnd (invxl, dummy, -xl, 0, xl);                           \
+  } while (0)
+#endif
+
 /* Divide the two-limb number in (NH,,NL) by D, with DI being the largest
    limb not larger than (2**(2*BITS_PER_MP_LIMB))/D - (2**BITS_PER_MP_LIMB).
    If this would yield overflow, DI should be the largest possible number
@@ -241,69 +711,132 @@ extern mp_size_t __gmp_default_fp_limb_precision;
    so that its most significant bit is set.  LGUP is ceil(log2(D)).  */
 #define udiv_qrnnd_preinv2gen(q, r, nh, nl, d, di, dnorm, lgup) \
   do {                                                                 \
-    mp_limb_t n2, n10, n1, nadj, q1;                                   \
+    mp_limb_t _n2, _n10, _n1, _nadj, _q1;                              \
     mp_limb_t _xh, _xl;                                                        \
-    n2 = ((nh) << (BITS_PER_MP_LIMB - (lgup))) + ((nl) >> 1 >> (l - 1));\
-    n10 = (nl) << (BITS_PER_MP_LIMB - (lgup));                         \
-    n1 = ((mp_limb_signed_t) n10 >> (BITS_PER_MP_LIMB - 1));           \
-    nadj = n10 + (n1 & (dnorm));                                       \
-    umul_ppmm (_xh, _xl, di, n2 - n1);                                 \
-    add_ssaaaa (_xh, _xl, _xh, _xl, 0, nadj);                          \
-    q1 = ~(n2 + _xh);                                                  \
-    umul_ppmm (_xh, _xl, q1, d);                                       \
+    _n2 = ((nh) << (BITS_PER_MP_LIMB - (lgup))) + ((nl) >> 1 >> (l - 1));\
+    _n10 = (nl) << (BITS_PER_MP_LIMB - (lgup));                                \
+    _n1 = ((mp_limb_signed_t) _n10 >> (BITS_PER_MP_LIMB - 1));         \
+    _nadj = _n10 + (_n1 & (dnorm));                                    \
+    umul_ppmm (_xh, _xl, di, _n2 - _n1);                               \
+    add_ssaaaa (_xh, _xl, _xh, _xl, 0, _nadj);                         \
+    _q1 = ~(_n2 + _xh);                                                        \
+    umul_ppmm (_xh, _xl, _q1, d);                                      \
     add_ssaaaa (_xh, _xl, _xh, _xl, nh, nl);                           \
     _xh -= (d);                                                                \
     (r) = _xl + ((d) & _xh);                                           \
-    (q) = _xh - q1;                                                    \
+    (q) = _xh - _q1;                                                   \
   } while (0)
 /* Exactly like udiv_qrnnd_preinv, but branch-free.  It is not clear which
    version to use.  */
 #define udiv_qrnnd_preinv2norm(q, r, nh, nl, d, di) \
   do {                                                                 \
-    mp_limb_t n2, n10, n1, nadj, q1;                                   \
+    mp_limb_t _n2, _n10, _n1, _nadj, _q1;                              \
     mp_limb_t _xh, _xl;                                                        \
-    n2 = (nh);                                                         \
-    n10 = (nl);                                                                \
-    n1 = ((mp_limb_signed_t) n10 >> (BITS_PER_MP_LIMB - 1));           \
-    nadj = n10 + (n1 & (d));                                           \
-    umul_ppmm (_xh, _xl, di, n2 - n1);                                 \
-    add_ssaaaa (_xh, _xl, _xh, _xl, 0, nadj);                          \
-    q1 = ~(n2 + _xh);                                                  \
-    umul_ppmm (_xh, _xl, q1, d);                                       \
+    _n2 = (nh);                                                                \
+    _n10 = (nl);                                                       \
+    _n1 = ((mp_limb_signed_t) _n10 >> (BITS_PER_MP_LIMB - 1));         \
+    _nadj = _n10 + (_n1 & (d));                                                \
+    umul_ppmm (_xh, _xl, di, _n2 - _n1);                               \
+    add_ssaaaa (_xh, _xl, _xh, _xl, 0, _nadj);                         \
+    _q1 = ~(_n2 + _xh);                                                        \
+    umul_ppmm (_xh, _xl, _q1, d);                                      \
     add_ssaaaa (_xh, _xl, _xh, _xl, nh, nl);                           \
     _xh -= (d);                                                                \
     (r) = _xl + ((d) & _xh);                                           \
-    (q) = _xh - q1;                                                    \
+    (q) = _xh - _q1;                                                   \
+  } while (0)
+
+
+/* modlimb_invert() sets "inv" to the multiplicative inverse of "n" modulo
+   2^BITS_PER_MP_LIMB, ie. so that inv*n == 1 mod 2^BITS_PER_MP_LIMB.
+   "n" must be odd (otherwise such an inverse doesn't exist).
+
+   This is not to be confused with invert_limb(), which is completely
+   different.
+
+   The table lookup gives an inverse with the low 8 bits valid, and each
+   multiply step doubles the number of bits.  See Jebelean's exact division
+   paper, end of section 4 (reference in gmp.texi). */
+
+#define modlimb_invert_table  __gmp_modlimb_invert_table
+extern const unsigned char  modlimb_invert_table[128];
+
+#if BITS_PER_MP_LIMB <= 32
+#define modlimb_invert(inv,n)                                   \
+  do {                                                          \
+    mp_limb_t  __n = (n);                                       \
+    mp_limb_t  __inv;                                           \
+    ASSERT ((__n & 1) == 1);                                    \
+    __inv = modlimb_invert_table[(__n&0xFF)/2]; /*  8 */        \
+    __inv = 2 * __inv - __inv * __inv * __n;    /* 16 */        \
+    __inv = 2 * __inv - __inv * __inv * __n;    /* 32 */        \
+    ASSERT (__inv * __n == 1);                                  \
+    (inv) = __inv;                                              \
+  } while (0)
+#endif
+
+#if BITS_PER_MP_LIMB > 32 && BITS_PER_MP_LIMB <= 64
+#define modlimb_invert(inv,n)                                   \
+  do {                                                          \
+    mp_limb_t  __n = (n);                                       \
+    mp_limb_t  __inv;                                           \
+    ASSERT ((__n & 1) == 1);                                    \
+    __inv = modlimb_invert_table[(__n&0xFF)/2]; /*  8 */        \
+    __inv = 2 * __inv - __inv * __inv * __n;    /* 16 */        \
+    __inv = 2 * __inv - __inv * __inv * __n;    /* 32 */        \
+    __inv = 2 * __inv - __inv * __inv * __n;    /* 64 */        \
+    ASSERT (__inv * __n == 1);                                  \
+    (inv) = __inv;                                              \
   } while (0)
+#endif
 
-#if defined (__GNUC__)
+
+/* The `mode' attribute was introduced in GCC 2.2, but we can only distinguish
+   between GCC 2 releases from 2.5, since __GNUC_MINOR__ wasn't introduced
+   until then.  */
+#if (__GNUC__ - 0 > 2 || defined (__GNUC_MINOR__)) && ! defined (__APPLE_CC__)
 /* Define stuff for longlong.h.  */
 typedef unsigned int UQItype   __attribute__ ((mode (QI)));
-typedef         int SItype     __attribute__ ((mode (SI)));
+typedef                 int SItype     __attribute__ ((mode (SI)));
 typedef unsigned int USItype   __attribute__ ((mode (SI)));
 typedef                 int DItype     __attribute__ ((mode (DI)));
 typedef unsigned int UDItype   __attribute__ ((mode (DI)));
 #else
 typedef unsigned char UQItype;
-typedef         long SItype;
+typedef                 long SItype;
 typedef unsigned long USItype;
+#if defined _LONGLONG || defined _LONG_LONG_LIMB
+typedef        long long int DItype;
+typedef unsigned long long int UDItype;
+#else /* Assume `long' gives us a wide enough type.  Needed for hppa2.0w.  */
+typedef long int DItype;
+typedef unsigned long int UDItype;
+#endif
 #endif
 
 typedef mp_limb_t UWtype;
 typedef unsigned int UHWtype;
 #define W_TYPE_SIZE BITS_PER_MP_LIMB
 
-/* Internal mpn calls */
-#define impn_mul_n_basecase    __MPN(impn_mul_n_basecase)
-#define impn_mul_n             __MPN(impn_mul_n)
-#define impn_sqr_n_basecase    __MPN(impn_sqr_n_basecase)
-#define impn_sqr_n             __MPN(impn_sqr_n)
-
 /* Define ieee_double_extract and _GMP_IEEE_FLOATS.  */
 
+#if (defined (__arm__) && (defined (__ARMWEL__) || defined (__linux__)))
+/* Special case for little endian ARM since floats remain in big-endian.  */
+#define _GMP_IEEE_FLOATS 1
+union ieee_double_extract
+{
+  struct
+    {
+      unsigned int manh:20;
+      unsigned int exp:11;
+      unsigned int sig:1;
+      unsigned int manl:32;
+    } s;
+  double d;
+};
+#else
 #if defined (_LITTLE_ENDIAN) || defined (__LITTLE_ENDIAN__)            \
  || defined (__alpha)                                                  \
- || (defined (__arm__) && defined (__ARMWEL__))                                \
  || defined (__clipper__)                                              \
  || defined (__cris)                                                   \
  || defined (__i386__)                                                 \
@@ -325,16 +858,17 @@ union ieee_double_extract
   double d;
 };
 #else /* Need this as an #else since the tests aren't made exclusive.  */
-#if defined (_BIG_ENDIAN)                                              \
+#if defined (_BIG_ENDIAN) || defined (__BIG_ENDIAN__)                  \
  || defined (__a29k__) || defined (_AM29K)                             \
  || defined (__arm__)                                                  \
  || (defined (__convex__) && defined (_IEEE_FLOAT_))                   \
+ || defined (_CRAYMPP)                                                 \
  || defined (__i370__) || defined (__mvs__)                            \
- || defined (__mc68000__) || defined (__mc68020__) || defined (__NeXT__)\
+ || defined (__mc68000__) || defined (__mc68020__) || defined (__m68k__)\
     || defined(mc68020)                                                        \
  || defined (__m88000__)                                               \
  || defined (MIPSEB) || defined (_MIPSEB)                              \
- || defined (__hppa)                                                   \
+ || defined (__hppa) || defined (__hppa__)                             \
  || defined (__pyr__)                                                  \
  || defined (__ibm032__)                                               \
  || defined (_IBMR2) || defined (_ARCH_PPC)                            \
@@ -355,8 +889,13 @@ union ieee_double_extract
 };
 #endif
 #endif
+#endif
 
-#define MP_BASE_AS_DOUBLE (2.0 * ((mp_limb_t) 1 << (BITS_PER_MP_LIMB - 1)))
+/* Using "(2.0 * ((mp_limb_t) 1 << (BITS_PER_MP_LIMB - 1)))" doesn't work on
+   SunOS 4.1.4 native /usr/ucb/cc (K&R), it comes out as -4294967296.0,
+   presumably due to treating the mp_limb_t constant as signed rather than
+   unsigned. */
+#define MP_BASE_AS_DOUBLE (4.0 * ((mp_limb_t) 1 << (BITS_PER_MP_LIMB - 2)))
 #if BITS_PER_MP_LIMB == 64
 #define LIMBS_PER_DOUBLE 2
 #else
@@ -364,4 +903,170 @@ union ieee_double_extract
 #endif
 
 double __gmp_scale2 _PROTO ((double, int));
-int __gmp_extract_double _PROTO((mp_ptr, double));
+int __gmp_extract_double _PROTO ((mp_ptr, double));
+
+extern int __gmp_junk;
+extern const int __gmp_0;
+#define GMP_ERROR(code)   (gmp_errno |= (code), __gmp_junk = 10/__gmp_0)
+#define DIVIDE_BY_ZERO    GMP_ERROR(GMP_ERROR_DIVISION_BY_ZERO)
+#define SQRT_OF_NEGATIVE  GMP_ERROR(GMP_ERROR_SQRT_OF_NEGATIVE)
+
+#if defined _LONG_LONG_LIMB
+#if defined (__STDC__)
+#define CNST_LIMB(C) C##LL
+#else
+#define CNST_LIMB(C) C/**/LL
+#endif
+#else /* not _LONG_LONG_LIMB */
+#if defined (__STDC__)
+#define CNST_LIMB(C) C##L
+#else
+#define CNST_LIMB(C) C/**/L
+#endif
+#endif /* _LONG_LONG_LIMB */
+
+/*** Stuff used by mpn/generic/prefsqr.c and mpn/generic/next_prime.c ***/
+#if BITS_PER_MP_LIMB == 32
+#define PP 0xC0CFD797L         /* 3 x 5 x 7 x 11 x 13 x ... x 29 */
+#define PP_INVERTED 0x53E5645CL
+#define PP_MAXPRIME 29
+#define PP_MASK 0x208A28A8L
+#endif
+
+#if BITS_PER_MP_LIMB == 64
+#define PP CNST_LIMB(0xE221F97C30E94E1D)       /* 3 x 5 x 7 x 11 x 13 x ... x 53 */
+#define PP_INVERTED CNST_LIMB(0x21CFE6CFC938B36B)
+#define PP_MAXPRIME 53
+#define PP_MASK CNST_LIMB(0x208A20A08A28A8)
+#endif
+
+
+/* BIT1 means a result value in bit 1 (second least significant bit), with a
+   zero bit representing +1 and a one bit representing -1.  Bits other than
+   bit 1 are garbage.
+
+   JACOBI_TWOS_U_BIT1 and JACOBI_RECIP_UU_BIT1 are used in mpn_jacobi_base
+   and their speed is important.  Expressions are used rather than
+   conditionals to accumulate sign changes, which effectively means XORs
+   instead of conditional JUMPs. */
+
+/* (a/0), with a signed; is 1 if a=+/-1, 0 otherwise */
+#define JACOBI_S0(a) \
+  (((a) == 1) | ((a) == -1))
+
+/* (a/0), with a unsigned; is 1 if a=+/-1, 0 otherwise */
+#define JACOBI_U0(a) \
+  ((a) == 1)
+
+/* (a/0), with a an mpz_t; is 1 if a=+/-1, 0 otherwise
+   An mpz_t always has at least one limb of allocated space, so the fetch of
+   the low limb is valid. */
+#define JACOBI_Z0(a) \
+  (((SIZ(a) == 1) | (SIZ(a) == -1)) & (PTR(a)[0] == 1))
+
+/* Convert a bit1 to +1 or -1. */
+#define JACOBI_BIT1_TO_PN(result_bit1) \
+  (1 - ((result_bit1) & 2))
+
+/* (2/b), with b unsigned and odd;
+   is (-1)^((b^2-1)/8) which is 1 if b==1,7mod8 or -1 if b==3,5mod8 and
+   hence obtained from (b>>1)^b */
+#define JACOBI_TWO_U_BIT1(b) \
+  (ASSERT (b & 1), (((b) >> 1) ^ (b)))
+
+/* (2/b)^twos, with b unsigned and odd */
+#define JACOBI_TWOS_U_BIT1(twos, b) \
+  (((twos) << 1) & JACOBI_TWO_U_BIT1 (b))
+
+/* (2/b)^twos, with b unsigned and odd */
+#define JACOBI_TWOS_U(twos, b) \
+  (JACOBI_BIT1_TO_PN (JACOBI_TWOS_U_BIT1 (twos, b)))
+
+/* (a/b) effect due to sign of a: signed/unsigned, b odd;
+   is (-1)^((b-1)/2) if a<0, or +1 if a>=0 */
+#define JACOBI_ASGN_SU_BIT1(a, b) \
+  ((((a) < 0) << 1) & (b))
+
+/* (a/b) effect due to sign of b: signed/mpz;
+   is -1 if a and b both negative, +1 otherwise */
+#define JACOBI_BSGN_SZ_BIT1(a, b) \
+  ((((a) < 0) & (SIZ(b) < 0)) << 1)
+
+/* (a/b) effect due to sign of b: mpz/signed */
+#define JACOBI_BSGN_ZS_BIT1(a, b) \
+  JACOBI_BSGN_SZ_BIT1(b, a)
+
+/* (a/b) reciprocity to switch to (b/a), a,b both unsigned and odd.
+   Is (-1)^((a-1)*(b-1)/4), which means +1 if either a,b==1mod4 or -1 if
+   both a,b==3mod4, achieved in bit 1 by a&b.  No ASSERT()s about a,b odd
+   because this is used in a couple of places with only bit 1 of a or b
+   valid. */
+#define JACOBI_RECIP_UU_BIT1(a, b) \
+  ((a) & (b))
+
+
+/* For testing and debugging.  */
+#define MPZ_CHECK_FORMAT(z)                                            \
+  (ASSERT_ALWAYS (SIZ(z) == 0 || PTR(z)[ABSIZ(z) - 1] != 0),           \
+   ASSERT_ALWAYS (ALLOC(z) >= ABSIZ(z)))
+#define MPZ_PROVOKE_REALLOC(z)                                         \
+  do { ALLOC(z) = ABSIZ(z); } while (0)
+
+
+#if TUNE_PROGRAM_BUILD
+/* Some extras wanted when recompiling some .c files for use by the tune
+   program.  Not part of a normal build. */
+
+extern mp_size_t  mul_threshold[];
+extern mp_size_t  fft_modf_mul_threshold;
+extern mp_size_t  sqr_threshold[];
+extern mp_size_t  fft_modf_sqr_threshold;
+extern mp_size_t  bz_threshold[];
+extern mp_size_t  fib_threshold[];
+extern mp_size_t  powm_threshold[];
+extern mp_size_t  gcd_accel_threshold[];
+extern mp_size_t  gcdext_threshold[];
+
+#undef KARATSUBA_MUL_THRESHOLD
+#undef TOOM3_MUL_THRESHOLD
+#undef FFT_MUL_TABLE
+#undef FFT_MUL_THRESHOLD
+#undef FFT_MODF_MUL_THRESHOLD
+#undef KARATSUBA_SQR_THRESHOLD
+#undef TOOM3_SQR_THRESHOLD
+#undef FFT_SQR_TABLE
+#undef FFT_SQR_THRESHOLD
+#undef FFT_MODF_SQR_THRESHOLD
+#undef BZ_THRESHOLD
+#undef FIB_THRESHOLD
+#undef POWM_THRESHOLD
+#undef GCD_ACCEL_THRESHOLD
+#undef GCDEXT_THRESHOLD
+
+#define KARATSUBA_MUL_THRESHOLD  mul_threshold[0]
+#define TOOM3_MUL_THRESHOLD      mul_threshold[1]
+#define FFT_MUL_TABLE            0
+#define FFT_MUL_THRESHOLD        mul_threshold[2]
+#define FFT_MODF_MUL_THRESHOLD   fft_modf_mul_threshold
+#define KARATSUBA_SQR_THRESHOLD  sqr_threshold[0]
+#define TOOM3_SQR_THRESHOLD      sqr_threshold[1]
+#define FFT_SQR_TABLE            0
+#define FFT_SQR_THRESHOLD        sqr_threshold[2]
+#define FFT_MODF_SQR_THRESHOLD   fft_modf_sqr_threshold
+#define BZ_THRESHOLD             bz_threshold[0]
+#define FIB_THRESHOLD            fib_threshold[0]
+#define POWM_THRESHOLD           powm_threshold[0]
+#define GCD_ACCEL_THRESHOLD      gcd_accel_threshold[0]
+#define GCDEXT_THRESHOLD         gcdext_threshold[0]
+
+#define TOOM3_MUL_THRESHOLD_LIMIT  700
+
+#undef  FFT_TABLE_ATTRS
+#define FFT_TABLE_ATTRS
+extern mp_size_t mpn_fft_table[2][MPN_FFT_TABLE_SIZE];
+
+#endif /* TUNE_PROGRAM_BUILD */
+
+#if defined (__cplusplus)
+}
+#endif
index be2ec98..bc8e94a 100644 (file)
@@ -1,42 +1,50 @@
 /* gmp.h -- Definitions for GNU multiple precision functions.
 
-Copyright (C) 1991, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
+Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1999, 2000 Free Software
+Foundation, Inc.
 
 This file is part of the GNU MP Library.
 
 The GNU MP Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Library General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at your
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or (at your
 option) any later version.
 
 The GNU MP 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 Library General Public
+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 Library General Public License
+You should have received a copy of the GNU Lesser General Public License
 along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 MA 02111-1307, USA. */
 
 #ifndef __GMP_H__
 
+#ifndef __GNU_MP__             /* to allow inclusion of both gmp.h and mp.h */
+#define __GNU_MP__ 2
+#define __need_size_t
+#include <stddef.h>
+#undef __need_size_t
+
 #ifndef STG_H
 /* Get DLL_IMPORT */
 #include "../../includes/config.h"
 #include "../../includes/StgDLL.h"
 #endif
 
-#ifndef __GNU_MP__
-#define __GNU_MP__ 2
-#define __need_size_t
-#include <stddef.h>
-#undef __need_size_t
+#if defined (__mips) && defined (_ABIN32)
+/* Force the use of 64-bit limbs for all 64-bit MIPS CPUs if ABI permits.  */
+#define _LONG_LONG_LIMB
+#endif
 
-#if defined (__STDC__) || defined (__cplusplus)
+#if (__STDC__-0) || defined (__cplusplus)
 #define __gmp_const const
+#define __gmp_signed signed
 #else
 #define __gmp_const
+#define __gmp_signed
 #endif
 
 #if defined (__GNUC__)
@@ -68,58 +76,33 @@ typedef long int            mp_limb_signed_t;
 
 typedef mp_limb_t *            mp_ptr;
 typedef __gmp_const mp_limb_t *        mp_srcptr;
+#if defined (_CRAY) && ! defined (_CRAYMPP)
+/* plain `int' is much faster (48 bits) */
+typedef int                    mp_size_t;
+typedef int                    mp_exp_t;
+#else
 typedef long int               mp_size_t;
 typedef long int               mp_exp_t;
+#endif
 
-#ifndef __MP_SMALL__
 typedef struct
 {
   int _mp_alloc;               /* Number of *limbs* allocated and pointed
-                                  to by the D field.  */
-  int _mp_size;                        /* abs(SIZE) is the number of limbs
-                                  the last field points to.  If SIZE
-                                  is negative this is a negative
-                                  number.  */
-  mp_limb_t *_mp_d;            /* Pointer to the limbs.  */
-} __mpz_struct;
-#else
-typedef struct
-{
-  short int _mp_alloc;         /* Number of *limbs* allocated and pointed
-                                  to by the D field.  */
-  short int _mp_size;          /* abs(SIZE) is the number of limbs
-                                  the last field points to.  If SIZE
-                                  is negative this is a negative
-                                  number.  */
+                                  to by the _mp_d field.  */
+  int _mp_size;                        /* abs(_mp_size) is the number of limbs the
+                                  last field points to.  If _mp_size is
+                                  negative this is a negative number.  */
   mp_limb_t *_mp_d;            /* Pointer to the limbs.  */
 } __mpz_struct;
-#endif
 #endif /* __GNU_MP__ */
 
-/* User-visible types.  */
 typedef __mpz_struct MP_INT;
 typedef __mpz_struct mpz_t[1];
 
-/* Structure for rational numbers.  Zero is represented as 0/any, i.e.
-   the denominator is ignored.  Negative numbers have the sign in
-   the numerator.  */
 typedef struct
 {
   __mpz_struct _mp_num;
   __mpz_struct _mp_den;
-#if 0
-  int _mp_num_alloc;           /* Number of limbs allocated
-                                  for the numerator.  */
-  int _mp_num_size;            /* The absolute value of this field is the
-                                  length of the numerator; the sign is the
-                                  sign of the entire rational number.  */
-  mp_ptr _mp_num;              /* Pointer to the numerator limbs.  */
-  int _mp_den_alloc;           /* Number of limbs allocated
-                                  for the denominator.  */
-  int _mp_den_size;            /* Length of the denominator.  (This field
-                                  should always be positive.) */
-  mp_ptr _mp_den;              /* Pointer to the denominator limbs.  */
-#endif
 } __mpq_struct;
 
 typedef __mpq_struct MP_RAT;
@@ -129,13 +112,11 @@ typedef struct
 {
   int _mp_prec;                        /* Max precision, in number of `mp_limb_t's.
                                   Set by mpf_init and modified by
-                                  mpf_set_prec.  The area pointed to
-                                  by the `d' field contains `prec' + 1
-                                  limbs.  */
-  int _mp_size;                        /* abs(SIZE) is the number of limbs
-                                  the last field points to.  If SIZE
-                                  is negative this is a negative
-                                  number.  */
+                                  mpf_set_prec.  The area pointed to by the
+                                  _mp_d field contains `prec' + 1 limbs.  */
+  int _mp_size;                        /* abs(_mp_size) is the number of limbs the
+                                  last field points to.  If _mp_size is
+                                  negative this is a negative number.  */
   mp_exp_t _mp_exp;            /* Exponent, in the base of `mp_limb_t'.  */
   mp_limb_t *_mp_d;            /* Pointer to the limbs.  */
 } __mpf_struct;
@@ -143,6 +124,32 @@ typedef struct
 /* typedef __mpf_struct MP_FLOAT; */
 typedef __mpf_struct mpf_t[1];
 
+/* Available random number generation algorithms.  */
+typedef enum
+{
+  GMP_RAND_ALG_DEFAULT = 0,
+  GMP_RAND_ALG_LC = GMP_RAND_ALG_DEFAULT /* Linear congruential.  */
+} gmp_randalg_t;
+
+/* Linear congruential data struct.  */
+typedef struct {
+  mpz_t a;                     /* Multiplier. */
+  unsigned long int c;         /* Adder. */
+  mpz_t m;                     /* Modulus (valid only if m2exp == 0).  */
+  unsigned long int m2exp;     /* If != 0, modulus is 2 ^ m2exp.  */
+} __gmp_randata_lc;
+
+/* Random state struct.  */
+typedef struct
+{
+  mpz_t seed;                  /* Current seed.  */
+  gmp_randalg_t alg;           /* Algorithm used.  */
+  union {                      /* Algorithm specific data.  */
+    __gmp_randata_lc *lc;      /* Linear congruential.  */
+  } algdata;
+} __gmp_randstate_struct;
+typedef __gmp_randstate_struct gmp_randstate_t[1];
+
 /* Types for function declarations in gmp files.  */
 /* ??? Should not pollute user name space with these ??? */
 typedef __gmp_const __mpz_struct *mpz_srcptr;
@@ -153,7 +160,7 @@ typedef __gmp_const __mpq_struct *mpq_srcptr;
 typedef __mpq_struct *mpq_ptr;
 
 #ifndef _PROTO
-#if defined (__STDC__) || defined (__cplusplus)
+#if (__STDC__-0) || defined (__cplusplus)
 #define _PROTO(x) x
 #else
 #define _PROTO(x) ()
@@ -161,26 +168,187 @@ typedef __mpq_struct *mpq_ptr;
 #endif
 
 #ifndef __MPN
+/* Really use `defined (__STDC__)' here; we want it to be true for Sun C */
 #if defined (__STDC__) || defined (__cplusplus)
-#define __MPN(x) __mpn_##x
+#define __MPN(x) __gmpn_##x
 #else
-#define __MPN(x) __mpn_/**/x
+#define __MPN(x) __gmpn_/**/x
 #endif
 #endif
 
 #if defined (FILE) || defined (H_STDIO) || defined (_H_STDIO) \
  || defined (_STDIO_H) || defined (_STDIO_H_) || defined (__STDIO_H__) \
- || defined (_STDIO_INCLUDED)
+ || defined (_STDIO_INCLUDED) || defined (__dj_include_stdio_h_)
 #define _GMP_H_HAVE_FILE 1
 #endif
 
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
+#define mp_set_memory_functions __gmp_set_memory_functions
 DLL_IMPORT void mp_set_memory_functions _PROTO ((void *(*) (size_t),
                                      void *(*) (void *, size_t, size_t),
                                      void (*) (void *, size_t)));
+
+#define mp_bits_per_limb __gmp_bits_per_limb
 DLL_IMPORT extern __gmp_const int mp_bits_per_limb;
 
+#if defined (__cplusplus)
+}
+#endif
+
+
+/**************** Random number routines.  ****************/
+
+#define _gmp_rand __gmp_rand
+#define gmp_randinit __gmp_randinit
+#define gmp_randinit_lc __gmp_randinit_lc
+#define gmp_randinit_lc_2exp __gmp_randinit_lc_2exp
+#define gmp_randseed __gmp_randseed
+#define gmp_randseed_ui __gmp_randseed_ui
+#define gmp_randclear __gmp_randclear
+
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
+DLL_IMPORT void _gmp_rand _PROTO ((mp_ptr, gmp_randstate_t, unsigned long int));
+DLL_IMPORT void gmp_randinit _PROTO ((gmp_randstate_t, gmp_randalg_t, ...));
+DLL_IMPORT void gmp_randinit_lc _PROTO ((gmp_randstate_t, mpz_t, unsigned long int,
+                             mpz_t));
+DLL_IMPORT void gmp_randinit_lc_2exp _PROTO ((gmp_randstate_t, mpz_t, unsigned long int,
+                                  unsigned long int));
+DLL_IMPORT void gmp_randseed _PROTO ((gmp_randstate_t, mpz_t));
+DLL_IMPORT void gmp_randseed_ui _PROTO ((gmp_randstate_t, unsigned long int));
+DLL_IMPORT void gmp_randclear _PROTO ((gmp_randstate_t));
+
+#if defined (__cplusplus)
+}
+#endif
+
 /**************** Integer (i.e. Z) routines.  ****************/
 
+#define _mpz_realloc __gmpz_realloc
+#define mpz_realloc __gmpz_realloc
+#define mpz_abs __gmpz_abs
+#define mpz_add __gmpz_add
+#define mpz_add_ui __gmpz_add_ui
+#define mpz_addmul_ui __gmpz_addmul_ui
+#define mpz_and __gmpz_and
+#define mpz_array_init __gmpz_array_init
+#define mpz_bin_ui __gmpz_bin_ui
+#define mpz_bin_uiui __gmpz_bin_uiui
+#define mpz_cdiv_q __gmpz_cdiv_q
+#define mpz_cdiv_q_ui __gmpz_cdiv_q_ui
+#define mpz_cdiv_qr __gmpz_cdiv_qr
+#define mpz_cdiv_qr_ui __gmpz_cdiv_qr_ui
+#define mpz_cdiv_r __gmpz_cdiv_r
+#define mpz_cdiv_r_ui __gmpz_cdiv_r_ui
+#define mpz_cdiv_ui __gmpz_cdiv_ui
+#define mpz_clear __gmpz_clear
+#define mpz_clrbit __gmpz_clrbit
+#define mpz_cmp __gmpz_cmp
+#define _mpz_cmp_si __gmpz_cmp_si
+#define _mpz_cmp_ui __gmpz_cmp_ui
+#define mpz_cmpabs __gmpz_cmpabs
+#define mpz_cmpabs_ui __gmpz_cmpabs_ui
+#define mpz_com __gmpz_com
+#define mpz_divexact __gmpz_divexact
+#define mpz_dump __gmpz_dump
+#define mpz_fac_ui __gmpz_fac_ui
+#define mpz_fdiv_q __gmpz_fdiv_q
+#define mpz_fdiv_q_2exp __gmpz_fdiv_q_2exp
+#define mpz_fdiv_q_ui __gmpz_fdiv_q_ui
+#define mpz_fdiv_qr __gmpz_fdiv_qr
+#define mpz_fdiv_qr_ui __gmpz_fdiv_qr_ui
+#define mpz_fdiv_r __gmpz_fdiv_r
+#define mpz_fdiv_r_2exp __gmpz_fdiv_r_2exp
+#define mpz_fdiv_r_ui __gmpz_fdiv_r_ui
+#define mpz_fdiv_ui __gmpz_fdiv_ui
+#define mpz_fib_ui __gmpz_fib_ui
+#define mpz_fits_sint_p __gmpz_fits_sint_p
+#define mpz_fits_slong_p __gmpz_fits_slong_p
+#define mpz_fits_sshort_p __gmpz_fits_sshort_p
+#define mpz_fits_uint_p __gmpz_fits_uint_p
+#define mpz_fits_ulong_p __gmpz_fits_ulong_p
+#define mpz_fits_ushort_p __gmpz_fits_ushort_p
+#define mpz_gcd __gmpz_gcd
+#define mpz_gcd_ui __gmpz_gcd_ui
+#define mpz_gcdext __gmpz_gcdext
+#define mpz_get_d __gmpz_get_d
+#define mpz_get_si __gmpz_get_si
+#define mpz_get_str __gmpz_get_str
+#define mpz_get_ui __gmpz_get_ui
+#define mpz_getlimbn __gmpz_getlimbn
+#define mpz_hamdist __gmpz_hamdist
+#define mpz_init __gmpz_init
+#define mpz_inp_binary __gmpz_inp_binary
+#define mpz_inp_raw __gmpz_inp_raw
+#define mpz_inp_str __gmpz_inp_str
+#define mpz_init_set __gmpz_init_set
+#define mpz_init_set_d __gmpz_init_set_d
+#define mpz_init_set_si __gmpz_init_set_si
+#define mpz_init_set_str __gmpz_init_set_str
+#define mpz_init_set_ui __gmpz_init_set_ui
+#define mpz_invert __gmpz_invert
+#define mpz_ior __gmpz_ior
+#define mpz_jacobi __gmpz_jacobi
+#define mpz_lcm __gmpz_lcm
+#define mpz_legendre __gmpz_legendre
+#define mpz_mod __gmpz_mod
+#define mpz_mul __gmpz_mul
+#define mpz_mul_2exp __gmpz_mul_2exp
+#define mpz_neg __gmpz_neg
+#define mpz_nextprime __gmpz_nextprime
+#define mpz_out_binary __gmpz_out_binary
+#define mpz_out_raw __gmpz_out_raw
+#define mpz_out_str __gmpz_out_str
+#define mpz_perfect_power_p __gmpz_perfect_power_p
+#define mpz_perfect_square_p __gmpz_perfect_square_p
+#define mpz_popcount __gmpz_popcount
+#define mpz_pow_ui __gmpz_pow_ui
+#define mpz_powm __gmpz_powm
+#define mpz_powm_ui __gmpz_powm_ui
+#define mpz_probab_prime_p __gmpz_probab_prime_p
+#define mpz_random __gmpz_random
+#define mpz_random2 __gmpz_random2
+#define mpz_remove __gmpz_remove
+#define mpz_root __gmpz_root
+#define mpz_rrandomb __gmpz_rrandomb
+#define mpz_scan0 __gmpz_scan0
+#define mpz_scan1 __gmpz_scan1
+#define mpz_set __gmpz_set
+#define mpz_set_d __gmpz_set_d
+#define mpz_set_f __gmpz_set_f
+#define mpz_set_q __gmpz_set_q
+#define mpz_set_si __gmpz_set_si
+#define mpz_set_str __gmpz_set_str
+#define mpz_set_ui __gmpz_set_ui
+#define mpz_setbit __gmpz_setbit
+#define mpz_size __gmpz_size
+#define mpz_sizeinbase __gmpz_sizeinbase
+#define mpz_sqrt __gmpz_sqrt
+#define mpz_sqrtrem __gmpz_sqrtrem
+#define mpz_sub __gmpz_sub
+#define mpz_sub_ui __gmpz_sub_ui
+#define mpz_swap __gmpz_swap
+#define mpz_tdiv_ui __gmpz_tdiv_ui
+#define mpz_tdiv_q __gmpz_tdiv_q
+#define mpz_tdiv_q_2exp __gmpz_tdiv_q_2exp
+#define mpz_tdiv_q_ui __gmpz_tdiv_q_ui
+#define mpz_tdiv_qr __gmpz_tdiv_qr
+#define mpz_tdiv_qr_ui __gmpz_tdiv_qr_ui
+#define mpz_tdiv_r __gmpz_tdiv_r
+#define mpz_tdiv_r_2exp __gmpz_tdiv_r_2exp
+#define mpz_tdiv_r_ui __gmpz_tdiv_r_ui
+#define mpz_tstbit __gmpz_tstbit
+#define mpz_ui_pow_ui __gmpz_ui_pow_ui
+#define mpz_urandomb __gmpz_urandomb
+#define mpz_urandomm __gmpz_urandomm
+#define mpz_xor __gmpz_xor
+#define mpz_eor __gmpz_xor
+
 #if defined (__cplusplus)
 extern "C" {
 #endif
@@ -189,8 +357,11 @@ DLL_IMPORT void *_mpz_realloc _PROTO ((mpz_ptr, mp_size_t));
 DLL_IMPORT void mpz_abs _PROTO ((mpz_ptr, mpz_srcptr));
 DLL_IMPORT void mpz_add _PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
 DLL_IMPORT void mpz_add_ui _PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
+DLL_IMPORT void mpz_addmul_ui _PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
 DLL_IMPORT void mpz_and _PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
 DLL_IMPORT void mpz_array_init _PROTO ((mpz_ptr, mp_size_t, mp_size_t));
+DLL_IMPORT void mpz_bin_ui _PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
+DLL_IMPORT void mpz_bin_uiui _PROTO ((mpz_ptr, unsigned long int, unsigned long int));
 DLL_IMPORT void mpz_cdiv_q _PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
 DLL_IMPORT unsigned long int mpz_cdiv_q_ui _PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
 DLL_IMPORT void mpz_cdiv_qr _PROTO ((mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr));
@@ -201,10 +372,13 @@ DLL_IMPORT unsigned long int mpz_cdiv_ui _PROTO ((mpz_srcptr, unsigned long int)
 DLL_IMPORT void mpz_clear _PROTO ((mpz_ptr));
 DLL_IMPORT void mpz_clrbit _PROTO ((mpz_ptr, unsigned long int));
 DLL_IMPORT int mpz_cmp _PROTO ((mpz_srcptr, mpz_srcptr));
-DLL_IMPORT int mpz_cmp_si _PROTO ((mpz_srcptr, signed long int));
-DLL_IMPORT int mpz_cmp_ui _PROTO ((mpz_srcptr, unsigned long int));
+DLL_IMPORT int _mpz_cmp_si _PROTO ((mpz_srcptr, signed long int));
+DLL_IMPORT int _mpz_cmp_ui _PROTO ((mpz_srcptr, unsigned long int));
+DLL_IMPORT int mpz_cmpabs _PROTO ((mpz_srcptr, mpz_srcptr));
+DLL_IMPORT int mpz_cmpabs_ui _PROTO ((mpz_srcptr, unsigned long int));
 DLL_IMPORT void mpz_com _PROTO ((mpz_ptr, mpz_srcptr));
 DLL_IMPORT void mpz_divexact _PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
+DLL_IMPORT void mpz_dump _PROTO ((mpz_srcptr));
 DLL_IMPORT void mpz_fac_ui _PROTO ((mpz_ptr, unsigned long int));
 DLL_IMPORT void mpz_fdiv_q _PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
 DLL_IMPORT void mpz_fdiv_q_2exp _PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
@@ -215,6 +389,13 @@ DLL_IMPORT void mpz_fdiv_r _PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
 DLL_IMPORT void mpz_fdiv_r_2exp _PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
 DLL_IMPORT unsigned long int mpz_fdiv_r_ui _PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
 DLL_IMPORT unsigned long int mpz_fdiv_ui _PROTO ((mpz_srcptr, unsigned long int));
+DLL_IMPORT void mpz_fib_ui _PROTO ((mpz_ptr, unsigned long int));
+DLL_IMPORT int mpz_fits_sint_p _PROTO ((mpz_srcptr));
+DLL_IMPORT int mpz_fits_slong_p _PROTO ((mpz_srcptr));
+DLL_IMPORT int mpz_fits_sshort_p _PROTO ((mpz_srcptr));
+DLL_IMPORT int mpz_fits_uint_p _PROTO ((mpz_srcptr));
+DLL_IMPORT int mpz_fits_ulong_p _PROTO ((mpz_srcptr));
+DLL_IMPORT int mpz_fits_ushort_p _PROTO ((mpz_srcptr));
 DLL_IMPORT void mpz_gcd _PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
 DLL_IMPORT unsigned long int mpz_gcd_ui _PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
 DLL_IMPORT void mpz_gcdext _PROTO ((mpz_ptr, mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr));
@@ -233,22 +414,44 @@ DLL_IMPORT size_t mpz_inp_str _PROTO ((mpz_ptr, FILE *, int));
 DLL_IMPORT void mpz_init_set _PROTO ((mpz_ptr, mpz_srcptr));
 DLL_IMPORT void mpz_init_set_d _PROTO ((mpz_ptr, double));
 DLL_IMPORT void mpz_init_set_si _PROTO ((mpz_ptr, signed long int));
-DLL_IMPORT int mpz_init_set_str _PROTO ((mpz_ptr, const char *, int));
+DLL_IMPORT int mpz_init_set_str _PROTO ((mpz_ptr, __gmp_const char *, int));
 DLL_IMPORT void mpz_init_set_ui _PROTO ((mpz_ptr, unsigned long int));
 DLL_IMPORT int mpz_invert _PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
 DLL_IMPORT void mpz_ior _PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
 DLL_IMPORT int mpz_jacobi _PROTO ((mpz_srcptr, mpz_srcptr));
+
+#define mpz_kronecker_si __gmpz_kronecker_si
+DLL_IMPORT int mpz_kronecker_si _PROTO ((mpz_srcptr, long));
+
+#define mpz_kronecker_ui __gmpz_kronecker_ui
+DLL_IMPORT int mpz_kronecker_ui _PROTO ((mpz_srcptr, unsigned long));
+
+#define mpz_si_kronecker __gmpz_si_kronecker
+DLL_IMPORT int mpz_si_kronecker _PROTO ((long, mpz_srcptr));
+
+#define mpz_ui_kronecker __gmpz_ui_kronecker
+DLL_IMPORT int mpz_ui_kronecker _PROTO ((unsigned long, mpz_srcptr));
+
+DLL_IMPORT void mpz_lcm _PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
 DLL_IMPORT int mpz_legendre _PROTO ((mpz_srcptr, mpz_srcptr));
 DLL_IMPORT void mpz_mod _PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
 DLL_IMPORT void mpz_mul _PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
 DLL_IMPORT void mpz_mul_2exp _PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
+
+#define mpz_mul_si __gmpz_mul_si
+DLL_IMPORT void mpz_mul_si _PROTO ((mpz_ptr, mpz_srcptr, long int));
+
+#define mpz_mul_ui __gmpz_mul_ui
 DLL_IMPORT void mpz_mul_ui _PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
+
 DLL_IMPORT void mpz_neg _PROTO ((mpz_ptr, mpz_srcptr));
+DLL_IMPORT void mpz_nextprime _PROTO ((mpz_ptr, mpz_srcptr));
 #ifdef _GMP_H_HAVE_FILE
 DLL_IMPORT size_t mpz_out_binary _PROTO ((FILE *, mpz_srcptr));
 DLL_IMPORT size_t mpz_out_raw _PROTO ((FILE *, mpz_srcptr));
 DLL_IMPORT size_t mpz_out_str _PROTO ((FILE *, int, mpz_srcptr));
 #endif
+DLL_IMPORT int mpz_perfect_power_p _PROTO ((mpz_srcptr));
 DLL_IMPORT int mpz_perfect_square_p _PROTO ((mpz_srcptr));
 DLL_IMPORT unsigned long int mpz_popcount _PROTO ((mpz_srcptr));
 DLL_IMPORT void mpz_pow_ui _PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
@@ -257,6 +460,9 @@ DLL_IMPORT void mpz_powm_ui _PROTO ((mpz_ptr, mpz_srcptr, unsigned long int, mpz
 DLL_IMPORT int mpz_probab_prime_p _PROTO ((mpz_srcptr, int));
 DLL_IMPORT void mpz_random _PROTO ((mpz_ptr, mp_size_t));
 DLL_IMPORT void mpz_random2 _PROTO ((mpz_ptr, mp_size_t));
+DLL_IMPORT unsigned long int mpz_remove _PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
+DLL_IMPORT int mpz_root _PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
+DLL_IMPORT void mpz_rrandomb _PROTO ((mpz_ptr, gmp_randstate_t, unsigned long int));
 DLL_IMPORT unsigned long int mpz_scan0 _PROTO ((mpz_srcptr, unsigned long int));
 DLL_IMPORT unsigned long int mpz_scan1 _PROTO ((mpz_srcptr, unsigned long int));
 DLL_IMPORT void mpz_set _PROTO ((mpz_ptr, mpz_srcptr));
@@ -264,7 +470,7 @@ DLL_IMPORT void mpz_set_d _PROTO ((mpz_ptr, double));
 DLL_IMPORT void mpz_set_f _PROTO ((mpz_ptr, mpf_srcptr));
 DLL_IMPORT void mpz_set_q _PROTO ((mpz_ptr, mpq_srcptr));
 DLL_IMPORT void mpz_set_si _PROTO ((mpz_ptr, signed long int));
-DLL_IMPORT int mpz_set_str _PROTO ((mpz_ptr, const char *, int));
+DLL_IMPORT int mpz_set_str _PROTO ((mpz_ptr, __gmp_const char *, int));
 DLL_IMPORT void mpz_set_ui _PROTO ((mpz_ptr, unsigned long int));
 DLL_IMPORT void mpz_setbit _PROTO ((mpz_ptr, unsigned long int));
 DLL_IMPORT size_t mpz_size _PROTO ((mpz_srcptr));
@@ -273,18 +479,53 @@ DLL_IMPORT void mpz_sqrt _PROTO ((mpz_ptr, mpz_srcptr));
 DLL_IMPORT void mpz_sqrtrem _PROTO ((mpz_ptr, mpz_ptr, mpz_srcptr));
 DLL_IMPORT void mpz_sub _PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
 DLL_IMPORT void mpz_sub_ui _PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
+DLL_IMPORT void mpz_swap _PROTO ((mpz_ptr, mpz_ptr));
 DLL_IMPORT void mpz_tdiv_q _PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
 DLL_IMPORT void mpz_tdiv_q_2exp _PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
-DLL_IMPORT void mpz_tdiv_q_ui _PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
+DLL_IMPORT unsigned long int mpz_tdiv_ui _PROTO ((mpz_srcptr, unsigned long int));
+DLL_IMPORT unsigned long int mpz_tdiv_q_ui _PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
 DLL_IMPORT void mpz_tdiv_qr _PROTO ((mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr));
-DLL_IMPORT void mpz_tdiv_qr_ui _PROTO ((mpz_ptr, mpz_ptr, mpz_srcptr, unsigned long int));
+DLL_IMPORT unsigned long int mpz_tdiv_qr_ui _PROTO ((mpz_ptr, mpz_ptr, mpz_srcptr, unsigned long int));
 DLL_IMPORT void mpz_tdiv_r _PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
 DLL_IMPORT void mpz_tdiv_r_2exp _PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
-DLL_IMPORT void mpz_tdiv_r_ui _PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
+DLL_IMPORT unsigned long int mpz_tdiv_r_ui _PROTO ((mpz_ptr, mpz_srcptr, unsigned long int));
+DLL_IMPORT int mpz_tstbit _PROTO ((mpz_srcptr, unsigned long int));
 DLL_IMPORT void mpz_ui_pow_ui _PROTO ((mpz_ptr, unsigned long int, unsigned long int));
+DLL_IMPORT void mpz_urandomb _PROTO ((mpz_t, gmp_randstate_t, unsigned long int));
+DLL_IMPORT void mpz_urandomm _PROTO ((mpz_t, gmp_randstate_t, mpz_t));
+DLL_IMPORT void mpz_xor _PROTO ((mpz_ptr, mpz_srcptr, mpz_srcptr));
+#if defined (__cplusplus)
+}
+#endif
 
 /**************** Rational (i.e. Q) routines.  ****************/
 
+#define mpq_init __gmpq_init
+#define mpq_clear __gmpq_clear
+#define mpq_set __gmpq_set
+#define mpq_set_ui __gmpq_set_ui
+#define mpq_set_si __gmpq_set_si
+#define mpq_set_z __gmpq_set_z
+#define mpq_add __gmpq_add
+#define mpq_sub __gmpq_sub
+#define mpq_mul __gmpq_mul
+#define mpq_div __gmpq_div
+#define mpq_neg __gmpq_neg
+#define mpq_cmp __gmpq_cmp
+#define _mpq_cmp_ui __gmpq_cmp_ui
+#define mpq_equal __gmpq_equal
+#define mpq_inv __gmpq_inv
+#define mpq_set_num __gmpq_set_num
+#define mpq_set_den __gmpq_set_den
+#define mpq_get_num __gmpq_get_num
+#define mpq_get_den __gmpq_get_den
+#define mpq_get_d __gmpq_get_d
+#define mpq_set_d __gmpq_set_d
+#define mpq_canonicalize __gmpq_canonicalize
+
+#if defined (__cplusplus)
+extern "C" {
+#endif
 DLL_IMPORT void mpq_init _PROTO ((mpq_ptr));
 DLL_IMPORT void mpq_clear _PROTO ((mpq_ptr));
 DLL_IMPORT void mpq_set _PROTO ((mpq_ptr, mpq_srcptr));
@@ -297,7 +538,7 @@ DLL_IMPORT void mpq_mul _PROTO ((mpq_ptr, mpq_srcptr, mpq_srcptr));
 DLL_IMPORT void mpq_div _PROTO ((mpq_ptr, mpq_srcptr, mpq_srcptr));
 DLL_IMPORT void mpq_neg _PROTO ((mpq_ptr, mpq_srcptr));
 DLL_IMPORT int mpq_cmp _PROTO ((mpq_srcptr, mpq_srcptr));
-DLL_IMPORT int mpq_cmp_ui _PROTO ((mpq_srcptr, unsigned long int, unsigned long int));
+DLL_IMPORT int _mpq_cmp_ui _PROTO ((mpq_srcptr, unsigned long int, unsigned long int));
 DLL_IMPORT int mpq_equal _PROTO ((mpq_srcptr, mpq_srcptr));
 DLL_IMPORT void mpq_inv _PROTO ((mpq_ptr, mpq_srcptr));
 DLL_IMPORT void mpq_set_num _PROTO ((mpq_ptr, mpz_srcptr));
@@ -305,13 +546,83 @@ DLL_IMPORT void mpq_set_den _PROTO ((mpq_ptr, mpz_srcptr));
 DLL_IMPORT void mpq_get_num _PROTO ((mpz_ptr, mpq_srcptr));
 DLL_IMPORT void mpq_get_den _PROTO ((mpz_ptr, mpq_srcptr));
 DLL_IMPORT double mpq_get_d _PROTO ((mpq_srcptr));
+DLL_IMPORT void mpq_set_d _PROTO ((mpq_ptr, double));
 DLL_IMPORT void mpq_canonicalize _PROTO ((mpq_ptr));
 
+#define mpq_swap __gmpq_swap
+DLL_IMPORT void mpq_swap _PROTO ((mpq_ptr, mpq_ptr));
+
+#ifdef _GMP_H_HAVE_FILE
+#define mpq_out_str __gmpq_out_str
+DLL_IMPORT size_t mpq_out_str _PROTO ((FILE *, int, mpq_srcptr));
+#endif
+
+#if defined (__cplusplus)
+}
+#endif
+
 /**************** Float (i.e. F) routines.  ****************/
 
+#define mpf_abs __gmpf_abs
+#define mpf_add __gmpf_add
+#define mpf_add_ui __gmpf_add_ui
+#define mpf_ceil __gmpf_ceil
+#define mpf_clear __gmpf_clear
+#define mpf_cmp __gmpf_cmp
+#define mpf_cmp_si __gmpf_cmp_si
+#define mpf_cmp_ui __gmpf_cmp_ui
+#define mpf_div __gmpf_div
+#define mpf_div_2exp __gmpf_div_2exp
+#define mpf_div_ui __gmpf_div_ui
+#define mpf_dump __gmpf_dump
+#define mpf_floor __gmpf_floor
+#define mpf_eq __gmpf_eq
+#define mpf_get_d __gmpf_get_d
+#define mpf_get_prec __gmpf_get_prec
+#define mpf_get_str __gmpf_get_str
+#define mpf_init __gmpf_init
+#define mpf_init2 __gmpf_init2
+#define mpf_inp_str __gmpf_inp_str
+#define mpf_init_set __gmpf_init_set
+#define mpf_init_set_d __gmpf_init_set_d
+#define mpf_init_set_si __gmpf_init_set_si
+#define mpf_init_set_str __gmpf_init_set_str
+#define mpf_init_set_ui __gmpf_init_set_ui
+#define mpf_mul __gmpf_mul
+#define mpf_mul_2exp __gmpf_mul_2exp
+#define mpf_mul_ui __gmpf_mul_ui
+#define mpf_neg __gmpf_neg
+#define mpf_out_str __gmpf_out_str
+#define mpf_pow_ui __gmpf_pow_ui
+#define mpf_random2 __gmpf_random2
+#define mpf_reldiff __gmpf_reldiff
+#define mpf_set __gmpf_set
+#define mpf_set_d __gmpf_set_d
+#define mpf_set_default_prec __gmpf_set_default_prec
+#define mpf_set_prec __gmpf_set_prec
+#define mpf_set_prec_raw __gmpf_set_prec_raw
+#define mpf_set_q __gmpf_set_q
+#define mpf_set_si __gmpf_set_si
+#define mpf_set_str __gmpf_set_str
+#define mpf_set_ui __gmpf_set_ui
+#define mpf_set_z __gmpf_set_z
+#define mpf_size __gmpf_size
+#define mpf_sqrt __gmpf_sqrt
+#define mpf_sqrt_ui __gmpf_sqrt_ui
+#define mpf_sub __gmpf_sub
+#define mpf_sub_ui __gmpf_sub_ui
+#define mpf_trunc __gmpf_trunc
+#define mpf_ui_div __gmpf_ui_div
+#define mpf_ui_sub __gmpf_ui_sub
+#define mpf_urandomb __gmpf_urandomb
+
+#if defined (__cplusplus)
+extern "C" {
+#endif
 DLL_IMPORT void mpf_abs _PROTO ((mpf_ptr, mpf_srcptr));
 DLL_IMPORT void mpf_add _PROTO ((mpf_ptr, mpf_srcptr, mpf_srcptr));
 DLL_IMPORT void mpf_add_ui _PROTO ((mpf_ptr, mpf_srcptr, unsigned long int));
+DLL_IMPORT void mpf_ceil _PROTO ((mpf_ptr, mpf_srcptr));
 DLL_IMPORT void mpf_clear _PROTO ((mpf_ptr));
 DLL_IMPORT int mpf_cmp _PROTO ((mpf_srcptr, mpf_srcptr));
 DLL_IMPORT int mpf_cmp_si _PROTO ((mpf_srcptr, signed long int));
@@ -321,9 +632,10 @@ DLL_IMPORT void mpf_div_2exp _PROTO ((mpf_ptr, mpf_srcptr, unsigned long int));
 DLL_IMPORT void mpf_div_ui _PROTO ((mpf_ptr, mpf_srcptr, unsigned long int));
 DLL_IMPORT void mpf_dump _PROTO ((mpf_srcptr));
 DLL_IMPORT int mpf_eq _PROTO ((mpf_srcptr, mpf_srcptr, unsigned long int));
+DLL_IMPORT void mpf_floor _PROTO ((mpf_ptr, mpf_srcptr));
 DLL_IMPORT double mpf_get_d _PROTO ((mpf_srcptr));
 DLL_IMPORT unsigned long int mpf_get_prec _PROTO ((mpf_srcptr));
-DLL_IMPORT char *mpf_get_str _PROTO ((char *, mp_exp_t *, int, size_t, mpf_srcptr));
+char *mpf_get_str _PROTO ((char *, mp_exp_t *, int, size_t, mpf_srcptr));
 DLL_IMPORT void mpf_init _PROTO ((mpf_ptr));
 DLL_IMPORT void mpf_init2 _PROTO ((mpf_ptr, unsigned long int));
 #ifdef _GMP_H_HAVE_FILE
@@ -332,7 +644,7 @@ DLL_IMPORT size_t mpf_inp_str _PROTO ((mpf_ptr, FILE *, int));
 DLL_IMPORT void mpf_init_set _PROTO ((mpf_ptr, mpf_srcptr));
 DLL_IMPORT void mpf_init_set_d _PROTO ((mpf_ptr, double));
 DLL_IMPORT void mpf_init_set_si _PROTO ((mpf_ptr, signed long int));
-DLL_IMPORT int mpf_init_set_str _PROTO ((mpf_ptr, const char *, int));
+DLL_IMPORT int mpf_init_set_str _PROTO ((mpf_ptr, __gmp_const char *, int));
 DLL_IMPORT void mpf_init_set_ui _PROTO ((mpf_ptr, unsigned long int));
 DLL_IMPORT void mpf_mul _PROTO ((mpf_ptr, mpf_srcptr, mpf_srcptr));
 DLL_IMPORT void mpf_mul_2exp _PROTO ((mpf_ptr, mpf_srcptr, unsigned long int));
@@ -341,6 +653,7 @@ DLL_IMPORT void mpf_neg _PROTO ((mpf_ptr, mpf_srcptr));
 #ifdef _GMP_H_HAVE_FILE
 DLL_IMPORT size_t mpf_out_str _PROTO ((FILE *, int, size_t, mpf_srcptr));
 #endif
+DLL_IMPORT void mpf_pow_ui _PROTO ((mpf_ptr, mpf_srcptr, unsigned long int));
 DLL_IMPORT void mpf_random2 _PROTO ((mpf_ptr, mp_size_t, mp_exp_t));
 DLL_IMPORT void mpf_reldiff _PROTO ((mpf_ptr, mpf_srcptr, mpf_srcptr));
 DLL_IMPORT void mpf_set _PROTO ((mpf_ptr, mpf_srcptr));
@@ -350,7 +663,7 @@ DLL_IMPORT void mpf_set_prec _PROTO ((mpf_ptr, unsigned long int));
 DLL_IMPORT void mpf_set_prec_raw _PROTO ((mpf_ptr, unsigned long int));
 DLL_IMPORT void mpf_set_q _PROTO ((mpf_ptr, mpq_srcptr));
 DLL_IMPORT void mpf_set_si _PROTO ((mpf_ptr, signed long int));
-DLL_IMPORT int mpf_set_str _PROTO ((mpf_ptr, const char *, int));
+DLL_IMPORT int mpf_set_str _PROTO ((mpf_ptr, __gmp_const char *, int));
 DLL_IMPORT void mpf_set_ui _PROTO ((mpf_ptr, unsigned long int));
 DLL_IMPORT void mpf_set_z _PROTO ((mpf_ptr, mpz_srcptr));
 DLL_IMPORT size_t mpf_size _PROTO ((mpf_srcptr));
@@ -358,92 +671,188 @@ DLL_IMPORT void mpf_sqrt _PROTO ((mpf_ptr, mpf_srcptr));
 DLL_IMPORT void mpf_sqrt_ui _PROTO ((mpf_ptr, unsigned long int));
 DLL_IMPORT void mpf_sub _PROTO ((mpf_ptr, mpf_srcptr, mpf_srcptr));
 DLL_IMPORT void mpf_sub_ui _PROTO ((mpf_ptr, mpf_srcptr, unsigned long int));
+DLL_IMPORT void mpf_trunc _PROTO ((mpf_ptr, mpf_srcptr));
 DLL_IMPORT void mpf_ui_div _PROTO ((mpf_ptr, unsigned long int, mpf_srcptr));
 DLL_IMPORT void mpf_ui_sub _PROTO ((mpf_ptr, unsigned long int, mpf_srcptr));
+DLL_IMPORT void mpf_urandomb _PROTO ((mpf_t, gmp_randstate_t, unsigned long int));
+
+#define mpf_swap __gmpf_swap
+DLL_IMPORT void mpf_swap _PROTO ((mpf_ptr, mpf_ptr));
+
 #if defined (__cplusplus)
 }
 #endif
 /************ Low level positive-integer (i.e. N) routines.  ************/
 
-/* This is ugly, but we need to make usr calls reach the prefixed function.  */
+/* This is ugly, but we need to make user calls reach the prefixed function. */
 #define mpn_add                        __MPN(add)
 #define mpn_add_1              __MPN(add_1)
 #define mpn_add_n              __MPN(add_n)
+#define mpn_add_nc             __MPN(add_nc)
 #define mpn_addmul_1           __MPN(addmul_1)
+#define mpn_addsub_n           __MPN(addsub_n)
+#define mpn_addsub_nc          __MPN(addsub_nc)
+/* #define mpn_and_n           __MPN(and_n) */
+/* #define mpn_andn_n          __MPN(andn_n) */
 #define mpn_bdivmod            __MPN(bdivmod)
 #define mpn_cmp                        __MPN(cmp)
-#define mpn_divmod_1           __MPN(divmod_1)
+/* #define mpn_com_n           __MPN(com_n) */
+#define mpn_copyd              __MPN(copyd)
+#define mpn_copyi              __MPN(copyi)
 #define mpn_divrem             __MPN(divrem)
 #define mpn_divrem_1           __MPN(divrem_1)
+#define mpn_divrem_2           __MPN(divrem_2)
 #define mpn_dump               __MPN(dump)
 #define mpn_gcd                        __MPN(gcd)
 #define mpn_gcd_1              __MPN(gcd_1)
 #define mpn_gcdext             __MPN(gcdext)
 #define mpn_get_str            __MPN(get_str)
 #define mpn_hamdist            __MPN(hamdist)
+#define mpn_invert_limb        __MPN(invert_limb)
+/* #define mpn_ior_n           __MPN(ior_n) */
+/* #define mpn_iorn_n          __MPN(iorn_n) */
+/* #define mpn_kara_mul_n      __MPN(kara_mul_n)  internal */
+/* #define mpn_kara_sqr_n      __MPN(kara_sqr_n)  internal */
 #define mpn_lshift             __MPN(lshift)
+#define mpn_lshiftc            __MPN(lshiftc)
 #define mpn_mod_1              __MPN(mod_1)
 #define mpn_mul                        __MPN(mul)
 #define mpn_mul_1              __MPN(mul_1)
+#define mpn_mul_basecase       __MPN(mul_basecase)
 #define mpn_mul_n              __MPN(mul_n)
 #define mpn_perfect_square_p   __MPN(perfect_square_p)
 #define mpn_popcount           __MPN(popcount)
 #define mpn_preinv_mod_1       __MPN(preinv_mod_1)
+/* #define mpn_nand_n          __MPN(nand_n) */
+/* #define mpn_nior_n          __MPN(nior_n) */
+#define mpn_random             __MPN(random)
 #define mpn_random2            __MPN(random2)
 #define mpn_rshift             __MPN(rshift)
+#define mpn_rshiftc            __MPN(rshiftc)
 #define mpn_scan0              __MPN(scan0)
 #define mpn_scan1              __MPN(scan1)
 #define mpn_set_str            __MPN(set_str)
+#define mpn_sqr_basecase       __MPN(sqr_basecase)
+#define mpn_sqr_n              __MPN(sqr_n)
 #define mpn_sqrtrem            __MPN(sqrtrem)
 #define mpn_sub                        __MPN(sub)
 #define mpn_sub_1              __MPN(sub_1)
 #define mpn_sub_n              __MPN(sub_n)
+#define mpn_sub_nc             __MPN(sub_nc)
 #define mpn_submul_1           __MPN(submul_1)
-#define mpn_udiv_w_sdiv                __MPN(udiv_w_sdiv)
+/* #define mpn_toom3_mul_n             __MPN(toom3_mul_n)  internal */
+/* #define mpn_toom3_sqr_n             __MPN(toom3_sqr_n)  internal */
+/* #define mpn_xnor_n          __MPN(xnor_n) */
+/* #define mpn_xor_n           __MPN(xor_n) */
 
 #if defined (__cplusplus)
 extern "C" {
 #endif
+
 DLL_IMPORT mp_limb_t mpn_add _PROTO ((mp_ptr, mp_srcptr, mp_size_t, mp_srcptr,mp_size_t));
 DLL_IMPORT mp_limb_t mpn_add_1 _PROTO ((mp_ptr, mp_srcptr, mp_size_t, mp_limb_t));
 DLL_IMPORT mp_limb_t mpn_add_n _PROTO ((mp_ptr, mp_srcptr, mp_srcptr, mp_size_t));
+DLL_IMPORT mp_limb_t mpn_add_nc _PROTO ((mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t));
+
 DLL_IMPORT mp_limb_t mpn_addmul_1 _PROTO ((mp_ptr, mp_srcptr, mp_size_t, mp_limb_t));
+
+#define mpn_addmul_1c  __MPN(addmul_1c)
+DLL_IMPORT mp_limb_t mpn_addmul_1c _PROTO ((mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t));
+
+DLL_IMPORT mp_limb_t mpn_addsub_n _PROTO ((mp_ptr, mp_ptr, mp_srcptr, mp_srcptr, mp_size_t));
 DLL_IMPORT mp_limb_t mpn_bdivmod _PROTO ((mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, unsigned long int));
 DLL_IMPORT int mpn_cmp _PROTO ((mp_srcptr, mp_srcptr, mp_size_t));
-DLL_IMPORT mp_limb_t mpn_divmod_1 _PROTO ((mp_ptr, mp_srcptr, mp_size_t, mp_limb_t));
-DLL_IMPORT mp_limb_t mpn_divrem _PROTO ((mp_ptr, mp_size_t, mp_ptr, mp_size_t, mp_srcptr, mp_size_t));
+
+#define mpn_divexact_by3(dst, src, size)  mpn_divexact_by3c (dst, src, size, 0)
+
+#define mpn_divexact_by3c  __MPN(divexact_by3c)
+DLL_IMPORT mp_limb_t mpn_divexact_by3c _PROTO ((mp_ptr dst, mp_srcptr src,
+                                     mp_size_t size, mp_limb_t carry));
+
+#define mpn_divmod_1(qp,np,nsize,dlimb) mpn_divrem_1 (qp,0,np,nsize,dlimb)
+
+DLL_IMPORT mp_limb_t mpn_divrem _PROTO((mp_ptr, mp_size_t, mp_ptr, mp_size_t, mp_srcptr, mp_size_t));
+
 DLL_IMPORT mp_limb_t mpn_divrem_1 _PROTO ((mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t));
+
+#define mpn_divrem_1c  __MPN(divrem_1c)
+DLL_IMPORT mp_limb_t mpn_divrem_1c _PROTO ((mp_ptr, mp_size_t, mp_srcptr, mp_size_t,
+                                 mp_limb_t, mp_limb_t));
+
+DLL_IMPORT mp_limb_t mpn_divrem_2 _PROTO ((mp_ptr, mp_size_t, mp_ptr, mp_size_t, mp_srcptr));
 DLL_IMPORT void mpn_dump _PROTO ((mp_srcptr, mp_size_t));
-DLL_IMPORT mp_size_t mpn_gcd _PROTO ((mp_ptr, mp_ptr, mp_size_t, mp_ptr, mp_size_t));
+mp_size_t mpn_gcd _PROTO ((mp_ptr, mp_ptr, mp_size_t, mp_ptr, mp_size_t));
 DLL_IMPORT mp_limb_t mpn_gcd_1 _PROTO ((mp_srcptr, mp_size_t, mp_limb_t));
-DLL_IMPORT mp_size_t mpn_gcdext _PROTO ((mp_ptr, mp_ptr, mp_ptr, mp_size_t, mp_ptr, mp_size_t));
+mp_size_t mpn_gcdext _PROTO ((mp_ptr, mp_ptr, mp_size_t *, mp_ptr, mp_size_t, mp_ptr, mp_size_t));
 DLL_IMPORT size_t mpn_get_str _PROTO ((unsigned char *, int, mp_ptr, mp_size_t));
 DLL_IMPORT unsigned long int mpn_hamdist _PROTO ((mp_srcptr, mp_srcptr, mp_size_t));
+
+#define mpn_jacobi_base __MPN(jacobi_base)
+DLL_IMPORT int mpn_jacobi_base _PROTO ((mp_limb_t a, mp_limb_t b, int result_bit1));
+
 DLL_IMPORT mp_limb_t mpn_lshift _PROTO ((mp_ptr, mp_srcptr, mp_size_t, unsigned int));
 DLL_IMPORT mp_limb_t mpn_mod_1 _PROTO ((mp_srcptr, mp_size_t, mp_limb_t));
+
+#define mpn_mod_1c  __MPN(mod_1c)
+DLL_IMPORT mp_limb_t mpn_mod_1c _PROTO ((mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t));
+
+#define mpn_mod_1_rshift __MPN(mod_1_rshift)
+DLL_IMPORT mp_limb_t mpn_mod_1_rshift _PROTO ((mp_srcptr, mp_size_t, unsigned,mp_limb_t));
+
 DLL_IMPORT mp_limb_t mpn_mul _PROTO ((mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t));
 DLL_IMPORT mp_limb_t mpn_mul_1 _PROTO ((mp_ptr, mp_srcptr, mp_size_t, mp_limb_t));
+
+#define mpn_mul_1c  __MPN(mul_1c)
+DLL_IMPORT mp_limb_t mpn_mul_1c _PROTO ((mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t));
+
+DLL_IMPORT void mpn_mul_basecase _PROTO ((mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t));
 DLL_IMPORT void mpn_mul_n _PROTO ((mp_ptr, mp_srcptr, mp_srcptr, mp_size_t));
 DLL_IMPORT int mpn_perfect_square_p _PROTO ((mp_srcptr, mp_size_t));
 DLL_IMPORT unsigned long int mpn_popcount _PROTO ((mp_srcptr, mp_size_t));
 DLL_IMPORT mp_limb_t mpn_preinv_mod_1 _PROTO ((mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t));
+DLL_IMPORT void mpn_random _PROTO ((mp_ptr, mp_size_t));
 DLL_IMPORT void mpn_random2 _PROTO ((mp_ptr, mp_size_t));
 DLL_IMPORT mp_limb_t mpn_rshift _PROTO ((mp_ptr, mp_srcptr, mp_size_t, unsigned int));
 DLL_IMPORT unsigned long int mpn_scan0 _PROTO ((mp_srcptr, unsigned long int));
 DLL_IMPORT unsigned long int mpn_scan1 _PROTO ((mp_srcptr, unsigned long int));
-DLL_IMPORT mp_size_t mpn_set_str _PROTO ((mp_ptr, const unsigned char *, size_t, int));
-DLL_IMPORT mp_size_t mpn_sqrtrem _PROTO ((mp_ptr, mp_ptr, mp_srcptr, mp_size_t));
+mp_size_t mpn_set_str _PROTO ((mp_ptr, __gmp_const unsigned char *, size_t, int));
+DLL_IMPORT void mpn_sqr_n _PROTO ((mp_ptr, mp_srcptr, mp_size_t));
+DLL_IMPORT void mpn_sqr_basecase _PROTO ((mp_ptr, mp_srcptr, mp_size_t));
+mp_size_t mpn_sqrtrem _PROTO ((mp_ptr, mp_ptr, mp_srcptr, mp_size_t));
 DLL_IMPORT mp_limb_t mpn_sub _PROTO ((mp_ptr, mp_srcptr, mp_size_t, mp_srcptr,mp_size_t));
 DLL_IMPORT mp_limb_t mpn_sub_1 _PROTO ((mp_ptr, mp_srcptr, mp_size_t, mp_limb_t));
 DLL_IMPORT mp_limb_t mpn_sub_n _PROTO ((mp_ptr, mp_srcptr, mp_srcptr, mp_size_t));
+DLL_IMPORT mp_limb_t mpn_sub_nc _PROTO ((mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t));
 DLL_IMPORT mp_limb_t mpn_submul_1 _PROTO ((mp_ptr, mp_srcptr, mp_size_t, mp_limb_t));
+
+#define mpn_submul_1c  __MPN(submul_1c)
+DLL_IMPORT mp_limb_t mpn_submul_1c _PROTO ((mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t));
+
 #if defined (__cplusplus)
 }
 #endif
 
+#define mpn_incr_u(p,incr) \
+  do { mp_limb_t __x; mp_ptr __p = p;                  \
+    __x = *__p + incr;                                 \
+    *__p = __x;                                                \
+    if (__x < incr)                                    \
+      while (++(*(++__p)) == 0)                                \
+        ;                                              \
+  } while (0)
+
+#define mpn_decr_u(p,incr) \
+  do { mp_limb_t __x; mp_ptr __p = p;                  \
+    __x = *__p;                                                \
+    *__p = __x - incr;                                 \
+    if (__x < incr)                                    \
+      while ((*(++__p))-- == 0)                                \
+        ;                                              \
+  } while (0)
+
 #if defined (__GNUC__) || defined (_FORCE_INLINES)
 _EXTERN_INLINE mp_limb_t
-#if defined (__STDC__) || defined (__cplusplus)
+#if (__STDC__-0) || defined (__cplusplus)
 mpn_add_1 (register mp_ptr res_ptr,
           register mp_srcptr s1_ptr,
           register mp_size_t s1_size,
@@ -485,7 +894,7 @@ mpn_add_1 (res_ptr, s1_ptr, s1_size, s2_limb)
 }
 
 _EXTERN_INLINE mp_limb_t
-#if defined (__STDC__) || defined (__cplusplus)
+#if (__STDC__-0) || defined (__cplusplus)
 mpn_add (register mp_ptr res_ptr,
         register mp_srcptr s1_ptr,
         register mp_size_t s1_size,
@@ -514,7 +923,7 @@ mpn_add (res_ptr, s1_ptr, s1_size, s2_ptr, s2_size)
 }
 
 _EXTERN_INLINE mp_limb_t
-#if defined (__STDC__) || defined (__cplusplus)
+#if (__STDC__-0) || defined (__cplusplus)
 mpn_sub_1 (register mp_ptr res_ptr,
           register mp_srcptr s1_ptr,
           register mp_size_t s1_size,
@@ -556,7 +965,7 @@ mpn_sub_1 (res_ptr, s1_ptr, s1_size, s2_limb)
 }
 
 _EXTERN_INLINE mp_limb_t
-#if defined (__STDC__) || defined (__cplusplus)
+#if (__STDC__-0) || defined (__cplusplus)
 mpn_sub (register mp_ptr res_ptr,
         register mp_srcptr s1_ptr,
         register mp_size_t s1_size,
@@ -590,28 +999,40 @@ mpn_sub (res_ptr, s1_ptr, s1_size, s2_ptr, s2_size)
 #define mpf_sgn(F) ((F)->_mp_size < 0 ? -1 : (F)->_mp_size > 0)
 #define mpq_sgn(Q) ((Q)->_mp_num._mp_size < 0 ? -1 : (Q)->_mp_num._mp_size > 0)
 
-/* Allow direct user access to numerator and denominator of a mpq_t object.  */
-#define mpq_numref(Q) (&((Q)->_mp_num))
-#define mpq_denref(Q) (&((Q)->_mp_den))
-
 /* When using GCC, optimize certain common comparisons.  */
 #if defined (__GNUC__)
 #define mpz_cmp_ui(Z,UI) \
   (__builtin_constant_p (UI) && (UI) == 0                              \
-   ? mpz_sgn (Z) : mpz_cmp_ui (Z,UI))
-#define mpz_cmp_si(Z,UI) \
-  (__builtin_constant_p (UI) && (UI) == 0 ? mpz_sgn (Z)                        \
-   : __builtin_constant_p (UI) && (UI) > 0 ? mpz_cmp_ui (Z,UI)         \
-   : mpz_cmp_si (Z,UI))
+   ? mpz_sgn (Z) : _mpz_cmp_ui (Z,UI))
+#define mpz_cmp_si(Z,SI) \
+  (__builtin_constant_p (SI) && (SI) == 0 ? mpz_sgn (Z)                        \
+   : __builtin_constant_p (SI) && (SI) > 0                             \
+    ? _mpz_cmp_ui (Z, (unsigned long int) SI)                          \
+   : _mpz_cmp_si (Z,SI))
 #define mpq_cmp_ui(Q,NUI,DUI) \
   (__builtin_constant_p (NUI) && (NUI) == 0                            \
-   ? mpq_sgn (Q) : mpq_cmp_ui (Q,NUI,DUI))
+   ? mpq_sgn (Q) : _mpq_cmp_ui (Q,NUI,DUI))
+#else
+#define mpz_cmp_ui(Z,UI) _mpz_cmp_ui (Z,UI)
+#define mpz_cmp_si(Z,UI) _mpz_cmp_si (Z,UI)
+#define mpq_cmp_ui(Q,NUI,DUI) _mpq_cmp_ui (Q,NUI,DUI)
 #endif
 
+
+/* Using "&" rather than "&&" means these can come out branch-free.  Every
+   mpz_t has at least one limb allocated, so fetching the low limb is always
+   allowed.  */
+#define mpz_odd_p(z)   ((int) ((z)->_mp_size != 0) & (int) (z)->_mp_d[0])
+#define mpz_even_p(z)  (! mpz_odd_p (z))
+
+
+/* Allow direct user access to numerator and denominator of a mpq_t object.  */
+#define mpq_numref(Q) (&((Q)->_mp_num))
+#define mpq_denref(Q) (&((Q)->_mp_den))
+
+
+/* Compatibility with GMP 2 and earlier. */
 #define mpn_divmod(qp,np,nsize,dp,dsize) mpn_divrem (qp,0,np,nsize,dp,dsize)
-#if 0
-#define mpn_divmod_1(qp,np,nsize,dlimb) mpn_divrem_1 (qp,0,np,nsize,dlimb)
-#endif
 
 /* Compatibility with GMP 1.  */
 #define mpz_mdiv       mpz_fdiv_q
@@ -632,7 +1053,28 @@ mpn_sub (res_ptr, s1_ptr, s1_size, s2_ptr, s2_size)
 #define mpz_div_2exp   mpz_fdiv_q_2exp
 #define mpz_mod_2exp   mpz_fdiv_r_2exp
 
-#define __GNU_MP_VERSION 2
-#define __GNU_MP_VERSION_MINOR 0
+#define gmp_errno __gmp_errno
+extern int gmp_errno;
+
+enum
+{
+  GMP_ERROR_NONE = 0,
+  GMP_ERROR_UNSUPPORTED_ARGUMENT = 1,
+  GMP_ERROR_DIVISION_BY_ZERO = 2,
+  GMP_ERROR_SQRT_OF_NEGATIVE = 4,
+  GMP_ERROR_INVALID_ARGUMENT = 8,
+  GMP_ERROR_ALLOCATE = 16,
+  GMP_ERROR_BAD_STRING = 32,
+  GMP_ERROR_UNUSED_ERROR
+};
+
+/* Note: major version number is in mp.h too */
+#define __GNU_MP_VERSION 3
+#define __GNU_MP_VERSION_MINOR 1
+#define __GNU_MP_VERSION_PATCHLEVEL 0
+
+#define gmp_version __gmp_version
+extern __gmp_const char *gmp_version;
+
 #define __GMP_H__
 #endif /* __GMP_H__ */
diff --git a/ghc/rts/gmp/insert-double.c b/ghc/rts/gmp/insert-double.c
deleted file mode 100644 (file)
index 1ce2571..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/* __gmp_insert_double -- convert from array of mp_limb_t to double.
-
-Copyright (C) 1996 Free Software Foundation, Inc.
-
-This file is part of the GNU MP Library.
-
-The GNU MP Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Library General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at your
-option) any later version.
-
-The GNU MP 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 Library General Public
-License for more details.
-
-You should have received a copy of the GNU Library General Public License
-along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-MA 02111-1307, USA. */
-
-#include "gmp.h"
-#include "gmp-impl.h"
-
-#ifdef XDEBUG
-#undef _GMP_IEEE_FLOATS
-#endif
-
-#ifndef _GMP_IEEE_FLOATS
-#define _GMP_IEEE_FLOATS 0
-#endif
-
-double
-#if __STDC__
-__gmp_scale2 (double d, int exp)
-#else
-__gmp_scale2 (d, exp)
-     double d;
-     int exp;
-#endif
-{
-#if _GMP_IEEE_FLOATS
-  {
-    union ieee_double_extract x;
-    x.d = d;
-    x.s.exp += exp;
-    return x.d;
-  }
-#else
-  {
-    double factor, r;
-
-    factor = 2.0;
-    if (exp < 0)
-      {
-       factor = 0.5;
-       exp = -exp;
-      }
-    r = d;
-    while (exp != 0)
-      {
-       if ((exp & 1) != 0)
-         r *= factor;
-       factor *= factor;
-       exp >>= 1;
-      }
-    return r;
-  }
-#endif
-}
diff --git a/ghc/rts/gmp/install.sh b/ghc/rts/gmp/install.sh
deleted file mode 100644 (file)
index 5871924..0000000
+++ /dev/null
@@ -1,238 +0,0 @@
-#! /bin/sh
-#
-# install - install a program, script, or datafile
-# This comes from X11R5.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch.
-#
-
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
-
-
-# put in absolute paths if you don't have them in your path; or use env. vars.
-
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
-
-transformbasename=""
-transform_arg=""
-instcmd="$mvprog"
-chmodcmd="$chmodprog 0755"
-chowncmd=""
-chgrpcmd=""
-stripcmd=""
-rmcmd="$rmprog -f"
-mvcmd="$mvprog"
-src=""
-dst=""
-dir_arg=""
-
-while [ x"$1" != x ]; do
-    case $1 in
-       -c) instcmd="$cpprog"
-           shift
-           continue;;
-
-       -d) dir_arg=true
-           shift
-           continue;;
-
-       -m) chmodcmd="$chmodprog $2"
-           shift
-           shift
-           continue;;
-
-       -o) chowncmd="$chownprog $2"
-           shift
-           shift
-           continue;;
-
-       -g) chgrpcmd="$chgrpprog $2"
-           shift
-           shift
-           continue;;
-
-       -s) stripcmd="$stripprog"
-           shift
-           continue;;
-
-       -t=*) transformarg=`echo $1 | sed 's/-t=//'`
-           shift
-           continue;;
-
-       -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
-           shift
-           continue;;
-
-       *)  if [ x"$src" = x ]
-           then
-               src=$1
-           else
-               # this colon is to work around a 386BSD /bin/sh bug
-               :
-               dst=$1
-           fi
-           shift
-           continue;;
-    esac
-done
-
-if [ x"$src" = x ]
-then
-       echo "install:  no input file specified"
-       exit 1
-else
-       true
-fi
-
-if [ x"$dir_arg" != x ]; then
-       dst=$src
-       src=""
-       
-       if [ -d $dst ]; then
-               instcmd=:
-       else
-               instcmd=mkdir
-       fi
-else
-
-# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
-# might cause directories to be created, which would be especially bad 
-# if $src (and thus $dsttmp) contains '*'.
-
-       if [ -f $src -o -d $src ]
-       then
-               true
-       else
-               echo "install:  $src does not exist"
-               exit 1
-       fi
-       
-       if [ x"$dst" = x ]
-       then
-               echo "install:  no destination specified"
-               exit 1
-       else
-               true
-       fi
-
-# If destination is a directory, append the input filename; if your system
-# does not like double slashes in filenames, you may need to add some logic
-
-       if [ -d $dst ]
-       then
-               dst="$dst"/`basename $src`
-       else
-               true
-       fi
-fi
-
-## this sed command emulates the dirname command
-dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
-
-# Make sure that the destination directory exists.
-#  this part is taken from Noah Friedman's mkinstalldirs script
-
-# Skip lots of stat calls in the usual case.
-if [ ! -d "$dstdir" ]; then
-defaultIFS='   
-'
-IFS="${IFS-${defaultIFS}}"
-
-oIFS="${IFS}"
-# Some sh's can't handle IFS=/ for some reason.
-IFS='%'
-set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
-IFS="${oIFS}"
-
-pathcomp=''
-
-while [ $# -ne 0 ] ; do
-       pathcomp="${pathcomp}${1}"
-       shift
-
-       if [ ! -d "${pathcomp}" ] ;
-        then
-               $mkdirprog "${pathcomp}"
-       else
-               true
-       fi
-
-       pathcomp="${pathcomp}/"
-done
-fi
-
-if [ x"$dir_arg" != x ]
-then
-       $doit $instcmd $dst &&
-
-       if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
-       if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
-       if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
-       if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
-else
-
-# If we're going to rename the final executable, determine the name now.
-
-       if [ x"$transformarg" = x ] 
-       then
-               dstfile=`basename $dst`
-       else
-               dstfile=`basename $dst $transformbasename | 
-                       sed $transformarg`$transformbasename
-       fi
-
-# don't allow the sed command to completely eliminate the filename
-
-       if [ x"$dstfile" = x ] 
-       then
-               dstfile=`basename $dst`
-       else
-               true
-       fi
-
-# Make a temp file name in the proper directory.
-
-       dsttmp=$dstdir/#inst.$$#
-
-# Move or copy the file name to the temp name
-
-       $doit $instcmd $src $dsttmp &&
-
-       trap "rm -f ${dsttmp}" 0 &&
-
-# and set any options; do chmod last to preserve setuid bits
-
-# If any of these fail, we abort the whole thing.  If we want to
-# ignore errors from any of these, just make sure not to ignore
-# errors from the above "$doit $instcmd $src $dsttmp" command.
-
-       if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
-       if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
-       if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
-       if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
-
-# Now rename the file to the real destination.
-
-       $doit $rmcmd -f $dstdir/$dstfile &&
-       $doit $mvcmd $dsttmp $dstdir/$dstfile 
-
-fi &&
-
-
-exit 0
diff --git a/ghc/rts/gmp/make.bat b/ghc/rts/gmp/make.bat
deleted file mode 100644 (file)
index 2a79c48..0000000
+++ /dev/null
@@ -1,315 +0,0 @@
-cd mpn\r
-copy msdos\asm-synt.h asm-synt.h\r
-copy bsd.h sysdep.h\r
-copy generic\inlines.c inlines.c\r
-copy x86\pentium\add_n.S add_n.S\r
-copy x86\pentium\addmul_1.S addmul_1.S\r
-copy generic\cmp.c cmp.c\r
-copy generic\divmod_1.c divmod_1.c \r
-copy generic\divrem.c divrem.c\r
-copy generic\divrem_1.c divrem_1.c\r
-copy generic\dump.c dump.c\r
-copy x86\pentium\lshift.S lshift.S\r
-copy generic\mod_1.c mod_1.c\r
-copy generic\mul.c mul.c\r
-copy x86\pentium\mul_1.S mul_1.S\r
-copy generic\mul_n.c mul_n.c\r
-copy generic\random2.c random2.c\r
-copy x86\pentium\rshift.S rshift.S\r
-copy generic\sqrtrem.c sqrtrem.c\r
-copy x86\pentium\sub_n.S sub_n.S\r
-copy x86\pentium\submul_1.S submul_1.S\r
-copy generic\get_str.c get_str.c\r
-copy generic\set_str.c set_str.c\r
-copy generic\scan0.c scan0.c\r
-copy generic\scan1.c scan1.c\r
-copy generic\popcount.c popcount.c\r
-copy generic\hamdist.c hamdist.c\r
-copy generic\gcd_1.c gcd_1.c\r
-copy generic\pre_mod_1.c pre_mod_1.c\r
-copy generic\perfsqr.c perfsqr.c\r
-copy generic\bdivmod.c bdivmod.c\r
-copy generic\gcd.c gcd.c\r
-copy generic\gcdext.c gcdext.c\r
-copy x86\gmp-mpar.h gmp-mpar.h\r
-cd ..\r
-\r
-cd mpbsd\r
-copy ..\mpz\add.c add.c\r
-copy ..\mpz\cmp.c cmp.c\r
-copy ..\mpz\gcd.c gcd.c\r
-copy ..\mpz\mul.c mul.c\r
-copy ..\mpz\pow_ui.c pow_ui.c\r
-copy ..\mpz\powm.c powm.c\r
-copy ..\mpz\sqrtrem.c sqrtrem.c\r
-copy ..\mpz\sub.c sub.c\r
-cd ..\r
-\r
-cd mpn\r
-gcc -c -I. -I.. -g -O mp_bases.c\r
-gcc -c -I. -I.. -g -O inlines.c\r
-gcc -E -I. -I.. -g -O add_n.S | grep -v '^#' >tmp-add_n.s\r
-gcc -c tmp-add_n.s -o add_n.o\r
-del tmp-add_n.s\r
-gcc -E -I. -I.. -g -O addmul_1.S | grep -v '^#' >tmp-addmul_1.s\r
-gcc -c tmp-addmul_1.s -o addmul_1.o\r
-del tmp-addmul_1.s\r
-gcc -c -I. -I.. -g -O cmp.c\r
-gcc -c -I. -I.. -g -O divmod_1.c\r
-gcc -c -I. -I.. -g -O divrem.c\r
-gcc -c -I. -I.. -g -O divrem_1.c\r
-gcc -c -I. -I.. -g -O dump.c\r
-gcc -E -I. -I.. -g -O lshift.S | grep -v '^#' >tmp-lshift.s\r
-gcc -c tmp-lshift.s -o lshift.o\r
-del tmp-lshift.s\r
-gcc -c -I. -I.. -g -O mod_1.c\r
-gcc -c -I. -I.. -g -O mul.c\r
-gcc -E -I. -I.. -g -O mul_1.S | grep -v '^#' >tmp-mul_1.s\r
-gcc -c tmp-mul_1.s -o mul_1.o\r
-del tmp-mul_1.s\r
-gcc -c -I. -I.. -g -O mul_n.c\r
-gcc -c -I. -I.. -g -O random2.c\r
-gcc -E -I. -I.. -g -O rshift.S | grep -v '^#' >tmp-rshift.s\r
-gcc -c tmp-rshift.s -o rshift.o\r
-del tmp-rshift.s\r
-gcc -c -I. -I.. -g -O sqrtrem.c\r
-gcc -E -I. -I.. -g -O sub_n.S | grep -v '^#' >tmp-sub_n.s\r
-gcc -c tmp-sub_n.s -o sub_n.o\r
-del tmp-sub_n.s\r
-gcc -E -I. -I.. -g -O submul_1.S | grep -v '^#' >tmp-submul_1.s\r
-gcc -c tmp-submul_1.s -o submul_1.o\r
-del tmp-submul_1.s\r
-gcc -c -I. -I.. -g -O get_str.c\r
-gcc -c -I. -I.. -g -O set_str.c\r
-gcc -c -I. -I.. -g -O scan0.c\r
-gcc -c -I. -I.. -g -O scan1.c\r
-gcc -c -I. -I.. -g -O popcount.c\r
-gcc -c -I. -I.. -g -O hamdist.c\r
-gcc -c -I. -I.. -g -O gcd_1.c\r
-gcc -c -I. -I.. -g -O pre_mod_1.c\r
-gcc -c -I. -I.. -g -O perfsqr.c\r
-gcc -c -I. -I.. -g -O bdivmod.c\r
-gcc -c -I. -I.. -g -O gcd.c\r
-gcc -c -I. -I.. -g -O gcdext.c\r
-del libmpn.a\r
-ar rc libmpn.a *.o\r
-cd ..\r
-\r
-cd mpz\r
-gcc -c -I. -I.. -I../mpn -g -O abs.c\r
-gcc -c -I. -I.. -I../mpn -g -O add.c\r
-gcc -c -I. -I.. -I../mpn -g -O add_ui.c\r
-gcc -c -I. -I.. -I../mpn -g -O and.c\r
-gcc -c -I. -I.. -I../mpn -g -O array_init.c\r
-gcc -c -I. -I.. -I../mpn -g -O cdiv_q.c\r
-gcc -c -I. -I.. -I../mpn -g -O cdiv_q_ui.c\r
-gcc -c -I. -I.. -I../mpn -g -O cdiv_qr.c\r
-gcc -c -I. -I.. -I../mpn -g -O cdiv_qr_ui.c\r
-gcc -c -I. -I.. -I../mpn -g -O cdiv_r.c\r
-gcc -c -I. -I.. -I../mpn -g -O cdiv_r_ui.c\r
-gcc -c -I. -I.. -I../mpn -g -O cdiv_ui.c\r
-gcc -c -I. -I.. -I../mpn -g -O clear.c\r
-gcc -c -I. -I.. -I../mpn -g -O clrbit.c\r
-gcc -c -I. -I.. -I../mpn -g -O cmp.c\r
-gcc -c -I. -I.. -I../mpn -g -O cmp_si.c\r
-gcc -c -I. -I.. -I../mpn -g -O cmp_ui.c\r
-gcc -c -I. -I.. -I../mpn -g -O com.c\r
-gcc -c -I. -I.. -I../mpn -g -O divexact.c\r
-gcc -c -I. -I.. -I../mpn -g -O fac_ui.c\r
-gcc -c -I. -I.. -I../mpn -g -O fdiv_q.c\r
-gcc -c -I. -I.. -I../mpn -g -O fdiv_q_2exp.c\r
-gcc -c -I. -I.. -I../mpn -g -O fdiv_q_ui.c\r
-gcc -c -I. -I.. -I../mpn -g -O fdiv_qr.c\r
-gcc -c -I. -I.. -I../mpn -g -O fdiv_qr_ui.c\r
-gcc -c -I. -I.. -I../mpn -g -O fdiv_r.c\r
-gcc -c -I. -I.. -I../mpn -g -O fdiv_r_2exp.c\r
-gcc -c -I. -I.. -I../mpn -g -O fdiv_r_ui.c\r
-gcc -c -I. -I.. -I../mpn -g -O fdiv_ui.c\r
-gcc -c -I. -I.. -I../mpn -g -O gcd.c\r
-gcc -c -I. -I.. -I../mpn -g -O gcd_ui.c\r
-gcc -c -I. -I.. -I../mpn -g -O gcdext.c\r
-gcc -c -I. -I.. -I../mpn -g -O get_d.c\r
-gcc -c -I. -I.. -I../mpn -g -O get_si.c\r
-gcc -c -I. -I.. -I../mpn -g -O get_str.c\r
-gcc -c -I. -I.. -I../mpn -g -O get_ui.c\r
-gcc -c -I. -I.. -I../mpn -g -O getlimbn.c\r
-gcc -c -I. -I.. -I../mpn -g -O hamdist.c\r
-gcc -c -I. -I.. -I../mpn -g -O init.c\r
-gcc -c -I. -I.. -I../mpn -g -O inp_raw.c\r
-gcc -c -I. -I.. -I../mpn -g -O inp_str.c\r
-gcc -c -I. -I.. -I../mpn -g -O invert.c\r
-gcc -c -I. -I.. -I../mpn -g -O ior.c\r
-gcc -c -I. -I.. -I../mpn -g -O iset.c\r
-gcc -c -I. -I.. -I../mpn -g -O iset_d.c\r
-gcc -c -I. -I.. -I../mpn -g -O iset_si.c\r
-gcc -c -I. -I.. -I../mpn -g -O iset_str.c\r
-gcc -c -I. -I.. -I../mpn -g -O iset_ui.c\r
-gcc -c -I. -I.. -I../mpn -g -O jacobi.c\r
-gcc -c -I. -I.. -I../mpn -g -O legendre.c\r
-gcc -c -I. -I.. -I../mpn -g -O mod.c\r
-gcc -c -I. -I.. -I../mpn -g -O mul.c\r
-gcc -c -I. -I.. -I../mpn -g -O mul_2exp.c\r
-gcc -c -I. -I.. -I../mpn -g -O mul_ui.c\r
-gcc -c -I. -I.. -I../mpn -g -O neg.c\r
-gcc -c -I. -I.. -I../mpn -g -O out_raw.c\r
-gcc -c -I. -I.. -I../mpn -g -O out_str.c\r
-gcc -c -I. -I.. -I../mpn -g -O perfsqr.c\r
-gcc -c -I. -I.. -I../mpn -g -O popcount.c\r
-gcc -c -I. -I.. -I../mpn -g -O pow_ui.c\r
-gcc -c -I. -I.. -I../mpn -g -O powm.c\r
-gcc -c -I. -I.. -I../mpn -g -O powm_ui.c\r
-gcc -c -I. -I.. -I../mpn -g -O pprime_p.c\r
-gcc -c -I. -I.. -I../mpn -g -O random.c\r
-gcc -c -I. -I.. -I../mpn -g -O random2.c\r
-gcc -c -I. -I.. -I../mpn -g -O realloc.c\r
-gcc -c -I. -I.. -I../mpn -g -O scan0.c\r
-gcc -c -I. -I.. -I../mpn -g -O scan1.c\r
-gcc -c -I. -I.. -I../mpn -g -O set.c\r
-gcc -c -I. -I.. -I../mpn -g -O set_d.c\r
-gcc -c -I. -I.. -I../mpn -g -O set_f.c\r
-gcc -c -I. -I.. -I../mpn -g -O set_q.c\r
-gcc -c -I. -I.. -I../mpn -g -O set_si.c\r
-gcc -c -I. -I.. -I../mpn -g -O set_str.c\r
-gcc -c -I. -I.. -I../mpn -g -O set_ui.c\r
-gcc -c -I. -I.. -I../mpn -g -O setbit.c\r
-gcc -c -I. -I.. -I../mpn -g -O size.c\r
-gcc -c -I. -I.. -I../mpn -g -O sizeinbase.c\r
-gcc -c -I. -I.. -I../mpn -g -O sqrt.c\r
-gcc -c -I. -I.. -I../mpn -g -O sqrtrem.c\r
-gcc -c -I. -I.. -I../mpn -g -O sub.c\r
-gcc -c -I. -I.. -I../mpn -g -O sub_ui.c\r
-gcc -c -I. -I.. -I../mpn -g -O tdiv_q.c\r
-gcc -c -I. -I.. -I../mpn -g -O tdiv_q_2exp.c\r
-gcc -c -I. -I.. -I../mpn -g -O tdiv_q_ui.c\r
-gcc -c -I. -I.. -I../mpn -g -O tdiv_qr.c\r
-gcc -c -I. -I.. -I../mpn -g -O tdiv_qr_ui.c\r
-gcc -c -I. -I.. -I../mpn -g -O tdiv_r.c\r
-gcc -c -I. -I.. -I../mpn -g -O tdiv_r_2exp.c\r
-gcc -c -I. -I.. -I../mpn -g -O tdiv_r_ui.c\r
-gcc -c -I. -I.. -I../mpn -g -O ui_pow_ui.c\r
-del libmpz.a\r
-ar rc libmpz.a *.o\r
-cd ..\r
-\r
-cd mpf\r
-gcc -c -I. -I.. -I../mpn -g -O abs.c\r
-gcc -c -I. -I.. -I../mpn -g -O add.c\r
-gcc -c -I. -I.. -I../mpn -g -O add_ui.c\r
-gcc -c -I. -I.. -I../mpn -g -O clear.c\r
-gcc -c -I. -I.. -I../mpn -g -O cmp.c\r
-gcc -c -I. -I.. -I../mpn -g -O cmp_si.c\r
-gcc -c -I. -I.. -I../mpn -g -O cmp_ui.c\r
-gcc -c -I. -I.. -I../mpn -g -O div.c\r
-gcc -c -I. -I.. -I../mpn -g -O div_2exp.c\r
-gcc -c -I. -I.. -I../mpn -g -O div_ui.c\r
-gcc -c -I. -I.. -I../mpn -g -O dump.c\r
-gcc -c -I. -I.. -I../mpn -g -O eq.c\r
-gcc -c -I. -I.. -I../mpn -g -O get_d.c\r
-gcc -c -I. -I.. -I../mpn -g -O get_prc.c\r
-gcc -c -I. -I.. -I../mpn -g -O get_str.c\r
-gcc -c -I. -I.. -I../mpn -g -O init.c\r
-gcc -c -I. -I.. -I../mpn -g -O init2.c\r
-gcc -c -I. -I.. -I../mpn -g -O inp_str.c\r
-gcc -c -I. -I.. -I../mpn -g -O iset.c\r
-gcc -c -I. -I.. -I../mpn -g -O iset_d.c\r
-gcc -c -I. -I.. -I../mpn -g -O iset_si.c\r
-gcc -c -I. -I.. -I../mpn -g -O iset_str.c\r
-gcc -c -I. -I.. -I../mpn -g -O iset_ui.c\r
-gcc -c -I. -I.. -I../mpn -g -O mul.c\r
-gcc -c -I. -I.. -I../mpn -g -O mul_2exp.c\r
-gcc -c -I. -I.. -I../mpn -g -O mul_ui.c\r
-gcc -c -I. -I.. -I../mpn -g -O neg.c\r
-gcc -c -I. -I.. -I../mpn -g -O out_str.c\r
-gcc -c -I. -I.. -I../mpn -g -O random2.c\r
-gcc -c -I. -I.. -I../mpn -g -O reldiff.c\r
-gcc -c -I. -I.. -I../mpn -g -O set.c\r
-gcc -c -I. -I.. -I../mpn -g -O set_d.c\r
-gcc -c -I. -I.. -I../mpn -g -O set_dfl_prc.c\r
-gcc -c -I. -I.. -I../mpn -g -O set_prc.c\r
-gcc -c -I. -I.. -I../mpn -g -O set_prc_raw.c\r
-gcc -c -I. -I.. -I../mpn -g -O set_q.c\r
-gcc -c -I. -I.. -I../mpn -g -O set_si.c\r
-gcc -c -I. -I.. -I../mpn -g -O set_str.c\r
-gcc -c -I. -I.. -I../mpn -g -O set_ui.c\r
-gcc -c -I. -I.. -I../mpn -g -O set_z.c\r
-gcc -c -I. -I.. -I../mpn -g -O size.c\r
-gcc -c -I. -I.. -I../mpn -g -O sqrt.c\r
-gcc -c -I. -I.. -I../mpn -g -O sqrt_ui.c\r
-gcc -c -I. -I.. -I../mpn -g -O sub.c\r
-gcc -c -I. -I.. -I../mpn -g -O sub_ui.c\r
-gcc -c -I. -I.. -I../mpn -g -O ui_div.c\r
-gcc -c -I. -I.. -I../mpn -g -O ui_sub.c\r
-del libmpf.a\r
-ar cr libmpf.a *.o\r
-cd ..\r
-\r
-cd mpq\r
-gcc -c -I. -I.. -I../mpn -g -O add.c\r
-gcc -c -I. -I.. -I../mpn -g -O canonicalize.c\r
-gcc -c -I. -I.. -I../mpn -g -O clear.c\r
-gcc -c -I. -I.. -I../mpn -g -O cmp.c\r
-gcc -c -I. -I.. -I../mpn -g -O cmp_ui.c\r
-gcc -c -I. -I.. -I../mpn -g -O div.c\r
-gcc -c -I. -I.. -I../mpn -g -O equal.c\r
-gcc -c -I. -I.. -I../mpn -g -O get_d.c\r
-gcc -c -I. -I.. -I../mpn -g -O get_den.c\r
-gcc -c -I. -I.. -I../mpn -g -O get_num.c\r
-gcc -c -I. -I.. -I../mpn -g -O init.c\r
-gcc -c -I. -I.. -I../mpn -g -O inv.c\r
-gcc -c -I. -I.. -I../mpn -g -O mul.c\r
-gcc -c -I. -I.. -I../mpn -g -O neg.c\r
-gcc -c -I. -I.. -I../mpn -g -O set.c\r
-gcc -c -I. -I.. -I../mpn -g -O set_den.c\r
-gcc -c -I. -I.. -I../mpn -g -O set_num.c\r
-gcc -c -I. -I.. -I../mpn -g -O set_si.c\r
-gcc -c -I. -I.. -I../mpn -g -O set_ui.c\r
-gcc -c -I. -I.. -I../mpn -g -O set_z.c\r
-gcc -c -I. -I.. -I../mpn -g -O sub.c\r
-del libmpq.a\r
-ar cr libmpq.a *.o\r
-cd ..\r
-\r
-gcc -c -I. -Impn -I.. -g -O extract-double.c\r
-gcc -c -I. -Impn -I.. -g -O insert-double.c\r
-gcc -c -I. -Impn -I.. -g -O memory.c\r
-gcc -c -I. -Impn -I.. -g -O mp_clz_tab.c\r
-gcc -c -I. -Impn -I.. -g -O mp_set_fns.c\r
-gcc -c -I. -Impn -I.. -g -O stack-alloc.c\r
-gcc -c -I. -Impn -I.. -g -O version.c\r
-deltree/y tmpdir\r
-\r
-md tmpdir\r
-\r
-md tmpdir\mpn\r
-cd tmpdir\mpn\r
-ar x ../../mpn/libmpn.a\r
-cd ..\..\r
-\r
-md tmpdir\mpz\r
-cd tmpdir\mpz\r
-ar x ../../mpz/libmpz.a\r
-cd ..\..\r
-\r
-md tmpdir\mpq\r
-cd tmpdir\mpq\r
-ar x ../../mpq/libmpq.a\r
-cd ..\..\r
-\r
-md tmpdir\mpf\r
-cd tmpdir\mpf\r
-ar x ../../mpf/libmpf.a\r
-cd ..\..\r
-\r
-copy memory.o tmpdir\r
-copy mp_set_fns.o tmpdir\r
-copy mp_clz_tab.o tmpdir\r
-copy version.o tmpdir\r
-copy stack-alloc.o tmpdir\r
-\r
-cd tmpdir\r
-ar rc libgmp.a *.o */*.o\r
-ranlib libgmp.a\r
-cd ..\r
-\r
-move/y tmpdir\libgmp.a libgmp.a\r
-deltree/y tmpdir\r
diff --git a/ghc/rts/gmp/move-if-change b/ghc/rts/gmp/move-if-change
deleted file mode 100644 (file)
index ee9e355..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-if
-test -r $2
-then
-if
-cmp $1 $2 > /dev/null
-then
-echo $2 is unchanged
-rm -f $1
-else
-mv -f $1 $2
-fi
-else
-mv -f $1 $2
-fi
diff --git a/ghc/rts/gmp/mpn/alpha/add_n.s b/ghc/rts/gmp/mpn/alpha/add_n.s
deleted file mode 100644 (file)
index 426556e..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
- # Alpha __mpn_add_n -- Add two limb vectors of the same length > 0 and
- # store sum in a third limb vector.
-
- # Copyright (C) 1995 Free Software Foundation, Inc.
-
- # This file is part of the GNU MP Library.
-
- # The GNU MP Library is free software; you can redistribute it and/or modify
- # it under the terms of the GNU Library General Public License as published by
- # the Free Software Foundation; either version 2 of the License, or (at your
- # option) any later version.
-
- # The GNU MP 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 Library General Public
- # License for more details.
-
- # You should have received a copy of the GNU Library General Public License
- # along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
- # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- # MA 02111-1307, USA.
-
-
- # INPUT PARAMETERS
- # res_ptr     $16
- # s1_ptr      $17
- # s2_ptr      $18
- # size                $19
-
-       .set    noreorder
-       .set    noat
-.text
-       .align  3
-       .globl  __mpn_add_n
-       .ent    __mpn_add_n
-__mpn_add_n:
-       .frame  $30,0,$26,0
-
-       ldq     $3,0($17)
-       ldq     $4,0($18)
-
-       subq    $19,1,$19
-       and     $19,4-1,$2      # number of limbs in first loop
-       bis     $31,$31,$0
-       beq     $2,.L0          # if multiple of 4 limbs, skip first loop
-
-       subq    $19,$2,$19
-
-.Loop0:        subq    $2,1,$2
-       ldq     $5,8($17)
-       addq    $4,$0,$4
-       ldq     $6,8($18)
-       cmpult  $4,$0,$1
-       addq    $3,$4,$4
-       cmpult  $4,$3,$0
-       stq     $4,0($16)
-       or      $0,$1,$0
-
-       addq    $17,8,$17
-       addq    $18,8,$18
-       bis     $5,$5,$3
-       bis     $6,$6,$4
-       addq    $16,8,$16
-       bne     $2,.Loop0
-
-.L0:   beq     $19,.Lend
-
-       .align  3
-.Loop: subq    $19,4,$19
-
-       ldq     $5,8($17)
-       addq    $4,$0,$4
-       ldq     $6,8($18)
-       cmpult  $4,$0,$1
-       addq    $3,$4,$4
-       cmpult  $4,$3,$0
-       stq     $4,0($16)
-       or      $0,$1,$0
-
-       ldq     $3,16($17)
-       addq    $6,$0,$6
-       ldq     $4,16($18)
-       cmpult  $6,$0,$1
-       addq    $5,$6,$6
-       cmpult  $6,$5,$0
-       stq     $6,8($16)
-       or      $0,$1,$0
-
-       ldq     $5,24($17)
-       addq    $4,$0,$4
-       ldq     $6,24($18)
-       cmpult  $4,$0,$1
-       addq    $3,$4,$4
-       cmpult  $4,$3,$0
-       stq     $4,16($16)
-       or      $0,$1,$0
-
-       ldq     $3,32($17)
-       addq    $6,$0,$6
-       ldq     $4,32($18)
-       cmpult  $6,$0,$1
-       addq    $5,$6,$6
-       cmpult  $6,$5,$0
-       stq     $6,24($16)
-       or      $0,$1,$0
-
-       addq    $17,32,$17
-       addq    $18,32,$18
-       addq    $16,32,$16
-       bne     $19,.Loop
-
-.Lend: addq    $4,$0,$4
-       cmpult  $4,$0,$1
-       addq    $3,$4,$4
-       cmpult  $4,$3,$0
-       stq     $4,0($16)
-       or      $0,$1,$0
-       ret     $31,($26),1
-
-       .end    __mpn_add_n
diff --git a/ghc/rts/gmp/mpn/alpha/addmul_1.s b/ghc/rts/gmp/mpn/alpha/addmul_1.s
deleted file mode 100644 (file)
index 048238a..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
- # Alpha 21064 __mpn_addmul_1 -- Multiply a limb vector with a limb and add
- # the result to a second limb vector.
-
- # Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
-
- # This file is part of the GNU MP Library.
-
- # The GNU MP Library is free software; you can redistribute it and/or modify
- # it under the terms of the GNU Library General Public License as published by
- # the Free Software Foundation; either version 2 of the License, or (at your
- # option) any later version.
-
- # The GNU MP 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 Library General Public
- # License for more details.
-
- # You should have received a copy of the GNU Library General Public License
- # along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
- # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- # MA 02111-1307, USA.
-
-
- # INPUT PARAMETERS
- # res_ptr     r16
- # s1_ptr      r17
- # size                r18
- # s2_limb     r19
-
- # This code runs at 42 cycles/limb on EV4 and 18 cycles/limb on EV5.
-
-       .set    noreorder
-       .set    noat
-.text
-       .align  3
-       .globl  __mpn_addmul_1
-       .ent    __mpn_addmul_1 2
-__mpn_addmul_1:
-       .frame  $30,0,$26
-
-       ldq     $2,0($17)       # $2 = s1_limb
-       addq    $17,8,$17       # s1_ptr++
-       subq    $18,1,$18       # size--
-       mulq    $2,$19,$3       # $3 = prod_low
-       ldq     $5,0($16)       # $5 = *res_ptr
-       umulh   $2,$19,$0       # $0 = prod_high
-       beq     $18,.Lend1      # jump if size was == 1
-       ldq     $2,0($17)       # $2 = s1_limb
-       addq    $17,8,$17       # s1_ptr++
-       subq    $18,1,$18       # size--
-       addq    $5,$3,$3
-       cmpult  $3,$5,$4
-       stq     $3,0($16)
-       addq    $16,8,$16       # res_ptr++
-       beq     $18,.Lend2      # jump if size was == 2
-
-       .align  3
-.Loop: mulq    $2,$19,$3       # $3 = prod_low
-       ldq     $5,0($16)       # $5 = *res_ptr
-       addq    $4,$0,$0        # cy_limb = cy_limb + 'cy'
-       subq    $18,1,$18       # size--
-       umulh   $2,$19,$4       # $4 = cy_limb
-       ldq     $2,0($17)       # $2 = s1_limb
-       addq    $17,8,$17       # s1_ptr++
-       addq    $3,$0,$3        # $3 = cy_limb + prod_low
-       cmpult  $3,$0,$0        # $0 = carry from (cy_limb + prod_low)
-       addq    $5,$3,$3
-       cmpult  $3,$5,$5
-       stq     $3,0($16)
-       addq    $16,8,$16       # res_ptr++
-       addq    $5,$0,$0        # combine carries
-       bne     $18,.Loop
-
-.Lend2:        mulq    $2,$19,$3       # $3 = prod_low
-       ldq     $5,0($16)       # $5 = *res_ptr
-       addq    $4,$0,$0        # cy_limb = cy_limb + 'cy'
-       umulh   $2,$19,$4       # $4 = cy_limb
-       addq    $3,$0,$3        # $3 = cy_limb + prod_low
-       cmpult  $3,$0,$0        # $0 = carry from (cy_limb + prod_low)
-       addq    $5,$3,$3
-       cmpult  $3,$5,$5
-       stq     $3,0($16)
-       addq    $5,$0,$0        # combine carries
-       addq    $4,$0,$0        # cy_limb = prod_high + cy
-       ret     $31,($26),1
-.Lend1:        addq    $5,$3,$3
-       cmpult  $3,$5,$5
-       stq     $3,0($16)
-       addq    $0,$5,$0
-       ret     $31,($26),1
-
-       .end    __mpn_addmul_1
diff --git a/ghc/rts/gmp/mpn/alpha/ev5/add_n.s b/ghc/rts/gmp/mpn/alpha/ev5/add_n.s
deleted file mode 100644 (file)
index 1251a1f..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
- # Alpha __mpn_add_n -- Add two limb vectors of the same length > 0 and
- # store sum in a third limb vector.
-
- # Copyright (C) 1995 Free Software Foundation, Inc.
-
- # This file is part of the GNU MP Library.
-
- # The GNU MP Library is free software; you can redistribute it and/or modify
- # it under the terms of the GNU Library General Public License as published by
- # the Free Software Foundation; either version 2 of the License, or (at your
- # option) any later version.
-
- # The GNU MP 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 Library General Public
- # License for more details.
-
- # You should have received a copy of the GNU Library General Public License
- # along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
- # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- # MA 02111-1307, USA.
-
-
- # INPUT PARAMETERS
- # res_ptr     $16
- # s1_ptr      $17
- # s2_ptr      $18
- # size                $19
-
-       .set    noreorder
-       .set    noat
-.text
-       .align  3
-       .globl  __mpn_add_n
-       .ent    __mpn_add_n
-__mpn_add_n:
-       .frame  $30,0,$26,0
-
-       or      $31,$31,$25             # clear cy
-       subq    $19,4,$19               # decr loop cnt
-       blt     $19,.Lend2              # if less than 4 limbs, goto 2nd loop
- # Start software pipeline for 1st loop
-       ldq     $0,0($18)
-       ldq     $1,8($18)
-       ldq     $4,0($17)
-       ldq     $5,8($17)
-       addq    $17,32,$17              # update s1_ptr
-       ldq     $2,16($18)
-       addq    $0,$4,$20               # 1st main add
-       ldq     $3,24($18)
-       subq    $19,4,$19               # decr loop cnt
-       ldq     $6,-16($17)
-       cmpult  $20,$0,$25              # compute cy from last add
-       ldq     $7,-8($17)
-       addq    $1,$25,$28              # cy add
-       addq    $18,32,$18              # update s2_ptr
-       addq    $5,$28,$21              # 2nd main add
-       cmpult  $28,$25,$8              # compute cy from last add
-       blt     $19,.Lend1              # if less than 4 limbs remain, jump
- # 1st loop handles groups of 4 limbs in a software pipeline
-       .align  4
-.Loop: cmpult  $21,$28,$25             # compute cy from last add
-       ldq     $0,0($18)
-       or      $8,$25,$25              # combine cy from the two adds
-       ldq     $1,8($18)
-       addq    $2,$25,$28              # cy add
-       ldq     $4,0($17)
-       addq    $28,$6,$22              # 3rd main add
-       ldq     $5,8($17)
-       cmpult  $28,$25,$8              # compute cy from last add
-       cmpult  $22,$28,$25             # compute cy from last add
-       stq     $20,0($16)
-       or      $8,$25,$25              # combine cy from the two adds
-       stq     $21,8($16)
-       addq    $3,$25,$28              # cy add
-       addq    $28,$7,$23              # 4th main add
-       cmpult  $28,$25,$8              # compute cy from last add
-       cmpult  $23,$28,$25             # compute cy from last add
-       addq    $17,32,$17              # update s1_ptr
-       or      $8,$25,$25              # combine cy from the two adds
-       addq    $16,32,$16              # update res_ptr
-       addq    $0,$25,$28              # cy add
-       ldq     $2,16($18)
-       addq    $4,$28,$20              # 1st main add
-       ldq     $3,24($18)
-       cmpult  $28,$25,$8              # compute cy from last add
-       ldq     $6,-16($17)
-       cmpult  $20,$28,$25             # compute cy from last add
-       ldq     $7,-8($17)
-       or      $8,$25,$25              # combine cy from the two adds
-       subq    $19,4,$19               # decr loop cnt
-       stq     $22,-16($16)
-       addq    $1,$25,$28              # cy add
-       stq     $23,-8($16)
-       addq    $5,$28,$21              # 2nd main add
-       addq    $18,32,$18              # update s2_ptr
-       cmpult  $28,$25,$8              # compute cy from last add
-       bge     $19,.Loop
- # Finish software pipeline for 1st loop
-.Lend1:        cmpult  $21,$28,$25             # compute cy from last add
-       or      $8,$25,$25              # combine cy from the two adds
-       addq    $2,$25,$28              # cy add
-       addq    $28,$6,$22              # 3rd main add
-       cmpult  $28,$25,$8              # compute cy from last add
-       cmpult  $22,$28,$25             # compute cy from last add
-       stq     $20,0($16)
-       or      $8,$25,$25              # combine cy from the two adds
-       stq     $21,8($16)
-       addq    $3,$25,$28              # cy add
-       addq    $28,$7,$23              # 4th main add
-       cmpult  $28,$25,$8              # compute cy from last add
-       cmpult  $23,$28,$25             # compute cy from last add
-       or      $8,$25,$25              # combine cy from the two adds
-       addq    $16,32,$16              # update res_ptr
-       stq     $22,-16($16)
-       stq     $23,-8($16)
-.Lend2:        addq    $19,4,$19               # restore loop cnt
-       beq     $19,.Lret
- # Start software pipeline for 2nd loop
-       ldq     $0,0($18)
-       ldq     $4,0($17)
-       subq    $19,1,$19
-       beq     $19,.Lend0
- # 2nd loop handles remaining 1-3 limbs
-       .align  4
-.Loop0:        addq    $0,$25,$28              # cy add
-       ldq     $0,8($18)
-       addq    $4,$28,$20              # main add
-       ldq     $4,8($17)
-       addq    $18,8,$18
-       cmpult  $28,$25,$8              # compute cy from last add
-       addq    $17,8,$17
-       stq     $20,0($16)
-       cmpult  $20,$28,$25             # compute cy from last add
-       subq    $19,1,$19               # decr loop cnt
-       or      $8,$25,$25              # combine cy from the two adds
-       addq    $16,8,$16
-       bne     $19,.Loop0
-.Lend0:        addq    $0,$25,$28              # cy add
-       addq    $4,$28,$20              # main add
-       cmpult  $28,$25,$8              # compute cy from last add
-       cmpult  $20,$28,$25             # compute cy from last add
-       stq     $20,0($16)
-       or      $8,$25,$25              # combine cy from the two adds
-
-.Lret: or      $25,$31,$0              # return cy
-       ret     $31,($26),1
-       .end    __mpn_add_n
diff --git a/ghc/rts/gmp/mpn/alpha/ev5/lshift.s b/ghc/rts/gmp/mpn/alpha/ev5/lshift.s
deleted file mode 100644 (file)
index ced55b7..0000000
+++ /dev/null
@@ -1,174 +0,0 @@
- # Alpha EV5 __mpn_lshift --
-
- # Copyright (C) 1994, 1995 Free Software Foundation, Inc.
-
- # This file is part of the GNU MP Library.
-
- # The GNU MP Library is free software; you can redistribute it and/or modify
- # it under the terms of the GNU Library General Public License as published by
- # the Free Software Foundation; either version 2 of the License, or (at your
- # option) any later version.
-
- # The GNU MP 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 Library General Public
- # License for more details.
-
- # You should have received a copy of the GNU Library General Public License
- # along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
- # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- # MA 02111-1307, USA.
-
-
- # INPUT PARAMETERS
- # res_ptr     r16
- # s1_ptr      r17
- # size                r18
- # cnt         r19
-
- # This code runs at 3.25 cycles/limb on the EV5.
-
-       .set    noreorder
-       .set    noat
-.text
-       .align  3
-       .globl  __mpn_lshift
-       .ent    __mpn_lshift
-__mpn_lshift:
-       .frame  $30,0,$26,0
-
-       s8addq  $18,$17,$17     # make r17 point at end of s1
-       ldq     $4,-8($17)      # load first limb
-       subq    $31,$19,$20
-       s8addq  $18,$16,$16     # make r16 point at end of RES
-       subq    $18,1,$18
-       and     $18,4-1,$28     # number of limbs in first loop
-       srl     $4,$20,$0       # compute function result
-
-       beq     $28,.L0
-       subq    $18,$28,$18
-
-       .align  3
-.Loop0:        ldq     $3,-16($17)
-       subq    $16,8,$16
-       sll     $4,$19,$5
-       subq    $17,8,$17
-       subq    $28,1,$28
-       srl     $3,$20,$6
-       or      $3,$3,$4
-       or      $5,$6,$8
-       stq     $8,0($16)
-       bne     $28,.Loop0
-
-.L0:   sll     $4,$19,$24
-       beq     $18,.Lend
- # warm up phase 1
-       ldq     $1,-16($17)
-       subq    $18,4,$18
-       ldq     $2,-24($17)
-       ldq     $3,-32($17)
-       ldq     $4,-40($17)
-       beq     $18,.Lend1
- # warm up phase 2
-       srl     $1,$20,$7
-       sll     $1,$19,$21
-       srl     $2,$20,$8
-       ldq     $1,-48($17)
-       sll     $2,$19,$22
-       ldq     $2,-56($17)
-       srl     $3,$20,$5
-       or      $7,$24,$7
-       sll     $3,$19,$23
-       or      $8,$21,$8
-       srl     $4,$20,$6
-       ldq     $3,-64($17)
-       sll     $4,$19,$24
-       ldq     $4,-72($17)
-       subq    $18,4,$18
-       beq     $18,.Lend2
-       .align  4
- # main loop
-.Loop: stq     $7,-8($16)
-       or      $5,$22,$5
-       stq     $8,-16($16)
-       or      $6,$23,$6
-
-       srl     $1,$20,$7
-       subq    $18,4,$18
-       sll     $1,$19,$21
-       unop    # ldq   $31,-96($17)
-
-       srl     $2,$20,$8
-       ldq     $1,-80($17)
-       sll     $2,$19,$22
-       ldq     $2,-88($17)
-
-       stq     $5,-24($16)
-       or      $7,$24,$7
-       stq     $6,-32($16)
-       or      $8,$21,$8
-
-       srl     $3,$20,$5
-       unop    # ldq   $31,-96($17)
-       sll     $3,$19,$23
-       subq    $16,32,$16
-
-       srl     $4,$20,$6
-       ldq     $3,-96($17)
-       sll     $4,$19,$24
-       ldq     $4,-104($17)
-
-       subq    $17,32,$17
-       bne     $18,.Loop
- # cool down phase 2/1
-.Lend2:        stq     $7,-8($16)
-       or      $5,$22,$5
-       stq     $8,-16($16)
-       or      $6,$23,$6
-       srl     $1,$20,$7
-       sll     $1,$19,$21
-       srl     $2,$20,$8
-       sll     $2,$19,$22
-       stq     $5,-24($16)
-       or      $7,$24,$7
-       stq     $6,-32($16)
-       or      $8,$21,$8
-       srl     $3,$20,$5
-       sll     $3,$19,$23
-       srl     $4,$20,$6
-       sll     $4,$19,$24
- # cool down phase 2/2
-       stq     $7,-40($16)
-       or      $5,$22,$5
-       stq     $8,-48($16)
-       or      $6,$23,$6
-       stq     $5,-56($16)
-       stq     $6,-64($16)
- # cool down phase 2/3
-       stq     $24,-72($16)
-       ret     $31,($26),1
-
- # cool down phase 1/1
-.Lend1:        srl     $1,$20,$7
-       sll     $1,$19,$21
-       srl     $2,$20,$8
-       sll     $2,$19,$22
-       srl     $3,$20,$5
-       or      $7,$24,$7
-       sll     $3,$19,$23
-       or      $8,$21,$8
-       srl     $4,$20,$6
-       sll     $4,$19,$24
- # cool down phase 1/2
-       stq     $7,-8($16)
-       or      $5,$22,$5
-       stq     $8,-16($16)
-       or      $6,$23,$6
-       stq     $5,-24($16)
-       stq     $6,-32($16)
-       stq     $24,-40($16)
-       ret     $31,($26),1
-
-.Lend: stq     $24,-8($16)
-       ret     $31,($26),1
-       .end    __mpn_lshift
diff --git a/ghc/rts/gmp/mpn/alpha/ev5/rshift.s b/ghc/rts/gmp/mpn/alpha/ev5/rshift.s
deleted file mode 100644 (file)
index 6e24fef..0000000
+++ /dev/null
@@ -1,172 +0,0 @@
- # Alpha EV5 __mpn_rshift --
-
- # Copyright (C) 1994, 1995 Free Software Foundation, Inc.
-
- # This file is part of the GNU MP Library.
-
- # The GNU MP Library is free software; you can redistribute it and/or modify
- # it under the terms of the GNU Library General Public License as published by
- # the Free Software Foundation; either version 2 of the License, or (at your
- # option) any later version.
-
- # The GNU MP 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 Library General Public
- # License for more details.
-
- # You should have received a copy of the GNU Library General Public License
- # along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
- # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- # MA 02111-1307, USA.
-
-
- # INPUT PARAMETERS
- # res_ptr     r16
- # s1_ptr      r17
- # size                r18
- # cnt         r19
-
- # This code runs at 3.25 cycles/limb on the EV5.
-
-       .set    noreorder
-       .set    noat
-.text
-       .align  3
-       .globl  __mpn_rshift
-       .ent    __mpn_rshift
-__mpn_rshift:
-       .frame  $30,0,$26,0
-
-       ldq     $4,0($17)       # load first limb
-       subq    $31,$19,$20
-       subq    $18,1,$18
-       and     $18,4-1,$28     # number of limbs in first loop
-       sll     $4,$20,$0       # compute function result
-
-       beq     $28,.L0
-       subq    $18,$28,$18
-
-       .align  3
-.Loop0:        ldq     $3,8($17)
-       addq    $16,8,$16
-       srl     $4,$19,$5
-       addq    $17,8,$17
-       subq    $28,1,$28
-       sll     $3,$20,$6
-       or      $3,$3,$4
-       or      $5,$6,$8
-       stq     $8,-8($16)
-       bne     $28,.Loop0
-
-.L0:   srl     $4,$19,$24
-       beq     $18,.Lend
- # warm up phase 1
-       ldq     $1,8($17)
-       subq    $18,4,$18
-       ldq     $2,16($17)
-       ldq     $3,24($17)
-       ldq     $4,32($17)
-       beq     $18,.Lend1
- # warm up phase 2
-       sll     $1,$20,$7
-       srl     $1,$19,$21
-       sll     $2,$20,$8
-       ldq     $1,40($17)
-       srl     $2,$19,$22
-       ldq     $2,48($17)
-       sll     $3,$20,$5
-       or      $7,$24,$7
-       srl     $3,$19,$23
-       or      $8,$21,$8
-       sll     $4,$20,$6
-       ldq     $3,56($17)
-       srl     $4,$19,$24
-       ldq     $4,64($17)
-       subq    $18,4,$18
-       beq     $18,.Lend2
-       .align  4
- # main loop
-.Loop: stq     $7,0($16)
-       or      $5,$22,$5
-       stq     $8,8($16)
-       or      $6,$23,$6
-
-       sll     $1,$20,$7
-       subq    $18,4,$18
-       srl     $1,$19,$21
-       unop    # ldq   $31,-96($17)
-
-       sll     $2,$20,$8
-       ldq     $1,72($17)
-       srl     $2,$19,$22
-       ldq     $2,80($17)
-
-       stq     $5,16($16)
-       or      $7,$24,$7
-       stq     $6,24($16)
-       or      $8,$21,$8
-
-       sll     $3,$20,$5
-       unop    # ldq   $31,-96($17)
-       srl     $3,$19,$23
-       addq    $16,32,$16
-
-       sll     $4,$20,$6
-       ldq     $3,88($17)
-       srl     $4,$19,$24
-       ldq     $4,96($17)
-
-       addq    $17,32,$17
-       bne     $18,.Loop
- # cool down phase 2/1
-.Lend2:        stq     $7,0($16)
-       or      $5,$22,$5
-       stq     $8,8($16)
-       or      $6,$23,$6
-       sll     $1,$20,$7
-       srl     $1,$19,$21
-       sll     $2,$20,$8
-       srl     $2,$19,$22
-       stq     $5,16($16)
-       or      $7,$24,$7
-       stq     $6,24($16)
-       or      $8,$21,$8
-       sll     $3,$20,$5
-       srl     $3,$19,$23
-       sll     $4,$20,$6
-       srl     $4,$19,$24
- # cool down phase 2/2
-       stq     $7,32($16)
-       or      $5,$22,$5
-       stq     $8,40($16)
-       or      $6,$23,$6
-       stq     $5,48($16)
-       stq     $6,56($16)
- # cool down phase 2/3
-       stq     $24,64($16)
-       ret     $31,($26),1
-
- # cool down phase 1/1
-.Lend1:        sll     $1,$20,$7
-       srl     $1,$19,$21
-       sll     $2,$20,$8
-       srl     $2,$19,$22
-       sll     $3,$20,$5
-       or      $7,$24,$7
-       srl     $3,$19,$23
-       or      $8,$21,$8
-       sll     $4,$20,$6
-       srl     $4,$19,$24
- # cool down phase 1/2
-       stq     $7,0($16)
-       or      $5,$22,$5
-       stq     $8,8($16)
-       or      $6,$23,$6
-       stq     $5,16($16)
-       stq     $6,24($16)
-       stq     $24,32($16)
-       ret     $31,($26),1
-
-.Lend: stq     $24,0($16)
-       ret     $31,($26),1
-       .end    __mpn_rshift
diff --git a/ghc/rts/gmp/mpn/alpha/ev5/sub_n.s b/ghc/rts/gmp/mpn/alpha/ev5/sub_n.s
deleted file mode 100644 (file)
index 6743af5..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
- # Alpha __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
- # store difference in a third limb vector.
-
- # Copyright (C) 1995 Free Software Foundation, Inc.
-
- # This file is part of the GNU MP Library.
-
- # The GNU MP Library is free software; you can redistribute it and/or modify
- # it under the terms of the GNU Library General Public License as published by
- # the Free Software Foundation; either version 2 of the License, or (at your
- # option) any later version.
-
- # The GNU MP 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 Library General Public
- # License for more details.
-
- # You should have received a copy of the GNU Library General Public License
- # along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
- # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- # MA 02111-1307, USA.
-
-
- # INPUT PARAMETERS
- # res_ptr     $16
- # s1_ptr      $17
- # s2_ptr      $18
- # size                $19
-
-       .set    noreorder
-       .set    noat
-.text
-       .align  3
-       .globl  __mpn_sub_n
-       .ent    __mpn_sub_n
-__mpn_sub_n:
-       .frame  $30,0,$26,0
-
-       or      $31,$31,$25             # clear cy
-       subq    $19,4,$19               # decr loop cnt
-       blt     $19,.Lend2              # if less than 4 limbs, goto 2nd loop
- # Start software pipeline for 1st loop
-       ldq     $0,0($18)
-       ldq     $1,8($18)
-       ldq     $4,0($17)
-       ldq     $5,8($17)
-       addq    $17,32,$17              # update s1_ptr
-       ldq     $2,16($18)
-       subq    $4,$0,$20               # 1st main sub
-       ldq     $3,24($18)
-       subq    $19,4,$19               # decr loop cnt
-       ldq     $6,-16($17)
-       cmpult  $4,$20,$25              # compute cy from last sub
-       ldq     $7,-8($17)
-       addq    $1,$25,$28              # cy add
-       addq    $18,32,$18              # update s2_ptr
-       subq    $5,$28,$21              # 2nd main sub
-       cmpult  $28,$25,$8              # compute cy from last add
-       blt     $19,.Lend1              # if less than 4 limbs remain, jump
- # 1st loop handles groups of 4 limbs in a software pipeline
-       .align  4
-.Loop: cmpult  $5,$21,$25              # compute cy from last add
-       ldq     $0,0($18)
-       or      $8,$25,$25              # combine cy from the two adds
-       ldq     $1,8($18)
-       addq    $2,$25,$28              # cy add
-       ldq     $4,0($17)
-       subq    $6,$28,$22              # 3rd main sub
-       ldq     $5,8($17)
-       cmpult  $28,$25,$8              # compute cy from last add
-       cmpult  $6,$22,$25              # compute cy from last add
-       stq     $20,0($16)
-       or      $8,$25,$25              # combine cy from the two adds
-       stq     $21,8($16)
-       addq    $3,$25,$28              # cy add
-       subq    $7,$28,$23              # 4th main sub
-       cmpult  $28,$25,$8              # compute cy from last add
-       cmpult  $7,$23,$25              # compute cy from last add
-       addq    $17,32,$17              # update s1_ptr
-       or      $8,$25,$25              # combine cy from the two adds
-       addq    $16,32,$16              # update res_ptr
-       addq    $0,$25,$28              # cy add
-       ldq     $2,16($18)
-       subq    $4,$28,$20              # 1st main sub
-       ldq     $3,24($18)
-       cmpult  $28,$25,$8              # compute cy from last add
-       ldq     $6,-16($17)
-       cmpult  $4,$20,$25              # compute cy from last add
-       ldq     $7,-8($17)
-       or      $8,$25,$25              # combine cy from the two adds
-       subq    $19,4,$19               # decr loop cnt
-       stq     $22,-16($16)
-       addq    $1,$25,$28              # cy add
-       stq     $23,-8($16)
-       subq    $5,$28,$21              # 2nd main sub
-       addq    $18,32,$18              # update s2_ptr
-       cmpult  $28,$25,$8              # compute cy from last add
-       bge     $19,.Loop
- # Finish software pipeline for 1st loop
-.Lend1:        cmpult  $5,$21,$25              # compute cy from last add
-       or      $8,$25,$25              # combine cy from the two adds
-       addq    $2,$25,$28              # cy add
-       subq    $6,$28,$22              # 3rd main sub
-       cmpult  $28,$25,$8              # compute cy from last add
-       cmpult  $6,$22,$25              # compute cy from last add
-       stq     $20,0($16)
-       or      $8,$25,$25              # combine cy from the two adds
-       stq     $21,8($16)
-       addq    $3,$25,$28              # cy add
-       subq    $7,$28,$23              # 4th main sub
-       cmpult  $28,$25,$8              # compute cy from last add
-       cmpult  $7,$23,$25              # compute cy from last add
-       or      $8,$25,$25              # combine cy from the two adds
-       addq    $16,32,$16              # update res_ptr
-       stq     $22,-16($16)
-       stq     $23,-8($16)
-.Lend2:        addq    $19,4,$19               # restore loop cnt
-       beq     $19,.Lret
- # Start software pipeline for 2nd loop
-       ldq     $0,0($18)
-       ldq     $4,0($17)
-       subq    $19,1,$19
-       beq     $19,.Lend0
- # 2nd loop handles remaining 1-3 limbs
-       .align  4
-.Loop0:        addq    $0,$25,$28              # cy add
-       ldq     $0,8($18)
-       subq    $4,$28,$20              # main sub
-       ldq     $1,8($17)
-       addq    $18,8,$18
-       cmpult  $28,$25,$8              # compute cy from last add
-       addq    $17,8,$17
-       stq     $20,0($16)
-       cmpult  $4,$20,$25              # compute cy from last add
-       subq    $19,1,$19               # decr loop cnt
-       or      $8,$25,$25              # combine cy from the two adds
-       addq    $16,8,$16
-       or      $1,$31,$4
-       bne     $19,.Loop0
-.Lend0:        addq    $0,$25,$28              # cy add
-       subq    $4,$28,$20              # main sub
-       cmpult  $28,$25,$8              # compute cy from last add
-       cmpult  $4,$20,$25              # compute cy from last add
-       stq     $20,0($16)
-       or      $8,$25,$25              # combine cy from the two adds
-
-.Lret: or      $25,$31,$0              # return cy
-       ret     $31,($26),1
-       .end    __mpn_sub_n
diff --git a/ghc/rts/gmp/mpn/alpha/lshift.s b/ghc/rts/gmp/mpn/alpha/lshift.s
deleted file mode 100644 (file)
index 13bd24a..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
- # Alpha 21064 __mpn_lshift --
-
- # Copyright (C) 1994, 1995 Free Software Foundation, Inc.
-
- # This file is part of the GNU MP Library.
-
- # The GNU MP Library is free software; you can redistribute it and/or modify
- # it under the terms of the GNU Library General Public License as published by
- # the Free Software Foundation; either version 2 of the License, or (at your
- # option) any later version.
-
- # The GNU MP 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 Library General Public
- # License for more details.
-
- # You should have received a copy of the GNU Library General Public License
- # along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
- # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- # MA 02111-1307, USA.
-
-
- # INPUT PARAMETERS
- # res_ptr     r16
- # s1_ptr      r17
- # size                r18
- # cnt         r19
-
- # This code runs at 4.8 cycles/limb on the 21064.  With infinite unrolling,
- # it would take 4 cycles/limb.  It should be possible to get down to 3
- # cycles/limb since both ldq and stq can be paired with the other used
- # instructions.  But there are many restrictions in the 21064 pipeline that
- # makes it hard, if not impossible, to get down to 3 cycles/limb:
-
- # 1. ldq has a 3 cycle delay, srl and sll have a 2 cycle delay.
- # 2. Only aligned instruction pairs can be paired.
- # 3. The store buffer or silo might not be able to deal with the bandwidth.
-
-       .set    noreorder
-       .set    noat
-.text
-       .align  3
-       .globl  __mpn_lshift
-       .ent    __mpn_lshift
-__mpn_lshift:
-       .frame  $30,0,$26,0
-
-       s8addq  $18,$17,$17     # make r17 point at end of s1
-       ldq     $4,-8($17)      # load first limb
-       subq    $17,8,$17
-       subq    $31,$19,$7
-       s8addq  $18,$16,$16     # make r16 point at end of RES
-       subq    $18,1,$18
-       and     $18,4-1,$20     # number of limbs in first loop
-       srl     $4,$7,$0        # compute function result
-
-       beq     $20,.L0
-       subq    $18,$20,$18
-
-       .align  3
-.Loop0:
-       ldq     $3,-8($17)
-       subq    $16,8,$16
-       subq    $17,8,$17
-       subq    $20,1,$20
-       sll     $4,$19,$5
-       srl     $3,$7,$6
-       bis     $3,$3,$4
-       bis     $5,$6,$8
-       stq     $8,0($16)
-       bne     $20,.Loop0
-
-.L0:   beq     $18,.Lend
-
-       .align  3
-.Loop: ldq     $3,-8($17)
-       subq    $16,32,$16
-       subq    $18,4,$18
-       sll     $4,$19,$5
-       srl     $3,$7,$6
-
-       ldq     $4,-16($17)
-       sll     $3,$19,$1
-       bis     $5,$6,$8
-       stq     $8,24($16)
-       srl     $4,$7,$2
-
-       ldq     $3,-24($17)
-       sll     $4,$19,$5
-       bis     $1,$2,$8
-       stq     $8,16($16)
-       srl     $3,$7,$6
-
-       ldq     $4,-32($17)
-       sll     $3,$19,$1
-       bis     $5,$6,$8
-       stq     $8,8($16)
-       srl     $4,$7,$2
-
-       subq    $17,32,$17
-       bis     $1,$2,$8
-       stq     $8,0($16)
-
-       bgt     $18,.Loop
-
-.Lend: sll     $4,$19,$8
-       stq     $8,-8($16)
-       ret     $31,($26),1
-       .end    __mpn_lshift
diff --git a/ghc/rts/gmp/mpn/alpha/mul_1.s b/ghc/rts/gmp/mpn/alpha/mul_1.s
deleted file mode 100644 (file)
index a1f5a94..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
- # Alpha 21064 __mpn_mul_1 -- Multiply a limb vector with a limb and store
- # the result in a second limb vector.
-
- # Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
-
- # This file is part of the GNU MP Library.
-
- # The GNU MP Library is free software; you can redistribute it and/or modify
- # it under the terms of the GNU Library General Public License as published by
- # the Free Software Foundation; either version 2 of the License, or (at your
- # option) any later version.
-
- # The GNU MP 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 Library General Public
- # License for more details.
-
- # You should have received a copy of the GNU Library General Public License
- # along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
- # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- # MA 02111-1307, USA.
-
-
- # INPUT PARAMETERS
- # res_ptr     r16
- # s1_ptr      r17
- # size                r18
- # s2_limb     r19
-
- # This code runs at 42 cycles/limb on the EV4 and 18 cycles/limb on the EV5.
-
- # To improve performance for long multiplications, we would use
- # 'fetch' for S1 and 'fetch_m' for RES.  It's not obvious how to use
- # these instructions without slowing down the general code: 1. We can
- # only have two prefetches in operation at any time in the Alpha
- # architecture.  2. There will seldom be any special alignment
- # between RES_PTR and S1_PTR.  Maybe we can simply divide the current
- # loop into an inner and outer loop, having the inner loop handle
- # exactly one prefetch block?
-
-       .set    noreorder
-       .set    noat
-.text
-       .align  3
-       .globl  __mpn_mul_1
-       .ent    __mpn_mul_1 2
-__mpn_mul_1:
-       .frame  $30,0,$26
-
-       ldq     $2,0($17)       # $2 = s1_limb
-       subq    $18,1,$18       # size--
-       mulq    $2,$19,$3       # $3 = prod_low
-       bic     $31,$31,$4      # clear cy_limb
-       umulh   $2,$19,$0       # $0 = prod_high
-       beq     $18,Lend1       # jump if size was == 1
-       ldq     $2,8($17)       # $2 = s1_limb
-       subq    $18,1,$18       # size--
-       stq     $3,0($16)
-       beq     $18,Lend2       # jump if size was == 2
-
-       .align  3
-Loop:  mulq    $2,$19,$3       # $3 = prod_low
-       addq    $4,$0,$0        # cy_limb = cy_limb + 'cy'
-       subq    $18,1,$18       # size--
-       umulh   $2,$19,$4       # $4 = cy_limb
-       ldq     $2,16($17)      # $2 = s1_limb
-       addq    $17,8,$17       # s1_ptr++
-       addq    $3,$0,$3        # $3 = cy_limb + prod_low
-       stq     $3,8($16)
-       cmpult  $3,$0,$0        # $0 = carry from (cy_limb + prod_low)
-       addq    $16,8,$16       # res_ptr++
-       bne     $18,Loop
-
-Lend2: mulq    $2,$19,$3       # $3 = prod_low
-       addq    $4,$0,$0        # cy_limb = cy_limb + 'cy'
-       umulh   $2,$19,$4       # $4 = cy_limb
-       addq    $3,$0,$3        # $3 = cy_limb + prod_low
-       cmpult  $3,$0,$0        # $0 = carry from (cy_limb + prod_low)
-       stq     $3,8($16)
-       addq    $4,$0,$0        # cy_limb = prod_high + cy
-       ret     $31,($26),1
-Lend1: stq     $3,0($16)
-       ret     $31,($26),1
-
-       .end    __mpn_mul_1
diff --git a/ghc/rts/gmp/mpn/alpha/rshift.s b/ghc/rts/gmp/mpn/alpha/rshift.s
deleted file mode 100644 (file)
index 389054a..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
- # Alpha 21064 __mpn_rshift --
-
- # Copyright (C) 1994, 1995 Free Software Foundation, Inc.
-
- # This file is part of the GNU MP Library.
-
- # The GNU MP Library is free software; you can redistribute it and/or modify
- # it under the terms of the GNU Library General Public License as published by
- # the Free Software Foundation; either version 2 of the License, or (at your
- # option) any later version.
-
- # The GNU MP 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 Library General Public
- # License for more details.
-
- # You should have received a copy of the GNU Library General Public License
- # along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
- # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- # MA 02111-1307, USA.
-
-
- # INPUT PARAMETERS
- # res_ptr     r16
- # s1_ptr      r17
- # size                r18
- # cnt         r19
-
- # This code runs at 4.8 cycles/limb on the 21064.  With infinite unrolling,
- # it would take 4 cycles/limb.  It should be possible to get down to 3
- # cycles/limb since both ldq and stq can be paired with the other used
- # instructions.  But there are many restrictions in the 21064 pipeline that
- # makes it hard, if not impossible, to get down to 3 cycles/limb:
-
- # 1. ldq has a 3 cycle delay, srl and sll have a 2 cycle delay.
- # 2. Only aligned instruction pairs can be paired.
- # 3. The store buffer or silo might not be able to deal with the bandwidth.
-
-       .set    noreorder
-       .set    noat
-.text
-       .align  3
-       .globl  __mpn_rshift
-       .ent    __mpn_rshift
-__mpn_rshift:
-       .frame  $30,0,$26,0
-
-       ldq     $4,0($17)       # load first limb
-       addq    $17,8,$17
-       subq    $31,$19,$7
-       subq    $18,1,$18
-       and     $18,4-1,$20     # number of limbs in first loop
-       sll     $4,$7,$0        # compute function result
-
-       beq     $20,.L0
-       subq    $18,$20,$18
-
-       .align  3
-.Loop0:
-       ldq     $3,0($17)
-       addq    $16,8,$16
-       addq    $17,8,$17
-       subq    $20,1,$20
-       srl     $4,$19,$5
-       sll     $3,$7,$6
-       bis     $3,$3,$4
-       bis     $5,$6,$8
-       stq     $8,-8($16)
-       bne     $20,.Loop0
-
-.L0:   beq     $18,.Lend
-
-       .align  3
-.Loop: ldq     $3,0($17)
-       addq    $16,32,$16
-       subq    $18,4,$18
-       srl     $4,$19,$5
-       sll     $3,$7,$6
-
-       ldq     $4,8($17)
-       srl     $3,$19,$1
-       bis     $5,$6,$8
-       stq     $8,-32($16)
-       sll     $4,$7,$2
-
-       ldq     $3,16($17)
-       srl     $4,$19,$5
-       bis     $1,$2,$8
-       stq     $8,-24($16)
-       sll     $3,$7,$6
-
-       ldq     $4,24($17)
-       srl     $3,$19,$1
-       bis     $5,$6,$8
-       stq     $8,-16($16)
-       sll     $4,$7,$2
-
-       addq    $17,32,$17
-       bis     $1,$2,$8
-       stq     $8,-8($16)
-
-       bgt     $18,.Loop
-
-.Lend: srl     $4,$19,$8
-       stq     $8,0($16)
-       ret     $31,($26),1
-       .end    __mpn_rshift
diff --git a/ghc/rts/gmp/mpn/alpha/sub_n.s b/ghc/rts/gmp/mpn/alpha/sub_n.s
deleted file mode 100644 (file)
index 3c90c11..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
- # Alpha __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
- # store difference in a third limb vector.
-
- # Copyright (C) 1995 Free Software Foundation, Inc.
-
- # This file is part of the GNU MP Library.
-
- # The GNU MP Library is free software; you can redistribute it and/or modify
- # it under the terms of the GNU Library General Public License as published by
- # the Free Software Foundation; either version 2 of the License, or (at your
- # option) any later version.
-
- # The GNU MP 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 Library General Public
- # License for more details.
-
- # You should have received a copy of the GNU Library General Public License
- # along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
- # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- # MA 02111-1307, USA.
-
-
- # INPUT PARAMETERS
- # res_ptr     $16
- # s1_ptr      $17
- # s2_ptr      $18
- # size                $19
-
-       .set    noreorder
-       .set    noat
-.text
-       .align  3
-       .globl  __mpn_sub_n
-       .ent    __mpn_sub_n
-__mpn_sub_n:
-       .frame  $30,0,$26,0
-
-       ldq     $3,0($17)
-       ldq     $4,0($18)
-
-       subq    $19,1,$19
-       and     $19,4-1,$2      # number of limbs in first loop
-       bis     $31,$31,$0
-       beq     $2,.L0          # if multiple of 4 limbs, skip first loop
-
-       subq    $19,$2,$19
-
-.Loop0:        subq    $2,1,$2
-       ldq     $5,8($17)
-       addq    $4,$0,$4
-       ldq     $6,8($18)
-       cmpult  $4,$0,$1
-       subq    $3,$4,$4
-       cmpult  $3,$4,$0
-       stq     $4,0($16)
-       or      $0,$1,$0
-
-       addq    $17,8,$17
-       addq    $18,8,$18
-       bis     $5,$5,$3
-       bis     $6,$6,$4
-       addq    $16,8,$16
-       bne     $2,.Loop0
-
-.L0:   beq     $19,.Lend
-
-       .align  3
-.Loop: subq    $19,4,$19
-
-       ldq     $5,8($17)
-       addq    $4,$0,$4
-       ldq     $6,8($18)
-       cmpult  $4,$0,$1
-       subq    $3,$4,$4
-       cmpult  $3,$4,$0
-       stq     $4,0($16)
-       or      $0,$1,$0
-
-       ldq     $3,16($17)
-       addq    $6,$0,$6
-       ldq     $4,16($18)
-       cmpult  $6,$0,$1
-       subq    $5,$6,$6
-       cmpult  $5,$6,$0
-       stq     $6,8($16)
-       or      $0,$1,$0
-
-       ldq     $5,24($17)
-       addq    $4,$0,$4
-       ldq     $6,24($18)
-       cmpult  $4,$0,$1
-       subq    $3,$4,$4
-       cmpult  $3,$4,$0
-       stq     $4,16($16)
-       or      $0,$1,$0
-
-       ldq     $3,32($17)
-       addq    $6,$0,$6
-       ldq     $4,32($18)
-       cmpult  $6,$0,$1
-       subq    $5,$6,$6
-       cmpult  $5,$6,$0
-       stq     $6,24($16)
-       or      $0,$1,$0
-
-       addq    $17,32,$17
-       addq    $18,32,$18
-       addq    $16,32,$16
-       bne     $19,.Loop
-
-.Lend: addq    $4,$0,$4
-       cmpult  $4,$0,$1
-       subq    $3,$4,$4
-       cmpult  $3,$4,$0
-       stq     $4,0($16)
-       or      $0,$1,$0
-       ret     $31,($26),1
-
-       .end    __mpn_sub_n
diff --git a/ghc/rts/gmp/mpn/alpha/submul_1.s b/ghc/rts/gmp/mpn/alpha/submul_1.s
deleted file mode 100644 (file)
index 1ed0c6a..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
- # Alpha 21064 __mpn_submul_1 -- Multiply a limb vector with a limb and
- # subtract the result from a second limb vector.
-
- # Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
-
- # This file is part of the GNU MP Library.
-
- # The GNU MP Library is free software; you can redistribute it and/or modify
- # it under the terms of the GNU Library General Public License as published by
- # the Free Software Foundation; either version 2 of the License, or (at your
- # option) any later version.
-
- # The GNU MP 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 Library General Public
- # License for more details.
-
- # You should have received a copy of the GNU Library General Public License
- # along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
- # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- # MA 02111-1307, USA.
-
-
- # INPUT PARAMETERS
- # res_ptr     r16
- # s1_ptr      r17
- # size                r18
- # s2_limb     r19
-
- # This code runs at 42 cycles/limb on EV4 and 18 cycles/limb on EV5.
-
-       .set    noreorder
-       .set    noat
-.text
-       .align  3
-       .globl  __mpn_submul_1
-       .ent    __mpn_submul_1 2
-__mpn_submul_1:
-       .frame  $30,0,$26
-
-       ldq     $2,0($17)       # $2 = s1_limb
-       addq    $17,8,$17       # s1_ptr++
-       subq    $18,1,$18       # size--
-       mulq    $2,$19,$3       # $3 = prod_low
-       ldq     $5,0($16)       # $5 = *res_ptr
-       umulh   $2,$19,$0       # $0 = prod_high
-       beq     $18,.Lend1      # jump if size was == 1
-       ldq     $2,0($17)       # $2 = s1_limb
-       addq    $17,8,$17       # s1_ptr++
-       subq    $18,1,$18       # size--
-       subq    $5,$3,$3
-       cmpult  $5,$3,$4
-       stq     $3,0($16)
-       addq    $16,8,$16       # res_ptr++
-       beq     $18,.Lend2      # jump if size was == 2
-
-       .align  3
-.Loop: mulq    $2,$19,$3       # $3 = prod_low
-       ldq     $5,0($16)       # $5 = *res_ptr
-       addq    $4,$0,$0        # cy_limb = cy_limb + 'cy'
-       subq    $18,1,$18       # size--
-       umulh   $2,$19,$4       # $4 = cy_limb
-       ldq     $2,0($17)       # $2 = s1_limb
-       addq    $17,8,$17       # s1_ptr++
-       addq    $3,$0,$3        # $3 = cy_limb + prod_low
-       cmpult  $3,$0,$0        # $0 = carry from (cy_limb + prod_low)
-       subq    $5,$3,$3
-       cmpult  $5,$3,$5
-       stq     $3,0($16)
-       addq    $16,8,$16       # res_ptr++
-       addq    $5,$0,$0        # combine carries
-       bne     $18,.Loop
-
-.Lend2:        mulq    $2,$19,$3       # $3 = prod_low
-       ldq     $5,0($16)       # $5 = *res_ptr
-       addq    $4,$0,$0        # cy_limb = cy_limb + 'cy'
-       umulh   $2,$19,$4       # $4 = cy_limb
-       addq    $3,$0,$3        # $3 = cy_limb + prod_low
-       cmpult  $3,$0,$0        # $0 = carry from (cy_limb + prod_low)
-       subq    $5,$3,$3
-       cmpult  $5,$3,$5
-       stq     $3,0($16)
-       addq    $5,$0,$0        # combine carries
-       addq    $4,$0,$0        # cy_limb = prod_high + cy
-       ret     $31,($26),1
-.Lend1:        subq    $5,$3,$3
-       cmpult  $5,$3,$5
-       stq     $3,0($16)
-       addq    $0,$5,$0
-       ret     $31,($26),1
-
-       .end    __mpn_submul_1
diff --git a/ghc/rts/gmp/mpn/bsd.h b/ghc/rts/gmp/mpn/bsd.h
deleted file mode 100644 (file)
index 8a0cbce..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#if __STDC__
-#define C_SYMBOL_NAME(name) _##name
-#else
-#define C_SYMBOL_NAME(name) _/**/name
-#endif
diff --git a/ghc/rts/gmp/mpn/config/t-oldgas b/ghc/rts/gmp/mpn/config/t-oldgas
deleted file mode 100644 (file)
index ba02fa7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-SFLAGS=-DBROKEN_ALIGN
diff --git a/ghc/rts/gmp/mpn/config/t-ppc-aix b/ghc/rts/gmp/mpn/config/t-ppc-aix
deleted file mode 100644 (file)
index a31ce0d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-SFLAGS=-Wa,-mppc
diff --git a/ghc/rts/gmp/mpn/config/t-pwr-aix b/ghc/rts/gmp/mpn/config/t-pwr-aix
deleted file mode 100644 (file)
index 3e11d9f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-SFLAGS=-Wa,-mpwr
diff --git a/ghc/rts/gmp/mpn/configure.in b/ghc/rts/gmp/mpn/configure.in
deleted file mode 100644 (file)
index 1002904..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-# This file is a shell script fragment that supplies the information
-# necessary for a configure script to process the program in
-# this directory.  For more information, look at ../configure.
-AC_INIT(Makefile.in)
-
-srctrigger=powerpc32
-srcname="GNU Multi-Precision library/mpn"
-
-# per-host:
-
-# per-target:
-
-case "${target}" in
-  sparc9*-*-* | sparc64*-*-* | ultrasparc*-*-*)
-       #path="sparc64" ;;      Don't use this until compilers are ready
-       path="sparc32/v8 sparc" ;;
-  sparc8*-*-* | microsparc*-*-*)
-       path="sparc32/v8 sparc" ;;
-  supersparc*-*-*)
-       path="sparc32/v8/supersparc sparc32/v8 sparc"
-       extra_functions="udiv" ;;
-  sparc*-*-*) path="sparc32"
-       if [ x$floating_point = xno ]
-         then extra_functions="udiv_nfp"
-         else extra_functions="udiv_fp"
-       fi
-       ;;
-  hppa7000*-*-*) path="hppa/hppa1_1 hppa"; extra_functions="udiv_qrnnd" ;;
-  hppa1.0*-*-*) path="hppa"; extra_functions="udiv_qrnnd" ;;
-  hppa*-*-*)                                   # assume pa7100
-    path="hppa/hppa1_1/pa7100 hppa/hppa1_1 hppa"
-    extra_functions="udiv_qrnnd" ;;
-  cray2-cray-unicos* | [xy]mp-cray-unicos* | [ctj]90-cray-unicos*)
-    path="cray" ;;
-  alphaev5-*-*) path="alpha/ev5 alpha"; extra_functions="udiv_qrnnd" ;;
-  alpha*-*-*) path="alpha"; extra_functions="udiv_qrnnd" ;;
-  am29000*-*-*) path="am29000" ;;
-  a29k*-*-*) path="am29000" ;;
-
-# Intel x86 configurations
-  i[34]86*-*-linuxaout* | i[34]86*-*-linuxoldld* | \
-  i[34]86*-*-*bsd*)                    # x86 running BSD or Linux with a.out
-       echo '#define BSD_SYNTAX' >asm-syntax.h
-       echo '#include "'$srcdir'/x86/syntax.h"' >>asm-syntax.h
-       path="x86" ;;
-  i[56]86*-*-linuxaout* | pentium-*-linuxaout* | pentiumpro-*-linuxaout* | \
-  i[56]86*-*-linuxoldld* | pentium-*-linuxoldld* | pentiumpro-*-linuxoldld* | \
-  i[56]86*-*-*bsd* | pentium-*-*bsd* | pentiumpro-*-*bsd*)
-       echo '#define BSD_SYNTAX' >asm-syntax.h
-       echo '#include "'$srcdir'/x86/syntax.h"' >>asm-syntax.h
-       path="x86/pentium x86" ;;
-  i[34]86*-*-*)                                # x86 with ELF/SysV format
-       echo '#define ELF_SYNTAX' >asm-syntax.h
-       echo '#include "'$srcdir'/x86/syntax.h"' >>asm-syntax.h
-       path="x86" ;;
-  i[56]86*-*-* | pentium-*-* | pentiumpro-*-*) # x86 with ELF/SysV format
-       echo '#define ELF_SYNTAX' >asm-syntax.h
-       echo '#include "'$srcdir'/x86/syntax.h"' >>asm-syntax.h
-       path="x86/pentium x86" ;;
-
-# Motorola 68k configurations.  Let m68k mean 68020-68040.
-# mc68000 or mc68060 configurations need to be specified explicitly
-  m680[234]0*-*-linuxaout* | m68k*-*-linuxaout*)
-        echo '#define MIT_SYNTAX' >asm-syntax.h
-       echo '#include "'$srcdir'/m68k/syntax.h"' >>asm-syntax.h
-       path="m68k/mc68020 m68k" ;;
-  m68060*-*-linuxaout*)
-        echo '#define MIT_SYNTAX' >asm-syntax.h
-       echo '#include "'$srcdir'/m68k/syntax.h"' >>asm-syntax.h
-       path="m68k" ;;
-  m680[234]0*-*-linux* | m68k*-*-linux*)
-       echo '#define ELF_SYNTAX' >asm-syntax.h
-       echo '#include "'$srcdir'/m68k/syntax.h"' >>asm-syntax.h
-       path="m68k/mc68020 m68k" ;;
-  m68060*-*-linux*)
-       echo '#define ELF_SYNTAX' >asm-syntax.h
-       echo '#include "'$srcdir'/m68k/syntax.h"' >>asm-syntax.h
-       path="m68k" ;;
-  m68000*-*-* | m68060*-*-*)
-        echo '#define MIT_SYNTAX' >asm-syntax.h
-       echo '#include "'$srcdir'/m68k/syntax.h"' >>asm-syntax.h
-       path="m68k/mc68000" ;;
-  m680[234]0*-*-* | m68k*-*-*)
-        echo '#define MIT_SYNTAX' >asm-syntax.h
-       echo '#include "'$srcdir'/m68k/syntax.h"' >>asm-syntax.h
-       path="m68k/mc68020 m68k" ;;
-
-  i960*-*-*) path="i960" ;;
-  m88k*-*-* | m88k*-*-*) path="m88k" ;;
-  m88110*-*-*) path="m88k/mc88110 m88k" ;;
-  ns32k*-*-*) path="n32k" ;;
-  ppc601-*-*) path="power powerpc32" ;;
-  ppc620-*-* | powerpc64*-*-*) path="powerpc64" ;;
-  ppc60[234]*-*-* | powerpc*-*-*) path="powerpc32" ;;
-  pyramid-*-*) path="pyr" ;;
-  rs6000-*-* | power-*-* | power2-*-*)
-    path="power"; extra_functions="udiv_w_sdiv" ;;
-  sh-*-*) path="sh" ;;
-  sh2-*-*) path="sh/sh2 sh" ;;
-  mips[34]*-*-*) path="mips3" ;;
-  mips*-*-irix6*) path="mips3" ;;
-  mips*-*-*) path="mips2" ;;
-  vax*-*-*) path="vax"; extra_functions="udiv_w_sdiv" ;;
-  z8000x*-*-*) path="z8000x"; extra_functions="udiv_w_sdiv" ;;
-  z8000*-*-*) path="z8000"; extra_functions="udiv_w_sdiv" ;;
-  clipper*-*-*) path="clipper" ;;
-  *-*-*) ;;
-esac
-
-case "${target}" in
-  *-*-linuxaout* | *-*-linuxoldld*) config=bsd.h ;;
-  *-sysv* | *-solaris* | *-*-linux*) config="sysv.h" ;;
-  *) config="bsd.h" ;;
-esac
-
-case "${target}" in
-  i[3456]86*-*-*bsd* | i[3456]86*-*-linuxaout* | i[3456]86*-*-linuxoldld* | \
-  pentium-*-*bsd* | pentium-*-linuxaout* | pentium-*-linuxoldld* | \
-  pentiumpro-*-*bsd* | pentiumpro-*-linuxaout* | pentiumpro-*-linuxoldld*)
-    target_makefile_frag=config/t-oldgas ;;
-  rs6000-*-aix[456789]* | rs6000-*-aix3.2.[456789])
-    target_makefile_frag=config/t-pwr-aix ;;
-  ppc601-*-aix[456789]* | ppc601-*-aix3.2.[456789] | \
-  ppc60[234]*-*-aix[456789]* | ppc60[234]*-*-aix3.2.[456789] | \
-  powerpc*-*-aix[456789]* | powerpc*-*-aix3.2.[456789])
-    target_makefile_frag=config/t-ppc-aix ;;
-esac
-
-
-functions="${extra_functions} inlines add_n addmul_1 cmp divmod_1 \
- divrem divrem_1 dump lshift mod_1 mul mul_1 mul_n random2 rshift sqrtrem \
- sub_n submul_1 get_str set_str scan0 scan1 popcount hamdist gcd_1 \
- pre_mod_1 perfsqr bdivmod gcd gcdext"
-
-path="$path generic"
-mpn_objects=
-
-for fn in $functions ; do
-  mpn_objects="$mpn_objects $fn.o"
-  for dir in $path ; do
-    rm -f $fn.[Ssc]
-    if test -f $srcdir/$dir/$fn.S ; then
-      files="$files $dir/$fn.S"
-      links="$links $fn.S"
-      break
-    elif test -f $srcdir/$dir/$fn.s ; then
-      files="$files $dir/$fn.s"
-      links="$links $fn.s"
-      break
-    elif test -f $srcdir/$dir/$fn.c ; then
-      files="$files $dir/$fn.c"
-      links="$links $fn.c"
-      break
-    fi
-  done
-done
-
-for dir in $path ; do
-  rm -f gmp-mparam.h
-  if test -f $srcdir/$dir/gmp-mparam.h ; then
-    files="$files $dir/gmp-mparam.h"
-    links="$links gmp-mparam.h"
-    break
-  fi
-done
-
-links="sysdep.h $links"
-files="$config $files"
-
-mpn_links=$links
-
-# post-target:
-
-AC_LINK_FILES($files,$links)
-AC_OUTPUT(Makefile)
-
-sed <Makefile >Makefile.tmp \
-  -e "s/MPN_LINKS = .*/MPN_LINKS =${mpn_links}/" \
-  -e "s/MPN_OBJECTS = .*/MPN_OBJECTS =${mpn_objects}/"
-
-mv Makefile.tmp Makefile
diff --git a/ghc/rts/gmp/mpn/generic/divmod_1.c b/ghc/rts/gmp/mpn/generic/divmod_1.c
deleted file mode 100644 (file)
index f93841f..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-/* mpn_divmod_1(quot_ptr, dividend_ptr, dividend_size, divisor_limb) --
-   Divide (DIVIDEND_PTR,,DIVIDEND_SIZE) by DIVISOR_LIMB.
-   Write DIVIDEND_SIZE limbs of quotient at QUOT_PTR.
-   Return the single-limb remainder.
-   There are no constraints on the value of the divisor.
-
-   QUOT_PTR and DIVIDEND_PTR might point to the same limb.
-
-Copyright (C) 1991, 1993, 1994, 1996 Free Software Foundation, Inc.
-
-This file is part of the GNU MP Library.
-
-The GNU MP Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Library General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at your
-option) any later version.
-
-The GNU MP 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 Library General Public
-License for more details.
-
-You should have received a copy of the GNU Library General Public License
-along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-MA 02111-1307, USA. */
-
-#include "gmp.h"
-#include "gmp-impl.h"
-#include "longlong.h"
-
-#ifndef UMUL_TIME
-#define UMUL_TIME 1
-#endif
-
-#ifndef UDIV_TIME
-#define UDIV_TIME UMUL_TIME
-#endif
-
-/* FIXME: We should be using invert_limb (or invert_normalized_limb)
-   here (not udiv_qrnnd).  */
-
-mp_limb_t
-#if __STDC__
-mpn_divmod_1 (mp_ptr quot_ptr,
-             mp_srcptr dividend_ptr, mp_size_t dividend_size,
-             mp_limb_t divisor_limb)
-#else
-mpn_divmod_1 (quot_ptr, dividend_ptr, dividend_size, divisor_limb)
-     mp_ptr quot_ptr;
-     mp_srcptr dividend_ptr;
-     mp_size_t dividend_size;
-     mp_limb_t divisor_limb;
-#endif
-{
-  mp_size_t i;
-  mp_limb_t n1, n0, r;
-  int dummy;
-
-  /* ??? Should this be handled at all?  Rely on callers?  */
-  if (dividend_size == 0)
-    return 0;
-
-  /* If multiplication is much faster than division, and the
-     dividend is large, pre-invert the divisor, and use
-     only multiplications in the inner loop.  */
-
-  /* This test should be read:
-       Does it ever help to use udiv_qrnnd_preinv?
-        && Does what we save compensate for the inversion overhead?  */
-  if (UDIV_TIME > (2 * UMUL_TIME + 6)
-      && (UDIV_TIME - (2 * UMUL_TIME + 6)) * dividend_size > UDIV_TIME)
-    {
-      int normalization_steps;
-
-      count_leading_zeros (normalization_steps, divisor_limb);
-      if (normalization_steps != 0)
-       {
-         mp_limb_t divisor_limb_inverted;
-
-         divisor_limb <<= normalization_steps;
-
-         /* Compute (2**2N - 2**N * DIVISOR_LIMB) / DIVISOR_LIMB.  The
-            result is a (N+1)-bit approximation to 1/DIVISOR_LIMB, with the
-            most significant bit (with weight 2**N) implicit.  */
-
-         /* Special case for DIVISOR_LIMB == 100...000.  */
-         if (divisor_limb << 1 == 0)
-           divisor_limb_inverted = ~(mp_limb_t) 0;
-         else
-           udiv_qrnnd (divisor_limb_inverted, dummy,
-                       -divisor_limb, 0, divisor_limb);
-
-         n1 = dividend_ptr[dividend_size - 1];
-         r = n1 >> (BITS_PER_MP_LIMB - normalization_steps);
-
-         /* Possible optimization:
-            if (r == 0
-            && divisor_limb > ((n1 << normalization_steps)
-                            | (dividend_ptr[dividend_size - 2] >> ...)))
-            ...one division less... */
-
-         for (i = dividend_size - 2; i >= 0; i--)
-           {
-             n0 = dividend_ptr[i];
-             udiv_qrnnd_preinv (quot_ptr[i + 1], r, r,
-                                ((n1 << normalization_steps)
-                                 | (n0 >> (BITS_PER_MP_LIMB - normalization_steps))),
-                                divisor_limb, divisor_limb_inverted);
-             n1 = n0;
-           }
-         udiv_qrnnd_preinv (quot_ptr[0], r, r,
-                            n1 << normalization_steps,
-                            divisor_limb, divisor_limb_inverted);
-         return r >> normalization_steps;
-       }
-      else
-       {
-         mp_limb_t divisor_limb_inverted;
-
-         /* Compute (2**2N - 2**N * DIVISOR_LIMB) / DIVISOR_LIMB.  The
-            result is a (N+1)-bit approximation to 1/DIVISOR_LIMB, with the
-            most significant bit (with weight 2**N) implicit.  */
-
-         /* Special case for DIVISOR_LIMB == 100...000.  */
-         if (divisor_limb << 1 == 0)
-           divisor_limb_inverted = ~(mp_limb_t) 0;
-         else
-           udiv_qrnnd (divisor_limb_inverted, dummy,
-                       -divisor_limb, 0, divisor_limb);
-
-         i = dividend_size - 1;
-         r = dividend_ptr[i];
-
-         if (r >= divisor_limb)
-           r = 0;
-         else
-           {
-             quot_ptr[i] = 0;
-             i--;
-           }
-
-         for (; i >= 0; i--)
-           {
-             n0 = dividend_ptr[i];
-             udiv_qrnnd_preinv (quot_ptr[i], r, r,
-                                n0, divisor_limb, divisor_limb_inverted);
-           }
-         return r;
-       }
-    }
-  else
-    {
-      if (UDIV_NEEDS_NORMALIZATION)
-       {
-         int normalization_steps;
-
-         count_leading_zeros (normalization_steps, divisor_limb);
-         if (normalization_steps != 0)
-           {
-             divisor_limb <<= normalization_steps;
-
-             n1 = dividend_ptr[dividend_size - 1];
-             r = n1 >> (BITS_PER_MP_LIMB - normalization_steps);
-
-             /* Possible optimization:
-                if (r == 0
-                && divisor_limb > ((n1 << normalization_steps)
-                                | (dividend_ptr[dividend_size - 2] >> ...)))
-                ...one division less... */
-
-             for (i = dividend_size - 2; i >= 0; i--)
-               {
-                 n0 = dividend_ptr[i];
-                 udiv_qrnnd (quot_ptr[i + 1], r, r,
-                             ((n1 << normalization_steps)
-                              | (n0 >> (BITS_PER_MP_LIMB - normalization_steps))),
-                             divisor_limb);
-                 n1 = n0;
-               }
-             udiv_qrnnd (quot_ptr[0], r, r,
-                         n1 << normalization_steps,
-                         divisor_limb);
-             return r >> normalization_steps;
-           }
-       }
-      /* No normalization needed, either because udiv_qrnnd doesn't require
-        it, or because DIVISOR_LIMB is already normalized.  */
-
-      i = dividend_size - 1;
-      r = dividend_ptr[i];
-
-      if (r >= divisor_limb)
-       r = 0;
-      else
-       {
-         quot_ptr[i] = 0;
-         i--;
-       }
-
-      for (; i >= 0; i--)
-       {
-         n0 = dividend_ptr[i];
-         udiv_qrnnd (quot_ptr[i], r, r, n0, divisor_limb);
-       }
-      return r;
-    }
-}
index 7ac442a..86682f8 100644 (file)
@@ -1,21 +1,21 @@
 /* mpn_random2 -- Generate random numbers with relatively long strings
    of ones and zeroes.  Suitable for border testing.
 
-Copyright (C) 1992, 1993, 1994, 1996 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1996, 2000 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library.
 
 The GNU MP Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Library General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at your
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or (at your
 option) any later version.
 
 The GNU MP 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 Library General Public
+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 Library General Public License
+You should have received a copy of the GNU Lesser General Public License
 along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 MA 02111-1307, USA. */
@@ -23,7 +23,7 @@ MA 02111-1307, USA. */
 #include "gmp.h"
 #include "gmp-impl.h"
 
-#if defined (__hpux) || defined (alpha__)  || defined (__svr4__) || defined (__SVR4)
+#if defined (__hpux) || defined (__alpha)  || defined (__svr4__) || defined (__SVR4)
 /* HPUX lacks random().  DEC OSF/1 1.2 random() returns a double.  */
 long mrand48 ();
 static inline long
@@ -49,9 +49,13 @@ long random ();
    made the most significant bit set.  */
 
 void
+#if __STDC__
+mpn_random2 (mp_ptr res_ptr, mp_size_t size)
+#else
 mpn_random2 (res_ptr, size)
      mp_ptr res_ptr;
      mp_size_t size;
+#endif
 {
   int n_bits;
   int bit_pos;
diff --git a/ghc/rts/gmp/mpn/hppa/hppa1_1/udiv_qrnnd.s b/ghc/rts/gmp/mpn/hppa/hppa1_1/udiv_qrnnd.s
deleted file mode 100644 (file)
index bf7dc70..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-; HP-PA  __udiv_qrnnd division support, used from longlong.h.
-; This version runs fast on PA 7000 and later.
-
-; Copyright (C) 1993, 1994 Free Software Foundation, Inc.
-
-; This file is part of the GNU MP Library.
-
-; The GNU MP Library is free software; you can redistribute it and/or modify
-; it under the terms of the GNU Library General Public License as published by
-; the Free Software Foundation; either version 2 of the License, or (at your
-; option) any later version.
-
-; The GNU MP 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 Library General Public
-; License for more details.
-
-; You should have received a copy of the GNU Library General Public License
-; along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-; MA 02111-1307, USA.
-
-
-; INPUT PARAMETERS
-; rem_ptr      gr26
-; n1           gr25
-; n0           gr24
-; d            gr23
-
-       .code
-L$0000 .word           0x43f00000
-       .word           0x0
-       .export         __udiv_qrnnd
-__udiv_qrnnd
-       .proc
-       .callinfo       frame=64,no_calls
-       .entry
-       ldo             64(%r30),%r30
-
-       stws            %r25,-16(0,%r30)        ; n_hi
-       stws            %r24,-12(0,%r30)        ; n_lo
-       ldil            L'L$0000,%r19
-       ldo             R'L$0000(%r19),%r19
-       fldds           -16(0,%r30),%fr5
-       stws            %r23,-12(0,%r30)
-       comib,<=        0,%r25,L$1
-       fcnvxf,dbl,dbl  %fr5,%fr5
-       fldds           0(0,%r19),%fr4
-       fadd,dbl        %fr4,%fr5,%fr5
-L$1
-       fcpy,sgl        %fr0,%fr6L
-       fldws           -12(0,%r30),%fr6R
-       fcnvxf,dbl,dbl  %fr6,%fr4
-
-       fdiv,dbl        %fr5,%fr4,%fr5
-
-       fcnvfx,dbl,dbl  %fr5,%fr4
-       fstws           %fr4R,-16(%r30)
-       xmpyu           %fr4R,%fr6R,%fr6
-       ldws            -16(%r30),%r28
-       fstds           %fr6,-16(0,%r30)
-       ldws            -12(0,%r30),%r21
-       ldws            -16(0,%r30),%r20
-       sub             %r24,%r21,%r22
-       subb            %r25,%r20,%r19
-       comib,=         0,%r19,L$2
-       ldo             -64(%r30),%r30
-
-       add             %r22,%r23,%r22
-       ldo             -1(%r28),%r28
-L$2    bv              0(%r2)
-       stws            %r22,0(0,%r26)
-
-       .exit
-       .procend
diff --git a/ghc/rts/gmp/mpn/msdos/asm-syntax.h b/ghc/rts/gmp/mpn/msdos/asm-syntax.h
deleted file mode 100644 (file)
index e6327e0..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#define ELF_SYNTAX
-#include "x86/syntax.h"
diff --git a/ghc/rts/gmp/mpn/powerpc32/add_n.s b/ghc/rts/gmp/mpn/powerpc32/add_n.s
deleted file mode 100644 (file)
index 7739a4a..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-# PowerPC-32 __mpn_add_n -- Add two limb vectors of equal, non-zero length.
-
-# Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
-
-# This file is part of the GNU MP Library.
-
-# The GNU MP Library is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Library General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or (at your
-# option) any later version.
-
-# The GNU MP 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 Library General Public
-# License for more details.
-
-# You should have received a copy of the GNU Library General Public License
-# along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA.
-
-
-# INPUT PARAMETERS
-# res_ptr      r3
-# s1_ptr       r4
-# s2_ptr       r5
-# size         r6
-
-       .toc
-       .extern __mpn_add_n[DS]
-       .extern .__mpn_add_n
-.csect [PR]
-       .align 2
-       .globl __mpn_add_n
-       .globl .__mpn_add_n
-       .csect __mpn_add_n[DS]
-__mpn_add_n:
-       .long .__mpn_add_n, TOC[tc0], 0
-       .csect [PR]
-.__mpn_add_n:
-       mtctr   6               # copy size into CTR
-       lwz     8,0(4)          # load least significant s1 limb
-       lwz     0,0(5)          # load least significant s2 limb
-       addi    3,3,-4          # offset res_ptr, it's updated before used
-       addc    7,0,8           # add least significant limbs, set cy
-       bdz     Lend            # If done, skip loop
-Loop:  lwzu    8,4(4)          # load s1 limb and update s1_ptr
-       lwzu    0,4(5)          # load s2 limb and update s2_ptr
-       stwu    7,4(3)          # store previous limb in load latency slot
-       adde    7,0,8           # add new limbs with cy, set cy
-       bdnz    Loop            # decrement CTR and loop back
-Lend:  stw     7,4(3)          # store ultimate result limb
-       li      3,0             # load cy into ...
-       addze   3,3             # ... return value register
-       blr
diff --git a/ghc/rts/gmp/mpn/powerpc32/addmul_1.s b/ghc/rts/gmp/mpn/powerpc32/addmul_1.s
deleted file mode 100644 (file)
index 6ecd53b..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-# PowerPC-32 __mpn_addmul_1 -- Multiply a limb vector with a limb and add
-# the result to a second limb vector.
-
-# Copyright (C) 1995 Free Software Foundation, Inc.
-
-# This file is part of the GNU MP Library.
-
-# The GNU MP Library is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Library General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or (at your
-# option) any later version.
-
-# The GNU MP 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 Library General Public
-# License for more details.
-
-# You should have received a copy of the GNU Library General Public License
-# along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA.
-
-
-# INPUT PARAMETERS
-# res_ptr      r3
-# s1_ptr       r4
-# size         r5
-# s2_limb      r6
-
-# This is a fairly straightforward implementation.  The timing of the PC601
-# is hard to understand, so I will wait to optimize this until I have some
-# hardware to play with.
-
-# The code trivially generalizes to 64 bit limbs for the PC620.
-
-       .toc
-       .csect .__mpn_addmul_1[PR]
-       .align 2
-       .globl __mpn_addmul_1
-       .globl .__mpn_addmul_1
-       .csect __mpn_addmul_1[DS]
-__mpn_addmul_1:
-       .long .__mpn_addmul_1[PR], TOC[tc0], 0
-       .csect .__mpn_addmul_1[PR]
-.__mpn_addmul_1:
-       mtctr   5
-
-       lwz     0,0(4)
-       mullw   7,0,6
-       mulhwu  10,0,6
-       lwz     9,0(3)
-       addc    8,7,9
-       addi    3,3,-4
-       bdz     Lend
-
-Loop:  lwzu    0,4(4)
-       stwu    8,4(3)
-       mullw   8,0,6
-       adde    7,8,10
-       mulhwu  10,0,6
-       lwz     9,4(3)
-       addze   10,10
-       addc    8,7,9
-       bdnz    Loop
-
-Lend:  stw     8,4(3)
-       addze   3,10
-       blr
diff --git a/ghc/rts/gmp/mpn/powerpc32/lshift.s b/ghc/rts/gmp/mpn/powerpc32/lshift.s
deleted file mode 100644 (file)
index 9eef2ee..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-# PowerPC-32 __mpn_lshift --
-
-# Copyright (C) 1995 Free Software Foundation, Inc.
-
-# This file is part of the GNU MP Library.
-
-# The GNU MP Library is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Library General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or (at your
-# option) any later version.
-
-# The GNU MP 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 Library General Public
-# License for more details.
-
-# You should have received a copy of the GNU Library General Public License
-# along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA.
-
-
-# INPUT PARAMETERS
-# res_ptr      r3
-# s1_ptr       r4
-# size         r5
-# cnt          r6
-
-       .toc
-.csect .text[PR]
-       .align  2
-       .globl  __mpn_lshift
-       .globl  .__mpn_lshift
-       .csect  __mpn_lshift[DS]
-__mpn_lshift:
-       .long   .__mpn_lshift,  TOC[tc0],       0
-       .csect  .text[PR]
-.__mpn_lshift:
-       mtctr   5               # copy size into CTR
-       slwi    0,5,2
-       add     7,3,0           # make r7 point at end of res
-       add     4,4,0           # make r4 point at end of s1
-       subfic  8,6,32
-       lwzu    11,-4(4)        # load first s1 limb
-       srw     3,11,8          # compute function return value
-       bdz     Lend1
-
-Loop:  lwzu    10,-4(4)
-       slw     9,11,6
-       srw     12,10,8
-       or      9,9,12
-       stwu    9,-4(7)
-       bdz     Lend2
-       lwzu    11,-4(4)
-       slw     9,10,6
-       srw     12,11,8
-       or      9,9,12
-       stwu    9,-4(7)
-       bdnz    Loop
-
-Lend1: slw     0,11,6
-       stw     0,-4(7)
-       blr
-
-Lend2: slw     0,10,6
-       stw     0,-4(7)
-       blr
diff --git a/ghc/rts/gmp/mpn/powerpc32/mul_1.s b/ghc/rts/gmp/mpn/powerpc32/mul_1.s
deleted file mode 100644 (file)
index dc13cac..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-# PowerPC-32 __mpn_mul_1 -- Multiply a limb vector with a limb and store
-# the result in a second limb vector.
-
-# Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
-
-# This file is part of the GNU MP Library.
-
-# The GNU MP Library is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Library General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or (at your
-# option) any later version.
-
-# The GNU MP 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 Library General Public
-# License for more details.
-
-# You should have received a copy of the GNU Library General Public License
-# along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA.
-
-
-# INPUT PARAMETERS
-# res_ptr      r3
-# s1_ptr       r4
-# size         r5
-# s2_limb      r6
-
-# This is a fairly straightforward implementation.  The timing of the PC601
-# is hard to understand, so I will wait to optimize this until I have some
-# hardware to play with.
-
-# The code trivially generalizes to 64 bit limbs for the PC620.
-
-       .toc
-       .csect .__mpn_mul_1[PR]
-       .align 2
-       .globl __mpn_mul_1
-       .globl .__mpn_mul_1
-       .csect __mpn_mul_1[DS]
-__mpn_mul_1:
-       .long .__mpn_mul_1[PR], TOC[tc0], 0
-       .csect .__mpn_mul_1[PR]
-.__mpn_mul_1:
-       mtctr   5
-
-       lwz     0,0(4)
-       mullw   7,0,6
-       mulhwu  10,0,6
-       addi    3,3,-4          # adjust res_ptr
-       addic   5,5,0           # clear cy with dummy insn
-       bdz     Lend
-
-Loop:  lwzu    0,4(4)
-       stwu    7,4(3)
-       mullw   8,0,6
-       adde    7,8,10
-       mulhwu  10,0,6
-       bdnz    Loop
-
-Lend:  stw     7,4(3)
-       addze   3,10
-       blr
diff --git a/ghc/rts/gmp/mpn/powerpc32/rshift.s b/ghc/rts/gmp/mpn/powerpc32/rshift.s
deleted file mode 100644 (file)
index 4059270..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-# PowerPC-32 __mpn_rshift --
-
-# Copyright (C) 1995 Free Software Foundation, Inc.
-
-# This file is part of the GNU MP Library.
-
-# The GNU MP Library is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Library General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or (at your
-# option) any later version.
-
-# The GNU MP 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 Library General Public
-# License for more details.
-
-# You should have received a copy of the GNU Library General Public License
-# along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA.
-
-
-# INPUT PARAMETERS
-# res_ptr      r3
-# s1_ptr       r4
-# size         r5
-# cnt          r6
-
-       .toc
-.csect .text[PR]
-       .align  2
-       .globl  __mpn_rshift
-       .globl  .__mpn_rshift
-       .csect  __mpn_rshift[DS]
-__mpn_rshift:
-       .long   .__mpn_rshift,  TOC[tc0],       0
-       .csect  .text[PR]
-.__mpn_rshift:
-       mtctr   5               # copy size into CTR
-       addi    7,3,-4          # move adjusted res_ptr to free return reg
-       subfic  8,6,32
-       lwz     11,0(4)         # load first s1 limb
-       slw     3,11,8          # compute function return value
-       bdz     Lend1
-
-Loop:  lwzu    10,4(4)
-       srw     9,11,6
-       slw     12,10,8
-       or      9,9,12
-       stwu    9,4(7)
-       bdz     Lend2
-       lwzu    11,4(4)
-       srw     9,10,6
-       slw     12,11,8
-       or      9,9,12
-       stwu    9,4(7)
-       bdnz    Loop
-
-Lend1: srw     0,11,6
-       stw     0,4(7)
-       blr
-
-Lend2: srw     0,10,6
-       stw     0,4(7)
-       blr
diff --git a/ghc/rts/gmp/mpn/powerpc32/sub_n.s b/ghc/rts/gmp/mpn/powerpc32/sub_n.s
deleted file mode 100644 (file)
index 2d00d36..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-# PowerPC-32  __mpn_sub_n -- Subtract two limb vectors of the same length > 0
-# and store difference in a third limb vector.
-
-# Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
-
-# This file is part of the GNU MP Library.
-
-# The GNU MP Library is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Library General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or (at your
-# option) any later version.
-
-# The GNU MP 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 Library General Public
-# License for more details.
-
-# You should have received a copy of the GNU Library General Public License
-# along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA.
-
-
-# INPUT PARAMETERS
-# res_ptr      r3
-# s1_ptr       r4
-# s2_ptr       r5
-# size         r6
-
-       .toc
-       .extern __mpn_sub_n[DS]
-       .extern .__mpn_sub_n
-.csect [PR]
-       .align 2
-       .globl __mpn_sub_n
-       .globl .__mpn_sub_n
-       .csect __mpn_sub_n[DS]
-__mpn_sub_n:
-       .long .__mpn_sub_n, TOC[tc0], 0
-       .csect [PR]
-.__mpn_sub_n:
-       mtctr   6               # copy size into CTR
-       lwz     8,0(4)          # load least significant s1 limb
-       lwz     0,0(5)          # load least significant s2 limb
-       addi    3,3,-4          # offset res_ptr, it's updated before used
-       subfc   7,0,8           # add least significant limbs, set cy
-       bdz     Lend            # If done, skip loop
-Loop:  lwzu    8,4(4)          # load s1 limb and update s1_ptr
-       lwzu    0,4(5)          # load s2 limb and update s2_ptr
-       stwu    7,4(3)          # store previous limb in load latency slot
-       subfe   7,0,8           # add new limbs with cy, set cy
-       bdnz    Loop            # decrement CTR and loop back
-Lend:  stw     7,4(3)          # store ultimate result limb
-       subfe   3,0,0           # load !cy into ...
-       subfic  3,3,0           # ... return value register
-       blr
diff --git a/ghc/rts/gmp/mpn/powerpc32/submul_1.s b/ghc/rts/gmp/mpn/powerpc32/submul_1.s
deleted file mode 100644 (file)
index 78467cc..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-# PowerPC-32 __mpn_submul_1 -- Multiply a limb vector with a limb and subtract
-# the result from a second limb vector.
-
-# Copyright (C) 1995 Free Software Foundation, Inc.
-
-# This file is part of the GNU MP Library.
-
-# The GNU MP Library is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Library General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or (at your
-# option) any later version.
-
-# The GNU MP 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 Library General Public
-# License for more details.
-
-# You should have received a copy of the GNU Library General Public License
-# along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA.
-
-
-# INPUT PARAMETERS
-# res_ptr      r3
-# s1_ptr       r4
-# size         r5
-# s2_limb      r6
-
-# This is a fairly straightforward implementation.  The timing of the PC601
-# is hard to understand, so I will wait to optimize this until I have some
-# hardware to play with.
-
-# The code trivially generalizes to 64 bit limbs for the PC620.
-
-       .toc
-       .csect .__mpn_submul_1[PR]
-       .align 2
-       .globl __mpn_submul_1
-       .globl .__mpn_submul_1
-       .csect __mpn_submul_1[DS]
-__mpn_submul_1:
-       .long .__mpn_submul_1[PR], TOC[tc0], 0
-       .csect .__mpn_submul_1[PR]
-.__mpn_submul_1:
-       mtctr   5
-
-       lwz     0,0(4)
-       mullw   7,0,6
-       mulhwu  10,0,6
-       lwz     9,0(3)
-       subfc   8,7,9
-       addc    7,7,8           # invert cy (r7 is junk)
-       addi    3,3,-4
-       bdz     Lend
-
-Loop:  lwzu    0,4(4)
-       stwu    8,4(3)
-       mullw   8,0,6
-       adde    7,8,10
-       mulhwu  10,0,6
-       lwz     9,4(3)
-       addze   10,10
-       subfc   8,7,9
-       addc    7,7,8           # invert cy (r7 is junk)
-       bdnz    Loop
-
-Lend:  stw     8,4(3)
-       addze   3,10
-       blr
diff --git a/ghc/rts/gmp/mpn/sparc32/add_n.S b/ghc/rts/gmp/mpn/sparc32/add_n.S
deleted file mode 100644 (file)
index 9852c25..0000000
+++ /dev/null
@@ -1,226 +0,0 @@
-! SPARC __mpn_add_n -- Add two limb vectors of the same length > 0 and store
-! sum in a third limb vector.
-
-! Copyright (C) 1995, 1996 Free Software Foundation, Inc.
-
-! This file is part of the GNU MP Library.
-
-! The GNU MP Library is free software; you can redistribute it and/or modify
-! it under the terms of the GNU Library General Public License as published by
-! the Free Software Foundation; either version 2 of the License, or (at your
-! option) any later version.
-
-! The GNU MP 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 Library General Public
-! License for more details.
-
-! You should have received a copy of the GNU Library General Public License
-! along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-! MA 02111-1307, USA.
-
-
-! INPUT PARAMETERS
-#define res_ptr        %o0
-#define s1_ptr %o1
-#define s2_ptr %o2
-#define size   %o3
-
-#include "sysdep.h"
-
-       .text
-       .align  4
-       .global C_SYMBOL_NAME(__mpn_add_n)
-C_SYMBOL_NAME(__mpn_add_n):
-       xor     s2_ptr,res_ptr,%g1
-       andcc   %g1,4,%g0
-       bne     L1                      ! branch if alignment differs
-       nop
-! **  V1a  **
-L0:    andcc   res_ptr,4,%g0           ! res_ptr unaligned? Side effect: cy=0
-       be      L_v1                    ! if no, branch
-       nop
-/* Add least significant limb separately to align res_ptr and s2_ptr */
-       ld      [s1_ptr],%g4
-       add     s1_ptr,4,s1_ptr
-       ld      [s2_ptr],%g2
-       add     s2_ptr,4,s2_ptr
-       add     size,-1,size
-       addcc   %g4,%g2,%o4
-       st      %o4,[res_ptr]
-       add     res_ptr,4,res_ptr
-L_v1:  addx    %g0,%g0,%o4             ! save cy in register
-       cmp     size,2                  ! if size < 2 ...
-       bl      Lend2                   ! ... branch to tail code
-       subcc   %g0,%o4,%g0             ! restore cy
-
-       ld      [s1_ptr+0],%g4
-       addcc   size,-10,size
-       ld      [s1_ptr+4],%g1
-       ldd     [s2_ptr+0],%g2
-       blt     Lfin1
-       subcc   %g0,%o4,%g0             ! restore cy
-/* Add blocks of 8 limbs until less than 8 limbs remain */
-Loop1: addxcc  %g4,%g2,%o4
-       ld      [s1_ptr+8],%g4
-       addxcc  %g1,%g3,%o5
-       ld      [s1_ptr+12],%g1
-       ldd     [s2_ptr+8],%g2
-       std     %o4,[res_ptr+0]
-       addxcc  %g4,%g2,%o4
-       ld      [s1_ptr+16],%g4
-       addxcc  %g1,%g3,%o5
-       ld      [s1_ptr+20],%g1
-       ldd     [s2_ptr+16],%g2
-       std     %o4,[res_ptr+8]
-       addxcc  %g4,%g2,%o4
-       ld      [s1_ptr+24],%g4
-       addxcc  %g1,%g3,%o5
-       ld      [s1_ptr+28],%g1
-       ldd     [s2_ptr+24],%g2
-       std     %o4,[res_ptr+16]
-       addxcc  %g4,%g2,%o4
-       ld      [s1_ptr+32],%g4
-       addxcc  %g1,%g3,%o5
-       ld      [s1_ptr+36],%g1
-       ldd     [s2_ptr+32],%g2
-       std     %o4,[res_ptr+24]
-       addx    %g0,%g0,%o4             ! save cy in register
-       addcc   size,-8,size
-       add     s1_ptr,32,s1_ptr
-       add     s2_ptr,32,s2_ptr
-       add     res_ptr,32,res_ptr
-       bge     Loop1
-       subcc   %g0,%o4,%g0             ! restore cy
-
-Lfin1: addcc   size,8-2,size
-       blt     Lend1
-       subcc   %g0,%o4,%g0             ! restore cy
-/* Add blocks of 2 limbs until less than 2 limbs remain */
-Loope1:        addxcc  %g4,%g2,%o4
-       ld      [s1_ptr+8],%g4
-       addxcc  %g1,%g3,%o5
-       ld      [s1_ptr+12],%g1
-       ldd     [s2_ptr+8],%g2
-       std     %o4,[res_ptr+0]
-       addx    %g0,%g0,%o4             ! save cy in register
-       addcc   size,-2,size
-       add     s1_ptr,8,s1_ptr
-       add     s2_ptr,8,s2_ptr
-       add     res_ptr,8,res_ptr
-       bge     Loope1
-       subcc   %g0,%o4,%g0             ! restore cy
-Lend1: addxcc  %g4,%g2,%o4
-       addxcc  %g1,%g3,%o5
-       std     %o4,[res_ptr+0]
-       addx    %g0,%g0,%o4             ! save cy in register
-
-       andcc   size,1,%g0
-       be      Lret1
-       subcc   %g0,%o4,%g0             ! restore cy
-/* Add last limb */
-       ld      [s1_ptr+8],%g4
-       ld      [s2_ptr+8],%g2
-       addxcc  %g4,%g2,%o4
-       st      %o4,[res_ptr+8]
-
-Lret1: retl
-       addx    %g0,%g0,%o0     ! return carry-out from most sign. limb
-
-L1:    xor     s1_ptr,res_ptr,%g1
-       andcc   %g1,4,%g0
-       bne     L2
-       nop
-! **  V1b  **
-       mov     s2_ptr,%g1
-       mov     s1_ptr,s2_ptr
-       b       L0
-       mov     %g1,s1_ptr
-
-! **  V2  **
-/* If we come here, the alignment of s1_ptr and res_ptr as well as the
-   alignment of s2_ptr and res_ptr differ.  Since there are only two ways
-   things can be aligned (that we care about) we now know that the alignment
-   of s1_ptr and s2_ptr are the same.  */
-
-L2:    cmp     size,1
-       be      Ljone
-       nop
-       andcc   s1_ptr,4,%g0            ! s1_ptr unaligned? Side effect: cy=0
-       be      L_v2                    ! if no, branch
-       nop
-/* Add least significant limb separately to align s1_ptr and s2_ptr */
-       ld      [s1_ptr],%g4
-       add     s1_ptr,4,s1_ptr
-       ld      [s2_ptr],%g2
-       add     s2_ptr,4,s2_ptr
-       add     size,-1,size
-       addcc   %g4,%g2,%o4
-       st      %o4,[res_ptr]
-       add     res_ptr,4,res_ptr
-
-L_v2:  addx    %g0,%g0,%o4             ! save cy in register
-       addcc   size,-8,size
-       blt     Lfin2
-       subcc   %g0,%o4,%g0             ! restore cy
-/* Add blocks of 8 limbs until less than 8 limbs remain */
-Loop2: ldd     [s1_ptr+0],%g2
-       ldd     [s2_ptr+0],%o4
-       addxcc  %g2,%o4,%g2
-       st      %g2,[res_ptr+0]
-       addxcc  %g3,%o5,%g3
-       st      %g3,[res_ptr+4]
-       ldd     [s1_ptr+8],%g2
-       ldd     [s2_ptr+8],%o4
-       addxcc  %g2,%o4,%g2
-       st      %g2,[res_ptr+8]
-       addxcc  %g3,%o5,%g3
-       st      %g3,[res_ptr+12]
-       ldd     [s1_ptr+16],%g2
-       ldd     [s2_ptr+16],%o4
-       addxcc  %g2,%o4,%g2
-       st      %g2,[res_ptr+16]
-       addxcc  %g3,%o5,%g3
-       st      %g3,[res_ptr+20]
-       ldd     [s1_ptr+24],%g2
-       ldd     [s2_ptr+24],%o4
-       addxcc  %g2,%o4,%g2
-       st      %g2,[res_ptr+24]
-       addxcc  %g3,%o5,%g3
-       st      %g3,[res_ptr+28]
-       addx    %g0,%g0,%o4             ! save cy in register
-       addcc   size,-8,size
-       add     s1_ptr,32,s1_ptr
-       add     s2_ptr,32,s2_ptr
-       add     res_ptr,32,res_ptr
-       bge     Loop2
-       subcc   %g0,%o4,%g0             ! restore cy
-
-Lfin2: addcc   size,8-2,size
-       blt     Lend2
-       subcc   %g0,%o4,%g0             ! restore cy
-Loope2:        ldd     [s1_ptr+0],%g2
-       ldd     [s2_ptr+0],%o4
-       addxcc  %g2,%o4,%g2
-       st      %g2,[res_ptr+0]
-       addxcc  %g3,%o5,%g3
-       st      %g3,[res_ptr+4]
-       addx    %g0,%g0,%o4             ! save cy in register
-       addcc   size,-2,size
-       add     s1_ptr,8,s1_ptr
-       add     s2_ptr,8,s2_ptr
-       add     res_ptr,8,res_ptr
-       bge     Loope2
-       subcc   %g0,%o4,%g0             ! restore cy
-Lend2: andcc   size,1,%g0
-       be      Lret2
-       subcc   %g0,%o4,%g0             ! restore cy
-/* Add last limb */
-Ljone: ld      [s1_ptr],%g4
-       ld      [s2_ptr],%g2
-       addxcc  %g4,%g2,%o4
-       st      %o4,[res_ptr]
-
-Lret2: retl
-       addx    %g0,%g0,%o0     ! return carry-out from most sign. limb
diff --git a/ghc/rts/gmp/mpn/sparc32/addmul_1.S b/ghc/rts/gmp/mpn/sparc32/addmul_1.S
deleted file mode 100644 (file)
index 375d25d..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-! SPARC __mpn_addmul_1 -- Multiply a limb vector with a limb and add
-! the result to a second limb vector.
-
-! Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
-
-! This file is part of the GNU MP Library.
-
-! The GNU MP Library is free software; you can redistribute it and/or modify
-! it under the terms of the GNU Library General Public License as published by
-! the Free Software Foundation; either version 2 of the License, or (at your
-! option) any later version.
-
-! The GNU MP 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 Library General Public
-! License for more details.
-
-! You should have received a copy of the GNU Library General Public License
-! along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-! MA 02111-1307, USA.
-
-
-! INPUT PARAMETERS
-! res_ptr      o0
-! s1_ptr       o1
-! size         o2
-! s2_limb      o3
-
-#include "sysdep.h"
-
-.text
-       .align 4
-       .global C_SYMBOL_NAME(__mpn_addmul_1)
-C_SYMBOL_NAME(__mpn_addmul_1):
-       ! Make S1_PTR and RES_PTR point at the end of their blocks
-       ! and put (- 4 x SIZE) in index/loop counter.
-       sll     %o2,2,%o2
-       add     %o0,%o2,%o4     ! RES_PTR in o4 since o0 is retval
-       add     %o1,%o2,%o1
-       sub     %g0,%o2,%o2
-
-       cmp     %o3,0xfff
-       bgu     Large
-       nop
-
-       ld      [%o1+%o2],%o5
-       mov     0,%o0
-       b       L0
-        add    %o4,-4,%o4
-Loop0:
-       addcc   %o5,%g1,%g1
-       ld      [%o1+%o2],%o5
-       addx    %o0,%g0,%o0
-       st      %g1,[%o4+%o2]
-L0:    wr      %g0,%o3,%y
-       sra     %o5,31,%g2
-       and     %o3,%g2,%g2
-       andcc   %g1,0,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,0,%g1
-       sra     %g1,20,%g4
-       sll     %g1,12,%g1
-       rd      %y,%g3
-       srl     %g3,20,%g3
-       or      %g1,%g3,%g1
-
-       addcc   %g1,%o0,%g1
-       addx    %g2,%g4,%o0     ! add sign-compensation and cy to hi limb
-       addcc   %o2,4,%o2       ! loop counter
-       bne     Loop0
-        ld     [%o4+%o2],%o5
-
-       addcc   %o5,%g1,%g1
-       addx    %o0,%g0,%o0
-       retl
-       st      %g1,[%o4+%o2]
-
-
-Large: ld      [%o1+%o2],%o5
-       mov     0,%o0
-       sra     %o3,31,%g4      ! g4 = mask of ones iff S2_LIMB < 0
-       b       L1
-        add    %o4,-4,%o4
-Loop:
-       addcc   %o5,%g3,%g3
-       ld      [%o1+%o2],%o5
-       addx    %o0,%g0,%o0
-       st      %g3,[%o4+%o2]
-L1:    wr      %g0,%o5,%y
-       and     %o5,%g4,%g2
-       andcc   %g0,%g0,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%g0,%g1
-       rd      %y,%g3
-       addcc   %g3,%o0,%g3
-       addx    %g2,%g1,%o0
-       addcc   %o2,4,%o2
-       bne     Loop
-        ld     [%o4+%o2],%o5
-
-       addcc   %o5,%g3,%g3
-       addx    %o0,%g0,%o0
-       retl
-       st      %g3,[%o4+%o2]
diff --git a/ghc/rts/gmp/mpn/sparc32/lshift.S b/ghc/rts/gmp/mpn/sparc32/lshift.S
deleted file mode 100644 (file)
index 4f0595f..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-! sparc __mpn_lshift --
-
-! Copyright (C) 1995, 1996 Free Software Foundation, Inc.
-
-! This file is part of the GNU MP Library.
-
-! The GNU MP Library is free software; you can redistribute it and/or modify
-! it under the terms of the GNU Library General Public License as published by
-! the Free Software Foundation; either version 2 of the License, or (at your
-! option) any later version.
-
-! The GNU MP 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 Library General Public
-! License for more details.
-
-! You should have received a copy of the GNU Library General Public License
-! along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-! MA 02111-1307, USA.
-
-
-! INPUT PARAMETERS
-! res_ptr      %o0
-! src_ptr      %o1
-! size         %o2
-! cnt          %o3
-
-#include "sysdep.h"
-
-       .text
-       .align  4
-       .global C_SYMBOL_NAME(__mpn_lshift)
-C_SYMBOL_NAME(__mpn_lshift):
-       sll     %o2,2,%g1
-       add     %o1,%g1,%o1     ! make %o1 point at end of src
-       ld      [%o1-4],%g2     ! load first limb
-       sub     %g0,%o3,%o5     ! negate shift count
-       add     %o0,%g1,%o0     ! make %o0 point at end of res
-       add     %o2,-1,%o2
-       andcc   %o2,4-1,%g4     ! number of limbs in first loop
-       srl     %g2,%o5,%g1     ! compute function result
-       be      L0              ! if multiple of 4 limbs, skip first loop
-       st      %g1,[%sp+80]
-
-       sub     %o2,%g4,%o2     ! adjust count for main loop
-
-Loop0: ld      [%o1-8],%g3
-       add     %o0,-4,%o0
-       add     %o1,-4,%o1
-       addcc   %g4,-1,%g4
-       sll     %g2,%o3,%o4
-       srl     %g3,%o5,%g1
-       mov     %g3,%g2
-       or      %o4,%g1,%o4
-       bne     Loop0
-        st     %o4,[%o0+0]
-
-L0:    tst     %o2
-       be      Lend
-        nop
-
-Loop:  ld      [%o1-8],%g3
-       add     %o0,-16,%o0
-       addcc   %o2,-4,%o2
-       sll     %g2,%o3,%o4
-       srl     %g3,%o5,%g1
-
-       ld      [%o1-12],%g2
-       sll     %g3,%o3,%g4
-       or      %o4,%g1,%o4
-       st      %o4,[%o0+12]
-       srl     %g2,%o5,%g1
-
-       ld      [%o1-16],%g3
-       sll     %g2,%o3,%o4
-       or      %g4,%g1,%g4
-       st      %g4,[%o0+8]
-       srl     %g3,%o5,%g1
-
-       ld      [%o1-20],%g2
-       sll     %g3,%o3,%g4
-       or      %o4,%g1,%o4
-       st      %o4,[%o0+4]
-       srl     %g2,%o5,%g1
-
-       add     %o1,-16,%o1
-       or      %g4,%g1,%g4
-       bne     Loop
-        st     %g4,[%o0+0]
-
-Lend:  sll     %g2,%o3,%g2
-       st      %g2,[%o0-4]
-       retl
-       ld      [%sp+80],%o0
diff --git a/ghc/rts/gmp/mpn/sparc32/mul_1.S b/ghc/rts/gmp/mpn/sparc32/mul_1.S
deleted file mode 100644 (file)
index 142fd8b..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-! SPARC __mpn_mul_1 -- Multiply a limb vector with a limb and store
-! the result in a second limb vector.
-
-! Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
-
-! This file is part of the GNU MP Library.
-
-! The GNU MP Library is free software; you can redistribute it and/or modify
-! it under the terms of the GNU Library General Public License as published by
-! the Free Software Foundation; either version 2 of the License, or (at your
-! option) any later version.
-
-! The GNU MP 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 Library General Public
-! License for more details.
-
-! You should have received a copy of the GNU Library General Public License
-! along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-! MA 02111-1307, USA.
-
-
-! INPUT PARAMETERS
-! res_ptr      o0
-! s1_ptr       o1
-! size         o2
-! s2_limb      o3
-
-! ADD CODE FOR SMALL MULTIPLIERS!
-!1:    ld
-!      st
-!
-!2:    ld      ,a
-!      addxcc  a,a,x
-!      st      x,
-!
-!3_unrolled:
-!      ld      ,a
-!      addxcc  a,a,x1          ! 2a + cy
-!      addx    %g0,%g0,x2
-!      addcc   a,x1,x          ! 3a + c
-!      st      x,
-!
-!      ld      ,a
-!      addxcc  a,a,y1
-!      addx    %g0,%g0,y2
-!      addcc   a,y1,x
-!      st      x,
-!
-!4_unrolled:
-!      ld      ,a
-!      srl     a,2,x1          ! 4a
-!      addxcc  y2,x1,x
-!      sll     a,30,x2
-!      st      x,
-!
-!      ld      ,a
-!      srl     a,2,y1
-!      addxcc  x2,y1,y
-!      sll     a,30,y2
-!      st      x,
-!
-!5_unrolled:
-!      ld      ,a
-!      srl     a,2,x1          ! 4a
-!      addxcc  a,x1,x          ! 5a + c
-!      sll     a,30,x2
-!      addx    %g0,x2,x2
-!      st      x,
-!
-!      ld      ,a
-!      srl     a,2,y1
-!      addxcc  a,y1,x
-!      sll     a,30,y2
-!      addx    %g0,y2,y2
-!      st      x,
-!
-!8_unrolled:
-!      ld      ,a
-!      srl     a,3,x1          ! 8a
-!      addxcc  y2,x1,x
-!      sll     a,29,x2
-!      st      x,
-!
-!      ld      ,a
-!      srl     a,3,y1
-!      addxcc  x2,y1,y
-!      sll     a,29,y2
-!      st      x,
-
-#include "sysdep.h"
-
-.text
-       .align 4
-       .global C_SYMBOL_NAME(__mpn_mul_1)
-C_SYMBOL_NAME(__mpn_mul_1):
-       ! Make S1_PTR and RES_PTR point at the end of their blocks
-       ! and put (- 4 x SIZE) in index/loop counter.
-       sll     %o2,2,%o2
-       add     %o0,%o2,%o4     ! RES_PTR in o4 since o0 is retval
-       add     %o1,%o2,%o1
-       sub     %g0,%o2,%o2
-
-       cmp     %o3,0xfff
-       bgu     Large
-       nop
-
-       ld      [%o1+%o2],%o5
-       mov     0,%o0
-       b       L0
-        add    %o4,-4,%o4
-Loop0:
-       st      %g1,[%o4+%o2]
-L0:    wr      %g0,%o3,%y
-       sra     %o5,31,%g2
-       and     %o3,%g2,%g2
-       andcc   %g1,0,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,0,%g1
-       sra     %g1,20,%g4
-       sll     %g1,12,%g1
-       rd      %y,%g3
-       srl     %g3,20,%g3
-       or      %g1,%g3,%g1
-
-       addcc   %g1,%o0,%g1
-       addx    %g2,%g4,%o0     ! add sign-compensation and cy to hi limb
-       addcc   %o2,4,%o2       ! loop counter
-       bne,a   Loop0
-        ld     [%o1+%o2],%o5
-
-       retl
-       st      %g1,[%o4+%o2]
-
-
-Large: ld      [%o1+%o2],%o5
-       mov     0,%o0
-       sra     %o3,31,%g4      ! g4 = mask of ones iff S2_LIMB < 0
-       b       L1
-        add    %o4,-4,%o4
-Loop:
-       st      %g3,[%o4+%o2]
-L1:    wr      %g0,%o5,%y
-       and     %o5,%g4,%g2     ! g2 = S1_LIMB iff S2_LIMB < 0, else 0
-       andcc   %g0,%g0,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%g0,%g1
-       rd      %y,%g3
-       addcc   %g3,%o0,%g3
-       addx    %g2,%g1,%o0     ! add sign-compensation and cy to hi limb
-       addcc   %o2,4,%o2       ! loop counter
-       bne,a   Loop
-        ld     [%o1+%o2],%o5
-
-       retl
-       st      %g3,[%o4+%o2]
diff --git a/ghc/rts/gmp/mpn/sparc32/rshift.S b/ghc/rts/gmp/mpn/sparc32/rshift.S
deleted file mode 100644 (file)
index fea4f3b..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-! sparc __mpn_rshift --
-
-! Copyright (C) 1995, 1996 Free Software Foundation, Inc.
-
-! This file is part of the GNU MP Library.
-
-! The GNU MP Library is free software; you can redistribute it and/or modify
-! it under the terms of the GNU Library General Public License as published by
-! the Free Software Foundation; either version 2 of the License, or (at your
-! option) any later version.
-
-! The GNU MP 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 Library General Public
-! License for more details.
-
-! You should have received a copy of the GNU Library General Public License
-! along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-! MA 02111-1307, USA.
-
-
-! INPUT PARAMETERS
-! res_ptr      %o0
-! src_ptr      %o1
-! size         %o2
-! cnt          %o3
-
-#include "sysdep.h"
-
-       .text
-       .align  4
-       .global C_SYMBOL_NAME(__mpn_rshift)
-C_SYMBOL_NAME(__mpn_rshift):
-       ld      [%o1],%g2       ! load first limb
-       sub     %g0,%o3,%o5     ! negate shift count
-       add     %o2,-1,%o2
-       andcc   %o2,4-1,%g4     ! number of limbs in first loop
-       sll     %g2,%o5,%g1     ! compute function result
-       be      L0              ! if multiple of 4 limbs, skip first loop
-       st      %g1,[%sp+80]
-
-       sub     %o2,%g4,%o2     ! adjust count for main loop
-
-Loop0: ld      [%o1+4],%g3
-       add     %o0,4,%o0
-       add     %o1,4,%o1
-       addcc   %g4,-1,%g4
-       srl     %g2,%o3,%o4
-       sll     %g3,%o5,%g1
-       mov     %g3,%g2
-       or      %o4,%g1,%o4
-       bne     Loop0
-        st     %o4,[%o0-4]
-
-L0:    tst     %o2
-       be      Lend
-        nop
-
-Loop:  ld      [%o1+4],%g3
-       add     %o0,16,%o0
-       addcc   %o2,-4,%o2
-       srl     %g2,%o3,%o4
-       sll     %g3,%o5,%g1
-
-       ld      [%o1+8],%g2
-       srl     %g3,%o3,%g4
-       or      %o4,%g1,%o4
-       st      %o4,[%o0-16]
-       sll     %g2,%o5,%g1
-
-       ld      [%o1+12],%g3
-       srl     %g2,%o3,%o4
-       or      %g4,%g1,%g4
-       st      %g4,[%o0-12]
-       sll     %g3,%o5,%g1
-
-       ld      [%o1+16],%g2
-       srl     %g3,%o3,%g4
-       or      %o4,%g1,%o4
-       st      %o4,[%o0-8]
-       sll     %g2,%o5,%g1
-
-       add     %o1,16,%o1
-       or      %g4,%g1,%g4
-       bne     Loop
-        st     %g4,[%o0-4]
-
-Lend:  srl     %g2,%o3,%g2
-       st      %g2,[%o0-0]
-       retl
-       ld      [%sp+80],%o0
diff --git a/ghc/rts/gmp/mpn/sparc32/sub_n.S b/ghc/rts/gmp/mpn/sparc32/sub_n.S
deleted file mode 100644 (file)
index b7a1195..0000000
+++ /dev/null
@@ -1,311 +0,0 @@
-! SPARC __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
-! store difference in a third limb vector.
-
-! Copyright (C) 1995, 1996 Free Software Foundation, Inc.
-
-! This file is part of the GNU MP Library.
-
-! The GNU MP Library is free software; you can redistribute it and/or modify
-! it under the terms of the GNU Library General Public License as published by
-! the Free Software Foundation; either version 2 of the License, or (at your
-! option) any later version.
-
-! The GNU MP 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 Library General Public
-! License for more details.
-
-! You should have received a copy of the GNU Library General Public License
-! along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-! MA 02111-1307, USA.
-
-
-! INPUT PARAMETERS
-#define res_ptr        %o0
-#define s1_ptr %o1
-#define s2_ptr %o2
-#define size   %o3
-
-#include "sysdep.h"
-
-       .text
-       .align  4
-       .global C_SYMBOL_NAME(__mpn_sub_n)
-C_SYMBOL_NAME(__mpn_sub_n):
-       xor     s2_ptr,res_ptr,%g1
-       andcc   %g1,4,%g0
-       bne     L1                      ! branch if alignment differs
-       nop
-! **  V1a  **
-       andcc   res_ptr,4,%g0           ! res_ptr unaligned? Side effect: cy=0
-       be      L_v1                    ! if no, branch
-       nop
-/* Add least significant limb separately to align res_ptr and s2_ptr */
-       ld      [s1_ptr],%g4
-       add     s1_ptr,4,s1_ptr
-       ld      [s2_ptr],%g2
-       add     s2_ptr,4,s2_ptr
-       add     size,-1,size
-       subcc   %g4,%g2,%o4
-       st      %o4,[res_ptr]
-       add     res_ptr,4,res_ptr
-L_v1:  addx    %g0,%g0,%o4             ! save cy in register
-       cmp     size,2                  ! if size < 2 ...
-       bl      Lend2                   ! ... branch to tail code
-       subcc   %g0,%o4,%g0             ! restore cy
-
-       ld      [s1_ptr+0],%g4
-       addcc   size,-10,size
-       ld      [s1_ptr+4],%g1
-       ldd     [s2_ptr+0],%g2
-       blt     Lfin1
-       subcc   %g0,%o4,%g0             ! restore cy
-/* Add blocks of 8 limbs until less than 8 limbs remain */
-Loop1: subxcc  %g4,%g2,%o4
-       ld      [s1_ptr+8],%g4
-       subxcc  %g1,%g3,%o5
-       ld      [s1_ptr+12],%g1
-       ldd     [s2_ptr+8],%g2
-       std     %o4,[res_ptr+0]
-       subxcc  %g4,%g2,%o4
-       ld      [s1_ptr+16],%g4
-       subxcc  %g1,%g3,%o5
-       ld      [s1_ptr+20],%g1
-       ldd     [s2_ptr+16],%g2
-       std     %o4,[res_ptr+8]
-       subxcc  %g4,%g2,%o4
-       ld      [s1_ptr+24],%g4
-       subxcc  %g1,%g3,%o5
-       ld      [s1_ptr+28],%g1
-       ldd     [s2_ptr+24],%g2
-       std     %o4,[res_ptr+16]
-       subxcc  %g4,%g2,%o4
-       ld      [s1_ptr+32],%g4
-       subxcc  %g1,%g3,%o5
-       ld      [s1_ptr+36],%g1
-       ldd     [s2_ptr+32],%g2
-       std     %o4,[res_ptr+24]
-       addx    %g0,%g0,%o4             ! save cy in register
-       addcc   size,-8,size
-       add     s1_ptr,32,s1_ptr
-       add     s2_ptr,32,s2_ptr
-       add     res_ptr,32,res_ptr
-       bge     Loop1
-       subcc   %g0,%o4,%g0             ! restore cy
-
-Lfin1: addcc   size,8-2,size
-       blt     Lend1
-       subcc   %g0,%o4,%g0             ! restore cy
-/* Add blocks of 2 limbs until less than 2 limbs remain */
-Loope1:        subxcc  %g4,%g2,%o4
-       ld      [s1_ptr+8],%g4
-       subxcc  %g1,%g3,%o5
-       ld      [s1_ptr+12],%g1
-       ldd     [s2_ptr+8],%g2
-       std     %o4,[res_ptr+0]
-       addx    %g0,%g0,%o4             ! save cy in register
-       addcc   size,-2,size
-       add     s1_ptr,8,s1_ptr
-       add     s2_ptr,8,s2_ptr
-       add     res_ptr,8,res_ptr
-       bge     Loope1
-       subcc   %g0,%o4,%g0             ! restore cy
-Lend1: subxcc  %g4,%g2,%o4
-       subxcc  %g1,%g3,%o5
-       std     %o4,[res_ptr+0]
-       addx    %g0,%g0,%o4             ! save cy in register
-
-       andcc   size,1,%g0
-       be      Lret1
-       subcc   %g0,%o4,%g0             ! restore cy
-/* Add last limb */
-       ld      [s1_ptr+8],%g4
-       ld      [s2_ptr+8],%g2
-       subxcc  %g4,%g2,%o4
-       st      %o4,[res_ptr+8]
-
-Lret1: retl
-       addx    %g0,%g0,%o0     ! return carry-out from most sign. limb
-
-L1:    xor     s1_ptr,res_ptr,%g1
-       andcc   %g1,4,%g0
-       bne     L2
-       nop
-! **  V1b  **
-       andcc   res_ptr,4,%g0           ! res_ptr unaligned? Side effect: cy=0
-       be      L_v1b                   ! if no, branch
-       nop
-/* Add least significant limb separately to align res_ptr and s1_ptr */
-       ld      [s2_ptr],%g4
-       add     s2_ptr,4,s2_ptr
-       ld      [s1_ptr],%g2
-       add     s1_ptr,4,s1_ptr
-       add     size,-1,size
-       subcc   %g2,%g4,%o4
-       st      %o4,[res_ptr]
-       add     res_ptr,4,res_ptr
-L_v1b: addx    %g0,%g0,%o4             ! save cy in register
-       cmp     size,2                  ! if size < 2 ...
-       bl      Lend2                   ! ... branch to tail code
-       subcc   %g0,%o4,%g0             ! restore cy
-
-       ld      [s2_ptr+0],%g4
-       addcc   size,-10,size
-       ld      [s2_ptr+4],%g1
-       ldd     [s1_ptr+0],%g2
-       blt     Lfin1b
-       subcc   %g0,%o4,%g0             ! restore cy
-/* Add blocks of 8 limbs until less than 8 limbs remain */
-Loop1b:        subxcc  %g2,%g4,%o4
-       ld      [s2_ptr+8],%g4
-       subxcc  %g3,%g1,%o5
-       ld      [s2_ptr+12],%g1
-       ldd     [s1_ptr+8],%g2
-       std     %o4,[res_ptr+0]
-       subxcc  %g2,%g4,%o4
-       ld      [s2_ptr+16],%g4
-       subxcc  %g3,%g1,%o5
-       ld      [s2_ptr+20],%g1
-       ldd     [s1_ptr+16],%g2
-       std     %o4,[res_ptr+8]
-       subxcc  %g2,%g4,%o4
-       ld      [s2_ptr+24],%g4
-       subxcc  %g3,%g1,%o5
-       ld      [s2_ptr+28],%g1
-       ldd     [s1_ptr+24],%g2
-       std     %o4,[res_ptr+16]
-       subxcc  %g2,%g4,%o4
-       ld      [s2_ptr+32],%g4
-       subxcc  %g3,%g1,%o5
-       ld      [s2_ptr+36],%g1
-       ldd     [s1_ptr+32],%g2
-       std     %o4,[res_ptr+24]
-       addx    %g0,%g0,%o4             ! save cy in register
-       addcc   size,-8,size
-       add     s1_ptr,32,s1_ptr
-       add     s2_ptr,32,s2_ptr
-       add     res_ptr,32,res_ptr
-       bge     Loop1b
-       subcc   %g0,%o4,%g0             ! restore cy
-
-Lfin1b:        addcc   size,8-2,size
-       blt     Lend1b
-       subcc   %g0,%o4,%g0             ! restore cy
-/* Add blocks of 2 limbs until less than 2 limbs remain */
-Loope1b:subxcc %g2,%g4,%o4
-       ld      [s2_ptr+8],%g4
-       subxcc  %g3,%g1,%o5
-       ld      [s2_ptr+12],%g1
-       ldd     [s1_ptr+8],%g2
-       std     %o4,[res_ptr+0]
-       addx    %g0,%g0,%o4             ! save cy in register
-       addcc   size,-2,size
-       add     s1_ptr,8,s1_ptr
-       add     s2_ptr,8,s2_ptr
-       add     res_ptr,8,res_ptr
-       bge     Loope1b
-       subcc   %g0,%o4,%g0             ! restore cy
-Lend1b:        subxcc  %g2,%g4,%o4
-       subxcc  %g3,%g1,%o5
-       std     %o4,[res_ptr+0]
-       addx    %g0,%g0,%o4             ! save cy in register
-
-       andcc   size,1,%g0
-       be      Lret1b
-       subcc   %g0,%o4,%g0             ! restore cy
-/* Add last limb */
-       ld      [s2_ptr+8],%g4
-       ld      [s1_ptr+8],%g2
-       subxcc  %g2,%g4,%o4
-       st      %o4,[res_ptr+8]
-
-Lret1b:        retl
-       addx    %g0,%g0,%o0     ! return carry-out from most sign. limb
-
-! **  V2  **
-/* If we come here, the alignment of s1_ptr and res_ptr as well as the
-   alignment of s2_ptr and res_ptr differ.  Since there are only two ways
-   things can be aligned (that we care about) we now know that the alignment
-   of s1_ptr and s2_ptr are the same.  */
-
-L2:    cmp     size,1
-       be      Ljone
-       nop
-       andcc   s1_ptr,4,%g0            ! s1_ptr unaligned? Side effect: cy=0
-       be      L_v2                    ! if no, branch
-       nop
-/* Add least significant limb separately to align s1_ptr and s2_ptr */
-       ld      [s1_ptr],%g4
-       add     s1_ptr,4,s1_ptr
-       ld      [s2_ptr],%g2
-       add     s2_ptr,4,s2_ptr
-       add     size,-1,size
-       subcc   %g4,%g2,%o4
-       st      %o4,[res_ptr]
-       add     res_ptr,4,res_ptr
-
-L_v2:  addx    %g0,%g0,%o4             ! save cy in register
-       addcc   size,-8,size
-       blt     Lfin2
-       subcc   %g0,%o4,%g0             ! restore cy
-/* Add blocks of 8 limbs until less than 8 limbs remain */
-Loop2: ldd     [s1_ptr+0],%g2
-       ldd     [s2_ptr+0],%o4
-       subxcc  %g2,%o4,%g2
-       st      %g2,[res_ptr+0]
-       subxcc  %g3,%o5,%g3
-       st      %g3,[res_ptr+4]
-       ldd     [s1_ptr+8],%g2
-       ldd     [s2_ptr+8],%o4
-       subxcc  %g2,%o4,%g2
-       st      %g2,[res_ptr+8]
-       subxcc  %g3,%o5,%g3
-       st      %g3,[res_ptr+12]
-       ldd     [s1_ptr+16],%g2
-       ldd     [s2_ptr+16],%o4
-       subxcc  %g2,%o4,%g2
-       st      %g2,[res_ptr+16]
-       subxcc  %g3,%o5,%g3
-       st      %g3,[res_ptr+20]
-       ldd     [s1_ptr+24],%g2
-       ldd     [s2_ptr+24],%o4
-       subxcc  %g2,%o4,%g2
-       st      %g2,[res_ptr+24]
-       subxcc  %g3,%o5,%g3
-       st      %g3,[res_ptr+28]
-       addx    %g0,%g0,%o4             ! save cy in register
-       addcc   size,-8,size
-       add     s1_ptr,32,s1_ptr
-       add     s2_ptr,32,s2_ptr
-       add     res_ptr,32,res_ptr
-       bge     Loop2
-       subcc   %g0,%o4,%g0             ! restore cy
-
-Lfin2: addcc   size,8-2,size
-       blt     Lend2
-       subcc   %g0,%o4,%g0             ! restore cy
-Loope2:        ldd     [s1_ptr+0],%g2
-       ldd     [s2_ptr+0],%o4
-       subxcc  %g2,%o4,%g2
-       st      %g2,[res_ptr+0]
-       subxcc  %g3,%o5,%g3
-       st      %g3,[res_ptr+4]
-       addx    %g0,%g0,%o4             ! save cy in register
-       addcc   size,-2,size
-       add     s1_ptr,8,s1_ptr
-       add     s2_ptr,8,s2_ptr
-       add     res_ptr,8,res_ptr
-       bge     Loope2
-       subcc   %g0,%o4,%g0             ! restore cy
-Lend2: andcc   size,1,%g0
-       be      Lret2
-       subcc   %g0,%o4,%g0             ! restore cy
-/* Add last limb */
-Ljone: ld      [s1_ptr],%g4
-       ld      [s2_ptr],%g2
-       subxcc  %g4,%g2,%o4
-       st      %o4,[res_ptr]
-
-Lret2: retl
-       addx    %g0,%g0,%o0     ! return carry-out from most sign. limb
diff --git a/ghc/rts/gmp/mpn/sparc32/submul_1.S b/ghc/rts/gmp/mpn/sparc32/submul_1.S
deleted file mode 100644 (file)
index a8ebd50..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-! SPARC __mpn_submul_1 -- Multiply a limb vector with a limb and subtract
-! the result from a second limb vector.
-
-! Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
-
-! This file is part of the GNU MP Library.
-
-! The GNU MP Library is free software; you can redistribute it and/or modify
-! it under the terms of the GNU Library General Public License as published by
-! the Free Software Foundation; either version 2 of the License, or (at your
-! option) any later version.
-
-! The GNU MP 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 Library General Public
-! License for more details.
-
-! You should have received a copy of the GNU Library General Public License
-! along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-! MA 02111-1307, USA.
-
-
-! INPUT PARAMETERS
-! res_ptr      o0
-! s1_ptr       o1
-! size         o2
-! s2_limb      o3
-
-#include "sysdep.h"
-
-.text
-       .align 4
-       .global C_SYMBOL_NAME(__mpn_submul_1)
-C_SYMBOL_NAME(__mpn_submul_1):
-       ! Make S1_PTR and RES_PTR point at the end of their blocks
-       ! and put (- 4 x SIZE) in index/loop counter.
-       sll     %o2,2,%o2
-       add     %o0,%o2,%o4     ! RES_PTR in o4 since o0 is retval
-       add     %o1,%o2,%o1
-       sub     %g0,%o2,%o2
-
-       cmp     %o3,0xfff
-       bgu     Large
-       nop
-
-       ld      [%o1+%o2],%o5
-       mov     0,%o0
-       b       L0
-        add    %o4,-4,%o4
-Loop0:
-       subcc   %o5,%g1,%g1
-       ld      [%o1+%o2],%o5
-       addx    %o0,%g0,%o0
-       st      %g1,[%o4+%o2]
-L0:    wr      %g0,%o3,%y
-       sra     %o5,31,%g2
-       and     %o3,%g2,%g2
-       andcc   %g1,0,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,%o5,%g1
-       mulscc  %g1,0,%g1
-       sra     %g1,20,%g4
-       sll     %g1,12,%g1
-       rd      %y,%g3
-       srl     %g3,20,%g3
-       or      %g1,%g3,%g1
-
-       addcc   %g1,%o0,%g1
-       addx    %g2,%g4,%o0     ! add sign-compensation and cy to hi limb
-       addcc   %o2,4,%o2       ! loop counter
-       bne     Loop0
-        ld     [%o4+%o2],%o5
-
-       subcc   %o5,%g1,%g1
-       addx    %o0,%g0,%o0
-       retl
-       st      %g1,[%o4+%o2]
-
-
-Large: ld      [%o1+%o2],%o5
-       mov     0,%o0
-       sra     %o3,31,%g4      ! g4 = mask of ones iff S2_LIMB < 0
-       b       L1
-        add    %o4,-4,%o4
-Loop:
-       subcc   %o5,%g3,%g3
-       ld      [%o1+%o2],%o5
-       addx    %o0,%g0,%o0
-       st      %g3,[%o4+%o2]
-L1:    wr      %g0,%o5,%y
-       and     %o5,%g4,%g2
-       andcc   %g0,%g0,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%o3,%g1
-       mulscc  %g1,%g0,%g1
-       rd      %y,%g3
-       addcc   %g3,%o0,%g3
-       addx    %g2,%g1,%o0
-       addcc   %o2,4,%o2
-       bne     Loop
-        ld     [%o4+%o2],%o5
-
-       subcc   %o5,%g3,%g3
-       addx    %o0,%g0,%o0
-       retl
-       st      %g3,[%o4+%o2]
diff --git a/ghc/rts/gmp/mpn/sparc32/udiv_fp.S b/ghc/rts/gmp/mpn/sparc32/udiv_fp.S
deleted file mode 100644 (file)
index d11227d..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-! SPARC v7 __udiv_qrnnd division support, used from longlong.h.
-! This is for v7 CPUs with a floating-point unit.
-
-! Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc.
-
-! This file is part of the GNU MP Library.
-
-! The GNU MP Library is free software; you can redistribute it and/or modify
-! it under the terms of the GNU Library General Public License as published by
-! the Free Software Foundation; either version 2 of the License, or (at your
-! option) any later version.
-
-! The GNU MP 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 Library General Public
-! License for more details.
-
-! You should have received a copy of the GNU Library General Public License
-! along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-! MA 02111-1307, USA.
-
-
-! INPUT PARAMETERS
-! rem_ptr      i0
-! n1           i1
-! n0           i2
-! d            i3
-
-#include "sysdep.h"
-#undef ret     /* Kludge for glibc */
-
-       .text
-       .align  8
-LC0:   .double 0r4294967296
-LC1:   .double 0r2147483648
-
-       .align  4
-       .global C_SYMBOL_NAME(__udiv_qrnnd)
-C_SYMBOL_NAME(__udiv_qrnnd):
-       !#PROLOGUE# 0
-       save    %sp,-104,%sp
-       !#PROLOGUE# 1
-       st      %i1,[%fp-8]
-       ld      [%fp-8],%f10
-       sethi   %hi(LC0),%o7
-       fitod   %f10,%f4
-       ldd     [%o7+%lo(LC0)],%f8
-       cmp     %i1,0
-       bge     L248
-       mov     %i0,%i5
-       faddd   %f4,%f8,%f4
-L248:
-       st      %i2,[%fp-8]
-       ld      [%fp-8],%f10
-       fmuld   %f4,%f8,%f6
-       cmp     %i2,0
-       bge     L249
-       fitod   %f10,%f2
-       faddd   %f2,%f8,%f2
-L249:
-       st      %i3,[%fp-8]
-       faddd   %f6,%f2,%f2
-       ld      [%fp-8],%f10
-       cmp     %i3,0
-       bge     L250
-       fitod   %f10,%f4
-       faddd   %f4,%f8,%f4
-L250:
-       fdivd   %f2,%f4,%f2
-       sethi   %hi(LC1),%o7
-       ldd     [%o7+%lo(LC1)],%f4
-       fcmped  %f2,%f4
-       nop
-       fbge,a  L251
-       fsubd   %f2,%f4,%f2
-       fdtoi   %f2,%f2
-       st      %f2,[%fp-8]
-       b       L252
-       ld      [%fp-8],%i4
-L251:
-       fdtoi   %f2,%f2
-       st      %f2,[%fp-8]
-       ld      [%fp-8],%i4
-       sethi   %hi(-2147483648),%g2
-       xor     %i4,%g2,%i4
-L252:
-       wr      %g0,%i4,%y
-       sra     %i3,31,%g2
-       and     %i4,%g2,%g2
-       andcc   %g0,0,%g1
-       mulscc  %g1,%i3,%g1
-       mulscc  %g1,%i3,%g1
-       mulscc  %g1,%i3,%g1
-       mulscc  %g1,%i3,%g1
-       mulscc  %g1,%i3,%g1
-       mulscc  %g1,%i3,%g1
-       mulscc  %g1,%i3,%g1
-       mulscc  %g1,%i3,%g1
-       mulscc  %g1,%i3,%g1
-       mulscc  %g1,%i3,%g1
-       mulscc  %g1,%i3,%g1
-       mulscc  %g1,%i3,%g1
-       mulscc  %g1,%i3,%g1
-       mulscc  %g1,%i3,%g1
-       mulscc  %g1,%i3,%g1
-       mulscc  %g1,%i3,%g1
-       mulscc  %g1,%i3,%g1
-       mulscc  %g1,%i3,%g1
-       mulscc  %g1,%i3,%g1
-       mulscc  %g1,%i3,%g1
-       mulscc  %g1,%i3,%g1
-       mulscc  %g1,%i3,%g1
-       mulscc  %g1,%i3,%g1
-       mulscc  %g1,%i3,%g1
-       mulscc  %g1,%i3,%g1
-       mulscc  %g1,%i3,%g1
-       mulscc  %g1,%i3,%g1
-       mulscc  %g1,%i3,%g1
-       mulscc  %g1,%i3,%g1
-       mulscc  %g1,%i3,%g1
-       mulscc  %g1,%i3,%g1
-       mulscc  %g1,%i3,%g1
-       mulscc  %g1,0,%g1
-       add     %g1,%g2,%i0
-       rd      %y,%g3
-       subcc   %i2,%g3,%o7
-       subxcc  %i1,%i0,%g0
-       be      L253
-       cmp     %o7,%i3
-
-       add     %i4,-1,%i0
-       add     %o7,%i3,%o7
-       st      %o7,[%i5]
-       ret
-       restore
-L253:
-       blu     L246
-       mov     %i4,%i0
-       add     %i4,1,%i0
-       sub     %o7,%i3,%o7
-L246:
-       st      %o7,[%i5]
-       ret
-       restore
diff --git a/ghc/rts/gmp/mpn/sparc32/udiv_nfp.S b/ghc/rts/gmp/mpn/sparc32/udiv_nfp.S
deleted file mode 100644 (file)
index 118d8a4..0000000
+++ /dev/null
@@ -1,188 +0,0 @@
-! SPARC v7 __udiv_qrnnd division support, used from longlong.h.
-! This is for v7 CPUs without a floating-point unit.
-
-! Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc.
-
-! This file is part of the GNU MP Library.
-
-! The GNU MP Library is free software; you can redistribute it and/or modify
-! it under the terms of the GNU Library General Public License as published by
-! the Free Software Foundation; either version 2 of the License, or (at your
-! option) any later version.
-
-! The GNU MP 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 Library General Public
-! License for more details.
-
-! You should have received a copy of the GNU Library General Public License
-! along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-! MA 02111-1307, USA.
-
-
-! INPUT PARAMETERS
-! rem_ptr      o0
-! n1           o1
-! n0           o2
-! d            o3
-
-#include "sysdep.h"
-
-       .text
-       .align 4
-       .global C_SYMBOL_NAME(__udiv_qrnnd)
-C_SYMBOL_NAME(__udiv_qrnnd):
-       tst     %o3
-       bneg    Largedivisor
-       mov     8,%g1
-
-       b       Lp1
-       addxcc  %o2,%o2,%o2
-
-Lplop: bcc     Ln1
-       addxcc  %o2,%o2,%o2
-Lp1:   addx    %o1,%o1,%o1
-       subcc   %o1,%o3,%o4
-       bcc     Ln2
-       addxcc  %o2,%o2,%o2
-Lp2:   addx    %o1,%o1,%o1
-       subcc   %o1,%o3,%o4
-       bcc     Ln3
-       addxcc  %o2,%o2,%o2
-Lp3:   addx    %o1,%o1,%o1
-       subcc   %o1,%o3,%o4
-       bcc     Ln4
-       addxcc  %o2,%o2,%o2
-Lp4:   addx    %o1,%o1,%o1
-       addcc   %g1,-1,%g1
-       bne     Lplop
-       subcc   %o1,%o3,%o4
-       bcc     Ln5
-       addxcc  %o2,%o2,%o2
-Lp5:   st      %o1,[%o0]
-       retl
-       xnor    %g0,%o2,%o0
-
-Lnlop: bcc     Lp1
-       addxcc  %o2,%o2,%o2
-Ln1:   addx    %o4,%o4,%o4
-       subcc   %o4,%o3,%o1
-       bcc     Lp2
-       addxcc  %o2,%o2,%o2
-Ln2:   addx    %o4,%o4,%o4
-       subcc   %o4,%o3,%o1
-       bcc     Lp3
-       addxcc  %o2,%o2,%o2
-Ln3:   addx    %o4,%o4,%o4
-       subcc   %o4,%o3,%o1
-       bcc     Lp4
-       addxcc  %o2,%o2,%o2
-Ln4:   addx    %o4,%o4,%o4
-       addcc   %g1,-1,%g1
-       bne     Lnlop
-       subcc   %o4,%o3,%o1
-       bcc     Lp5
-       addxcc  %o2,%o2,%o2
-Ln5:   st      %o4,[%o0]
-       retl
-       xnor    %g0,%o2,%o0
-
-Largedivisor:
-       and     %o2,1,%o5       ! %o5 = n0 & 1
-
-       srl     %o2,1,%o2
-       sll     %o1,31,%g2
-       or      %g2,%o2,%o2     ! %o2 = lo(n1n0 >> 1)
-       srl     %o1,1,%o1       ! %o1 = hi(n1n0 >> 1)
-
-       and     %o3,1,%g2
-       srl     %o3,1,%g3       ! %g3 = floor(d / 2)
-       add     %g3,%g2,%g3     ! %g3 = ceil(d / 2)
-
-       b       LLp1
-       addxcc  %o2,%o2,%o2
-
-LLplop:        bcc     LLn1
-       addxcc  %o2,%o2,%o2
-LLp1:  addx    %o1,%o1,%o1
-       subcc   %o1,%g3,%o4
-       bcc     LLn2
-       addxcc  %o2,%o2,%o2
-LLp2:  addx    %o1,%o1,%o1
-       subcc   %o1,%g3,%o4
-       bcc     LLn3
-       addxcc  %o2,%o2,%o2
-LLp3:  addx    %o1,%o1,%o1
-       subcc   %o1,%g3,%o4
-       bcc     LLn4
-       addxcc  %o2,%o2,%o2
-LLp4:  addx    %o1,%o1,%o1
-       addcc   %g1,-1,%g1
-       bne     LLplop
-       subcc   %o1,%g3,%o4
-       bcc     LLn5
-       addxcc  %o2,%o2,%o2
-LLp5:  add     %o1,%o1,%o1     ! << 1
-       tst     %g2
-       bne     Oddp
-       add     %o5,%o1,%o1
-       st      %o1,[%o0]
-       retl
-       xnor    %g0,%o2,%o0
-
-LLnlop:        bcc     LLp1
-       addxcc  %o2,%o2,%o2
-LLn1:  addx    %o4,%o4,%o4
-       subcc   %o4,%g3,%o1
-       bcc     LLp2
-       addxcc  %o2,%o2,%o2
-LLn2:  addx    %o4,%o4,%o4
-       subcc   %o4,%g3,%o1
-       bcc     LLp3
-       addxcc  %o2,%o2,%o2
-LLn3:  addx    %o4,%o4,%o4
-       subcc   %o4,%g3,%o1
-       bcc     LLp4
-       addxcc  %o2,%o2,%o2
-LLn4:  addx    %o4,%o4,%o4
-       addcc   %g1,-1,%g1
-       bne     LLnlop
-       subcc   %o4,%g3,%o1
-       bcc     LLp5
-       addxcc  %o2,%o2,%o2
-LLn5:  add     %o4,%o4,%o4     ! << 1
-       tst     %g2
-       bne     Oddn
-       add     %o5,%o4,%o4
-       st      %o4,[%o0]
-       retl
-       xnor    %g0,%o2,%o0
-
-Oddp:  xnor    %g0,%o2,%o2
-       ! q' in %o2. r' in %o1
-       addcc   %o1,%o2,%o1
-       bcc     LLp6
-       addx    %o2,0,%o2
-       sub     %o1,%o3,%o1
-LLp6:  subcc   %o1,%o3,%g0
-       bcs     LLp7
-       subx    %o2,-1,%o2
-       sub     %o1,%o3,%o1
-LLp7:  st      %o1,[%o0]
-       retl
-       mov     %o2,%o0
-
-Oddn:  xnor    %g0,%o2,%o2
-       ! q' in %o2. r' in %o4
-       addcc   %o4,%o2,%o4
-       bcc     LLn6
-       addx    %o2,0,%o2
-       sub     %o4,%o3,%o4
-LLn6:  subcc   %o4,%o3,%g0
-       bcs     LLn7
-       subx    %o2,-1,%o2
-       sub     %o4,%o3,%o4
-LLn7:  st      %o4,[%o0]
-       retl
-       mov     %o2,%o0
diff --git a/ghc/rts/gmp/mpn/sparc32/v8/addmul_1.S b/ghc/rts/gmp/mpn/sparc32/v8/addmul_1.S
deleted file mode 100644 (file)
index fb9ea7c..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-! SPARC v8 __mpn_addmul_1 -- Multiply a limb vector with a limb and
-! add the result to a second limb vector.
-
-! Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
-
-! This file is part of the GNU MP Library.
-
-! The GNU MP Library is free software; you can redistribute it and/or modify
-! it under the terms of the GNU Library General Public License as published by
-! the Free Software Foundation; either version 2 of the License, or (at your
-! option) any later version.
-
-! The GNU MP 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 Library General Public
-! License for more details.
-
-! You should have received a copy of the GNU Library General Public License
-! along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-! MA 02111-1307, USA.
-
-
-! INPUT PARAMETERS
-! res_ptr      o0
-! s1_ptr       o1
-! size         o2
-! s2_limb      o3
-
-#include "sysdep.h"
-
-.text
-       .align 4
-       .global C_SYMBOL_NAME(__mpn_addmul_1)
-C_SYMBOL_NAME(__mpn_addmul_1):
-       orcc    %g0,%g0,%g2
-       ld      [%o1+0],%o4     ! 1
-
-       sll     %o2,4,%g1
-       and     %g1,(4-1)<<4,%g1
-#if PIC
-       mov     %o7,%g4                 ! Save return address register
-       call    1f
-       add     %o7,LL-1f,%g3
-1:     mov     %g4,%o7                 ! Restore return address register
-#else
-       sethi   %hi(LL),%g3
-       or      %g3,%lo(LL),%g3
-#endif
-       jmp     %g3+%g1
-       nop
-LL:
-LL00:  add     %o0,-4,%o0
-       b       Loop00          /* 4, 8, 12, ... */
-       add     %o1,-4,%o1
-       nop
-LL01:  b       Loop01          /* 1, 5, 9, ... */
-       nop
-       nop
-       nop
-LL10:  add     %o0,-12,%o0     /* 2, 6, 10, ... */
-       b       Loop10
-       add     %o1,4,%o1
-       nop
-LL11:  add     %o0,-8,%o0      /* 3, 7, 11, ... */
-       b       Loop11
-       add     %o1,-8,%o1
-       nop
-
-1:     addcc   %g3,%g2,%g3     ! 1
-       ld      [%o1+4],%o4     ! 2
-       rd      %y,%g2          ! 1
-       addx    %g0,%g2,%g2
-       ld      [%o0+0],%g1     ! 2
-       addcc   %g1,%g3,%g3
-       st      %g3,[%o0+0]     ! 1
-Loop00:        umul    %o4,%o3,%g3     ! 2
-       ld      [%o0+4],%g1     ! 2
-       addxcc  %g3,%g2,%g3     ! 2
-       ld      [%o1+8],%o4     ! 3
-       rd      %y,%g2          ! 2
-       addx    %g0,%g2,%g2
-       nop
-       addcc   %g1,%g3,%g3
-       st      %g3,[%o0+4]     ! 2
-Loop11:        umul    %o4,%o3,%g3     ! 3
-       addxcc  %g3,%g2,%g3     ! 3
-       ld      [%o1+12],%o4    ! 4
-       rd      %y,%g2          ! 3
-       add     %o1,16,%o1
-       addx    %g0,%g2,%g2
-       ld      [%o0+8],%g1     ! 2
-       addcc   %g1,%g3,%g3
-       st      %g3,[%o0+8]     ! 3
-Loop10:        umul    %o4,%o3,%g3     ! 4
-       addxcc  %g3,%g2,%g3     ! 4
-       ld      [%o1+0],%o4     ! 1
-       rd      %y,%g2          ! 4
-       addx    %g0,%g2,%g2
-       ld      [%o0+12],%g1    ! 2
-       addcc   %g1,%g3,%g3
-       st      %g3,[%o0+12]    ! 4
-       add     %o0,16,%o0
-       addx    %g0,%g2,%g2
-Loop01:        addcc   %o2,-4,%o2
-       bg      1b
-       umul    %o4,%o3,%g3     ! 1
-
-       addcc   %g3,%g2,%g3     ! 4
-       rd      %y,%g2          ! 4
-       addx    %g0,%g2,%g2
-       ld      [%o0+0],%g1     ! 2
-       addcc   %g1,%g3,%g3
-       st      %g3,[%o0+0]     ! 4
-       addx    %g0,%g2,%o0
-
-       retl
-        nop
-
-
-!      umul, ld, addxcc, rd, st
-
-!      umul, ld, addxcc, rd, ld, addcc, st, addx
-
diff --git a/ghc/rts/gmp/mpn/sparc32/v8/mul_1.S b/ghc/rts/gmp/mpn/sparc32/v8/mul_1.S
deleted file mode 100644 (file)
index b641feb..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-! SPARC v8 __mpn_mul_1 -- Multiply a limb vector with a single limb and
-! store the product in a second limb vector.
-
-! Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
-
-! This file is part of the GNU MP Library.
-
-! The GNU MP Library is free software; you can redistribute it and/or modify
-! it under the terms of the GNU Library General Public License as published by
-! the Free Software Foundation; either version 2 of the License, or (at your
-! option) any later version.
-
-! The GNU MP 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 Library General Public
-! License for more details.
-
-! You should have received a copy of the GNU Library General Public License
-! along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-! MA 02111-1307, USA.
-
-
-! INPUT PARAMETERS
-! res_ptr      o0
-! s1_ptr       o1
-! size         o2
-! s2_limb      o3
-
-#include "sysdep.h"
-
-.text
-       .align  8
-       .global C_SYMBOL_NAME(__mpn_mul_1)
-C_SYMBOL_NAME(__mpn_mul_1):
-       sll     %o2,4,%g1
-       and     %g1,(4-1)<<4,%g1
-#if PIC
-       mov     %o7,%g4                 ! Save return address register
-       call    1f
-       add     %o7,LL-1f,%g3
-1:     mov     %g4,%o7                 ! Restore return address register
-#else
-       sethi   %hi(LL),%g3
-       or      %g3,%lo(LL),%g3
-#endif
-       jmp     %g3+%g1
-       ld      [%o1+0],%o4     ! 1
-LL:
-LL00:  add     %o0,-4,%o0
-       add     %o1,-4,%o1
-       b       Loop00          /* 4, 8, 12, ... */
-       orcc    %g0,%g0,%g2
-LL01:  b       Loop01          /* 1, 5, 9, ... */
-       orcc    %g0,%g0,%g2
-       nop
-       nop
-LL10:  add     %o0,-12,%o0     /* 2, 6, 10, ... */
-       add     %o1,4,%o1
-       b       Loop10
-       orcc    %g0,%g0,%g2
-       nop
-LL11:  add     %o0,-8,%o0      /* 3, 7, 11, ... */
-       add     %o1,-8,%o1
-       b       Loop11
-       orcc    %g0,%g0,%g2
-
-Loop:  addcc   %g3,%g2,%g3     ! 1
-       ld      [%o1+4],%o4     ! 2
-       st      %g3,[%o0+0]     ! 1
-       rd      %y,%g2          ! 1
-Loop00:        umul    %o4,%o3,%g3     ! 2
-       addxcc  %g3,%g2,%g3     ! 2
-       ld      [%o1+8],%o4     ! 3
-       st      %g3,[%o0+4]     ! 2
-       rd      %y,%g2          ! 2
-Loop11:        umul    %o4,%o3,%g3     ! 3
-       addxcc  %g3,%g2,%g3     ! 3
-       ld      [%o1+12],%o4    ! 4
-       add     %o1,16,%o1
-       st      %g3,[%o0+8]     ! 3
-       rd      %y,%g2          ! 3
-Loop10:        umul    %o4,%o3,%g3     ! 4
-       addxcc  %g3,%g2,%g3     ! 4
-       ld      [%o1+0],%o4     ! 1
-       st      %g3,[%o0+12]    ! 4
-       add     %o0,16,%o0
-       rd      %y,%g2          ! 4
-       addx    %g0,%g2,%g2
-Loop01:        addcc   %o2,-4,%o2
-       bg      Loop
-       umul    %o4,%o3,%g3     ! 1
-
-       addcc   %g3,%g2,%g3     ! 4
-       st      %g3,[%o0+0]     ! 4
-       rd      %y,%g2          ! 4
-
-       retl
-       addx    %g0,%g2,%o0
diff --git a/ghc/rts/gmp/mpn/sparc32/v8/submul_1.S b/ghc/rts/gmp/mpn/sparc32/v8/submul_1.S
deleted file mode 100644 (file)
index e40119d..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-! SPARC v8 __mpn_submul_1 -- Multiply a limb vector with a limb and
-! subtract the result from a second limb vector.
-
-! Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
-
-! This file is part of the GNU MP Library.
-
-! The GNU MP Library is free software; you can redistribute it and/or modify
-! it under the terms of the GNU Library General Public License as published by
-! the Free Software Foundation; either version 2 of the License, or (at your
-! option) any later version.
-
-! The GNU MP 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 Library General Public
-! License for more details.
-
-! You should have received a copy of the GNU Library General Public License
-! along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-! MA 02111-1307, USA.
-
-
-! INPUT PARAMETERS
-! res_ptr      o0
-! s1_ptr       o1
-! size         o2
-! s2_limb      o3
-
-#include "sysdep.h"
-
-.text
-       .align 4
-       .global C_SYMBOL_NAME(__mpn_submul_1)
-C_SYMBOL_NAME(__mpn_submul_1):
-       sub     %g0,%o2,%o2             ! negate ...
-       sll     %o2,2,%o2               ! ... and scale size
-       sub     %o1,%o2,%o1             ! o1 is offset s1_ptr
-       sub     %o0,%o2,%g1             ! g1 is offset res_ptr
-
-       mov     0,%o0                   ! clear cy_limb
-
-Loop:  ld      [%o1+%o2],%o4
-       ld      [%g1+%o2],%g2
-       umul    %o4,%o3,%o5
-       rd      %y,%g3
-       addcc   %o5,%o0,%o5
-       addx    %g3,0,%o0
-       subcc   %g2,%o5,%g2
-       addx    %o0,0,%o0
-       st      %g2,[%g1+%o2]
-
-       addcc   %o2,4,%o2
-       bne     Loop
-        nop
-
-       retl
-        nop
diff --git a/ghc/rts/gmp/mpn/sparc32/v8/supersparc/udiv.S b/ghc/rts/gmp/mpn/sparc32/v8/supersparc/udiv.S
deleted file mode 100644 (file)
index ed688ee..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-! SuperSPARC __udiv_qrnnd division support, used from longlong.h.
-! This is for SuperSPARC only, to compensate for its semi-functional
-! udiv instruction.
-
-! Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc.
-
-! This file is part of the GNU MP Library.
-
-! The GNU MP Library is free software; you can redistribute it and/or modify
-! it under the terms of the GNU Library General Public License as published by
-! the Free Software Foundation; either version 2 of the License, or (at your
-! option) any later version.
-
-! The GNU MP 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 Library General Public
-! License for more details.
-
-! You should have received a copy of the GNU Library General Public License
-! along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-! MA 02111-1307, USA.
-
-
-! INPUT PARAMETERS
-! rem_ptr      i0
-! n1           i1
-! n0           i2
-! d            i3
-
-#include "sysdep.h"
-#undef ret     /* Kludge for glibc */
-
-       .text
-       .align  8
-LC0:   .double 0r4294967296
-LC1:   .double 0r2147483648
-
-       .align  4
-       .global C_SYMBOL_NAME(__udiv_qrnnd)
-C_SYMBOL_NAME(__udiv_qrnnd):
-       !#PROLOGUE# 0
-       save    %sp,-104,%sp
-       !#PROLOGUE# 1
-       st      %i1,[%fp-8]
-       ld      [%fp-8],%f10
-       sethi   %hi(LC0),%o7
-       fitod   %f10,%f4
-       ldd     [%o7+%lo(LC0)],%f8
-       cmp     %i1,0
-       bge     L248
-       mov     %i0,%i5
-       faddd   %f4,%f8,%f4
-L248:
-       st      %i2,[%fp-8]
-       ld      [%fp-8],%f10
-       fmuld   %f4,%f8,%f6
-       cmp     %i2,0
-       bge     L249
-       fitod   %f10,%f2
-       faddd   %f2,%f8,%f2
-L249:
-       st      %i3,[%fp-8]
-       faddd   %f6,%f2,%f2
-       ld      [%fp-8],%f10
-       cmp     %i3,0
-       bge     L250
-       fitod   %f10,%f4
-       faddd   %f4,%f8,%f4
-L250:
-       fdivd   %f2,%f4,%f2
-       sethi   %hi(LC1),%o7
-       ldd     [%o7+%lo(LC1)],%f4
-       fcmped  %f2,%f4
-       nop
-       fbge,a  L251
-       fsubd   %f2,%f4,%f2
-       fdtoi   %f2,%f2
-       st      %f2,[%fp-8]
-       b       L252
-       ld      [%fp-8],%i4
-L251:
-       fdtoi   %f2,%f2
-       st      %f2,[%fp-8]
-       ld      [%fp-8],%i4
-       sethi   %hi(-2147483648),%g2
-       xor     %i4,%g2,%i4
-L252:
-       umul    %i3,%i4,%g3
-       rd      %y,%i0
-       subcc   %i2,%g3,%o7
-       subxcc  %i1,%i0,%g0
-       be      L253
-       cmp     %o7,%i3
-
-       add     %i4,-1,%i0
-       add     %o7,%i3,%o7
-       st      %o7,[%i5]
-       ret
-       restore
-L253:
-       blu     L246
-       mov     %i4,%i0
-       add     %i4,1,%i0
-       sub     %o7,%i3,%o7
-L246:
-       st      %o7,[%i5]
-       ret
-       restore
diff --git a/ghc/rts/gmp/mpn/sparc64/add_n.s b/ghc/rts/gmp/mpn/sparc64/add_n.s
deleted file mode 100644 (file)
index 01d1f49..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-! SPARC v9 __mpn_add_n -- Add two limb vectors of the same length > 0 and store
-! sum in a third limb vector.
-
-! Copyright (C) 1995, 1996 Free Software Foundation, Inc.
-
-! This file is part of the GNU MP Library.
-
-! The GNU MP Library is free software; you can redistribute it and/or modify
-! it under the terms of the GNU Library General Public License as published by
-! the Free Software Foundation; either version 2 of the License, or (at your
-! option) any later version.
-
-! The GNU MP 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 Library General Public
-! License for more details.
-
-! You should have received a copy of the GNU Library General Public License
-! along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-! MA 02111-1307, USA.
-
-
-! INPUT PARAMETERS
-! res_ptr      %o0
-! s1_ptr       %o1
-! s2_ptr       %o2
-! size         %o3
-
-.section       ".text"
-       .align 4
-       .global __mpn_add_n
-       .type    __mpn_add_n,#function
-       .proc   04
-__mpn_add_n:
-       sub %g0,%o3,%g3
-       sllx %o3,3,%g1
-       add %o1,%g1,%o1                 ! make s1_ptr point at end
-       add %o2,%g1,%o2                 ! make s2_ptr point at end
-       add %o0,%g1,%o0                 ! make res_ptr point at end
-       mov 0,%o4                       ! clear carry variable
-       sllx %g3,3,%o5                  ! compute initial address index
-
-.Loop: ldx [%o2+%o5],%g1               ! load s2 limb
-       add %g3,1,%g3                   ! increment loop count
-       ldx [%o1+%o5],%g2               ! load s1 limb
-       addcc %g1,%o4,%g1               ! add s2 limb and carry variable
-       movcc %xcc,0,%o4                ! if carry-out, o4 was 1; clear it
-       addcc %g1,%g2,%g1               ! add s1 limb to sum
-       stx %g1,[%o0+%o5]               ! store result
-       add %o5,8,%o5                   ! increment address index
-       brnz,pt %g3,.Loop
-       movcs %xcc,1,%o4                ! if s1 add gave carry, record it
-
-       retl
-       mov %o4,%o0
-.LLfe1:
-       .size    __mpn_add_n,.LLfe1-__mpn_add_n
diff --git a/ghc/rts/gmp/mpn/sparc64/addmul_1.s b/ghc/rts/gmp/mpn/sparc64/addmul_1.s
deleted file mode 100644 (file)
index 8d86390..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-! SPARC v9 __mpn_addmul_1 -- Multiply a limb vector with a single limb and
-! add the product to a second limb vector.
-
-! Copyright (C) 1996 Free Software Foundation, Inc.
-
-! This file is part of the GNU MP Library.
-
-! The GNU MP Library is free software; you can redistribute it and/or modify
-! it under the terms of the GNU Library General Public License as published by
-! the Free Software Foundation; either version 2 of the License, or (at your
-! option) any later version.
-
-! The GNU MP 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 Library General Public
-! License for more details.
-
-! You should have received a copy of the GNU Library General Public License
-! along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-! MA 02111-1307, USA.
-
-
-! INPUT PARAMETERS
-! res_ptr      o0
-! s1_ptr       o1
-! size         o2
-! s2_limb      o3
-
-.section       ".text"
-       .align 4
-       .global __mpn_addmul_1
-       .type    __mpn_addmul_1,#function
-       .proc   016
-__mpn_addmul_1:
-       !#PROLOGUE#     0
-       save    %sp,-160,%sp
-       !#PROLOGUE#     1
-       sub     %g0,%i2,%o7
-       sllx    %o7,3,%g5
-       sub     %i1,%g5,%o3
-       sub     %i0,%g5,%o4
-       mov     0,%o0                   ! zero cy_limb
-
-       srl     %i3,0,%o1               ! extract low 32 bits of s2_limb
-       srlx    %i3,32,%i3              ! extract high 32 bits of s2_limb
-       mov     1,%o2
-       sllx    %o2,32,%o2              ! o2 = 0x100000000
-
-       !   hi   !
-             !  mid-1 !
-             !  mid-2 !
-                !   lo   !
-.Loop:
-       sllx    %o7,3,%g1
-       ldx     [%o3+%g1],%g5
-       srl     %g5,0,%i0               ! zero hi bits
-       srlx    %g5,32,%g5
-       mulx    %o1,%i0,%i4             ! lo product
-       mulx    %i3,%i0,%i1             ! mid-1 product
-       mulx    %o1,%g5,%l2             ! mid-2 product
-       mulx    %i3,%g5,%i5             ! hi product
-       srlx    %i4,32,%i0              ! extract high 32 bits of lo product...
-       add     %i1,%i0,%i1             ! ...and add it to the mid-1 product
-       addcc   %i1,%l2,%i1             ! add mid products
-       mov     0,%l0                   ! we need the carry from that add...
-       movcs   %xcc,%o2,%l0            ! ...compute it and...
-       add     %i5,%l0,%i5             ! ...add to bit 32 of the hi product
-       sllx    %i1,32,%i0              ! align low bits of mid product
-       srl     %i4,0,%g5               ! zero high 32 bits of lo product
-       add     %i0,%g5,%i0             ! combine into low 64 bits of result
-       srlx    %i1,32,%i1              ! extract high bits of mid product...
-       add     %i5,%i1,%i1             ! ...and add them to the high result
-       addcc   %i0,%o0,%i0             ! add cy_limb to low 64 bits of result
-       mov     0,%g5
-       movcs   %xcc,1,%g5
-       add     %o7,1,%o7
-       ldx     [%o4+%g1],%l1
-       addcc   %l1,%i0,%i0
-       movcs   %xcc,1,%g5
-       stx     %i0,[%o4+%g1]
-       brnz    %o7,.Loop
-       add     %i1,%g5,%o0             ! compute new cy_limb
-
-       mov     %o0,%i0
-       ret
-       restore
-.LLfe1:
-       .size  __mpn_addmul_1,.LLfe1-__mpn_addmul_1
diff --git a/ghc/rts/gmp/mpn/sparc64/lshift.s b/ghc/rts/gmp/mpn/sparc64/lshift.s
deleted file mode 100644 (file)
index ad1f667..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-! SPARC v9 __mpn_lshift --
-
-! Copyright (C) 1996 Free Software Foundation, Inc.
-
-! This file is part of the GNU MP Library.
-
-! The GNU MP Library is free software; you can redistribute it and/or modify
-! it under the terms of the GNU Library General Public License as published by
-! the Free Software Foundation; either version 2 of the License, or (at your
-! option) any later version.
-
-! The GNU MP 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 Library General Public
-! License for more details.
-
-! You should have received a copy of the GNU Library General Public License
-! along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-! MA 02111-1307, USA.
-
-
-! INPUT PARAMETERS
-! res_ptr      %o0
-! src_ptr      %o1
-! size         %o2
-! cnt          %o3
-
-.section       ".text"
-       .align 4
-       .global __mpn_lshift
-       .type    __mpn_lshift,#function
-       .proc   04
-__mpn_lshift:
-       sllx    %o2,3,%g1
-       add     %o1,%g1,%o1     ! make %o1 point at end of src
-       ldx     [%o1-8],%g2     ! load first limb
-       sub     %g0,%o3,%o5     ! negate shift count
-       add     %o0,%g1,%o0     ! make %o0 point at end of res
-       add     %o2,-1,%o2
-       and     %o2,4-1,%g4     ! number of limbs in first loop
-       srlx    %g2,%o5,%g1     ! compute function result
-       brz,pn  %g4,.L0         ! if multiple of 4 limbs, skip first loop
-       stx     %g1,[%sp+80]
-
-       sub     %o2,%g4,%o2     ! adjust count for main loop
-
-.Loop0:        ldx     [%o1-16],%g3
-       add     %o0,-8,%o0
-       add     %o1,-8,%o1
-       add     %g4,-1,%g4
-       sllx    %g2,%o3,%o4
-       srlx    %g3,%o5,%g1
-       mov     %g3,%g2
-       or      %o4,%g1,%o4
-       brnz,pt %g4,.Loop0
-        stx    %o4,[%o0+0]
-
-.L0:   brz,pn  %o2,.Lend
-        nop
-
-.Loop: ldx     [%o1-16],%g3
-       add     %o0,-32,%o0
-       add     %o2,-4,%o2
-       sllx    %g2,%o3,%o4
-       srlx    %g3,%o5,%g1
-
-       ldx     [%o1-24],%g2
-       sllx    %g3,%o3,%g4
-       or      %o4,%g1,%o4
-       stx     %o4,[%o0+24]
-       srlx    %g2,%o5,%g1
-
-       ldx     [%o1-32],%g3
-       sllx    %g2,%o3,%o4
-       or      %g4,%g1,%g4
-       stx     %g4,[%o0+16]
-       srlx    %g3,%o5,%g1
-
-       ldx     [%o1-40],%g2
-       sllx    %g3,%o3,%g4
-       or      %o4,%g1,%o4
-       stx     %o4,[%o0+8]
-       srlx    %g2,%o5,%g1
-
-       add     %o1,-32,%o1
-       or      %g4,%g1,%g4
-       brnz,pt %o2,.Loop
-        stx    %g4,[%o0+0]
-
-.Lend: sllx    %g2,%o3,%g2
-       stx     %g2,[%o0-8]
-       retl
-       ldx     [%sp+80],%o0
-.LLfe1:
-       .size    __mpn_lshift,.LLfe1-__mpn_lshift
diff --git a/ghc/rts/gmp/mpn/sparc64/mul_1.s b/ghc/rts/gmp/mpn/sparc64/mul_1.s
deleted file mode 100644 (file)
index 91d6eb0..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-! SPARC v9 __mpn_mul_1 -- Multiply a limb vector with a single limb and
-! store the product in a second limb vector.
-
-! Copyright (C) 1995, 1996 Free Software Foundation, Inc.
-
-! This file is part of the GNU MP Library.
-
-! The GNU MP Library is free software; you can redistribute it and/or modify
-! it under the terms of the GNU Library General Public License as published by
-! the Free Software Foundation; either version 2 of the License, or (at your
-! option) any later version.
-
-! The GNU MP 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 Library General Public
-! License for more details.
-
-! You should have received a copy of the GNU Library General Public License
-! along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-! MA 02111-1307, USA.
-
-
-! INPUT PARAMETERS
-! res_ptr      o0
-! s1_ptr       o1
-! size         o2
-! s2_limb      o3
-
-.section       ".text"
-       .align 4
-       .global __mpn_mul_1
-       .type    __mpn_mul_1,#function
-       .proc   016
-__mpn_mul_1:
-       !#PROLOGUE#     0
-       save    %sp,-160,%sp
-       !#PROLOGUE#     1
-       sub     %g0,%i2,%o7
-       sllx    %o7,3,%g5
-       sub     %i1,%g5,%o3
-       sub     %i0,%g5,%o4
-       mov     0,%o0                   ! zero cy_limb
-
-       srl     %i3,0,%o1               ! extract low 32 bits of s2_limb
-       srlx    %i3,32,%i3              ! extract high 32 bits of s2_limb
-       mov     1,%o2
-       sllx    %o2,32,%o2              ! o2 = 0x100000000
-
-       !   hi   !
-             !  mid-1 !
-             !  mid-2 !
-                !   lo   !
-.Loop:
-       sllx    %o7,3,%g1
-       ldx     [%o3+%g1],%g5
-       srl     %g5,0,%i0               ! zero hi bits
-       srlx    %g5,32,%g5
-       mulx    %o1,%i0,%i4             ! lo product
-       mulx    %i3,%i0,%i1             ! mid-1 product
-       mulx    %o1,%g5,%l2             ! mid-2 product
-       mulx    %i3,%g5,%i5             ! hi product
-       srlx    %i4,32,%i0              ! extract high 32 bits of lo product...
-       add     %i1,%i0,%i1             ! ...and add it to the mid-1 product
-       addcc   %i1,%l2,%i1             ! add mid products
-       mov     0,%l0                   ! we need the carry from that add...
-       movcs   %xcc,%o2,%l0            ! ...compute it and...
-       add     %i5,%l0,%i5             ! ...add to bit 32 of the hi product
-       sllx    %i1,32,%i0              ! align low bits of mid product
-       srl     %i4,0,%g5               ! zero high 32 bits of lo product
-       add     %i0,%g5,%i0             ! combine into low 64 bits of result
-       srlx    %i1,32,%i1              ! extract high bits of mid product...
-       add     %i5,%i1,%i1             ! ...and add them to the high result
-       addcc   %i0,%o0,%i0             ! add cy_limb to low 64 bits of result
-       mov     0,%g5
-       movcs   %xcc,1,%g5
-       add     %o7,1,%o7
-       stx     %i0,[%o4+%g1]
-       brnz    %o7,.Loop
-       add     %i1,%g5,%o0             ! compute new cy_limb
-
-       mov     %o0,%i0
-       ret
-       restore
-.LLfe1:
-       .size  __mpn_mul_1,.LLfe1-__mpn_mul_1
diff --git a/ghc/rts/gmp/mpn/sparc64/rshift.s b/ghc/rts/gmp/mpn/sparc64/rshift.s
deleted file mode 100644 (file)
index ff6a380..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-! SPARC v9 __mpn_rshift --
-
-! Copyright (C) 1996 Free Software Foundation, Inc.
-
-! This file is part of the GNU MP Library.
-
-! The GNU MP Library is free software; you can redistribute it and/or modify
-! it under the terms of the GNU Library General Public License as published by
-! the Free Software Foundation; either version 2 of the License, or (at your
-! option) any later version.
-
-! The GNU MP 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 Library General Public
-! License for more details.
-
-! You should have received a copy of the GNU Library General Public License
-! along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-! MA 02111-1307, USA.
-
-
-! INPUT PARAMETERS
-! res_ptr      %o0
-! src_ptr      %o1
-! size         %o2
-! cnt          %o3
-
-.section       ".text"
-       .align  4
-       .global __mpn_rshift
-       .type   __mpn_rshift,#function
-       .proc   04
-__mpn_rshift:
-       ldx     [%o1],%g2       ! load first limb
-       sub     %g0,%o3,%o5     ! negate shift count
-       add     %o2,-1,%o2
-       and     %o2,4-1,%g4     ! number of limbs in first loop
-       sllx    %g2,%o5,%g1     ! compute function result
-       brz,pn  %g4,.L0         ! if multiple of 4 limbs, skip first loop
-       stx     %g1,[%sp+80]
-
-       sub     %o2,%g4,%o2     ! adjust count for main loop
-
-.Loop0:        ldx     [%o1+8],%g3
-       add     %o0,8,%o0
-       add     %o1,8,%o1
-       add     %g4,-1,%g4
-       srlx    %g2,%o3,%o4
-       sllx    %g3,%o5,%g1
-       mov     %g3,%g2
-       or      %o4,%g1,%o4
-       brnz,pt %g4,.Loop0
-        stx    %o4,[%o0-8]
-
-.L0:   brz,pn  %o2,.Lend
-        nop
-
-.Loop: ldx     [%o1+8],%g3
-       add     %o0,32,%o0
-       add     %o2,-4,%o2
-       srlx    %g2,%o3,%o4
-       sllx    %g3,%o5,%g1
-
-       ldx     [%o1+16],%g2
-       srlx    %g3,%o3,%g4
-       or      %o4,%g1,%o4
-       stx     %o4,[%o0-32]
-       sllx    %g2,%o5,%g1
-
-       ldx     [%o1+24],%g3
-       srlx    %g2,%o3,%o4
-       or      %g4,%g1,%g4
-       stx     %g4,[%o0-24]
-       sllx    %g3,%o5,%g1
-
-       ldx     [%o1+32],%g2
-       srlx    %g3,%o3,%g4
-       or      %o4,%g1,%o4
-       stx     %o4,[%o0-16]
-       sllx    %g2,%o5,%g1
-
-       add     %o1,32,%o1
-       or      %g4,%g1,%g4
-       brnz    %o2,.Loop
-        stx    %g4,[%o0-8]
-
-.Lend: srlx    %g2,%o3,%g2
-       stx     %g2,[%o0-0]
-       retl
-       ldx     [%sp+80],%o0
-.LLfe1:
-       .size   __mpn_rshift,.LLfe1-__mpn_rshift
diff --git a/ghc/rts/gmp/mpn/sparc64/sub_n.s b/ghc/rts/gmp/mpn/sparc64/sub_n.s
deleted file mode 100644 (file)
index d4842b8..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-! SPARC v9 __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
-! store difference in a third limb vector.
-
-! Copyright (C) 1995, 1996 Free Software Foundation, Inc.
-
-! This file is part of the GNU MP Library.
-
-! The GNU MP Library is free software; you can redistribute it and/or modify
-! it under the terms of the GNU Library General Public License as published by
-! the Free Software Foundation; either version 2 of the License, or (at your
-! option) any later version.
-
-! The GNU MP 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 Library General Public
-! License for more details.
-
-! You should have received a copy of the GNU Library General Public License
-! along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-! MA 02111-1307, USA.
-
-
-! INPUT PARAMETERS
-! res_ptr      %o0
-! s1_ptr       %o1
-! s2_ptr       %o2
-! size         %o3
-
-.section       ".text"
-       .align 4
-       .global __mpn_sub_n
-       .type    __mpn_sub_n,#function
-       .proc   04
-__mpn_sub_n:
-       sub %g0,%o3,%g3
-       sllx %o3,3,%g1
-       add %o1,%g1,%o1                 ! make s1_ptr point at end
-       add %o2,%g1,%o2                 ! make s2_ptr point at end
-       add %o0,%g1,%o0                 ! make res_ptr point at end
-       mov 0,%o4                       ! clear carry variable
-       sllx %g3,3,%o5                  ! compute initial address index
-
-.Loop: ldx [%o2+%o5],%g1               ! load s2 limb
-       add %g3,1,%g3                   ! increment loop count
-       ldx [%o1+%o5],%g2               ! load s1 limb
-       addcc %g1,%o4,%g1               ! add s2 limb and carry variable
-       movcc %xcc,0,%o4                ! if carry-out, o4 was 1; clear it
-       subcc %g1,%g2,%g1               ! subtract s1 limb from sum
-       stx %g1,[%o0+%o5]               ! store result
-       add %o5,8,%o5                   ! increment address index
-       brnz,pt %g3,.Loop
-       movcs %xcc,1,%o4                ! if s1 subtract gave carry, record it
-
-       retl
-       mov %o4,%o0
-.LLfe1:
-       .size    __mpn_sub_n,.LLfe1-__mpn_sub_n
diff --git a/ghc/rts/gmp/mpn/sparc64/submul_1.s b/ghc/rts/gmp/mpn/sparc64/submul_1.s
deleted file mode 100644 (file)
index e796243..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-! SPARC v9 __mpn_submul_1 -- Multiply a limb vector with a single limb and
-! subtract the product from a second limb vector.
-
-! Copyright (C) 1996 Free Software Foundation, Inc.
-
-! This file is part of the GNU MP Library.
-
-! The GNU MP Library is free software; you can redistribute it and/or modify
-! it under the terms of the GNU Library General Public License as published by
-! the Free Software Foundation; either version 2 of the License, or (at your
-! option) any later version.
-
-! The GNU MP 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 Library General Public
-! License for more details.
-
-! You should have received a copy of the GNU Library General Public License
-! along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-! MA 02111-1307, USA.
-
-
-! INPUT PARAMETERS
-! res_ptr      o0
-! s1_ptr       o1
-! size         o2
-! s2_limb      o3
-
-.section       ".text"
-       .align 4
-       .global __mpn_submul_1
-       .type    __mpn_submul_1,#function
-       .proc   016
-__mpn_submul_1:
-       !#PROLOGUE#     0
-       save    %sp,-160,%sp
-       !#PROLOGUE#     1
-       sub     %g0,%i2,%o7
-       sllx    %o7,3,%g5
-       sub     %i1,%g5,%o3
-       sub     %i0,%g5,%o4
-       mov     0,%o0                   ! zero cy_limb
-
-       srl     %i3,0,%o1               ! extract low 32 bits of s2_limb
-       srlx    %i3,32,%i3              ! extract high 32 bits of s2_limb
-       mov     1,%o2
-       sllx    %o2,32,%o2              ! o2 = 0x100000000
-
-       !   hi   !
-             !  mid-1 !
-             !  mid-2 !
-                !   lo   !
-.Loop:
-       sllx    %o7,3,%g1
-       ldx     [%o3+%g1],%g5
-       srl     %g5,0,%i0               ! zero hi bits
-       srlx    %g5,32,%g5
-       mulx    %o1,%i0,%i4             ! lo product
-       mulx    %i3,%i0,%i1             ! mid-1 product
-       mulx    %o1,%g5,%l2             ! mid-2 product
-       mulx    %i3,%g5,%i5             ! hi product
-       srlx    %i4,32,%i0              ! extract high 32 bits of lo product...
-       add     %i1,%i0,%i1             ! ...and add it to the mid-1 product
-       addcc   %i1,%l2,%i1             ! add mid products
-       mov     0,%l0                   ! we need the carry from that add...
-       movcs   %xcc,%o2,%l0            ! ...compute it and...
-       add     %i5,%l0,%i5             ! ...add to bit 32 of the hi product
-       sllx    %i1,32,%i0              ! align low bits of mid product
-       srl     %i4,0,%g5               ! zero high 32 bits of lo product
-       add     %i0,%g5,%i0             ! combine into low 64 bits of result
-       srlx    %i1,32,%i1              ! extract high bits of mid product...
-       add     %i5,%i1,%i1             ! ...and add them to the high result
-       addcc   %i0,%o0,%i0             ! add cy_limb to low 64 bits of result
-       mov     0,%g5
-       movcs   %xcc,1,%g5
-       add     %o7,1,%o7
-       ldx     [%o4+%g1],%l1
-       subcc   %l1,%i0,%i0
-       movcs   %xcc,1,%g5
-       stx     %i0,[%o4+%g1]
-       brnz    %o7,.Loop
-       add     %i1,%g5,%o0             ! compute new cy_limb
-
-       mov     %o0,%i0
-       ret
-       restore
-.LLfe1:
-       .size  __mpn_submul_1,.LLfe1-__mpn_submul_1
diff --git a/ghc/rts/gmp/mpn/sysv.h b/ghc/rts/gmp/mpn/sysv.h
deleted file mode 100644 (file)
index 87c2509..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#define C_SYMBOL_NAME(name) name
diff --git a/ghc/rts/gmp/mpn/tests/add_n.c b/ghc/rts/gmp/mpn/tests/add_n.c
deleted file mode 100644 (file)
index c27d347..0000000
+++ /dev/null
@@ -1,211 +0,0 @@
-#include <stdio.h>
-#include "gmp.h"
-#include "gmp-impl.h"
-
-#ifndef USG
-#include <sys/time.h>
-#include <sys/resource.h>
-
-unsigned long
-cputime ()
-{
-    struct rusage rus;
-
-    getrusage (0, &rus);
-    return rus.ru_utime.tv_sec * 1000 + rus.ru_utime.tv_usec / 1000;
-}
-#else
-#include <time.h>
-
-#ifndef CLOCKS_PER_SEC
-#define CLOCKS_PER_SEC 1000000
-#endif
-
-#if CLOCKS_PER_SEC >= 10000
-#define CLOCK_TO_MILLISEC(cl) ((cl) / (CLOCKS_PER_SEC / 1000))
-#else
-#define CLOCK_TO_MILLISEC(cl) ((cl) * 1000 / CLOCKS_PER_SEC)
-#endif
-
-unsigned long
-cputime ()
-{
-  return CLOCK_TO_MILLISEC (clock ());
-}
-#endif
-
-#define M * 1000000
-
-#ifndef CLOCK
-#if defined (__m88k__)
-#define CLOCK 20 M
-#elif defined (__i386__)
-#define CLOCK (16.666667 M)
-#elif defined (__m68k__)
-#define CLOCK (20 M)
-#elif defined (_IBMR2)
-#define CLOCK (25 M)
-#elif defined (__sparc__)
-#define CLOCK (20 M)
-#elif defined (__sun__)
-#define CLOCK (20 M)
-#elif defined (__mips)
-#define CLOCK (40 M)
-#elif defined (__hppa__)
-#define CLOCK (50 M)
-#elif defined (__alpha)
-#define CLOCK (133 M)
-#else
-#error "Don't know CLOCK of your machine"
-#endif
-#endif
-
-#ifndef OPS
-#define OPS 10000000
-#endif
-#ifndef SIZE
-#define SIZE 328
-#endif
-#ifndef TIMES
-#define TIMES OPS/SIZE
-#else
-#undef OPS
-#define OPS (SIZE*TIMES)
-#endif
-
-
-mp_limb_t
-#if __STDC__
-refmpn_add_n (mp_ptr res_ptr,
-              mp_srcptr s1_ptr, mp_srcptr s2_ptr, mp_size_t size)
-#else
-refmpn_add_n (res_ptr, s1_ptr, s2_ptr, size)
-     register mp_ptr res_ptr;
-     register mp_srcptr s1_ptr;
-     register mp_srcptr s2_ptr;
-     mp_size_t size;
-#endif
-{
-  register mp_limb_t x, y, cy;
-  register mp_size_t j;
-
-  /* The loop counter and index J goes from -SIZE to -1.  This way
-     the loop becomes faster.  */
-  j = -size;
-
-  /* Offset the base pointers to compensate for the negative indices.  */
-  s1_ptr -= j;
-  s2_ptr -= j;
-  res_ptr -= j;
-
-  cy = 0;
-  do
-    {
-      y = s2_ptr[j];
-      x = s1_ptr[j];
-      y += cy;                 /* add previous carry to one addend */
-      cy = (y < cy);           /* get out carry from that addition */
-      y = x + y;               /* add other addend */
-      cy = (y < x) + cy;       /* get out carry from that add, combine */
-      res_ptr[j] = y;
-    }
-  while (++j != 0);
-
-  return cy;
-}
-
-main (argc, argv)
-     int argc;
-     char **argv;
-{
-  mp_limb_t s1[SIZE];
-  mp_limb_t s2[SIZE];
-  mp_limb_t dx[SIZE+1];
-  mp_limb_t dy[SIZE+1];
-  int cyx, cyy;
-  int i;
-  long t0, t;
-  int test;
-  mp_size_t size;
-
-  for (test = 0; ; test++)
-    {
-#ifdef RANDOM
-      size = (random () % SIZE + 1);
-#else
-      size = SIZE;
-#endif
-
-      mpn_random2 (s1, size);
-      mpn_random2 (s2, size);
-
-      dx[size] = 0x12345678;
-      dy[size] = 0x12345678;
-
-#ifdef PRINT
-      mpn_print (s1, size);
-      mpn_print (s2, size);
-#endif
-      t0 = cputime();
-      for (i = 0; i < TIMES; i++)
-       cyx = refmpn_add_n (dx, s1, s2, size);
-      t = cputime() - t0;
-#if TIMES != 1
-      printf ("refmpn_add_n:   %ldms (%.2f cycles/limb)\n",
-             t,
-             ((double) t * CLOCK) / (OPS * 1000.0));
-#endif
-#ifdef PRINT
-      printf ("%d ", cyx); mpn_print (dx, size);
-#endif
-
-      t0 = cputime();
-      for (i = 0; i < TIMES; i++)
-       cyx = mpn_add_n (dx, s1, s2, size);
-      t = cputime() - t0;
-#if TIMES != 1
-      printf ("mpn_add_n:   %ldms (%.2f cycles/limb)\n",
-             t,
-             ((double) t * CLOCK) / (OPS * 1000.0));
-#endif
-#ifdef PRINT
-      printf ("%d ", cyx); mpn_print (dx, size);
-#endif
-
-#ifndef NOCHECK
-      /* Put garbage in the destination.  */
-      for (i = 0; i < size; i++)
-       {
-         dx[i] = 0x7654321;
-         dy[i] = 0x1234567;
-       }
-
-      cyx = refmpn_add_n (dx, s1, s2, size);
-      cyy = mpn_add_n (dy, s1, s2, size);
-      if (cyx != cyy || mpn_cmp (dx, dy, size) != 0
-         || dx[size] != 0x12345678 || dy[size] != 0x12345678)
-       {
-#ifndef PRINT
-         printf ("%d ", cyx); mpn_print (dx, size);
-         printf ("%d ", cyy); mpn_print (dy, size);
-#endif
-         abort();
-       }
-#endif
-    }
-}
-
-mpn_print (mp_ptr p, mp_size_t size)
-{
-  mp_size_t i;
-
-  for (i = size - 1; i >= 0; i--)
-    {
-      printf ("%0*lX", (int) (2 * sizeof(mp_limb_t)), p[i]);
-#ifdef SPACE
-      if (i != 0)
-       printf (" ");
-#endif
-    }
-  puts ("");
-}
diff --git a/ghc/rts/gmp/mpn/tests/addmul_1.c b/ghc/rts/gmp/mpn/tests/addmul_1.c
deleted file mode 100644 (file)
index 23952a1..0000000
+++ /dev/null
@@ -1,223 +0,0 @@
-#include <stdio.h>
-#include "gmp.h"
-#include "gmp-impl.h"
-#include "longlong.h"
-
-#ifndef USG
-#include <sys/time.h>
-#include <sys/resource.h>
-
-unsigned long
-cputime ()
-{
-    struct rusage rus;
-
-    getrusage (0, &rus);
-    return rus.ru_utime.tv_sec * 1000 + rus.ru_utime.tv_usec / 1000;
-}
-#else
-#include <time.h>
-
-#ifndef CLOCKS_PER_SEC
-#define CLOCKS_PER_SEC 1000000
-#endif
-
-#if CLOCKS_PER_SEC >= 10000
-#define CLOCK_TO_MILLISEC(cl) ((cl) / (CLOCKS_PER_SEC / 1000))
-#else
-#define CLOCK_TO_MILLISEC(cl) ((cl) * 1000 / CLOCKS_PER_SEC)
-#endif
-
-unsigned long
-cputime ()
-{
-  return CLOCK_TO_MILLISEC (clock ());
-}
-#endif
-
-#define M * 1000000
-
-#ifndef CLOCK
-#if defined (__m88k__)
-#define CLOCK 20 M
-#elif defined (__i386__)
-#define CLOCK (16.666667 M)
-#elif defined (__m68k__)
-#define CLOCK (20 M)
-#elif defined (_IBMR2)
-#define CLOCK (25 M)
-#elif defined (__sparc__)
-#define CLOCK (20 M)
-#elif defined (__sun__)
-#define CLOCK (20 M)
-#elif defined (__mips)
-#define CLOCK (40 M)
-#elif defined (__hppa__)
-#define CLOCK (50 M)
-#elif defined (__alpha)
-#define CLOCK (133 M)
-#else
-#error "Don't know CLOCK of your machine"
-#endif
-#endif
-
-#ifndef OPS
-#define OPS 20000000
-#endif
-#ifndef SIZE
-#define SIZE 496
-#endif
-#ifndef TIMES
-#define TIMES OPS/SIZE
-#else
-#undef OPS
-#define OPS (SIZE*TIMES)
-#endif
-
-mp_limb_t
-refmpn_addmul_1 (res_ptr, s1_ptr, s1_size, s2_limb)
-     register mp_ptr res_ptr;
-     register mp_srcptr s1_ptr;
-     mp_size_t s1_size;
-     register mp_limb_t s2_limb;
-{
-  register mp_limb_t cy_limb;
-  register mp_size_t j;
-  register mp_limb_t prod_high, prod_low;
-  register mp_limb_t x;
-
-  /* The loop counter and index J goes from -SIZE to -1.  This way
-     the loop becomes faster.  */
-  j = -s1_size;
-
-  /* Offset the base pointers to compensate for the negative indices.  */
-  res_ptr -= j;
-  s1_ptr -= j;
-
-  cy_limb = 0;
-  do
-    {
-      umul_ppmm (prod_high, prod_low, s1_ptr[j], s2_limb);
-
-      prod_low += cy_limb;
-      cy_limb = (prod_low < cy_limb) + prod_high;
-
-      x = res_ptr[j];
-      prod_low = x + prod_low;
-      cy_limb += (prod_low < x);
-      res_ptr[j] = prod_low;
-    }
-  while (++j != 0);
-
-  return cy_limb;
-}
-
-main (argc, argv)
-     int argc;
-     char **argv;
-{
-  mp_limb_t s1[SIZE];
-  mp_limb_t dx[SIZE+2];
-  mp_limb_t dy[SIZE+2];
-  mp_limb_t cyx, cyy;
-  int i;
-  long t0, t;
-  int test;
-  mp_limb_t xlimb;
-  mp_size_t size;
-  double cyc;
-
-  for (test = 0; ; test++)
-    {
-#ifdef RANDOM
-      size = (random () % SIZE + 1);
-#else
-      size = SIZE;
-#endif
-
-      mpn_random2 (s1, size);
-      mpn_random2 (dy+1, size);
-
-      if (random () % 0x100 == 0)
-       xlimb = 0;
-      else
-       mpn_random2 (&xlimb, 1);
-
-      dy[size+1] = 0x12345678;
-      dy[0] = 0x87654321;
-
-#if defined (PRINT) || defined (XPRINT)
-      printf ("xlimb=%*lX\n", (int) (2 * sizeof(mp_limb_t)), xlimb);
-#endif
-#ifdef PRINT
-      mpn_print (dy+1, size);
-      mpn_print (s1, size);
-#endif
-
-      MPN_COPY (dx, dy, size+2);
-      t0 = cputime();
-      for (i = 0; i < TIMES; i++)
-       cyx = refmpn_addmul_1 (dx+1, s1, size, xlimb);
-      t = cputime() - t0;
-#if TIMES != 1
-      cyc = ((double) t * CLOCK) / (OPS * 1000.0);
-      printf ("refmpn_addmul_1: %5ldms (%.2f cycles/limb) [%.2f Gb/s]\n",
-             t,
-             cyc,
-             CLOCK/cyc*BITS_PER_MP_LIMB*BITS_PER_MP_LIMB);
-#endif
-
-      MPN_COPY (dx, dy, size+2);
-      t0 = cputime();
-      for (i = 0; i < TIMES; i++)
-       cyy = mpn_addmul_1 (dx+1, s1, size, xlimb);
-      t = cputime() - t0;
-#if TIMES != 1
-      cyc = ((double) t * CLOCK) / (OPS * 1000.0);
-      printf ("mpn_addmul_1:    %5ldms (%.2f cycles/limb) [%.2f Gb/s]\n",
-             t,
-             cyc,
-             CLOCK/cyc*BITS_PER_MP_LIMB*BITS_PER_MP_LIMB);
-#endif
-
-      MPN_COPY (dx, dy, size+2);
-      cyx = refmpn_addmul_1 (dx+1, s1, size, xlimb);
-      cyy = mpn_addmul_1 (dy+1, s1, size, xlimb);
-
-#ifdef PRINT
-      printf ("%*lX ", (int) (2 * sizeof(mp_limb_t)), cyx);
-      mpn_print (dx+1, size);
-      printf ("%*lX ", (int) (2 * sizeof(mp_limb_t)), cyy);
-      mpn_print (dy+1, size);
-#endif
-
-#ifndef NOCHECK
-      if (cyx != cyy || mpn_cmp (dx, dy, size+2) != 0
-         || dx[size+1] != 0x12345678 || dx[0] != 0x87654321)
-       {
-#ifndef PRINT
-         printf ("%*lX ", (int) (2 * sizeof(mp_limb_t)), cyx);
-         mpn_print (dx+1, size);
-         printf ("%*lX ", (int) (2 * sizeof(mp_limb_t)), cyy);
-         mpn_print (dy+1, size);
-#endif
-         abort();
-       }
-#endif
-    }
-}
-
-mpn_print (mp_ptr p, mp_size_t size)
-{
-  mp_size_t i;
-
-  for (i = size - 1; i >= 0; i--)
-    {
-      printf ("%0*lX", (int) (2 * sizeof(mp_limb_t)), p[i]);
-#ifdef SPACE
-      if (i != 0)
-       printf (" ");
-#endif
-    }
-  puts ("");
-}
diff --git a/ghc/rts/gmp/mpn/tests/divmod_1.c b/ghc/rts/gmp/mpn/tests/divmod_1.c
deleted file mode 100644 (file)
index f6b541e..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-#include <stdio.h>
-#include "gmp.h"
-#include "gmp-impl.h"
-#include "longlong.h"
-
-#ifndef USG
-#include <sys/time.h>
-#include <sys/resource.h>
-
-unsigned long
-cputime ()
-{
-    struct rusage rus;
-
-    getrusage (0, &rus);
-    return rus.ru_utime.tv_sec * 1000 + rus.ru_utime.tv_usec / 1000;
-}
-#else
-#include <time.h>
-
-#ifndef CLOCKS_PER_SEC
-#define CLOCKS_PER_SEC 1000000
-#endif
-
-#if CLOCKS_PER_SEC >= 10000
-#define CLOCK_TO_MILLISEC(cl) ((cl) / (CLOCKS_PER_SEC / 1000))
-#else
-#define CLOCK_TO_MILLISEC(cl) ((cl) * 1000 / CLOCKS_PER_SEC)
-#endif
-
-unsigned long
-cputime ()
-{
-  return CLOCK_TO_MILLISEC (clock ());
-}
-#endif
-
-#define M * 1000000
-
-#ifndef CLOCK
-#if defined (__m88k__)
-#define CLOCK 20 M
-#elif defined (__i386__)
-#define CLOCK (16.666667 M)
-#elif defined (__m68k__)
-#define CLOCK (20 M)
-#elif defined (_IBMR2)
-#define CLOCK (25 M)
-#elif defined (__sparc__)
-#define CLOCK (20 M)
-#elif defined (__sun__)
-#define CLOCK (20 M)
-#elif defined (__mips)
-#define CLOCK (40 M)
-#elif defined (__hppa__)
-#define CLOCK (50 M)
-#elif defined (__alpha)
-#define CLOCK (133 M)
-#else
-#error "Don't know CLOCK of your machine"
-#endif
-#endif
-
-#ifndef OPS
-#define OPS 20000000
-#endif
-#ifndef SIZE
-#define SIZE 1000
-#endif
-#ifndef TIMES
-#define TIMES OPS/SIZE
-#else
-#undef OPS
-#define OPS (SIZE*TIMES)
-#endif
-
-main ()
-{
-  mp_limb_t nptr[SIZE];
-  mp_limb_t qptr[SIZE];
-  mp_limb_t pptr[SIZE];
-  mp_limb_t dlimb, rlimb, plimb;
-  mp_size_t nsize, qsize, psize;
-  int test;
-
-  for (test = 0; ; test++)
-    {
-#ifdef RANDOM
-      nsize = random () % SIZE + 1;
-#else
-      nsize = SIZE;
-#endif
-
-      mpn_random2 (nptr, nsize);
-
-      mpn_random2 (&dlimb, 1);
-      if (dlimb == 0)
-       abort ();
-
-      rlimb = mpn_divmod_1 (qptr, nptr, nsize, dlimb);
-      qsize = nsize - (qptr[nsize - 1] == 0);
-      if (qsize == 0)
-       {
-         plimb = rlimb;
-         psize = qsize;
-       }
-      else
-       {
-         plimb = mpn_mul_1 (pptr, qptr, qsize, dlimb);
-         psize = qsize;
-         plimb += mpn_add_1 (pptr, pptr, psize, rlimb);
-       }
-      if (plimb != 0)
-       pptr[psize++] = plimb;
-
-
-      if (nsize != psize || mpn_cmp (nptr, pptr, nsize) != 0)
-       abort ();
-    }
-}
diff --git a/ghc/rts/gmp/mpn/tests/divrem.c b/ghc/rts/gmp/mpn/tests/divrem.c
deleted file mode 100644 (file)
index 6eafc99..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-#include <stdio.h>
-#include "gmp.h"
-#include "gmp-impl.h"
-#include "longlong.h"
-
-#ifndef USG
-#include <sys/time.h>
-#include <sys/resource.h>
-
-unsigned long
-cputime ()
-{
-    struct rusage rus;
-
-    getrusage (0, &rus);
-    return rus.ru_utime.tv_sec * 1000 + rus.ru_utime.tv_usec / 1000;
-}
-#else
-#include <time.h>
-
-#ifndef CLOCKS_PER_SEC
-#define CLOCKS_PER_SEC 1000000
-#endif
-
-#if CLOCKS_PER_SEC >= 10000
-#define CLOCK_TO_MILLISEC(cl) ((cl) / (CLOCKS_PER_SEC / 1000))
-#else
-#define CLOCK_TO_MILLISEC(cl) ((cl) * 1000 / CLOCKS_PER_SEC)
-#endif
-
-unsigned long
-cputime ()
-{
-  return CLOCK_TO_MILLISEC (clock ());
-}
-#endif
-
-#define M * 1000000
-
-#ifndef CLOCK
-#if defined (__m88k__)
-#define CLOCK 20 M
-#elif defined (__i386__)
-#define CLOCK (16.666667 M)
-#elif defined (__m68k__)
-#define CLOCK (20 M)
-#elif defined (_IBMR2)
-#define CLOCK (25 M)
-#elif defined (__sparc__)
-#define CLOCK (20 M)
-#elif defined (__sun__)
-#define CLOCK (20 M)
-#elif defined (__mips)
-#define CLOCK (40 M)
-#elif defined (__hppa__)
-#define CLOCK (50 M)
-#elif defined (__alpha)
-#define CLOCK (133 M)
-#else
-#error "Don't know CLOCK of your machine"
-#endif
-#endif
-
-#ifndef OPS
-#define OPS 20000000
-#endif
-#ifndef SIZE
-#define SIZE 100
-#endif
-#ifndef TIMES
-#define TIMES OPS/SIZE
-#else
-#undef OPS
-#define OPS (SIZE*TIMES)
-#endif
-
-main ()
-{
-  mp_limb_t nptr[2 * SIZE];
-  mp_limb_t dptr[SIZE];
-  mp_limb_t qptr[2 * SIZE];
-  mp_limb_t pptr[2 * SIZE];
-  mp_limb_t rptr[2 * SIZE];
-  mp_size_t nsize, dsize, qsize, rsize, psize;
-  int test;
-  mp_limb_t qlimb;
-
-  for (test = 0; ; test++)
-    {
-#ifdef RANDOM
-      nsize = random () % (2 * SIZE) + 1;
-      dsize = random () % nsize + 1;
-#else
-      nsize = 2 * SIZE;
-      dsize = SIZE;
-#endif
-
-      mpn_random2 (nptr, nsize);
-      mpn_random2 (dptr, dsize);
-      dptr[dsize - 1] |= (mp_limb_t) 1 << (BITS_PER_MP_LIMB - 1);
-
-      MPN_COPY (rptr, nptr, nsize);
-      qlimb = mpn_divrem (qptr, (mp_size_t) 0, rptr, nsize, dptr, dsize);
-      rsize = dsize;
-      qsize = nsize - dsize;
-      qptr[qsize] = qlimb;
-      qsize += qlimb;
-      if (qsize == 0 || qsize > 2 * SIZE)
-       {
-         continue;             /* bogus */
-       }
-      else
-       {
-         mp_limb_t cy;
-         if (qsize > dsize)
-           mpn_mul (pptr, qptr, qsize, dptr, dsize);
-         else
-           mpn_mul (pptr, dptr, dsize, qptr, qsize);
-         psize = qsize + dsize;
-         psize -= pptr[psize - 1] == 0;
-         cy = mpn_add (pptr, pptr, psize, rptr, rsize);
-         pptr[psize] = cy;
-         psize += cy;
-       }
-
-      if (nsize != psize || mpn_cmp (nptr, pptr, nsize) != 0)
-       abort ();
-    }
-}
diff --git a/ghc/rts/gmp/mpn/tests/lshift.c b/ghc/rts/gmp/mpn/tests/lshift.c
deleted file mode 100644 (file)
index f50c5dc..0000000
+++ /dev/null
@@ -1,226 +0,0 @@
-#include <stdio.h>
-#include "gmp.h"
-#include "gmp-impl.h"
-#include "longlong.h"
-
-#ifndef USG
-#include <sys/time.h>
-#include <sys/resource.h>
-
-unsigned long
-cputime ()
-{
-    struct rusage rus;
-
-    getrusage (0, &rus);
-    return rus.ru_utime.tv_sec * 1000 + rus.ru_utime.tv_usec / 1000;
-}
-#else
-#include <time.h>
-
-#ifndef CLOCKS_PER_SEC
-#define CLOCKS_PER_SEC 1000000
-#endif
-
-#if CLOCKS_PER_SEC >= 10000
-#define CLOCK_TO_MILLISEC(cl) ((cl) / (CLOCKS_PER_SEC / 1000))
-#else
-#define CLOCK_TO_MILLISEC(cl) ((cl) * 1000 / CLOCKS_PER_SEC)
-#endif
-
-unsigned long
-cputime ()
-{
-  return CLOCK_TO_MILLISEC (clock ());
-}
-#endif
-
-#define M * 1000000
-
-#ifndef CLOCK
-#if defined (__m88k__)
-#define CLOCK 20 M
-#elif defined (__i386__)
-#define CLOCK (16.666667 M)
-#elif defined (__m68k__)
-#define CLOCK (20 M)
-#elif defined (_IBMR2)
-#define CLOCK (25 M)
-#elif defined (__sparc__)
-#define CLOCK (20 M)
-#elif defined (__sun__)
-#define CLOCK (20 M)
-#elif defined (__mips)
-#define CLOCK (40 M)
-#elif defined (__hppa__)
-#define CLOCK (50 M)
-#elif defined (__alpha)
-#define CLOCK (133 M)
-#else
-#error "Don't know CLOCK of your machine"
-#endif
-#endif
-
-#ifndef OPS
-#define OPS 10000000
-#endif
-#ifndef SIZE
-#define SIZE 496
-#endif
-#ifndef TIMES
-#define TIMES OPS/SIZE
-#else
-#undef OPS
-#define OPS (SIZE*TIMES)
-#endif
-
-mp_limb_t
-refmpn_lshift (wp, up, usize, cnt)
-     register mp_ptr wp;
-     register mp_srcptr up;
-     mp_size_t usize;
-     register unsigned int cnt;
-{
-  register mp_limb_t high_limb, low_limb;
-  register unsigned sh_1, sh_2;
-  register mp_size_t i;
-  mp_limb_t retval;
-
-#ifdef DEBUG
-  if (usize == 0 || cnt == 0)
-    abort ();
-#endif
-
-  sh_1 = cnt;
-#if 0
-  if (sh_1 == 0)
-    {
-      if (wp != up)
-       {
-         /* Copy from high end to low end, to allow specified input/output
-            overlapping.  */
-         for (i = usize - 1; i >= 0; i--)
-           wp[i] = up[i];
-       }
-      return 0;
-    }
-#endif
-
-  wp += 1;
-  sh_2 = BITS_PER_MP_LIMB - sh_1;
-  i = usize - 1;
-  low_limb = up[i];
-  retval = low_limb >> sh_2;
-  high_limb = low_limb;
-  while (--i >= 0)
-    {
-      low_limb = up[i];
-      wp[i] = (high_limb << sh_1) | (low_limb >> sh_2);
-      high_limb = low_limb;
-    }
-  wp[i] = high_limb << sh_1;
-
-  return retval;
-}
-
-#ifndef CNT
-#define CNT 4
-#endif
-
-main (argc, argv)
-     int argc;
-     char **argv;
-{
-  mp_limb_t s1[SIZE];
-  mp_limb_t dx[SIZE+2];
-  mp_limb_t dy[SIZE+2];
-  mp_limb_t cyx, cyy;
-  int i;
-  long t0, t;
-  int test;
-  int cnt = CNT;
-  mp_size_t size;
-
-  for (test = 0; ; test++)
-    {
-#ifdef RANDOM
-      size = (random () % SIZE + 1);
-#else
-      size = SIZE;
-#endif
-      mpn_random2 (s1, size);
-
-      dx[size+1] = 0x12345678;
-      dy[size+1] = 0x12345678;
-      dx[0] = 0x87654321;
-      dy[0] = 0x87654321;
-
-#ifdef PRINT
-      mpn_print (s1, size);
-#endif
-      t0 = cputime();
-      for (i = 0; i < TIMES; i++)
-       cyx = refmpn_lshift (dx+1, s1, size, cnt);
-      t = cputime() - t0;
-#if TIMES != 1
-      printf ("refmpn_lshift: %5ldms (%.2f cycles/limb)\n",
-             t,
-             ((double) t * CLOCK) / (OPS * 1000.0));
-#endif
-#ifdef PRINT
-      printf ("%*lX ", (int) (2 * sizeof(mp_limb_t)), cyx); mpn_print (dx+1, size);
-#endif
-
-      t0 = cputime();
-      for (i = 0; i < TIMES; i++)
-       cyy = mpn_lshift (dx+1, s1, size, cnt);
-      t = cputime() - t0;
-#if TIMES != 1
-      printf ("mpn_lshift:  %5ldms (%.2f cycles/limb)\n",
-             t,
-             ((double) t * CLOCK) / (OPS * 1000.0));
-#endif
-#ifdef PRINT
-      printf ("%*lX ", (int) (2 * sizeof(mp_limb_t)), cyy); mpn_print (dx+1, size);
-#endif
-
-#ifndef NOCHECK
-      /* Put garbage in the destination.  */
-      for (i = 1; i <= size; i++)
-       {
-         dx[i] = 0x7654321;
-         dy[i] = 0x1234567;
-       }
-
-      cyx = refmpn_lshift (dx+1, s1, size, cnt);
-      cyy = mpn_lshift (dy+1, s1, size, cnt);
-
-      if (cyx != cyy || mpn_cmp (dx, dy, size+2) != 0
-         || dx[size+1] != 0x12345678 || dx[0] != 0x87654321)
-       {
-#ifndef PRINT
-         printf ("%*lX ", (int) (2 * sizeof(mp_limb_t)), cyx);
-         mpn_print (dx+1, size);
-         printf ("%*lX ", (int) (2 * sizeof(mp_limb_t)), cyy);
-         mpn_print (dy+1, size);
-#endif
-         abort();
-       }
-#endif
-    }
-}
-
-mpn_print (mp_ptr p, mp_size_t size)
-{
-  mp_size_t i;
-
-  for (i = size - 1; i >= 0; i--)
-    {
-      printf ("%0*lX", (int) (2 * sizeof(mp_limb_t)), p[i]);
-#ifdef SPACE
-      if (i != 0)
-       printf (" ");
-#endif
-    }
-  puts ("");
-}
diff --git a/ghc/rts/gmp/mpn/tests/mul_1.c b/ghc/rts/gmp/mpn/tests/mul_1.c
deleted file mode 100644 (file)
index 2b522fa..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-#include <stdio.h>
-#include "gmp.h"
-#include "gmp-impl.h"
-#include "longlong.h"
-
-#ifndef USG
-#include <sys/time.h>
-#include <sys/resource.h>
-
-unsigned long
-cputime ()
-{
-    struct rusage rus;
-
-    getrusage (0, &rus);
-    return rus.ru_utime.tv_sec * 1000 + rus.ru_utime.tv_usec / 1000;
-}
-#else
-#include <time.h>
-
-#ifndef CLOCKS_PER_SEC
-#define CLOCKS_PER_SEC 1000000
-#endif
-
-#if CLOCKS_PER_SEC >= 10000
-#define CLOCK_TO_MILLISEC(cl) ((cl) / (CLOCKS_PER_SEC / 1000))
-#else
-#define CLOCK_TO_MILLISEC(cl) ((cl) * 1000 / CLOCKS_PER_SEC)
-#endif
-
-unsigned long
-cputime ()
-{
-  return CLOCK_TO_MILLISEC (clock ());
-}
-#endif
-
-#define M * 1000000
-
-#ifndef CLOCK
-#if defined (__m88k__)
-#define CLOCK 20 M
-#elif defined (__i386__)
-#define CLOCK (16.666667 M)
-#elif defined (__m68k__)
-#define CLOCK (20 M)
-#elif defined (_IBMR2)
-#define CLOCK (25 M)
-#elif defined (__sparc__)
-#define CLOCK (20 M)
-#elif defined (__sun__)
-#define CLOCK (20 M)
-#elif defined (__mips)
-#define CLOCK (40 M)
-#elif defined (__hppa__)
-#define CLOCK (50 M)
-#elif defined (__alpha)
-#define CLOCK (133 M)
-#else
-#error "Don't know CLOCK of your machine"
-#endif
-#endif
-
-#ifndef OPS
-#define OPS 20000000
-#endif
-#ifndef SIZE
-#define SIZE 496
-#endif
-#ifndef TIMES
-#define TIMES OPS/SIZE
-#else
-#undef OPS
-#define OPS (SIZE*TIMES)
-#endif
-
-mp_limb_t
-refmpn_mul_1 (res_ptr, s1_ptr, s1_size, s2_limb)
-     register mp_ptr res_ptr;
-     register mp_srcptr s1_ptr;
-     mp_size_t s1_size;
-     register mp_limb_t s2_limb;
-{
-  register mp_limb_t cy_limb;
-  register mp_size_t j;
-  register mp_limb_t prod_high, prod_low;
-
-  /* The loop counter and index J goes from -S1_SIZE to -1.  This way
-     the loop becomes faster.  */
-  j = -s1_size;
-
-  /* Offset the base pointers to compensate for the negative indices.  */
-  s1_ptr -= j;
-  res_ptr -= j;
-
-  cy_limb = 0;
-  do
-    {
-      umul_ppmm (prod_high, prod_low, s1_ptr[j], s2_limb);
-
-      prod_low += cy_limb;
-      cy_limb = (prod_low < cy_limb) + prod_high;
-
-      res_ptr[j] = prod_low;
-    }
-  while (++j != 0);
-
-  return cy_limb;
-}
-
-main (argc, argv)
-     int argc;
-     char **argv;
-{
-  mp_limb_t s1[SIZE];
-  mp_limb_t dx[SIZE+2];
-  mp_limb_t dy[SIZE+2];
-  mp_limb_t cyx, cyy;
-  int i;
-  long t0, t;
-  int test;
-  mp_limb_t xlimb;
-  mp_size_t size;
-
-  for (test = 0; ; test++)
-    {
-#ifdef RANDOM
-      size = (random () % SIZE + 1);
-#else
-      size = SIZE;
-#endif
-
-      mpn_random2 (s1, size);
-      mpn_random2 (dy+1, size);
-
-      if (random () % 0x100 == 0)
-       xlimb = 0;
-      else
-       mpn_random2 (&xlimb, 1);
-
-      dy[size+1] = 0x12345678;
-      dy[0] = 0x87654321;
-
-#if defined (PRINT) || defined (XPRINT)
-      printf ("xlimb=%*lX\n", (int) (2 * sizeof(mp_limb_t)), xlimb);
-#endif
-#ifdef PRINT
-      mpn_print (s1, size);
-#endif
-
-      MPN_COPY (dx, dy, size+2);
-      t0 = cputime();
-      for (i = 0; i < TIMES; i++)
-       cyx = refmpn_mul_1 (dx+1, s1, size, xlimb);
-      t = cputime() - t0;
-#if TIMES != 1
-      printf ("refmpn_mul_1: %5ldms (%.2f cycles/limb)\n",
-             t,
-             ((double) t * CLOCK) / (OPS * 1000.0));
-#endif
-
-      MPN_COPY (dx, dy, size+2);
-      t0 = cputime();
-      for (i = 0; i < TIMES; i++)
-       cyy = mpn_mul_1 (dx+1, s1, size, xlimb);
-      t = cputime() - t0;
-#if TIMES != 1
-      printf ("mpn_mul_1:    %5ldms (%.2f cycles/limb)\n",
-             t,
-             ((double) t * CLOCK) / (OPS * 1000.0));
-#endif
-
-      cyx = refmpn_mul_1 (dx+1, s1, size, xlimb);
-      cyy = mpn_mul_1 (dy+1, s1, size, xlimb);
-
-#ifdef PRINT
-      printf ("%*lX ", (int) (2 * sizeof(mp_limb_t)), cyx);
-      mpn_print (dx+1, size);
-      printf ("%*lX ", (int) (2 * sizeof(mp_limb_t)), cyy);
-      mpn_print (dy+1, size);
-#endif
-
-#ifndef NOCHECK
-      if (cyx != cyy || mpn_cmp (dx, dy, size+2) != 0
-         || dx[size+1] != 0x12345678 || dx[0] != 0x87654321)
-       {
-#ifndef PRINT
-         printf ("%*lX ", (int) (2 * sizeof(mp_limb_t)), cyx);
-         mpn_print (dx+1, size);
-         printf ("%*lX ", (int) (2 * sizeof(mp_limb_t)), cyy);
-         mpn_print (dy+1, size);
-#endif
-         abort();
-       }
-#endif
-    }
-}
-
-mpn_print (mp_ptr p, mp_size_t size)
-{
-  mp_size_t i;
-
-  for (i = size - 1; i >= 0; i--)
-    {
-      printf ("%0*lX", (int) (2 * sizeof(mp_limb_t)), p[i]);
-#ifdef SPACE
-      if (i != 0)
-       printf (" ");
-#endif
-    }
-  puts ("");
-}
diff --git a/ghc/rts/gmp/mpn/tests/rshift.c b/ghc/rts/gmp/mpn/tests/rshift.c
deleted file mode 100644 (file)
index 2482bf3..0000000
+++ /dev/null
@@ -1,227 +0,0 @@
-#include <stdio.h>
-#include "gmp.h"
-#include "gmp-impl.h"
-#include "longlong.h"
-
-#ifndef USG
-#include <sys/time.h>
-#include <sys/resource.h>
-
-unsigned long
-cputime ()
-{
-    struct rusage rus;
-
-    getrusage (0, &rus);
-    return rus.ru_utime.tv_sec * 1000 + rus.ru_utime.tv_usec / 1000;
-}
-#else
-#include <time.h>
-
-#ifndef CLOCKS_PER_SEC
-#define CLOCKS_PER_SEC 1000000
-#endif
-
-#if CLOCKS_PER_SEC >= 10000
-#define CLOCK_TO_MILLISEC(cl) ((cl) / (CLOCKS_PER_SEC / 1000))
-#else
-#define CLOCK_TO_MILLISEC(cl) ((cl) * 1000 / CLOCKS_PER_SEC)
-#endif
-
-unsigned long
-cputime ()
-{
-  return CLOCK_TO_MILLISEC (clock ());
-}
-#endif
-
-#define M * 1000000
-
-#ifndef CLOCK
-#if defined (__m88k__)
-#define CLOCK 20 M
-#elif defined (__i386__)
-#define CLOCK (16.666667 M)
-#elif defined (__m68k__)
-#define CLOCK (20 M)
-#elif defined (_IBMR2)
-#define CLOCK (25 M)
-#elif defined (__sparc__)
-#define CLOCK (20 M)
-#elif defined (__sun__)
-#define CLOCK (20 M)
-#elif defined (__mips)
-#define CLOCK (40 M)
-#elif defined (__hppa__)
-#define CLOCK (50 M)
-#elif defined (__alpha)
-#define CLOCK (133 M)
-#else
-#error "Don't know CLOCK of your machine"
-#endif
-#endif
-
-#ifndef OPS
-#define OPS 10000000
-#endif
-#ifndef SIZE
-#define SIZE 496
-#endif
-#ifndef TIMES
-#define TIMES OPS/SIZE
-#else
-#undef OPS
-#define OPS (SIZE*TIMES)
-#endif
-
-mp_limb_t
-refmpn_rshift (wp, up, usize, cnt)
-     register mp_ptr wp;
-     register mp_srcptr up;
-     mp_size_t usize;
-     register unsigned int cnt;
-{
-  register mp_limb_t high_limb, low_limb;
-  register unsigned sh_1, sh_2;
-  register mp_size_t i;
-  mp_limb_t retval;
-
-#ifdef DEBUG
-  if (usize == 0 || cnt == 0)
-    abort ();
-#endif
-
-  sh_1 = cnt;
-#if 0
-  if (sh_1 == 0)
-    {
-      if (wp != up)
-       {
-         /* Copy from low end to high end, to allow specified input/output
-            overlapping.  */
-         for (i = 0; i < usize; i++)
-           wp[i] = up[i];
-       }
-      return 0;
-    }
-#endif
-
-  wp -= 1;
-  sh_2 = BITS_PER_MP_LIMB - sh_1;
-  high_limb = up[0];
-  retval = high_limb << sh_2;
-  low_limb = high_limb;
-
-  for (i = 1; i < usize; i++)
-    {
-      high_limb = up[i];
-      wp[i] = (low_limb >> sh_1) | (high_limb << sh_2);
-      low_limb = high_limb;
-    }
-  low_limb >>= sh_1;
-  wp[i] = low_limb;
-
-  return retval;
-}
-
-#ifndef CNT
-#define CNT 4
-#endif
-
-main (argc, argv)
-     int argc;
-     char **argv;
-{
-  mp_limb_t s1[SIZE];
-  mp_limb_t dx[SIZE+2];
-  mp_limb_t dy[SIZE+2];
-  mp_limb_t cyx, cyy;
-  int i;
-  long t0, t;
-  int test;
-  int cnt = CNT;
-  mp_size_t size;
-
-  for (test = 0; ; test++)
-    {
-#ifdef RANDOM
-      size = (random () % SIZE + 1);
-#else
-      size = SIZE;
-#endif
-      mpn_random2 (s1, size);
-
-      dx[size+1] = 0x12345678;
-      dy[size+1] = 0x12345678;
-      dx[0] = 0x87654321;
-      dy[0] = 0x87654321;
-
-#ifdef PRINT
-      mpn_print (s1, size);
-#endif
-      t0 = cputime();
-      for (i = 0; i < TIMES; i++)
-       cyx = refmpn_rshift (dx+1, s1, size, cnt);
-      t = cputime() - t0;
-#if TIMES != 1
-      printf ("refmpn_rshift: %5ldms (%.2f cycles/limb)\n",
-             t,
-             ((double) t * CLOCK) / (OPS * 1000.0));
-#endif
-#ifdef PRINT
-      printf ("%*lX ", (int) (2 * sizeof(mp_limb_t)), cyx); mpn_print (dx+1, size);
-#endif
-
-      t0 = cputime();
-      for (i = 0; i < TIMES; i++)
-       cyy = mpn_rshift (dx+1, s1, size, cnt);
-      t = cputime() - t0;
-#if TIMES != 1
-      printf ("mpn_rshift:  %5ldms (%.2f cycles/limb)\n",
-             t,
-             ((double) t * CLOCK) / (OPS * 1000.0));
-#endif
-#ifdef PRINT
-      printf ("%*lX ", (int) (2 * sizeof(mp_limb_t)), cyy); mpn_print (dx+1, size);
-#endif
-
-#ifndef NOCHECK
-      /* Put garbage in the destination.  */
-      for (i = 1; i <= size; i++)
-       {
-         dx[i] = 0x7654321;
-         dy[i] = 0x1234567;
-       }
-
-      cyx = refmpn_rshift (dx+1, s1, size, cnt);
-      cyy = mpn_rshift (dy+1, s1, size, cnt);
-
-      if (cyx != cyy || mpn_cmp (dx, dy, size+2) != 0
-         || dx[size+1] != 0x12345678 || dx[0] != 0x87654321)
-       {
-#ifndef PRINT
-         printf ("%*lX ", (int) (2 * sizeof(mp_limb_t)), cyx);
-         mpn_print (dx+1, size);
-         printf ("%*lX ", (int) (2 * sizeof(mp_limb_t)), cyy);
-         mpn_print (dy+1, size);
-#endif
-         abort();
-       }
-#endif
-    }
-}
-
-mpn_print (mp_ptr p, mp_size_t size)
-{
-  mp_size_t i;
-
-  for (i = size - 1; i >= 0; i--)
-    {
-      printf ("%0*lX", (int) (2 * sizeof(mp_limb_t)), p[i]);
-#ifdef SPACE
-      if (i != 0)
-       printf (" ");
-#endif
-    }
-  puts ("");
-}
diff --git a/ghc/rts/gmp/mpn/tests/sub_n.c b/ghc/rts/gmp/mpn/tests/sub_n.c
deleted file mode 100644 (file)
index 2b9031b..0000000
+++ /dev/null
@@ -1,211 +0,0 @@
-#include <stdio.h>
-#include "gmp.h"
-#include "gmp-impl.h"
-
-#ifndef USG
-#include <sys/time.h>
-#include <sys/resource.h>
-
-unsigned long
-cputime ()
-{
-    struct rusage rus;
-
-    getrusage (0, &rus);
-    return rus.ru_utime.tv_sec * 1000 + rus.ru_utime.tv_usec / 1000;
-}
-#else
-#include <time.h>
-
-#ifndef CLOCKS_PER_SEC
-#define CLOCKS_PER_SEC 1000000
-#endif
-
-#if CLOCKS_PER_SEC >= 10000
-#define CLOCK_TO_MILLISEC(cl) ((cl) / (CLOCKS_PER_SEC / 1000))
-#else
-#define CLOCK_TO_MILLISEC(cl) ((cl) * 1000 / CLOCKS_PER_SEC)
-#endif
-
-unsigned long
-cputime ()
-{
-  return CLOCK_TO_MILLISEC (clock ());
-}
-#endif
-
-#define M * 1000000
-
-#ifndef CLOCK
-#if defined (__m88k__)
-#define CLOCK 20 M
-#elif defined (__i386__)
-#define CLOCK (16.666667 M)
-#elif defined (__m68k__)
-#define CLOCK (20 M)
-#elif defined (_IBMR2)
-#define CLOCK (25 M)
-#elif defined (__sparc__)
-#define CLOCK (20 M)
-#elif defined (__sun__)
-#define CLOCK (20 M)
-#elif defined (__mips)
-#define CLOCK (40 M)
-#elif defined (__hppa__)
-#define CLOCK (50 M)
-#elif defined (__alpha)
-#define CLOCK (133 M)
-#else
-#error "Don't know CLOCK of your machine"
-#endif
-#endif
-
-#ifndef OPS
-#define OPS 10000000
-#endif
-#ifndef SIZE
-#define SIZE 328
-#endif
-#ifndef TIMES
-#define TIMES OPS/SIZE
-#else
-#undef OPS
-#define OPS (SIZE*TIMES)
-#endif
-
-
-mp_limb_t
-#if __STDC__
-refmpn_sub_n (mp_ptr res_ptr,
-              mp_srcptr s1_ptr, mp_srcptr s2_ptr, mp_size_t size)
-#else
-refmpn_sub_n (res_ptr, s1_ptr, s2_ptr, size)
-     register mp_ptr res_ptr;
-     register mp_srcptr s1_ptr;
-     register mp_srcptr s2_ptr;
-     mp_size_t size;
-#endif
-{
-  register mp_limb_t x, y, cy;
-  register mp_size_t j;
-
-  /* The loop counter and index J goes from -SIZE to -1.  This way
-     the loop becomes faster.  */
-  j = -size;
-
-  /* Offset the base pointers to compensate for the negative indices.  */
-  s1_ptr -= j;
-  s2_ptr -= j;
-  res_ptr -= j;
-
-  cy = 0;
-  do
-    {
-      y = s2_ptr[j];
-      x = s1_ptr[j];
-      y += cy;                 /* add previous carry to subtrahend */
-      cy = (y < cy);           /* get out carry from that addition */
-      y = x - y;               /* main subtract */
-      cy = (y > x) + cy;       /* get out carry from the subtract, combine */
-      res_ptr[j] = y;
-    }
-  while (++j != 0);
-
-  return cy;
-}
-
-main (argc, argv)
-     int argc;
-     char **argv;
-{
-  mp_limb_t s1[SIZE];
-  mp_limb_t s2[SIZE];
-  mp_limb_t dx[SIZE+1];
-  mp_limb_t dy[SIZE+1];
-  int cyx, cyy;
-  int i;
-  long t0, t;
-  int test;
-  mp_size_t size;
-
-  for (test = 0; ; test++)
-    {
-#ifdef RANDOM
-      size = (random () % SIZE + 1);
-#else
-      size = SIZE;
-#endif
-
-      mpn_random2 (s1, size);
-      mpn_random2 (s2, size);
-
-      dx[size] = 0x12345678;
-      dy[size] = 0x12345678;
-
-#ifdef PRINT
-      mpn_print (s1, size);
-      mpn_print (s2, size);
-#endif
-      t0 = cputime();
-      for (i = 0; i < TIMES; i++)
-       cyx = refmpn_sub_n (dx, s1, s2, size);
-      t = cputime() - t0;
-#if TIMES != 1
-      printf ("refmpn_sub_n:   %ldms (%.2f cycles/limb)\n",
-             t,
-             ((double) t * CLOCK) / (OPS * 1000.0));
-#endif
-#ifdef PRINT
-      printf ("%d ", cyx); mpn_print (dx, size);
-#endif
-
-      t0 = cputime();
-      for (i = 0; i < TIMES; i++)
-       cyx = mpn_sub_n (dx, s1, s2, size);
-      t = cputime() - t0;
-#if TIMES != 1
-      printf ("mpn_sub_n:   %ldms (%.2f cycles/limb)\n",
-             t,
-             ((double) t * CLOCK) / (OPS * 1000.0));
-#endif
-#ifdef PRINT
-      printf ("%d ", cyx); mpn_print (dx, size);
-#endif
-
-#ifndef NOCHECK
-      /* Put garbage in the destination.  */
-      for (i = 0; i < size; i++)
-       {
-         dx[i] = 0x7654321;
-         dy[i] = 0x1234567;
-       }
-
-      cyx = refmpn_sub_n (dx, s1, s2, size);
-      cyy = mpn_sub_n (dy, s1, s2, size);
-      if (cyx != cyy || mpn_cmp (dx, dy, size) != 0
-         || dx[size] != 0x12345678 || dy[size] != 0x12345678)
-       {
-#ifndef PRINT
-         printf ("%d ", cyx); mpn_print (dx, size);
-         printf ("%d ", cyy); mpn_print (dy, size);
-#endif
-         abort();
-       }
-#endif
-    }
-}
-
-mpn_print (mp_ptr p, mp_size_t size)
-{
-  mp_size_t i;
-
-  for (i = size - 1; i >= 0; i--)
-    {
-      printf ("%0*lX", (int) (2 * sizeof(mp_limb_t)), p[i]);
-#ifdef SPACE
-      if (i != 0)
-       printf (" ");
-#endif
-    }
-  puts ("");
-}
diff --git a/ghc/rts/gmp/mpn/tests/submul_1.c b/ghc/rts/gmp/mpn/tests/submul_1.c
deleted file mode 100644 (file)
index 0e464e6..0000000
+++ /dev/null
@@ -1,218 +0,0 @@
-#include <stdio.h>
-#include "gmp.h"
-#include "gmp-impl.h"
-#include "longlong.h"
-
-#ifndef USG
-#include <sys/time.h>
-#include <sys/resource.h>
-
-unsigned long
-cputime ()
-{
-    struct rusage rus;
-
-    getrusage (0, &rus);
-    return rus.ru_utime.tv_sec * 1000 + rus.ru_utime.tv_usec / 1000;
-}
-#else
-#include <time.h>
-
-#ifndef CLOCKS_PER_SEC
-#define CLOCKS_PER_SEC 1000000
-#endif
-
-#if CLOCKS_PER_SEC >= 10000
-#define CLOCK_TO_MILLISEC(cl) ((cl) / (CLOCKS_PER_SEC / 1000))
-#else
-#define CLOCK_TO_MILLISEC(cl) ((cl) * 1000 / CLOCKS_PER_SEC)
-#endif
-
-unsigned long
-cputime ()
-{
-  return CLOCK_TO_MILLISEC (clock ());
-}
-#endif
-
-#define M * 1000000
-
-#ifndef CLOCK
-#if defined (__m88k__)
-#define CLOCK 20 M
-#elif defined (__i386__)
-#define CLOCK (16.666667 M)
-#elif defined (__m68k__)
-#define CLOCK (20 M)
-#elif defined (_IBMR2)
-#define CLOCK (25 M)
-#elif defined (__sparc__)
-#define CLOCK (20 M)
-#elif defined (__sun__)
-#define CLOCK (20 M)
-#elif defined (__mips)
-#define CLOCK (40 M)
-#elif defined (__hppa__)
-#define CLOCK (50 M)
-#elif defined (__alpha)
-#define CLOCK (133 M)
-#else
-#error "Don't know CLOCK of your machine"
-#endif
-#endif
-
-#ifndef OPS
-#define OPS 20000000
-#endif
-#ifndef SIZE
-#define SIZE 496
-#endif
-#ifndef TIMES
-#define TIMES OPS/SIZE
-#else
-#undef OPS
-#define OPS (SIZE*TIMES)
-#endif
-
-mp_limb_t
-refmpn_submul_1 (res_ptr, s1_ptr, s1_size, s2_limb)
-     register mp_ptr res_ptr;
-     register mp_srcptr s1_ptr;
-     mp_size_t s1_size;
-     register mp_limb_t s2_limb;
-{
-  register mp_limb_t cy_limb;
-  register mp_size_t j;
-  register mp_limb_t prod_high, prod_low;
-  register mp_limb_t x;
-
-  /* The loop counter and index J goes from -SIZE to -1.  This way
-     the loop becomes faster.  */
-  j = -s1_size;
-
-  /* Offset the base pointers to compensate for the negative indices.  */
-  res_ptr -= j;
-  s1_ptr -= j;
-
-  cy_limb = 0;
-  do
-    {
-      umul_ppmm (prod_high, prod_low, s1_ptr[j], s2_limb);
-
-      prod_low += cy_limb;
-      cy_limb = (prod_low < cy_limb) + prod_high;
-
-      x = res_ptr[j];
-      prod_low = x - prod_low;
-      cy_limb += (prod_low > x);
-      res_ptr[j] = prod_low;
-    }
-  while (++j != 0);
-
-  return cy_limb;
-}
-
-main (argc, argv)
-     int argc;
-     char **argv;
-{
-  mp_limb_t s1[SIZE];
-  mp_limb_t dx[SIZE+2];
-  mp_limb_t dy[SIZE+2];
-  mp_limb_t cyx, cyy;
-  int i;
-  long t0, t;
-  int test;
-  mp_limb_t xlimb;
-  mp_size_t size;
-
-  for (test = 0; ; test++)
-    {
-#ifdef RANDOM
-      size = (random () % SIZE + 1);
-#else
-      size = SIZE;
-#endif
-
-      mpn_random2 (s1, size);
-      mpn_random2 (dy+1, size);
-
-      if (random () % 0x100 == 0)
-       xlimb = 0;
-      else
-       mpn_random2 (&xlimb, 1);
-
-      dy[size+1] = 0x12345678;
-      dy[0] = 0x87654321;
-
-#if defined (PRINT) || defined (XPRINT)
-      printf ("xlimb=%*lX\n", (int) (2 * sizeof(mp_limb_t)), xlimb);
-#endif
-#ifdef PRINT
-      mpn_print (dy+1, size);
-      mpn_print (s1, size);
-#endif
-
-      MPN_COPY (dx, dy, size+2);
-      t0 = cputime();
-      for (i = 0; i < TIMES; i++)
-       cyx = refmpn_submul_1 (dx+1, s1, size, xlimb);
-      t = cputime() - t0;
-#if TIMES != 1
-      printf ("refmpn_submul_1: %5ldms (%.2f cycles/limb)\n",
-             t,
-             ((double) t * CLOCK) / (OPS * 1000.0));
-#endif
-
-      MPN_COPY (dx, dy, size+2);
-      t0 = cputime();
-      for (i = 0; i < TIMES; i++)
-       cyy = mpn_submul_1 (dx+1, s1, size, xlimb);
-      t = cputime() - t0;
-#if TIMES != 1
-      printf ("mpn_submul_1:    %5ldms (%.2f cycles/limb)\n",
-             t,
-             ((double) t * CLOCK) / (OPS * 1000.0));
-#endif
-
-      MPN_COPY (dx, dy, size+2);
-      cyx = refmpn_submul_1 (dx+1, s1, size, xlimb);
-      cyy = mpn_submul_1 (dy+1, s1, size, xlimb);
-
-#ifdef PRINT
-      printf ("%*lX ", (int) (2 * sizeof(mp_limb_t)), cyx);
-      mpn_print (dx+1, size);
-      printf ("%*lX ", (int) (2 * sizeof(mp_limb_t)), cyy);
-      mpn_print (dy+1, size);
-#endif
-
-#ifndef NOCHECK
-      if (cyx != cyy || mpn_cmp (dx, dy, size+2) != 0
-         || dx[size+1] != 0x12345678 || dx[0] != 0x87654321)
-       {
-#ifndef PRINT
-         printf ("%*lX ", (int) (2 * sizeof(mp_limb_t)), cyx);
-         mpn_print (dx+1, size);
-         printf ("%*lX ", (int) (2 * sizeof(mp_limb_t)), cyy);
-         mpn_print (dy+1, size);
-#endif
-         abort();
-       }
-#endif
-    }
-}
-
-mpn_print (mp_ptr p, mp_size_t size)
-{
-  mp_size_t i;
-
-  for (i = size - 1; i >= 0; i--)
-    {
-      printf ("%0*lX", (int) (2 * sizeof(mp_limb_t)), p[i]);
-#ifdef SPACE
-      if (i != 0)
-       printf (" ");
-#endif
-    }
-  puts ("");
-}
diff --git a/ghc/rts/gmp/mpn/tests/tst-addsub.c b/ghc/rts/gmp/mpn/tests/tst-addsub.c
deleted file mode 100644 (file)
index e02b9d5..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include "gmp.h"
-#include "gmp-impl.h"
-
-#define ADD 1
-#define SUB 2
-
-#ifndef METHOD
-#define METHOD ADD
-#endif
-
-#if METHOD == ADD
-#define REFCALL refmpn_add_n
-#define TESTCALL mpn_add_n
-#endif
-
-#if METHOD == SUB
-#define REFCALL refmpn_sub_n
-#define TESTCALL mpn_sub_n
-#endif
-
-mp_limb_t refmpn_add_n ();
-mp_limb_t refmpn_sub_n ();
-
-#define SIZE 100
-
-main (argc, argv)
-     int argc;
-     char **argv;
-{
-  mp_size_t alloc_size, max_size, size, i, cumul_size;
-  mp_ptr s1, s2, dx, dy;
-  int s1_align, s2_align, d_align;
-  long pass, n_passes;
-  mp_limb_t cx, cy;
-
-  max_size = SIZE;
-  n_passes = 1000000;
-
-  argc--; argv++;
-  if (argc)
-    {
-      max_size = atol (*argv);
-      argc--; argv++;
-    }
-
-  alloc_size = max_size + 32;
-  s1 = malloc (alloc_size * BYTES_PER_MP_LIMB);
-  s2 = malloc (alloc_size * BYTES_PER_MP_LIMB);
-  dx = malloc (alloc_size * BYTES_PER_MP_LIMB);
-  dy = malloc (alloc_size * BYTES_PER_MP_LIMB);
-
-  cumul_size = 0;
-  for (pass = 0; pass < n_passes; pass++)
-    {
-      cumul_size += size;
-      if (cumul_size >= 1000000)
-       {
-         cumul_size -= 1000000;
-         printf ("%d ", pass); fflush (stdout);
-       }
-      s1_align = random () % 32;
-      s2_align = random () % 32;
-      d_align = random () % 32;
-
-      size = random () % max_size + 1;
-
-      mpn_random2 (s1 + s1_align, size);
-      mpn_random2 (s2 + s2_align, size);
-
-      for (i = 0; i < alloc_size; i++)
-       dx[i] = dy[i] = i + 0x9876500;
-
-      cx = TESTCALL (dx + d_align, s1 + s1_align, s2 + s2_align, size);
-      cy = REFCALL (dy + d_align, s1 + s1_align, s2 + s2_align, size);
-
-      if (cx != cy || mpn_cmp (dx, dy, alloc_size) != 0)
-       abort ();
-    }
-
-  printf ("%d passes OK\n", n_passes);
-  exit (0);
-}
-
-mp_limb_t
-#if __STDC__
-refmpn_add_n (mp_ptr res_ptr,
-             mp_srcptr s1_ptr, mp_srcptr s2_ptr, mp_size_t size)
-#else
-refmpn_add_n (res_ptr, s1_ptr, s2_ptr, size)
-     register mp_ptr res_ptr;
-     register mp_srcptr s1_ptr;
-     register mp_srcptr s2_ptr;
-     mp_size_t size;
-#endif
-{
-  register mp_limb_t x, y, cy;
-  register mp_size_t j;
-
-  /* The loop counter and index J goes from -SIZE to -1.  This way
-     the loop becomes faster.  */
-  j = -size;
-
-  /* Offset the base pointers to compensate for the negative indices.  */
-  s1_ptr -= j;
-  s2_ptr -= j;
-  res_ptr -= j;
-
-  cy = 0;
-  do
-    {
-      y = s2_ptr[j];
-      x = s1_ptr[j];
-      y += cy;                 /* add previous carry to one addend */
-      cy = (y < cy);           /* get out carry from that addition */
-      y = x + y;               /* add other addend */
-      cy = (y < x) + cy;       /* get out carry from that add, combine */
-      res_ptr[j] = y;
-    }
-  while (++j != 0);
-
-  return cy;
-}
-
-mp_limb_t
-#if __STDC__
-refmpn_sub_n (mp_ptr res_ptr,
-              mp_srcptr s1_ptr, mp_srcptr s2_ptr, mp_size_t size)
-#else
-refmpn_sub_n (res_ptr, s1_ptr, s2_ptr, size)
-     register mp_ptr res_ptr;
-     register mp_srcptr s1_ptr;
-     register mp_srcptr s2_ptr;
-     mp_size_t size;
-#endif
-{
-  register mp_limb_t x, y, cy;
-  register mp_size_t j;
-
-  /* The loop counter and index J goes from -SIZE to -1.  This way
-     the loop becomes faster.  */
-  j = -size;
-
-  /* Offset the base pointers to compensate for the negative indices.  */
-  s1_ptr -= j;
-  s2_ptr -= j;
-  res_ptr -= j;
-
-  cy = 0;
-  do
-    {
-      y = s2_ptr[j];
-      x = s1_ptr[j];
-      y += cy;                 /* add previous carry to subtrahend */
-      cy = (y < cy);           /* get out carry from that addition */
-      y = x - y;               /* main subtract */
-      cy = (y > x) + cy;       /* get out carry from the subtract, combine */
-      res_ptr[j] = y;
-    }
-  while (++j != 0);
-
-  return cy;
-}
diff --git a/ghc/rts/gmp/mpn/x86/add_n.S b/ghc/rts/gmp/mpn/x86/add_n.S
deleted file mode 100644 (file)
index 5bbbd0d..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-/* i80386 __mpn_add_n -- Add two limb vectors of the same length > 0 and store
-sum in a third limb vector.
-
-Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
-
-This file is part of the GNU MP Library.
-
-The GNU MP Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Library General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at your
-option) any later version.
-
-The GNU MP 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 Library General Public
-License for more details.
-
-You should have received a copy of the GNU Library General Public License
-along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-MA 02111-1307, USA. */
-
-/*
-  INPUT PARAMETERS
-  res_ptr      (sp + 4)
-  s1_ptr       (sp + 8)
-  s2_ptr       (sp + 12)
-  size         (sp + 16)
-*/
-
-#include "sysdep.h"
-#include "asm-syntax.h"
-
-.text
-       ALIGN (3)
-       .globl C_SYMBOL_NAME(__mpn_add_n)
-C_SYMBOL_NAME(__mpn_add_n:)
-       pushl %edi
-       pushl %esi
-
-       movl 12(%esp),%edi              /* res_ptr */
-       movl 16(%esp),%esi              /* s1_ptr */
-       movl 20(%esp),%edx              /* s2_ptr */
-       movl 24(%esp),%ecx              /* size */
-
-       movl    %ecx,%eax
-       shrl    $3,%ecx                 /* compute count for unrolled loop */
-       negl    %eax
-       andl    $7,%eax                 /* get index where to start loop */
-       jz      Loop                    /* necessary special case for 0 */
-       incl    %ecx                    /* adjust loop count */
-       shll    $2,%eax                 /* adjustment for pointers... */
-       subl    %eax,%edi               /* ... since they are offset ... */
-       subl    %eax,%esi               /* ... by a constant when we ... */
-       subl    %eax,%edx               /* ... enter the loop */
-       shrl    $2,%eax                 /* restore previous value */
-#ifdef PIC
-/* Calculate start address in loop for PIC.  Due to limitations in some
-   assemblers, Loop-L0-3 cannot be put into the leal */
-       call    L0
-L0:    leal    (%eax,%eax,8),%eax
-       addl    (%esp),%eax
-       addl    $(Loop-L0-3),%eax
-       addl    $4,%esp
-#else
-/* Calculate start address in loop for non-PIC.  */
-       leal    (Loop - 3)(%eax,%eax,8),%eax
-#endif
-       jmp     *%eax                   /* jump into loop */
-       ALIGN (3)
-Loop:  movl    (%esi),%eax
-       adcl    (%edx),%eax
-       movl    %eax,(%edi)
-       movl    4(%esi),%eax
-       adcl    4(%edx),%eax
-       movl    %eax,4(%edi)
-       movl    8(%esi),%eax
-       adcl    8(%edx),%eax
-       movl    %eax,8(%edi)
-       movl    12(%esi),%eax
-       adcl    12(%edx),%eax
-       movl    %eax,12(%edi)
-       movl    16(%esi),%eax
-       adcl    16(%edx),%eax
-       movl    %eax,16(%edi)
-       movl    20(%esi),%eax
-       adcl    20(%edx),%eax
-       movl    %eax,20(%edi)
-       movl    24(%esi),%eax
-       adcl    24(%edx),%eax
-       movl    %eax,24(%edi)
-       movl    28(%esi),%eax
-       adcl    28(%edx),%eax
-       movl    %eax,28(%edi)
-       leal    32(%edi),%edi
-       leal    32(%esi),%esi
-       leal    32(%edx),%edx
-       decl    %ecx
-       jnz     Loop
-
-       sbbl    %eax,%eax
-       negl    %eax
-
-       popl %esi
-       popl %edi
-       ret
diff --git a/ghc/rts/gmp/mpn/x86/addmul_1.S b/ghc/rts/gmp/mpn/x86/addmul_1.S
deleted file mode 100644 (file)
index c11209d..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/* i80386 __mpn_addmul_1 -- Multiply a limb vector with a limb and add
-   the result to a second limb vector.
-
-Copyright (C) 1992, 1994 Free Software Foundation, Inc.
-
-This file is part of the GNU MP Library.
-
-The GNU MP Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Library General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at your
-option) any later version.
-
-The GNU MP 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 Library General Public
-License for more details.
-
-You should have received a copy of the GNU Library General Public License
-along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-MA 02111-1307, USA. */
-
-/*
-   INPUT PARAMETERS
-   res_ptr     (sp + 4)
-   s1_ptr      (sp + 8)
-   size                (sp + 12)
-   s2_limb     (sp + 16)
-*/
-
-#include "sysdep.h"
-#include "asm-syntax.h"
-
-#define res_ptr edi
-#define s1_ptr esi
-#define size ecx
-#define s2_limb ebp
-
-       TEXT
-       ALIGN (3)
-       GLOBL   C_SYMBOL_NAME(__mpn_addmul_1)
-C_SYMBOL_NAME(__mpn_addmul_1:)
-
-       INSN1(push,l    ,R(edi))
-       INSN1(push,l    ,R(esi))
-       INSN1(push,l    ,R(ebx))
-       INSN1(push,l    ,R(ebp))
-
-       INSN2(mov,l     ,R(res_ptr),MEM_DISP(esp,20))
-       INSN2(mov,l     ,R(s1_ptr),MEM_DISP(esp,24))
-       INSN2(mov,l     ,R(size),MEM_DISP(esp,28))
-       INSN2(mov,l     ,R(s2_limb),MEM_DISP(esp,32))
-
-       INSN2(lea,l     ,R(res_ptr),MEM_INDEX(res_ptr,size,4))
-       INSN2(lea,l     ,R(s1_ptr),MEM_INDEX(s1_ptr,size,4))
-       INSN1(neg,l     ,R(size))
-       INSN2(xor,l     ,R(ebx),R(ebx))
-       ALIGN (3)
-Loop:
-       INSN2(mov,l     ,R(eax),MEM_INDEX(s1_ptr,size,4))
-       INSN1(mul,l     ,R(s2_limb))
-       INSN2(add,l     ,R(eax),R(ebx))
-       INSN2(adc,l     ,R(edx),$0)
-       INSN2(add,l     ,MEM_INDEX(res_ptr,size,4),R(eax))
-       INSN2(adc,l     ,R(edx),$0)
-       INSN2(mov,l     ,R(ebx),R(edx))
-
-       INSN1(inc,l     ,R(size))
-       INSN1(jnz,      ,Loop)
-       INSN2(mov,l     ,R(eax),R(ebx))
-
-       INSN1(pop,l     ,R(ebp))
-       INSN1(pop,l     ,R(ebx))
-       INSN1(pop,l     ,R(esi))
-       INSN1(pop,l     ,R(edi))
-       ret
diff --git a/ghc/rts/gmp/mpn/x86/lshift.S b/ghc/rts/gmp/mpn/x86/lshift.S
deleted file mode 100644 (file)
index 8173b92..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/* i80386 __mpn_lshift -- 
-
-Copyright (C) 1992, 1994 Free Software Foundation, Inc.
-
-This file is part of the GNU MP Library.
-
-The GNU MP Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Library General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at your
-option) any later version.
-
-The GNU MP 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 Library General Public
-License for more details.
-
-You should have received a copy of the GNU Library General Public License
-along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-MA 02111-1307, USA. */
-
-/*
-  INPUT PARAMETERS
-  res_ptr      (sp + 4)
-  s_ptr                (sp + 8)
-  size         (sp + 12)
-  cnt          (sp + 16)
-*/
-
-#include "sysdep.h"
-#include "asm-syntax.h"
-
-.text
-       ALIGN (3)
-       .globl C_SYMBOL_NAME(__mpn_lshift)
-C_SYMBOL_NAME(__mpn_lshift:)
-       pushl   %edi
-       pushl   %esi
-       pushl   %ebx
-
-       movl    16(%esp),%edi           /* res_ptr */
-       movl    20(%esp),%esi           /* s_ptr */
-       movl    24(%esp),%edx           /* size */
-       movl    28(%esp),%ecx           /* cnt */
-
-       subl    $4,%esi                 /* adjust s_ptr */
-
-       movl    (%esi,%edx,4),%ebx      /* read most significant limb */
-       xorl    %eax,%eax
-       shldl   %cl,%ebx,%eax           /* compute carry limb */
-       decl    %edx
-       jz      Lend
-       pushl   %eax                    /* push carry limb onto stack */
-       testb   $1,%edx
-       jnz     L1                      /* enter loop in the middle */
-       movl    %ebx,%eax
-
-       ALIGN (3)
-Loop:  movl    (%esi,%edx,4),%ebx      /* load next lower limb */
-       shldl   %cl,%ebx,%eax           /* compute result limb */
-       movl    %eax,(%edi,%edx,4)      /* store it */
-       decl    %edx
-L1:    movl    (%esi,%edx,4),%eax
-       shldl   %cl,%eax,%ebx
-       movl    %ebx,(%edi,%edx,4)
-       decl    %edx
-       jnz     Loop
-
-       shll    %cl,%eax                /* compute least significant limb */
-       movl    %eax,(%edi)             /* store it */
-
-       popl    %eax                    /* pop carry limb */
-
-       popl    %ebx
-       popl    %esi
-       popl    %edi
-       ret
-
-Lend:  shll    %cl,%ebx                /* compute least significant limb */
-       movl    %ebx,(%edi)             /* store it */
-
-       popl    %ebx
-       popl    %esi
-       popl    %edi
-       ret
diff --git a/ghc/rts/gmp/mpn/x86/mul_1.S b/ghc/rts/gmp/mpn/x86/mul_1.S
deleted file mode 100644 (file)
index b271399..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/* i80386 __mpn_mul_1 -- Multiply a limb vector with a limb and store
-   the result in a second limb vector.
-
-Copyright (C) 1992, 1994 Free Software Foundation, Inc.
-
-This file is part of the GNU MP Library.
-
-The GNU MP Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Library General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at your
-option) any later version.
-
-The GNU MP 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 Library General Public
-License for more details.
-
-You should have received a copy of the GNU Library General Public License
-along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-MA 02111-1307, USA. */
-
-/*
-   INPUT PARAMETERS
-   res_ptr     (sp + 4)
-   s1_ptr      (sp + 8)
-   size                (sp + 12)
-   s2_limb     (sp + 16)
-*/
-
-#include "sysdep.h"
-#include "asm-syntax.h"
-
-#define res_ptr edi
-#define s1_ptr esi
-#define size ecx
-#define s2_limb ebp
-
-       TEXT
-       ALIGN (3)
-       GLOBL   C_SYMBOL_NAME(__mpn_mul_1)
-C_SYMBOL_NAME(__mpn_mul_1:)
-
-       INSN1(push,l    ,R(edi))
-       INSN1(push,l    ,R(esi))
-       INSN1(push,l    ,R(ebx))
-       INSN1(push,l    ,R(ebp))
-
-       INSN2(mov,l     ,R(res_ptr),MEM_DISP(esp,20))
-       INSN2(mov,l     ,R(s1_ptr),MEM_DISP(esp,24))
-       INSN2(mov,l     ,R(size),MEM_DISP(esp,28))
-       INSN2(mov,l     ,R(s2_limb),MEM_DISP(esp,32))
-
-       INSN2(lea,l     ,R(res_ptr),MEM_INDEX(res_ptr,size,4))
-       INSN2(lea,l     ,R(s1_ptr),MEM_INDEX(s1_ptr,size,4))
-       INSN1(neg,l     ,R(size))
-       INSN2(xor,l     ,R(ebx),R(ebx))
-       ALIGN (3)
-Loop:
-       INSN2(mov,l     ,R(eax),MEM_INDEX(s1_ptr,size,4))
-       INSN1(mul,l     ,R(s2_limb))
-       INSN2(add,l     ,R(eax),R(ebx))
-       INSN2(mov,l     ,MEM_INDEX(res_ptr,size,4),R(eax))
-       INSN2(adc,l     ,R(edx),$0)
-       INSN2(mov,l     ,R(ebx),R(edx))
-
-       INSN1(inc,l     ,R(size))
-       INSN1(jnz,      ,Loop)
-       INSN2(mov,l     ,R(eax),R(ebx))
-
-       INSN1(pop,l     ,R(ebp))
-       INSN1(pop,l     ,R(ebx))
-       INSN1(pop,l     ,R(esi))
-       INSN1(pop,l     ,R(edi))
-       ret
diff --git a/ghc/rts/gmp/mpn/x86/pentium/add_n.S b/ghc/rts/gmp/mpn/x86/pentium/add_n.S
deleted file mode 100644 (file)
index ac6f281..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-/* Pentium __mpn_add_n -- Add two limb vectors of the same length > 0 and store
-   sum in a third limb vector.
-
-Copyright (C) 1992, 1994, 1995, 1996 Free Software Foundation, Inc.
-
-This file is part of the GNU MP Library.
-
-The GNU MP Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Library General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at your
-option) any later version.
-
-The GNU MP 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 Library General Public
-License for more details.
-
-You should have received a copy of the GNU Library General Public License
-along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-MA 02111-1307, USA. */
-
-/*
-   INPUT PARAMETERS
-   res_ptr     (sp + 4)
-   s1_ptr      (sp + 8)
-   s2_ptr      (sp + 12)
-   size                (sp + 16)
-*/
-
-#include "sysdep.h"
-#include "asm-syntax.h"
-
-.text
-       ALIGN (3)
-       .globl C_SYMBOL_NAME(__mpn_add_n)
-C_SYMBOL_NAME(__mpn_add_n:)
-       pushl   %edi
-       pushl   %esi
-       pushl   %ebx
-       pushl   %ebp
-
-       movl    20(%esp),%edi           /* res_ptr */
-       movl    24(%esp),%esi           /* s1_ptr */
-       movl    28(%esp),%ebp           /* s2_ptr */
-       movl    32(%esp),%ecx           /* size */
-
-       movl    (%ebp),%ebx
-
-       decl    %ecx
-       movl    %ecx,%edx
-       shrl    $3,%ecx
-       andl    $7,%edx
-       testl   %ecx,%ecx               /* zero carry flag */
-       jz      Lend
-       pushl   %edx
-
-       ALIGN (3)
-Loop:  movl    28(%edi),%eax           /* fetch destination cache line */
-       leal    32(%edi),%edi
-
-L1:    movl    (%esi),%eax
-       movl    4(%esi),%edx
-       adcl    %ebx,%eax
-       movl    4(%ebp),%ebx
-       adcl    %ebx,%edx
-       movl    8(%ebp),%ebx
-       movl    %eax,-32(%edi)
-       movl    %edx,-28(%edi)
-
-L2:    movl    8(%esi),%eax
-       movl    12(%esi),%edx
-       adcl    %ebx,%eax
-       movl    12(%ebp),%ebx
-       adcl    %ebx,%edx
-       movl    16(%ebp),%ebx
-       movl    %eax,-24(%edi)
-       movl    %edx,-20(%edi)
-
-L3:    movl    16(%esi),%eax
-       movl    20(%esi),%edx
-       adcl    %ebx,%eax
-       movl    20(%ebp),%ebx
-       adcl    %ebx,%edx
-       movl    24(%ebp),%ebx
-       movl    %eax,-16(%edi)
-       movl    %edx,-12(%edi)
-
-L4:    movl    24(%esi),%eax
-       movl    28(%esi),%edx
-       adcl    %ebx,%eax
-       movl    28(%ebp),%ebx
-       adcl    %ebx,%edx
-       movl    32(%ebp),%ebx
-       movl    %eax,-8(%edi)
-       movl    %edx,-4(%edi)
-
-       leal    32(%esi),%esi
-       leal    32(%ebp),%ebp
-       decl    %ecx
-       jnz     Loop
-
-       popl    %edx
-Lend:
-       decl    %edx                    /* test %edx w/o clobbering carry */
-       js      Lend2
-       incl    %edx
-Loop2:
-       leal    4(%edi),%edi
-       movl    (%esi),%eax
-       adcl    %ebx,%eax
-       movl    4(%ebp),%ebx
-       movl    %eax,-4(%edi)
-       leal    4(%esi),%esi
-       leal    4(%ebp),%ebp
-       decl    %edx
-       jnz     Loop2
-Lend2:
-       movl    (%esi),%eax
-       adcl    %ebx,%eax
-       movl    %eax,(%edi)
-
-       sbbl    %eax,%eax
-       negl    %eax
-
-       popl    %ebp
-       popl    %ebx
-       popl    %esi
-       popl    %edi
-       ret
diff --git a/ghc/rts/gmp/mpn/x86/pentium/addmul_1.S b/ghc/rts/gmp/mpn/x86/pentium/addmul_1.S
deleted file mode 100644 (file)
index 7cfa5db..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/* Pentium __mpn_addmul_1 -- Multiply a limb vector with a limb and add
-   the result to a second limb vector.
-
-Copyright (C) 1992, 1994, 1996 Free Software Foundation, Inc.
-
-This file is part of the GNU MP Library.
-
-The GNU MP Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Library General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at your
-option) any later version.
-
-The GNU MP 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 Library General Public
-License for more details.
-
-You should have received a copy of the GNU Library General Public License
-along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-MA 02111-1307, USA. */
-
-/*
-   INPUT PARAMETERS
-   res_ptr     (sp + 4)
-   s1_ptr      (sp + 8)
-   size                (sp + 12)
-   s2_limb     (sp + 16)
-*/
-
-#include "sysdep.h"
-#include "asm-syntax.h"
-
-#define res_ptr edi
-#define s1_ptr esi
-#define size ecx
-#define s2_limb ebp
-
-       TEXT
-       ALIGN (3)
-       GLOBL   C_SYMBOL_NAME(__mpn_addmul_1)
-C_SYMBOL_NAME(__mpn_addmul_1:)
-
-       INSN1(push,l    ,R(edi))
-       INSN1(push,l    ,R(esi))
-       INSN1(push,l    ,R(ebx))
-       INSN1(push,l    ,R(ebp))
-
-       INSN2(mov,l     ,R(res_ptr),MEM_DISP(esp,20))
-       INSN2(mov,l     ,R(s1_ptr),MEM_DISP(esp,24))
-       INSN2(mov,l     ,R(size),MEM_DISP(esp,28))
-       INSN2(mov,l     ,R(s2_limb),MEM_DISP(esp,32))
-
-       INSN2(lea,l     ,R(res_ptr),MEM_INDEX(res_ptr,size,4))
-       INSN2(lea,l     ,R(s1_ptr),MEM_INDEX(s1_ptr,size,4))
-       INSN1(neg,l     ,R(size))
-       INSN2(xor,l     ,R(ebx),R(ebx))
-       ALIGN (3)
-
-Loop:  INSN2(adc,l     ,R(ebx),$0)
-       INSN2(mov,l     ,R(eax),MEM_INDEX(s1_ptr,size,4))
-
-       INSN1(mul,l     ,R(s2_limb))
-
-       INSN2(add,l     ,R(eax),R(ebx))
-       INSN2(mov,l     ,R(ebx),MEM_INDEX(res_ptr,size,4))
-
-       INSN2(adc,l     ,R(edx),$0)
-       INSN2(add,l     ,R(ebx),R(eax))
-
-       INSN2(mov,l     ,MEM_INDEX(res_ptr,size,4),R(ebx))
-       INSN1(inc,l     ,R(size))
-
-       INSN2(mov,l     ,R(ebx),R(edx))
-       INSN1(jnz,      ,Loop)
-
-       INSN2(adc,l     ,R(ebx),$0)
-       INSN2(mov,l     ,R(eax),R(ebx))
-       INSN1(pop,l     ,R(ebp))
-       INSN1(pop,l     ,R(ebx))
-       INSN1(pop,l     ,R(esi))
-       INSN1(pop,l     ,R(edi))
-       ret
diff --git a/ghc/rts/gmp/mpn/x86/pentium/lshift.S b/ghc/rts/gmp/mpn/x86/pentium/lshift.S
deleted file mode 100644 (file)
index b298983..0000000
+++ /dev/null
@@ -1,217 +0,0 @@
-/* Pentium optimized __mpn_lshift -- 
-
-Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
-
-This file is part of the GNU MP Library.
-
-The GNU MP Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Library General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at your
-option) any later version.
-
-The GNU MP 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 Library General Public
-License for more details.
-
-You should have received a copy of the GNU Library General Public License
-along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-MA 02111-1307, USA. */
-
-/*
-  INPUT PARAMETERS
-  res_ptr      (sp + 4)
-  s_ptr                (sp + 8)
-  size         (sp + 12)
-  cnt          (sp + 16)
-*/
-
-#include "sysdep.h"
-#include "asm-syntax.h"
-
-.text
-       ALIGN (3)
-       .globl C_SYMBOL_NAME(__mpn_lshift)
-C_SYMBOL_NAME(__mpn_lshift:)
-       pushl   %edi
-       pushl   %esi
-       pushl   %ebx
-       pushl   %ebp
-
-       movl    20(%esp),%edi           /* res_ptr */
-       movl    24(%esp),%esi           /* s_ptr */
-       movl    28(%esp),%ebp           /* size */
-       movl    32(%esp),%ecx           /* cnt */
-
-/* We can use faster code for shift-by-1 under certain conditions.  */
-       cmp     $1,%ecx
-       jne     Lnormal
-       leal    4(%esi),%eax
-       cmpl    %edi,%eax
-       jnc     Lspecial                /* jump if s_ptr + 1 >= res_ptr */
-       leal    (%esi,%ebp,4),%eax
-       cmpl    %eax,%edi
-       jnc     Lspecial                /* jump if res_ptr >= s_ptr + size */
-
-Lnormal:
-       leal    -4(%edi,%ebp,4),%edi
-       leal    -4(%esi,%ebp,4),%esi
-
-       movl    (%esi),%edx
-       subl    $4,%esi
-       xorl    %eax,%eax
-       shldl   %cl,%edx,%eax           /* compute carry limb */
-       pushl   %eax                    /* push carry limb onto stack */
-
-       decl    %ebp
-       pushl   %ebp
-       shrl    $3,%ebp
-       jz      Lend
-
-       movl    (%edi),%eax             /* fetch destination cache line */
-
-       ALIGN   (2)
-Loop:  movl    -28(%edi),%eax          /* fetch destination cache line */
-       movl    %edx,%ebx
-
-       movl    (%esi),%eax
-       movl    -4(%esi),%edx
-       shldl   %cl,%eax,%ebx
-       shldl   %cl,%edx,%eax
-       movl    %ebx,(%edi)
-       movl    %eax,-4(%edi)
-
-       movl    -8(%esi),%ebx
-       movl    -12(%esi),%eax
-       shldl   %cl,%ebx,%edx
-       shldl   %cl,%eax,%ebx
-       movl    %edx,-8(%edi)
-       movl    %ebx,-12(%edi)
-
-       movl    -16(%esi),%edx
-       movl    -20(%esi),%ebx
-       shldl   %cl,%edx,%eax
-       shldl   %cl,%ebx,%edx
-       movl    %eax,-16(%edi)
-       movl    %edx,-20(%edi)
-
-       movl    -24(%esi),%eax
-       movl    -28(%esi),%edx
-       shldl   %cl,%eax,%ebx
-       shldl   %cl,%edx,%eax
-       movl    %ebx,-24(%edi)
-       movl    %eax,-28(%edi)
-
-       subl    $32,%esi
-       subl    $32,%edi
-       decl    %ebp
-       jnz     Loop
-
-Lend:  popl    %ebp
-       andl    $7,%ebp
-       jz      Lend2
-Loop2: movl    (%esi),%eax
-       shldl   %cl,%eax,%edx
-       movl    %edx,(%edi)
-       movl    %eax,%edx
-       subl    $4,%esi
-       subl    $4,%edi
-       decl    %ebp
-       jnz     Loop2
-
-Lend2: shll    %cl,%edx                /* compute least significant limb */
-       movl    %edx,(%edi)             /* store it */
-
-       popl    %eax                    /* pop carry limb */
-
-       popl    %ebp
-       popl    %ebx
-       popl    %esi
-       popl    %edi
-       ret
-
-/* We loop from least significant end of the arrays, which is only
-   permissable if the source and destination don't overlap, since the
-   function is documented to work for overlapping source and destination.
-*/
-
-Lspecial:
-       movl    (%esi),%edx
-       addl    $4,%esi
-
-       decl    %ebp
-       pushl   %ebp
-       shrl    $3,%ebp
-
-       addl    %edx,%edx
-       incl    %ebp
-       decl    %ebp
-       jz      LLend
-
-       movl    (%edi),%eax             /* fetch destination cache line */
-
-       ALIGN   (2)
-LLoop: movl    28(%edi),%eax           /* fetch destination cache line */
-       movl    %edx,%ebx
-
-       movl    (%esi),%eax
-       movl    4(%esi),%edx
-       adcl    %eax,%eax
-       movl    %ebx,(%edi)
-       adcl    %edx,%edx
-       movl    %eax,4(%edi)
-
-       movl    8(%esi),%ebx
-       movl    12(%esi),%eax
-       adcl    %ebx,%ebx
-       movl    %edx,8(%edi)
-       adcl    %eax,%eax
-       movl    %ebx,12(%edi)
-
-       movl    16(%esi),%edx
-       movl    20(%esi),%ebx
-       adcl    %edx,%edx
-       movl    %eax,16(%edi)
-       adcl    %ebx,%ebx
-       movl    %edx,20(%edi)
-
-       movl    24(%esi),%eax
-       movl    28(%esi),%edx
-       adcl    %eax,%eax
-       movl    %ebx,24(%edi)
-       adcl    %edx,%edx
-       movl    %eax,28(%edi)
-
-       leal    32(%esi),%esi           /* use leal not to clobber carry */
-       leal    32(%edi),%edi
-       decl    %ebp
-       jnz     LLoop
-
-LLend: popl    %ebp
-       sbbl    %eax,%eax               /* save carry in %eax */
-       andl    $7,%ebp
-       jz      LLend2
-       addl    %eax,%eax               /* restore carry from eax */
-LLoop2:        movl    %edx,%ebx
-       movl    (%esi),%edx
-       adcl    %edx,%edx
-       movl    %ebx,(%edi)
-
-       leal    4(%esi),%esi            /* use leal not to clobber carry */
-       leal    4(%edi),%edi
-       decl    %ebp
-       jnz     LLoop2
-
-       jmp     LL1
-LLend2:        addl    %eax,%eax               /* restore carry from eax */
-LL1:   movl    %edx,(%edi)             /* store last limb */
-
-       sbbl    %eax,%eax
-       negl    %eax
-
-       popl    %ebp
-       popl    %ebx
-       popl    %esi
-       popl    %edi
-       ret
diff --git a/ghc/rts/gmp/mpn/x86/pentium/mul_1.S b/ghc/rts/gmp/mpn/x86/pentium/mul_1.S
deleted file mode 100644 (file)
index 4ac3050..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/* Pentium __mpn_mul_1 -- Multiply a limb vector with a limb and store
-   the result in a second limb vector.
-
-Copyright (C) 1992, 1994, 1996 Free Software Foundation, Inc.
-
-This file is part of the GNU MP Library.
-
-The GNU MP Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Library General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at your
-option) any later version.
-
-The GNU MP 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 Library General Public
-License for more details.
-
-You should have received a copy of the GNU Library General Public License
-along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-MA 02111-1307, USA. */
-
-/*
-   INPUT PARAMETERS
-   res_ptr     (sp + 4)
-   s1_ptr      (sp + 8)
-   size                (sp + 12)
-   s2_limb     (sp + 16)
-*/
-
-#include "sysdep.h"
-#include "asm-syntax.h"
-
-#define res_ptr edi
-#define s1_ptr esi
-#define size ecx
-#define s2_limb ebp
-
-       TEXT
-       ALIGN (3)
-       GLOBL   C_SYMBOL_NAME(__mpn_mul_1)
-C_SYMBOL_NAME(__mpn_mul_1:)
-
-       INSN1(push,l    ,R(edi))
-       INSN1(push,l    ,R(esi))
-       INSN1(push,l    ,R(ebx))
-       INSN1(push,l    ,R(ebp))
-
-       INSN2(mov,l     ,R(res_ptr),MEM_DISP(esp,20))
-       INSN2(mov,l     ,R(s1_ptr),MEM_DISP(esp,24))
-       INSN2(mov,l     ,R(size),MEM_DISP(esp,28))
-       INSN2(mov,l     ,R(s2_limb),MEM_DISP(esp,32))
-
-       INSN2(lea,l     ,R(res_ptr),MEM_INDEX(res_ptr,size,4))
-       INSN2(lea,l     ,R(s1_ptr),MEM_INDEX(s1_ptr,size,4))
-       INSN1(neg,l     ,R(size))
-       INSN2(xor,l     ,R(ebx),R(ebx))
-       ALIGN (3)
-
-Loop:  INSN2(adc,l     ,R(ebx),$0)
-       INSN2(mov,l     ,R(eax),MEM_INDEX(s1_ptr,size,4))
-
-       INSN1(mul,l     ,R(s2_limb))
-
-       INSN2(add,l     ,R(ebx),R(eax))
-
-       INSN2(mov,l     ,MEM_INDEX(res_ptr,size,4),R(ebx))
-       INSN1(inc,l     ,R(size))
-
-       INSN2(mov,l     ,R(ebx),R(edx))
-       INSN1(jnz,      ,Loop)
-
-       INSN2(adc,l     ,R(ebx),$0)
-       INSN2(mov,l     ,R(eax),R(ebx))
-       INSN1(pop,l     ,R(ebp))
-       INSN1(pop,l     ,R(ebx))
-       INSN1(pop,l     ,R(esi))
-       INSN1(pop,l     ,R(edi))
-       ret
diff --git a/ghc/rts/gmp/mpn/x86/pentium/rshift.S b/ghc/rts/gmp/mpn/x86/pentium/rshift.S
deleted file mode 100644 (file)
index 38398ed..0000000
+++ /dev/null
@@ -1,217 +0,0 @@
-/* Pentium optimized __mpn_rshift -- 
-
-Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
-
-This file is part of the GNU MP Library.
-
-The GNU MP Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Library General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at your
-option) any later version.
-
-The GNU MP 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 Library General Public
-License for more details.
-
-You should have received a copy of the GNU Library General Public License
-along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-MA 02111-1307, USA. */
-
-/*
-  INPUT PARAMETERS
-  res_ptr      (sp + 4)
-  s_ptr                (sp + 8)
-  size         (sp + 12)
-  cnt          (sp + 16)
-*/
-
-#include "sysdep.h"
-#include "asm-syntax.h"
-
-.text
-       ALIGN (3)
-       .globl C_SYMBOL_NAME(__mpn_rshift)
-C_SYMBOL_NAME(__mpn_rshift:)
-       pushl   %edi
-       pushl   %esi
-       pushl   %ebx
-       pushl   %ebp
-
-       movl    20(%esp),%edi           /* res_ptr */
-       movl    24(%esp),%esi           /* s_ptr */
-       movl    28(%esp),%ebp           /* size */
-       movl    32(%esp),%ecx           /* cnt */
-
-/* We can use faster code for shift-by-1 under certain conditions.  */
-       cmp     $1,%ecx
-       jne     Lnormal
-       leal    4(%edi),%eax
-       cmpl    %esi,%eax
-       jnc     Lspecial                /* jump if res_ptr + 1 >= s_ptr */
-       leal    (%edi,%ebp,4),%eax
-       cmpl    %eax,%esi
-       jnc     Lspecial                /* jump if s_ptr >= res_ptr + size */
-
-Lnormal:
-       movl    (%esi),%edx
-       addl    $4,%esi
-       xorl    %eax,%eax
-       shrdl   %cl,%edx,%eax           /* compute carry limb */
-       pushl   %eax                    /* push carry limb onto stack */
-
-       decl    %ebp
-       pushl   %ebp
-       shrl    $3,%ebp
-       jz      Lend
-
-       movl    (%edi),%eax             /* fetch destination cache line */
-
-       ALIGN   (2)
-Loop:  movl    28(%edi),%eax           /* fetch destination cache line */
-       movl    %edx,%ebx
-
-       movl    (%esi),%eax
-       movl    4(%esi),%edx
-       shrdl   %cl,%eax,%ebx
-       shrdl   %cl,%edx,%eax
-       movl    %ebx,(%edi)
-       movl    %eax,4(%edi)
-
-       movl    8(%esi),%ebx
-       movl    12(%esi),%eax
-       shrdl   %cl,%ebx,%edx
-       shrdl   %cl,%eax,%ebx
-       movl    %edx,8(%edi)
-       movl    %ebx,12(%edi)
-
-       movl    16(%esi),%edx
-       movl    20(%esi),%ebx
-       shrdl   %cl,%edx,%eax
-       shrdl   %cl,%ebx,%edx
-       movl    %eax,16(%edi)
-       movl    %edx,20(%edi)
-
-       movl    24(%esi),%eax
-       movl    28(%esi),%edx
-       shrdl   %cl,%eax,%ebx
-       shrdl   %cl,%edx,%eax
-       movl    %ebx,24(%edi)
-       movl    %eax,28(%edi)
-
-       addl    $32,%esi
-       addl    $32,%edi
-       decl    %ebp
-       jnz     Loop
-
-Lend:  popl    %ebp
-       andl    $7,%ebp
-       jz      Lend2
-Loop2: movl    (%esi),%eax
-       shrdl   %cl,%eax,%edx           /* compute result limb */
-       movl    %edx,(%edi)
-       movl    %eax,%edx
-       addl    $4,%esi
-       addl    $4,%edi
-       decl    %ebp
-       jnz     Loop2
-
-Lend2: shrl    %cl,%edx                /* compute most significant limb */
-       movl    %edx,(%edi)             /* store it */
-
-       popl    %eax                    /* pop carry limb */
-
-       popl    %ebp
-       popl    %ebx
-       popl    %esi
-       popl    %edi
-       ret
-
-/* We loop from least significant end of the arrays, which is only
-   permissable if the source and destination don't overlap, since the
-   function is documented to work for overlapping source and destination.
-*/
-
-Lspecial:
-       leal    -4(%edi,%ebp,4),%edi
-       leal    -4(%esi,%ebp,4),%esi
-
-       movl    (%esi),%edx
-       subl    $4,%esi
-
-       decl    %ebp
-       pushl   %ebp
-       shrl    $3,%ebp
-
-       shrl    $1,%edx
-       incl    %ebp
-       decl    %ebp
-       jz      LLend
-
-       movl    (%edi),%eax             /* fetch destination cache line */
-
-       ALIGN   (2)
-LLoop: movl    -28(%edi),%eax          /* fetch destination cache line */
-       movl    %edx,%ebx
-
-       movl    (%esi),%eax
-       movl    -4(%esi),%edx
-       rcrl    $1,%eax
-       movl    %ebx,(%edi)
-       rcrl    $1,%edx
-       movl    %eax,-4(%edi)
-
-       movl    -8(%esi),%ebx
-       movl    -12(%esi),%eax
-       rcrl    $1,%ebx
-       movl    %edx,-8(%edi)
-       rcrl    $1,%eax
-       movl    %ebx,-12(%edi)
-
-       movl    -16(%esi),%edx
-       movl    -20(%esi),%ebx
-       rcrl    $1,%edx
-       movl    %eax,-16(%edi)
-       rcrl    $1,%ebx
-       movl    %edx,-20(%edi)
-
-       movl    -24(%esi),%eax
-       movl    -28(%esi),%edx
-       rcrl    $1,%eax
-       movl    %ebx,-24(%edi)
-       rcrl    $1,%edx
-       movl    %eax,-28(%edi)
-
-       leal    -32(%esi),%esi          /* use leal not to clobber carry */
-       leal    -32(%edi),%edi
-       decl    %ebp
-       jnz     LLoop
-
-LLend: popl    %ebp
-       sbbl    %eax,%eax               /* save carry in %eax */
-       andl    $7,%ebp
-       jz      LLend2
-       addl    %eax,%eax               /* restore carry from eax */
-LLoop2:        movl    %edx,%ebx
-       movl    (%esi),%edx
-       rcrl    $1,%edx
-       movl    %ebx,(%edi)
-
-       leal    -4(%esi),%esi           /* use leal not to clobber carry */
-       leal    -4(%edi),%edi
-       decl    %ebp
-       jnz     LLoop2
-
-       jmp     LL1
-LLend2:        addl    %eax,%eax               /* restore carry from eax */
-LL1:   movl    %edx,(%edi)             /* store last limb */
-
-       movl    $0,%eax
-       rcrl    $1,%eax
-
-       popl    %ebp
-       popl    %ebx
-       popl    %esi
-       popl    %edi
-       ret
diff --git a/ghc/rts/gmp/mpn/x86/pentium/sub_n.S b/ghc/rts/gmp/mpn/x86/pentium/sub_n.S
deleted file mode 100644 (file)
index d1a2bc0..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-/* Pentium __mpn_sub_n -- Subtract two limb vectors of the same length > 0
-   and store difference in a third limb vector.
-
-Copyright (C) 1992, 1994, 1995, 1996 Free Software Foundation, Inc.
-
-This file is part of the GNU MP Library.
-
-The GNU MP Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Library General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at your
-option) any later version.
-
-The GNU MP 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 Library General Public
-License for more details.
-
-You should have received a copy of the GNU Library General Public License
-along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-MA 02111-1307, USA. */
-
-/*
-   INPUT PARAMETERS
-   res_ptr     (sp + 4)
-   s1_ptr      (sp + 8)
-   s2_ptr      (sp + 12)
-   size                (sp + 16)
-*/
-
-#include "sysdep.h"
-#include "asm-syntax.h"
-
-.text
-       ALIGN (3)
-       .globl C_SYMBOL_NAME(__mpn_sub_n)
-C_SYMBOL_NAME(__mpn_sub_n:)
-       pushl   %edi
-       pushl   %esi
-       pushl   %ebx
-       pushl   %ebp
-
-       movl    20(%esp),%edi           /* res_ptr */
-       movl    24(%esp),%esi           /* s1_ptr */
-       movl    28(%esp),%ebp           /* s2_ptr */
-       movl    32(%esp),%ecx           /* size */
-
-       movl    (%ebp),%ebx
-
-       decl    %ecx
-       movl    %ecx,%edx
-       shrl    $3,%ecx
-       andl    $7,%edx
-       testl   %ecx,%ecx               /* zero carry flag */
-       jz      Lend
-       pushl   %edx
-
-       ALIGN (3)
-Loop:  movl    28(%edi),%eax           /* fetch destination cache line */
-       leal    32(%edi),%edi
-
-L1:    movl    (%esi),%eax
-       movl    4(%esi),%edx
-       sbbl    %ebx,%eax
-       movl    4(%ebp),%ebx
-       sbbl    %ebx,%edx
-       movl    8(%ebp),%ebx
-       movl    %eax,-32(%edi)
-       movl    %edx,-28(%edi)
-
-L2:    movl    8(%esi),%eax
-       movl    12(%esi),%edx
-       sbbl    %ebx,%eax
-       movl    12(%ebp),%ebx
-       sbbl    %ebx,%edx
-       movl    16(%ebp),%ebx
-       movl    %eax,-24(%edi)
-       movl    %edx,-20(%edi)
-
-L3:    movl    16(%esi),%eax
-       movl    20(%esi),%edx
-       sbbl    %ebx,%eax
-       movl    20(%ebp),%ebx
-       sbbl    %ebx,%edx
-       movl    24(%ebp),%ebx
-       movl    %eax,-16(%edi)
-       movl    %edx,-12(%edi)
-
-L4:    movl    24(%esi),%eax
-       movl    28(%esi),%edx
-       sbbl    %ebx,%eax
-       movl    28(%ebp),%ebx
-       sbbl    %ebx,%edx
-       movl    32(%ebp),%ebx
-       movl    %eax,-8(%edi)
-       movl    %edx,-4(%edi)
-
-       leal    32(%esi),%esi
-       leal    32(%ebp),%ebp
-       decl    %ecx
-       jnz     Loop
-
-       popl    %edx
-Lend:
-       decl    %edx                    /* test %edx w/o clobbering carry */
-       js      Lend2
-       incl    %edx
-Loop2:
-       leal    4(%edi),%edi
-       movl    (%esi),%eax
-       sbbl    %ebx,%eax
-       movl    4(%ebp),%ebx
-       movl    %eax,-4(%edi)
-       leal    4(%esi),%esi
-       leal    4(%ebp),%ebp
-       decl    %edx
-       jnz     Loop2
-Lend2:
-       movl    (%esi),%eax
-       sbbl    %ebx,%eax
-       movl    %eax,(%edi)
-
-       sbbl    %eax,%eax
-       negl    %eax
-
-       popl    %ebp
-       popl    %ebx
-       popl    %esi
-       popl    %edi
-       ret
diff --git a/ghc/rts/gmp/mpn/x86/pentium/submul_1.S b/ghc/rts/gmp/mpn/x86/pentium/submul_1.S
deleted file mode 100644 (file)
index adf2d63..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/* Pentium __mpn_submul_1 -- Multiply a limb vector with a limb and subtract
-   the result from a second limb vector.
-
-Copyright (C) 1992, 1994, 1996 Free Software Foundation, Inc.
-
-This file is part of the GNU MP Library.
-
-The GNU MP Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Library General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at your
-option) any later version.
-
-The GNU MP 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 Library General Public
-License for more details.
-
-You should have received a copy of the GNU Library General Public License
-along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-MA 02111-1307, USA. */
-
-/*
-   INPUT PARAMETERS
-   res_ptr     (sp + 4)
-   s1_ptr      (sp + 8)
-   size                (sp + 12)
-   s2_limb     (sp + 16)
-*/
-
-#include "sysdep.h"
-#include "asm-syntax.h"
-
-#define res_ptr edi
-#define s1_ptr esi
-#define size ecx
-#define s2_limb ebp
-
-       TEXT
-       ALIGN (3)
-       GLOBL   C_SYMBOL_NAME(__mpn_submul_1)
-C_SYMBOL_NAME(__mpn_submul_1:)
-
-       INSN1(push,l    ,R(edi))
-       INSN1(push,l    ,R(esi))
-       INSN1(push,l    ,R(ebx))
-       INSN1(push,l    ,R(ebp))
-
-       INSN2(mov,l     ,R(res_ptr),MEM_DISP(esp,20))
-       INSN2(mov,l     ,R(s1_ptr),MEM_DISP(esp,24))
-       INSN2(mov,l     ,R(size),MEM_DISP(esp,28))
-       INSN2(mov,l     ,R(s2_limb),MEM_DISP(esp,32))
-
-       INSN2(lea,l     ,R(res_ptr),MEM_INDEX(res_ptr,size,4))
-       INSN2(lea,l     ,R(s1_ptr),MEM_INDEX(s1_ptr,size,4))
-       INSN1(neg,l     ,R(size))
-       INSN2(xor,l     ,R(ebx),R(ebx))
-       ALIGN (3)
-
-Loop:  INSN2(adc,l     ,R(ebx),$0)
-       INSN2(mov,l     ,R(eax),MEM_INDEX(s1_ptr,size,4))
-
-       INSN1(mul,l     ,R(s2_limb))
-
-       INSN2(add,l     ,R(eax),R(ebx))
-       INSN2(mov,l     ,R(ebx),MEM_INDEX(res_ptr,size,4))
-
-       INSN2(adc,l     ,R(edx),$0)
-       INSN2(sub,l     ,R(ebx),R(eax))
-
-       INSN2(mov,l     ,MEM_INDEX(res_ptr,size,4),R(ebx))
-       INSN1(inc,l     ,R(size))
-
-       INSN2(mov,l     ,R(ebx),R(edx))
-       INSN1(jnz,      ,Loop)
-
-       INSN2(adc,l     ,R(ebx),$0)
-       INSN2(mov,l     ,R(eax),R(ebx))
-       INSN1(pop,l     ,R(ebp))
-       INSN1(pop,l     ,R(ebx))
-       INSN1(pop,l     ,R(esi))
-       INSN1(pop,l     ,R(edi))
-       ret
diff --git a/ghc/rts/gmp/mpn/x86/rshift.S b/ghc/rts/gmp/mpn/x86/rshift.S
deleted file mode 100644 (file)
index 9abbf9a..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/* i80386 __mpn_rshift -- 
-
-Copyright (C) 1992, 1994 Free Software Foundation, Inc.
-
-This file is part of the GNU MP Library.
-
-The GNU MP Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Library General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at your
-option) any later version.
-
-The GNU MP 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 Library General Public
-License for more details.
-
-You should have received a copy of the GNU Library General Public License
-along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-MA 02111-1307, USA. */
-
-/*
-  INPUT PARAMETERS
-  res_ptr      (sp + 4)
-  s_ptr                (sp + 8)
-  size         (sp + 12)
-  cnt          (sp + 16)
-*/
-
-#include "sysdep.h"
-#include "asm-syntax.h"
-
-.text
-       ALIGN (3)
-       .globl C_SYMBOL_NAME(__mpn_rshift)
-C_SYMBOL_NAME(__mpn_rshift:)
-       pushl   %edi
-       pushl   %esi
-       pushl   %ebx
-
-       movl    16(%esp),%edi           /* res_ptr */
-       movl    20(%esp),%esi           /* s_ptr */
-       movl    24(%esp),%edx           /* size */
-       movl    28(%esp),%ecx           /* cnt */
-
-       leal    -4(%edi,%edx,4),%edi
-       leal    (%esi,%edx,4),%esi
-       negl    %edx
-
-       movl    (%esi,%edx,4),%ebx      /* read least significant limb */
-       xorl    %eax,%eax
-       shrdl   %cl,%ebx,%eax           /* compute carry limb */
-       incl    %edx
-       jz      Lend
-       pushl   %eax                    /* push carry limb onto stack */
-       testb   $1,%edx
-       jnz     L1                      /* enter loop in the middle */
-       movl    %ebx,%eax
-
-       ALIGN (3)
-Loop:  movl    (%esi,%edx,4),%ebx      /* load next higher limb */
-       shrdl   %cl,%ebx,%eax           /* compute result limb */
-       movl    %eax,(%edi,%edx,4)      /* store it */
-       incl    %edx
-L1:    movl    (%esi,%edx,4),%eax
-       shrdl   %cl,%eax,%ebx
-       movl    %ebx,(%edi,%edx,4)
-       incl    %edx
-       jnz     Loop
-
-       shrl    %cl,%eax                /* compute most significant limb */
-       movl    %eax,(%edi)             /* store it */
-
-       popl    %eax                    /* pop carry limb */
-
-       popl    %ebx
-       popl    %esi
-       popl    %edi
-       ret
-
-Lend:  shrl    %cl,%ebx                /* compute most significant limb */
-       movl    %ebx,(%edi)             /* store it */
-
-       popl    %ebx
-       popl    %esi
-       popl    %edi
-       ret
diff --git a/ghc/rts/gmp/mpn/x86/sub_n.S b/ghc/rts/gmp/mpn/x86/sub_n.S
deleted file mode 100644 (file)
index 1774f3a..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-/* i80386 __mpn_sub_n -- Add two limb vectors of the same length > 0 and store
-   sum in a third limb vector.
-
-Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
-
-This file is part of the GNU MP Library.
-
-The GNU MP Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Library General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at your
-option) any later version.
-
-The GNU MP 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 Library General Public
-License for more details.
-
-You should have received a copy of the GNU Library General Public License
-along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-MA 02111-1307, USA. */
-
-/*
-  INPUT PARAMETERS
-  res_ptr      (sp + 4)
-  s1_ptr       (sp + 8)
-  s2_ptr       (sp + 12)
-  size         (sp + 16)
-*/
-
-#include "sysdep.h"
-#include "asm-syntax.h"
-
-.text
-       ALIGN (3)
-       .globl C_SYMBOL_NAME(__mpn_sub_n)
-C_SYMBOL_NAME(__mpn_sub_n:)
-       pushl %edi
-       pushl %esi
-
-       movl 12(%esp),%edi              /* res_ptr */
-       movl 16(%esp),%esi              /* s1_ptr */
-       movl 20(%esp),%edx              /* s2_ptr */
-       movl 24(%esp),%ecx              /* size */
-
-       movl    %ecx,%eax
-       shrl    $3,%ecx                 /* compute count for unrolled loop */
-       negl    %eax
-       andl    $7,%eax                 /* get index where to start loop */
-       jz      Loop                    /* necessary special case for 0 */
-       incl    %ecx                    /* adjust loop count */
-       shll    $2,%eax                 /* adjustment for pointers... */
-       subl    %eax,%edi               /* ... since they are offset ... */
-       subl    %eax,%esi               /* ... by a constant when we ... */
-       subl    %eax,%edx               /* ... enter the loop */
-       shrl    $2,%eax                 /* restore previous value */
-#ifdef PIC
-/* Calculate start address in loop for PIC.  Due to limitations in some
-   assemblers, Loop-L0-3 cannot be put into the leal */
-       call    L0
-L0:    leal    (%eax,%eax,8),%eax
-       addl    (%esp),%eax
-       addl    $(Loop-L0-3),%eax
-       addl    $4,%esp
-#else
-/* Calculate start address in loop for non-PIC.  */
-       leal    (Loop - 3)(%eax,%eax,8),%eax
-#endif
-       jmp     *%eax                   /* jump into loop */
-       ALIGN (3)
-Loop:  movl    (%esi),%eax
-       sbbl    (%edx),%eax
-       movl    %eax,(%edi)
-       movl    4(%esi),%eax
-       sbbl    4(%edx),%eax
-       movl    %eax,4(%edi)
-       movl    8(%esi),%eax
-       sbbl    8(%edx),%eax
-       movl    %eax,8(%edi)
-       movl    12(%esi),%eax
-       sbbl    12(%edx),%eax
-       movl    %eax,12(%edi)
-       movl    16(%esi),%eax
-       sbbl    16(%edx),%eax
-       movl    %eax,16(%edi)
-       movl    20(%esi),%eax
-       sbbl    20(%edx),%eax
-       movl    %eax,20(%edi)
-       movl    24(%esi),%eax
-       sbbl    24(%edx),%eax
-       movl    %eax,24(%edi)
-       movl    28(%esi),%eax
-       sbbl    28(%edx),%eax
-       movl    %eax,28(%edi)
-       leal    32(%edi),%edi
-       leal    32(%esi),%esi
-       leal    32(%edx),%edx
-       decl    %ecx
-       jnz     Loop
-
-       sbbl    %eax,%eax
-       negl    %eax
-
-       popl %esi
-       popl %edi
-       ret
diff --git a/ghc/rts/gmp/mpn/x86/submul_1.S b/ghc/rts/gmp/mpn/x86/submul_1.S
deleted file mode 100644 (file)
index 730e732..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/* i80386 __mpn_submul_1 -- Multiply a limb vector with a limb and subtract
-   the result from a second limb vector.
-
-Copyright (C) 1992, 1994 Free Software Foundation, Inc.
-
-This file is part of the GNU MP Library.
-
-The GNU MP Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Library General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at your
-option) any later version.
-
-The GNU MP 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 Library General Public
-License for more details.
-
-You should have received a copy of the GNU Library General Public License
-along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-MA 02111-1307, USA. */
-
-/*
-   INPUT PARAMETERS
-   res_ptr     (sp + 4)
-   s1_ptr      (sp + 8)
-   size                (sp + 12)
-   s2_limb     (sp + 16)
-*/
-
-#include "sysdep.h"
-#include "asm-syntax.h"
-
-#define res_ptr edi
-#define s1_ptr esi
-#define size ecx
-#define s2_limb ebp
-
-       TEXT
-       ALIGN (3)
-       GLOBL   C_SYMBOL_NAME(__mpn_submul_1)
-C_SYMBOL_NAME(__mpn_submul_1:)
-
-       INSN1(push,l    ,R(edi))
-       INSN1(push,l    ,R(esi))
-       INSN1(push,l    ,R(ebx))
-       INSN1(push,l    ,R(ebp))
-
-       INSN2(mov,l     ,R(res_ptr),MEM_DISP(esp,20))
-       INSN2(mov,l     ,R(s1_ptr),MEM_DISP(esp,24))
-       INSN2(mov,l     ,R(size),MEM_DISP(esp,28))
-       INSN2(mov,l     ,R(s2_limb),MEM_DISP(esp,32))
-
-       INSN2(lea,l     ,R(res_ptr),MEM_INDEX(res_ptr,size,4))
-       INSN2(lea,l     ,R(s1_ptr),MEM_INDEX(s1_ptr,size,4))
-       INSN1(neg,l     ,R(size))
-       INSN2(xor,l     ,R(ebx),R(ebx))
-       ALIGN (3)
-Loop:
-       INSN2(mov,l     ,R(eax),MEM_INDEX(s1_ptr,size,4))
-       INSN1(mul,l     ,R(s2_limb))
-       INSN2(add,l     ,R(eax),R(ebx))
-       INSN2(adc,l     ,R(edx),$0)
-       INSN2(sub,l     ,MEM_INDEX(res_ptr,size,4),R(eax))
-       INSN2(adc,l     ,R(edx),$0)
-       INSN2(mov,l     ,R(ebx),R(edx))
-
-       INSN1(inc,l     ,R(size))
-       INSN1(jnz,      ,Loop)
-       INSN2(mov,l     ,R(eax),R(ebx))
-
-       INSN1(pop,l     ,R(ebp))
-       INSN1(pop,l     ,R(ebx))
-       INSN1(pop,l     ,R(esi))
-       INSN1(pop,l     ,R(edi))
-       ret
diff --git a/ghc/rts/gmp/mpn/x86/syntax.h b/ghc/rts/gmp/mpn/x86/syntax.h
deleted file mode 100644 (file)
index c53c73c..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/* asm.h -- Definitions for x86 syntax variations.
-
-Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
-
-This file is part of the GNU MP Library.
-
-The GNU MP Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Library General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at your
-option) any later version.
-
-The GNU MP 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 Library General Public
-License for more details.
-
-You should have received a copy of the GNU Library General Public License
-along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-MA 02111-1307, USA.  */
-
-
-#undef ALIGN
-
-#if defined (BSD_SYNTAX) || defined (ELF_SYNTAX)
-#define R(r) %r
-#define MEM(base)(base)
-#define MEM_DISP(base,displacement)displacement(R(base))
-#define MEM_INDEX(base,index,size)(R(base),R(index),size)
-#ifdef __STDC__
-#define INSN1(mnemonic,size_suffix,dst)mnemonic##size_suffix dst
-#define INSN2(mnemonic,size_suffix,dst,src)mnemonic##size_suffix src,dst
-#else
-#define INSN1(mnemonic,size_suffix,dst)mnemonic/**/size_suffix dst
-#define INSN2(mnemonic,size_suffix,dst,src)mnemonic/**/size_suffix src,dst
-#endif
-#define TEXT .text
-#if defined (BSD_SYNTAX)
-#define ALIGN(log) .align log
-#endif
-#if defined (ELF_SYNTAX)
-#define ALIGN(log) .align 1<<(log)
-#endif
-#define GLOBL .globl
-#endif
-
-#ifdef INTEL_SYNTAX
-#define R(r) r
-#define MEM(base)[base]
-#define MEM_DISP(base,displacement)[base+(displacement)]
-#define MEM_INDEX(base,index,size)[base+index*size]
-#define INSN1(mnemonic,size_suffix,dst)mnemonic dst
-#define INSN2(mnemonic,size_suffix,dst,src)mnemonic dst,src
-#define TEXT .text
-#define ALIGN(log) .align log
-#define GLOBL .globl
-#endif
-
-#ifdef BROKEN_ALIGN
-#undef ALIGN
-#define ALIGN(log) .align log,0x90
-#endif
index b302c79..fec01c9 100644 (file)
-# Makefile for GNU MP/mpz functions
-# Copyright (C) 1991, 1993, 1994, 1996 Free Software Foundation, Inc.
+# Makefile.in generated automatically by automake 1.4a from Makefile.am
 
-# This file is part of the GNU MP Library.
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = ..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
 
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_FLAG =
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+
+@SET_MAKE@
+build_alias = @build_alias@
+build_triplet = @build@
+host_alias = @host_alias@
+host_triplet = @host@
+target_alias = @target_alias@
+target_triplet = @target@
+AMDEP = @AMDEP@
+AMTAR = @AMTAR@
+AR = @AR@
+AS = @AS@
+AWK = @AWK@
+CALLING_CONVENTIONS_OBJS = @CALLING_CONVENTIONS_OBJS@
+CC = @CC@
+CCAS = @CCAS@
+CPP = @CPP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+EXEEXT = @EXEEXT@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+M4 = @M4@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+SPEED_CYCLECOUNTER_OBJS = @SPEED_CYCLECOUNTER_OBJS@
+STRIP = @STRIP@
+U = @U@
+VERSION = @VERSION@
+gmp_srclinks = @gmp_srclinks@
+install_sh = @install_sh@
+mpn_objects = @mpn_objects@
+mpn_objs_in_libgmp = @mpn_objs_in_libgmp@
+
+# Copyright (C) 1996, 1998, 1999, 2000 Free Software Foundation, Inc.
+#
+# This file is part of the GNU MP Library.
+#
 # The GNU MP Library is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Library General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or (at your
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at your
 # option) any later version.
-
+#
 # The GNU MP 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 Library General Public
+# 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 Library General Public License
+#
+# You should have received a copy of the GNU Lesser General Public License
 # along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 # MA 02111-1307, USA.
 
-srcdir = .
-
-CC = gcc
-
-# If you cross compile on a machine with the same sizes of the integral
-# types ("int", "long int", "short int", and "char") define this as the
-# local compiler.  Otherwise, you need to look for the uses of LOCAL_CC below,
-# and handle those cases manually.
-LOCAL_CC = $(CC)
-CFLAGS = -g -O
-AR = ar
-AR_FLAGS = rc
-SHELL = /bin/sh
-
-#### host and target specific makefile fragments come in here.
-###
-
-MPZ_SRCS = init.c set.c set_ui.c set_si.c set_str.c set_d.c set_f.c set_q.c \
-  iset.c iset_ui.c iset_si.c iset_str.c iset_d.c clear.c \
-  get_ui.c get_si.c get_str.c get_d.c size.c sizeinbase.c \
-  add.c add_ui.c sub.c sub_ui.c mul.c mul_ui.c \
-  gcd.c gcd_ui.c gcdext.c sqrt.c sqrtrem.c powm.c powm_ui.c \
-  cmp.c cmp_ui.c cmp_si.c mul_2exp.c fdiv_q_2exp.c fdiv_r_2exp.c \
-  tdiv_q_2exp.c tdiv_r_2exp.c abs.c neg.c com.c and.c ior.c \
-  inp_raw.c inp_str.c out_raw.c out_str.c \
-  perfsqr.c random.c random2.c pow_ui.c ui_pow_ui.c setbit.c \
-  clrbit.c fac_ui.c pprime_p.c realloc.c getlimbn.c popcount.c hamdist.c \
-  cdiv_qr.c cdiv_q.c cdiv_r.c cdiv_qr_ui.c cdiv_q_ui.c cdiv_r_ui.c cdiv_ui.c \
-  fdiv_qr.c fdiv_q.c fdiv_r.c fdiv_qr_ui.c fdiv_q_ui.c fdiv_r_ui.c fdiv_ui.c \
-  tdiv_qr.c tdiv_q.c tdiv_r.c tdiv_qr_ui.c tdiv_q_ui.c tdiv_r_ui.c \
-  mod.c divexact.c array_init.c scan0.c scan1.c \
-  jacobi.c legendre.c invert.c
-MPZ_OBJS = init.o set.o set_ui.o set_si.o set_str.o set_d.o set_f.o set_q.o \
-  iset.o iset_ui.o iset_si.o iset_str.o iset_d.o clear.o \
-  get_ui.o get_si.o get_str.o get_d.o size.o sizeinbase.o \
-  add.o add_ui.o sub.o sub_ui.o mul.o mul_ui.o \
-  gcd.o gcd_ui.o gcdext.o sqrt.o sqrtrem.o powm.o powm_ui.o \
-  cmp.o cmp_ui.o cmp_si.o mul_2exp.o fdiv_q_2exp.o fdiv_r_2exp.o \
-  tdiv_q_2exp.o tdiv_r_2exp.o abs.o neg.o com.o and.o ior.o \
-  inp_raw.o inp_str.o out_raw.o out_str.o \
-  perfsqr.o random.o random2.o pow_ui.o ui_pow_ui.o setbit.o \
-  clrbit.o fac_ui.o pprime_p.o realloc.o getlimbn.o popcount.o hamdist.o \
-  cdiv_qr.o cdiv_q.o cdiv_r.o cdiv_qr_ui.o cdiv_q_ui.o cdiv_r_ui.o cdiv_ui.o \
-  fdiv_qr.o fdiv_q.o fdiv_r.o fdiv_qr_ui.o fdiv_q_ui.o fdiv_r_ui.o fdiv_ui.o \
-  tdiv_qr.o tdiv_q.o tdiv_r.o tdiv_qr_ui.o tdiv_q_ui.o tdiv_r_ui.o \
-  mod.o divexact.o array_init.o scan0.o scan1.o \
-  jacobi.o legendre.o invert.o
-
-INCLUDES = -I. -I.. -I../mpn -I$(srcdir)/..
-
-libmpz.a: Makefile $(MPZ_OBJS)
-       rm -f $@
-       $(AR) $(AR_FLAGS) $@ $(MPZ_OBJS)
 
+AUTOMAKE_OPTIONS = gnu no-dependencies
+
+SUBDIRS = tests
+
+INCLUDES = -I$(top_srcdir) -DOPERATION_$*
+
+noinst_LTLIBRARIES = libmpz.la
+libmpz_la_SOURCES = \
+  abs.c add.c add_ui.c addmul_ui.c and.c array_init.c \
+  bin_ui.c bin_uiui.c cdiv_q.c \
+  cdiv_q_ui.c cdiv_qr.c cdiv_qr_ui.c cdiv_r.c cdiv_r_ui.c cdiv_ui.c \
+  clear.c clrbit.c cmp.c cmp_si.c cmp_ui.c cmpabs.c cmpabs_ui.c com.c \
+  divexact.c dump.c fac_ui.c fdiv_q.c fdiv_q_2exp.c fdiv_q_ui.c \
+  fdiv_qr.c fdiv_qr_ui.c fdiv_r.c fdiv_r_2exp.c fdiv_r_ui.c fdiv_ui.c \
+  fib_ui.c fits_sint_p.c fits_slong_p.c fits_sshort_p.c fits_uint_p.c \
+  fits_ulong_p.c fits_ushort_p.c gcd.c gcd_ui.c gcdext.c get_d.c get_si.c \
+  get_str.c get_ui.c getlimbn.c hamdist.c init.c inp_raw.c inp_str.c \
+  invert.c ior.c iset.c iset_d.c iset_si.c iset_str.c iset_ui.c \
+  jacobi.c kronsz.c kronuz.c kronzs.c kronzu.c \
+  lcm.c legendre.c mod.c mul.c mul_2exp.c neg.c nextprime.c \
+  out_raw.c out_str.c perfpow.c perfsqr.c popcount.c pow_ui.c powm.c \
+  powm_ui.c pprime_p.c random.c random2.c realloc.c remove.c root.c rrandomb.c \
+  scan0.c scan1.c set.c set_d.c set_f.c set_q.c set_si.c set_str.c \
+  set_ui.c setbit.c size.c sizeinbase.c sqrt.c sqrtrem.c sub.c \
+  sub_ui.c swap.c tdiv_ui.c tdiv_q.c tdiv_q_2exp.c tdiv_q_ui.c tdiv_qr.c \
+  tdiv_qr_ui.c tdiv_r.c tdiv_r_2exp.c tdiv_r_ui.c tstbit.c ui_pow_ui.c \
+  urandomb.c urandomm.c xor.c
+
+
+EXTRA_DIST = mul_siui.c
+nodist_libmpz_la_SOURCES = mul_si.c mul_ui.c
+CLEANFILES = $(nodist_libmpz_la_SOURCES)
+subdir = mpz
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = ../config.h
+CONFIG_CLEAN_FILES = 
+LTLIBRARIES =  $(noinst_LTLIBRARIES)
+
+
+DEFS = @DEFS@ -I. -I$(srcdir) -I..
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+libmpz_la_LDFLAGS = 
+libmpz_la_LIBADD = 
+am_libmpz_la_OBJECTS =  abs.lo add.lo add_ui.lo addmul_ui.lo and.lo \
+array_init.lo bin_ui.lo bin_uiui.lo cdiv_q.lo cdiv_q_ui.lo cdiv_qr.lo \
+cdiv_qr_ui.lo cdiv_r.lo cdiv_r_ui.lo cdiv_ui.lo clear.lo clrbit.lo \
+cmp.lo cmp_si.lo cmp_ui.lo cmpabs.lo cmpabs_ui.lo com.lo divexact.lo \
+dump.lo fac_ui.lo fdiv_q.lo fdiv_q_2exp.lo fdiv_q_ui.lo fdiv_qr.lo \
+fdiv_qr_ui.lo fdiv_r.lo fdiv_r_2exp.lo fdiv_r_ui.lo fdiv_ui.lo \
+fib_ui.lo fits_sint_p.lo fits_slong_p.lo fits_sshort_p.lo \
+fits_uint_p.lo fits_ulong_p.lo fits_ushort_p.lo gcd.lo gcd_ui.lo \
+gcdext.lo get_d.lo get_si.lo get_str.lo get_ui.lo getlimbn.lo \
+hamdist.lo init.lo inp_raw.lo inp_str.lo invert.lo ior.lo iset.lo \
+iset_d.lo iset_si.lo iset_str.lo iset_ui.lo jacobi.lo kronsz.lo \
+kronuz.lo kronzs.lo kronzu.lo lcm.lo legendre.lo mod.lo mul.lo \
+mul_2exp.lo neg.lo nextprime.lo out_raw.lo out_str.lo perfpow.lo \
+perfsqr.lo popcount.lo pow_ui.lo powm.lo powm_ui.lo pprime_p.lo \
+random.lo random2.lo realloc.lo remove.lo root.lo rrandomb.lo scan0.lo \
+scan1.lo set.lo set_d.lo set_f.lo set_q.lo set_si.lo set_str.lo \
+set_ui.lo setbit.lo size.lo sizeinbase.lo sqrt.lo sqrtrem.lo sub.lo \
+sub_ui.lo swap.lo tdiv_ui.lo tdiv_q.lo tdiv_q_2exp.lo tdiv_q_ui.lo \
+tdiv_qr.lo tdiv_qr_ui.lo tdiv_r.lo tdiv_r_2exp.lo tdiv_r_ui.lo \
+tstbit.lo ui_pow_ui.lo urandomb.lo urandomm.lo xor.lo
+nodist_libmpz_la_OBJECTS =  mul_si.lo mul_ui.lo
+libmpz_la_OBJECTS =  $(am_libmpz_la_OBJECTS) $(nodist_libmpz_la_OBJECTS)
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CFLAGS = @CFLAGS@
+CCLD = $(CC)
+LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+DIST_SOURCES =  $(libmpz_la_SOURCES)
+DIST_COMMON =  README Makefile.am Makefile.in
+
+
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+GZIP_ENV = --best
+depcomp = 
+SOURCES = $(libmpz_la_SOURCES) $(nodist_libmpz_la_SOURCES)
+OBJECTS = $(am_libmpz_la_OBJECTS) $(nodist_libmpz_la_OBJECTS)
+
+all: all-redirect
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
+       cd $(top_srcdir) && $(AUTOMAKE) --gnu mpz/Makefile
+
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
+       cd $(top_builddir) \
+         && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+
+mostlyclean-noinstLTLIBRARIES:
+
+clean-noinstLTLIBRARIES:
+       -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+
+distclean-noinstLTLIBRARIES:
+
+maintainer-clean-noinstLTLIBRARIES:
+
+mostlyclean-compile:
+       -rm -f *.o core *.core
+       -rm -f *.$(OBJEXT)
+
+clean-compile:
+
+distclean-compile:
+       -rm -f *.tab.c
+
+maintainer-clean-compile:
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+distclean-libtool:
+
+maintainer-clean-libtool:
+
+libmpz.la: $(libmpz_la_OBJECTS) $(libmpz_la_DEPENDENCIES)
+       $(LINK)  $(libmpz_la_LDFLAGS) $(libmpz_la_OBJECTS) $(libmpz_la_LIBADD) $(LIBS)
 .c.o:
-       $(CC) -c $(INCLUDES) $(CFLAGS) $(XCFLAGS) $<
-
-clean mostlyclean:
-       rm -f *.o libmpz.a
-
-distclean maintainer-clean: clean
-       rm -f Makefile config.status
-
-Makefile: $(srcdir)/Makefile.in
-       $(SHELL) ./config.status
-
-H = $(srcdir)/../gmp.h $(srcdir)/../gmp-impl.h ../mpn/gmp-mparam.h
-
-abs.o: $(srcdir)/abs.c $(H)
-add.o: $(srcdir)/add.c $(H)
-add_ui.o: $(srcdir)/add_ui.c $(H)
-and.o: $(srcdir)/and.c $(H)
-array_init.o: $(srcdir)/array_init.c $(H)
-cdiv_q.o: $(srcdir)/cdiv_q.c $(H)
-cdiv_q_ui.o: $(srcdir)/cdiv_q_ui.c $(H)
-cdiv_qr.o: $(srcdir)/cdiv_qr.c $(H)
-cdiv_qr_ui.o: $(srcdir)/cdiv_qr_ui.c $(H)
-cdiv_r.o: $(srcdir)/cdiv_r.c $(H)
-cdiv_r_ui.o: $(srcdir)/cdiv_r_ui.c $(H)
-cdiv_ui.o: $(srcdir)/cdiv_ui.c $(H)
-clear.o: $(srcdir)/clear.c $(H)
-clrbit.o: $(srcdir)/clrbit.c $(H)
-cmp.o: $(srcdir)/cmp.c $(H)
-cmp_si.o: $(srcdir)/cmp_si.c $(H)
-cmp_ui.o: $(srcdir)/cmp_ui.c $(H)
-com.o: $(srcdir)/com.c $(H)
-fdiv_q_2exp.o: $(srcdir)/fdiv_q_2exp.c $(H)
-fdiv_r_2exp.o: $(srcdir)/fdiv_r_2exp.c $(H)
-divexact.o: $(srcdir)/divexact.c $(H) $(srcdir)/../longlong.h
-fac_ui.o: $(srcdir)/fac_ui.c $(H) $(srcdir)/../longlong.h
-fdiv_q.o: $(srcdir)/fdiv_q.c $(H)
-fdiv_q_ui.o: $(srcdir)/fdiv_q_ui.c $(H)
-fdiv_qr.o: $(srcdir)/fdiv_qr.c $(H)
-fdiv_qr_ui.o: $(srcdir)/fdiv_qr_ui.c $(H)
-fdiv_r.o: $(srcdir)/fdiv_r.c $(H)
-fdiv_r_ui.o: $(srcdir)/fdiv_r_ui.c $(H)
-fdiv_ui.o: $(srcdir)/fdiv_ui.c $(H)
-gcd.o: $(srcdir)/gcd.c $(H) $(srcdir)/../longlong.h
-gcd_ui.o: $(srcdir)/gcd_ui.c $(H)
-gcdext.o: $(srcdir)/gcdext.c $(H)
-get_d.o: $(srcdir)/get_d.c $(H)
-get_si.o: $(srcdir)/get_si.c $(H)
-get_str.o: $(srcdir)/get_str.c $(H)
-get_ui.o: $(srcdir)/get_ui.c $(H)
-getlimbn.o: $(srcdir)/getlimbn.c $(H)
-hamdist.o: $(srcdir)/hamdist.c $(H)
-init.o: $(srcdir)/init.c $(H)
-inp_raw.o: $(srcdir)/inp_raw.c $(H)
-inp_str.o: $(srcdir)/inp_str.c $(H)
-invert.o: $(srcdir)/invert.c $(H)
-ior.o: $(srcdir)/ior.c $(H)
-iset.o: $(srcdir)/iset.c $(H)
-iset_d.o: $(srcdir)/iset_d.c $(H)
-iset_si.o: $(srcdir)/iset_si.c $(H)
-iset_str.o: $(srcdir)/iset_str.c $(H)
-iset_ui.o: $(srcdir)/iset_ui.c $(H)
-jacobi.o: $(srcdir)/jacobi.c $(H)
-legendre.o: $(srcdir)/legendre.c $(H)
-mod.o: $(srcdir)/mod.c $(H)
-tdiv_q_2exp.o: $(srcdir)/tdiv_q_2exp.c $(H)
-tdiv_r_2exp.o: $(srcdir)/tdiv_r_2exp.c $(H)
-mul.o: $(srcdir)/mul.c $(H)
-mul_2exp.o: $(srcdir)/mul_2exp.c $(H)
-mul_ui.o: $(srcdir)/mul_ui.c $(H)
-neg.o: $(srcdir)/neg.c $(H)
-out_raw.o: $(srcdir)/out_raw.c $(H)
-out_str.o: $(srcdir)/out_str.c $(H)
-perfsqr.o: $(srcdir)/perfsqr.c $(H)
-popcount.o: $(srcdir)/popcount.c $(H)
-pow_ui.o: $(srcdir)/pow_ui.c $(H) $(srcdir)/../longlong.h
-powm.o: $(srcdir)/powm.c $(H) $(srcdir)/../longlong.h
-powm_ui.o: $(srcdir)/powm_ui.c $(H) $(srcdir)/../longlong.h
-pprime_p.o: $(srcdir)/pprime_p.c $(H)
-random.o: $(srcdir)/random.c $(H) $(srcdir)/../urandom.h
-random2.o: $(srcdir)/random2.c $(H)
-realloc.o: $(srcdir)/realloc.c $(H)
-scan0.o: $(srcdir)/scan0.c $(H)
-scan1.o: $(srcdir)/scan1.c $(H)
-set.o: $(srcdir)/set.c $(H)
-set_d.o: $(srcdir)/set_d.c $(H)
-set_f.o: $(srcdir)/set_f.c $(H)
-set_q.o: $(srcdir)/set_q.c $(H)
-set_si.o: $(srcdir)/set_si.c $(H)
-set_str.o: $(srcdir)/set_str.c $(H) $(srcdir)/../longlong.h
-set_ui.o: $(srcdir)/set_ui.c $(H)
-setbit.o: $(srcdir)/setbit.c $(H)
-size.o: $(srcdir)/size.c $(H)
-sizeinbase.o: $(srcdir)/sizeinbase.c $(H) $(srcdir)/../longlong.h
-sqrt.o: $(srcdir)/sqrt.c $(H)
-sqrtrem.o: $(srcdir)/sqrtrem.c $(H)
-sub.o: $(srcdir)/sub.c $(H)
-sub_ui.o: $(srcdir)/sub_ui.c $(H)
-tdiv_q.o: $(srcdir)/tdiv_q.c $(H) $(srcdir)/../longlong.h
-tdiv_q_ui.o: $(srcdir)/tdiv_q_ui.c $(H)
-tdiv_qr.o: $(srcdir)/tdiv_qr.c $(H) $(srcdir)/../longlong.h $(srcdir)/dmincl.c $(H)
-tdiv_qr_ui.o: $(srcdir)/tdiv_qr_ui.c $(H)
-tdiv_r.o: $(srcdir)/tdiv_r.c $(H) $(srcdir)/../longlong.h $(srcdir)/dmincl.c $(H)
-tdiv_r_ui.o: $(srcdir)/tdiv_r_ui.c $(H)
-ui_pow_ui.o: $(srcdir)/ui_pow_ui.c $(H) $(srcdir)/../longlong.h
+       $(COMPILE) -c $<
+.c.obj:
+       $(COMPILE) -c `cygpath -w $<`
+.c.lo:
+       $(LTCOMPILE) -c -o $@ $<
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+
+all-recursive install-data-recursive install-exec-recursive \
+installdirs-recursive install-recursive uninstall-recursive  \
+check-recursive installcheck-recursive info-recursive dvi-recursive:
+       @set fnord $(MAKEFLAGS); amf=$$2; \
+       dot_seen=no; \
+       target=`echo $@ | sed s/-recursive//`; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         echo "Making $$target in $$subdir"; \
+         if test "$$subdir" = "."; then \
+           dot_seen=yes; \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+          || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+       done; \
+       if test "$$dot_seen" = "no"; then \
+         $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+       fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+       @set fnord $(MAKEFLAGS); amf=$$2; \
+       dot_seen=no; \
+       rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
+         rev="$$subdir $$rev"; \
+         if test "$$subdir" = "."; then dot_seen=yes; else :; fi; \
+       done; \
+       test "$$dot_seen" = "no" && rev=". $$rev"; \
+       target=`echo $@ | sed s/-recursive//`; \
+       for subdir in $$rev; do \
+         echo "Making $$target in $$subdir"; \
+         if test "$$subdir" = "."; then \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+          || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+       done && test -z "$$fail"
+tags-recursive:
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+       done
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+       list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       mkid -f$$here/ID $$unique $(LISP)
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+   if test "$$subdir" = .; then :; else \
+           test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+   fi; \
+       done; \
+       list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+         || etags $(ETAGS_ARGS) $$tags  $$unique $(LISP)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+       -rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+distdir: $(DISTFILES)
+       @for file in $(DISTFILES); do \
+         d=$(srcdir); \
+         if test -d $$d/$$file; then \
+           cp -pR $$d/$$file $(distdir); \
+         else \
+           test -f $(distdir)/$$file \
+           || cp -p $$d/$$file $(distdir)/$$file || :; \
+         fi; \
+       done
+       for subdir in $(SUBDIRS); do \
+         if test "$$subdir" = .; then :; else \
+           test -d $(distdir)/$$subdir \
+           || mkdir $(distdir)/$$subdir \
+           || exit 1; \
+           (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \
+             || exit 1; \
+         fi; \
+       done
+info-am:
+info: info-recursive
+dvi-am:
+dvi: dvi-recursive
+check-am: all-am
+check: check-recursive
+installcheck-am:
+installcheck: installcheck-recursive
+install-exec-am:
+install-exec: install-exec-recursive
+
+install-data-am:
+install-data: install-data-recursive
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-recursive
+uninstall-am:
+uninstall: uninstall-recursive
+all-am: Makefile $(LTLIBRARIES)
+all-redirect: all-recursive
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
+installdirs: installdirs-recursive
+installdirs-am:
+
+
+mostlyclean-generic:
+
+clean-generic:
+       -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+       -rm -f Makefile $(CONFIG_CLEAN_FILES)
+       -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+       -rm -f Makefile.in
+mostlyclean-am:  mostlyclean-noinstLTLIBRARIES mostlyclean-compile \
+               mostlyclean-libtool mostlyclean-tags \
+               mostlyclean-generic
+
+mostlyclean: mostlyclean-recursive
+
+clean-am:  clean-noinstLTLIBRARIES clean-compile clean-libtool \
+               clean-tags clean-generic mostlyclean-am
+
+clean: clean-recursive
+
+distclean-am:  distclean-noinstLTLIBRARIES distclean-compile \
+               distclean-libtool distclean-tags distclean-generic \
+               clean-am
+       -rm -f libtool
+
+distclean: distclean-recursive
+
+maintainer-clean-am:  maintainer-clean-noinstLTLIBRARIES \
+               maintainer-clean-compile maintainer-clean-libtool \
+               maintainer-clean-tags maintainer-clean-generic \
+               distclean-am
+       @echo "This command is intended for maintainers to use;"
+       @echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-recursive
+
+.PHONY: mostlyclean-noinstLTLIBRARIES distclean-noinstLTLIBRARIES \
+clean-noinstLTLIBRARIES maintainer-clean-noinstLTLIBRARIES \
+mostlyclean-compile distclean-compile clean-compile \
+maintainer-clean-compile mostlyclean-libtool distclean-libtool \
+clean-libtool maintainer-clean-libtool install-recursive \
+uninstall-recursive install-data-recursive uninstall-data-recursive \
+install-exec-recursive uninstall-exec-recursive installdirs-recursive \
+uninstalldirs-recursive all-recursive check-recursive \
+installcheck-recursive info-recursive dvi-recursive \
+mostlyclean-recursive distclean-recursive clean-recursive \
+maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
+distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
+dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
+install-exec install-data-am install-data install-am install \
+uninstall-am uninstall all-redirect all-am all install-strip \
+installdirs-am installdirs mostlyclean-generic distclean-generic \
+clean-generic maintainer-clean-generic clean mostlyclean distclean \
+maintainer-clean
+
+
+mul_si.c: $(srcdir)/mul_siui.c
+       cp $(srcdir)/mul_siui.c mul_si.c
+mul_ui.c: $(srcdir)/mul_siui.c
+       cp $(srcdir)/mul_siui.c mul_ui.c
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/ghc/rts/gmp/mpz/configure.in b/ghc/rts/gmp/mpz/configure.in
deleted file mode 100644 (file)
index 9a0eb21..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-# This file is a shell script fragment that supplies the information
-# necessary for a configure script to process the program in
-# this directory.  For more information, look at ../configure.
-AC_INIT(Makefile.in)
-
-srctrigger=add_ui.c
-srcname="GNU Multi-Precision library/mpz"
-
-# per-host:
-
-# per-target:
-
-AC_OUTPUT(Makefile)
diff --git a/ghc/rts/gmp/mpz/dmincl.c b/ghc/rts/gmp/mpz/dmincl.c
deleted file mode 100644 (file)
index 51bd084..0000000
+++ /dev/null
@@ -1,201 +0,0 @@
-/* dmincl.c -- include file for tdiv_qr.c, tdiv_r.c.
-
-Copyright (C) 1991, 1993, 1994, 1996 Free Software Foundation, Inc.
-
-This file is part of the GNU MP Library.
-
-The GNU MP Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Library General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at your
-option) any later version.
-
-The GNU MP 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 Library General Public
-License for more details.
-
-You should have received a copy of the GNU Library General Public License
-along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-MA 02111-1307, USA. */
-
-/* If den == quot, den needs temporary storage.
-   If den == rem, den needs temporary storage.
-   If num == quot, num needs temporary storage.
-   If den has temporary storage, it can be normalized while being copied,
-     i.e no extra storage should be allocated.  */
-
-/* This is the function body of mdiv, mpz_divmod, and mpz_mod.
-
-   If COMPUTE_QUOTIENT is defined, the quotient is put in the MP_INT
-   object quot, otherwise that variable is not referenced at all.
-
-   The remainder is always computed, and the result is put in the MP_INT
-   object rem.  */
-
-{
-  mp_ptr np, dp;
-  mp_ptr qp, rp;
-  mp_size_t nsize = num->_mp_size;
-  mp_size_t dsize = den->_mp_size;
-  mp_size_t qsize, rsize;
-  mp_size_t sign_remainder = nsize;
-#ifdef COMPUTE_QUOTIENT
-  mp_size_t sign_quotient = nsize ^ dsize;
-#endif
-  unsigned normalization_steps;
-  mp_limb_t q_limb;
-  TMP_DECL (marker);
-
-  nsize = ABS (nsize);
-  dsize = ABS (dsize);
-
-  /* Ensure space is enough for quotient and remainder. */
-
-  /* We need space for an extra limb in the remainder, because it's
-     up-shifted (normalized) below.  */
-  rsize = nsize + 1;
-  if (rem->_mp_alloc < rsize)
-    _mpz_realloc (rem, rsize);
-
-  qsize = rsize - dsize;       /* qsize cannot be bigger than this.  */
-  if (qsize <= 0)
-    {
-      if (num != rem)
-       {
-         rem->_mp_size = num->_mp_size;
-         MPN_COPY (rem->_mp_d, num->_mp_d, nsize);
-       }
-#ifdef COMPUTE_QUOTIENT
-      /* This needs to follow the assignment to rem, in case the
-        numerator and quotient are the same.  */
-      quot->_mp_size = 0;
-#endif
-      return;
-    }
-
-#ifdef COMPUTE_QUOTIENT
-  if (quot->_mp_alloc < qsize)
-    _mpz_realloc (quot, qsize);
-#endif
-
-  /* Read pointers here, when reallocation is finished.  */
-  np = num->_mp_d;
-  dp = den->_mp_d;
-  rp = rem->_mp_d;
-
-  /* Optimize division by a single-limb divisor.  */
-  if (dsize == 1)
-    {
-      mp_limb_t rlimb;
-#ifdef COMPUTE_QUOTIENT
-      qp = quot->_mp_d;
-      rlimb = mpn_divmod_1 (qp, np, nsize, dp[0]);
-      qsize -= qp[qsize - 1] == 0;
-      quot->_mp_size = sign_quotient >= 0 ? qsize : -qsize;
-#else
-      rlimb = mpn_mod_1 (np, nsize, dp[0]);
-#endif
-      rp[0] = rlimb;
-      rsize = rlimb != 0;
-      rem->_mp_size = sign_remainder >= 0 ? rsize : -rsize;
-      return;
-    }
-
-  TMP_MARK (marker);
-
-#ifdef COMPUTE_QUOTIENT
-  qp = quot->_mp_d;
-
-  /* Make sure QP and NP point to different objects.  Otherwise the
-     numerator would be gradually overwritten by the quotient limbs.  */
-  if (qp == np)
-    {
-      /* Copy NP object to temporary space.  */
-      np = (mp_ptr) TMP_ALLOC (nsize * BYTES_PER_MP_LIMB);
-      MPN_COPY (np, qp, nsize);
-    }
-
-#else
-  /* Put quotient at top of remainder. */
-  qp = rp + dsize;
-#endif
-
-  count_leading_zeros (normalization_steps, dp[dsize - 1]);
-
-  /* Normalize the denominator, i.e. make its most significant bit set by
-     shifting it NORMALIZATION_STEPS bits to the left.  Also shift the
-     numerator the same number of steps (to keep the quotient the same!).  */
-  if (normalization_steps != 0)
-    {
-      mp_ptr tp;
-      mp_limb_t nlimb;
-
-      /* Shift up the denominator setting the most significant bit of
-        the most significant word.  Use temporary storage not to clobber
-        the original contents of the denominator.  */
-      tp = (mp_ptr) TMP_ALLOC (dsize * BYTES_PER_MP_LIMB);
-      mpn_lshift (tp, dp, dsize, normalization_steps);
-      dp = tp;
-
-      /* Shift up the numerator, possibly introducing a new most
-        significant word.  Move the shifted numerator in the remainder
-        meanwhile.  */
-      nlimb = mpn_lshift (rp, np, nsize, normalization_steps);
-      if (nlimb != 0)
-       {
-         rp[nsize] = nlimb;
-         rsize = nsize + 1;
-       }
-      else
-       rsize = nsize;
-    }
-  else
-    {
-      /* The denominator is already normalized, as required.  Copy it to
-        temporary space if it overlaps with the quotient or remainder.  */
-#ifdef COMPUTE_QUOTIENT
-      if (dp == rp || dp == qp)
-#else
-      if (dp == rp)
-#endif
-       {
-         mp_ptr tp;
-
-         tp = (mp_ptr) TMP_ALLOC (dsize * BYTES_PER_MP_LIMB);
-         MPN_COPY (tp, dp, dsize);
-         dp = tp;
-       }
-
-      /* Move the numerator to the remainder.  */
-      if (rp != np)
-       MPN_COPY (rp, np, nsize);
-
-      rsize = nsize;
-    }
-
-  q_limb = mpn_divmod (qp, rp, rsize, dp, dsize);
-
-#ifdef COMPUTE_QUOTIENT
-  qsize = rsize - dsize;
-  if (q_limb)
-    {
-      qp[qsize] = q_limb;
-      qsize += 1;
-    }
-
-  quot->_mp_size = sign_quotient >= 0 ? qsize : -qsize;
-#endif
-
-  rsize = dsize;
-  MPN_NORMALIZE (rp, rsize);
-
-  if (normalization_steps != 0 && rsize != 0)
-    {
-      mpn_rshift (rp, rp, rsize, normalization_steps);
-      rsize -= rp[rsize - 1] == 0;
-    }
-
-  rem->_mp_size = sign_remainder >= 0 ? rsize : -rsize;
-  TMP_FREE (marker);
-}
diff --git a/ghc/rts/gmp/mpz/mul_ui.c b/ghc/rts/gmp/mpz/mul_ui.c
deleted file mode 100644 (file)
index f1f7269..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/* mpz_mul_ui(product, multiplier, small_multiplicand) -- Set
-   PRODUCT to MULTIPLICATOR times SMALL_MULTIPLICAND.
-
-Copyright (C) 1991, 1993, 1994, 1996 Free Software Foundation, Inc.
-
-This file is part of the GNU MP Library.
-
-The GNU MP Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Library General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at your
-option) any later version.
-
-The GNU MP 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 Library General Public
-License for more details.
-
-You should have received a copy of the GNU Library General Public License
-along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-MA 02111-1307, USA. */
-
-#include "gmp.h"
-#include "gmp-impl.h"
-
-void
-#if __STDC__
-mpz_mul_ui (mpz_ptr prod, mpz_srcptr mult, unsigned long int small_mult)
-#else
-mpz_mul_ui (prod, mult, small_mult)
-     mpz_ptr prod;
-     mpz_srcptr mult;
-     unsigned long int small_mult;
-#endif
-{
-  mp_size_t size = mult->_mp_size;
-  mp_size_t sign_product = size;
-  mp_limb_t cy;
-  mp_size_t prod_size;
-  mp_ptr prod_ptr;
-
-  size = ABS (size);
-
-  if (size == 0 || small_mult == 0)
-    {
-      prod->_mp_size = 0;
-      return;
-    }
-
-  prod_size = size + 1;
-  if (prod->_mp_alloc < prod_size)
-    _mpz_realloc (prod, prod_size);
-
-  prod_ptr = prod->_mp_d;
-
-  cy = mpn_mul_1 (prod_ptr, mult->_mp_d, size, (mp_limb_t) small_mult);
-  if (cy != 0)
-    {
-      prod_ptr[size] = cy;
-      size++;
-    }
-
-  prod->_mp_size = sign_product >= 0 ? size : -size;
-}
index 37221c2..313479e 100644 (file)
@@ -1,27 +1,27 @@
 /* urandom.h -- define urandom returning a full unsigned long random value.
 
-Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library.
 
 The GNU MP Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Library General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at your
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or (at your
 option) any later version.
 
 The GNU MP 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 Library General Public
+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 Library General Public License
+You should have received a copy of the GNU Lesser General Public License
 along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 MA 02111-1307, USA. */
 
 #if defined (__hpux) || defined (__svr4__) || defined (__SVR4)
 /* HPUX lacks random().  */
-static inline unsigned long
+static inline mp_limb_t
 urandom ()
 {
   return mrand48 ();
@@ -42,7 +42,7 @@ urandom ()
 #if defined (__alpha) && !defined (__URANDOM)
 /* DEC OSF/1 1.2 random() returns a double.  */
 long mrand48 ();
-static inline unsigned long
+static inline mp_limb_t
 urandom ()
 {
   return mrand48 () | (mrand48 () << 32);
@@ -51,8 +51,14 @@ urandom ()
 #endif
 
 #if BITS_PER_MP_LIMB == 32 && !defined (__URANDOM)
+#if defined (__cplusplus)
+extern "C" {
+#endif
 long random ();
-static inline unsigned long
+#if defined (__cplusplus)
+}
+#endif
+static inline mp_limb_t
 urandom ()
 {
   /* random() returns 31 bits, we want 32.  */
@@ -62,12 +68,18 @@ urandom ()
 #endif
 
 #if BITS_PER_MP_LIMB == 64 && !defined (__URANDOM)
+#if defined (__cplusplus)
+extern "C" {
+#endif
 long random ();
-static inline unsigned long
+#if defined (__cplusplus)
+}
+#endif
+static inline mp_limb_t
 urandom ()
 {
   /* random() returns 31 bits, we want 64.  */
-  return random () ^ (random () << 31) ^ (random () << 62);
+  return random () ^ ((mp_limb_t) random () << 31) ^ ((mp_limb_t) random () << 62);
 }
 #define __URANDOM
 #endif