summaryrefslogtreecommitdiff
path: root/devel/gmp/patches
diff options
context:
space:
mode:
authormjl <mjl@pkgsrc.org>2002-08-24 00:39:06 +0000
committermjl <mjl@pkgsrc.org>2002-08-24 00:39:06 +0000
commita1f4abf7ef07454acdaeee648e9fd1b4e3437e32 (patch)
treef6a8dcd2d946d310b66bfbc325955cbdf182fce0 /devel/gmp/patches
parent11b2702502d19f33e37ae50f588b40524da8465e (diff)
downloadpkgsrc-a1f4abf7ef07454acdaeee648e9fd1b4e3437e32.tar.gz
Update to 4.1
* Bug fixes. * Speed improvements. * Upwardly binary compatible with 4.0, 4.0.1, and 3.x versions. * Asymptotically fast conversion to/from strings (mpz, mpq, mpn levels), but also major speed improvements for tiny operands. * mpn_get_str parameter restrictions relaxed. * Major speed improvments for HPPA 2.0 systems. * Major speed improvments for UltraSPARC systems. * Major speed improvments for IA-64 systems (but still sub-optimal code). * Extended test suite. * mpfr is back, with many bug fixes and portability improvements. * New function: mpz_ui_sub. * New functions: mpz_export, mpz_import. * Optimization for nth root functions (mpz_root, mpz_perfect_power_p). * Optimization for extended gcd (mpz_gcdext, mpz_invert, mpn_gcdext). * Generalized low-level number format, reserving a `nails' part of each limb. (Please note that this is really experimental; some functions are likely to compute garbage when nails are enabled.) * Nails-enabled Alpha 21264 assembly code, allowing up to 75% better performance. (Use --enable-nails=4 to enable it.)
Diffstat (limited to 'devel/gmp/patches')
-rw-r--r--devel/gmp/patches/patch-aa33
-rw-r--r--devel/gmp/patches/patch-ga25
-rw-r--r--devel/gmp/patches/patch-gb33
-rw-r--r--devel/gmp/patches/patch-gc27
-rw-r--r--devel/gmp/patches/patch-gd30
5 files changed, 115 insertions, 33 deletions
diff --git a/devel/gmp/patches/patch-aa b/devel/gmp/patches/patch-aa
deleted file mode 100644
index 91488883c57..00000000000
--- a/devel/gmp/patches/patch-aa
+++ /dev/null
@@ -1,33 +0,0 @@
-$NetBSD: patch-aa,v 1.7 2002/05/10 05:06:23 fredb Exp $
-
---- longlong.h.orig Thu Nov 15 14:48:14 2001
-+++ longlong.h
-@@ -734,8 +734,8 @@
- #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
- __asm__ ("add%.l %5,%1\n\taddx%.l %3,%0" \
- : "=d" ((USItype)(sh)), "=&d" ((USItype)(sl)) \
-- : "%0" ((USItype)(ah)), "d" ((USItype)(bh)), \
-- "%1" ((USItype)(al)), "g" ((USItype)(bl)))
-+ : "0" ((USItype)(ah)), "d" ((USItype)(bh)), \
-+ "1" ((USItype)(al)), "g" ((USItype)(bl)))
- #define sub_ddmmss(sh, sl, ah, al, bh, bl) \
- __asm__ ("sub%.l %5,%1\n\tsubx%.l %3,%0" \
- : "=d" ((USItype)(sh)), "=&d" ((USItype)(sl)) \
-@@ -750,7 +750,7 @@
- #define umul_ppmm(w1, w0, u, v) \
- __asm__ ("mulu%.l %3,%1:%0" \
- : "=d" ((USItype)(w0)), "=d" ((USItype)(w1)) \
-- : "%0" ((USItype)(u)), "dmi" ((USItype)(v)))
-+ : "0" ((USItype)(u)), "dmi" ((USItype)(v)))
- #define UMUL_TIME 45
- #define udiv_qrnnd(q, r, n1, n0, d) \
- __asm__ ("divu%.l %4,%1:%0" \
-@@ -788,7 +788,7 @@
- " | End inlined umul_ppmm" \
- : "=&d" ((USItype)(xh)), "=&d" ((USItype)(xl)), \
- "=d" (__umul_tmp1), "=&d" (__umul_tmp2) \
-- : "%2" ((USItype)(a)), "d" ((USItype)(b))); \
-+ : "2" ((USItype)(a)), "d" ((USItype)(b))); \
- } while (0)
- #define UMUL_TIME 100
- #define UDIV_TIME 400
diff --git a/devel/gmp/patches/patch-ga b/devel/gmp/patches/patch-ga
new file mode 100644
index 00000000000..7cdd5c4d35e
--- /dev/null
+++ b/devel/gmp/patches/patch-ga
@@ -0,0 +1,25 @@
+$NetBSD: patch-ga,v 1.1 2002/08/24 00:39:07 mjl Exp $
+
+This is a patch for 4.1 from the GNU MP Homepage, it should be
+removed in future versions
+
+Index: randraw.c
+===================================================================
+RCS file: /home/cvsfiles/gmp/randraw.c,v
+retrieving revision 1.18
+retrieving revision 1.19
+diff -u -r1.18 -r1.19
+--- randraw.c 2002/05/14 16:59:44 1.18
++++ randraw.c 2002/06/09 08:12:03 1.19
+@@ -112,10 +112,8 @@
+ if (seedn == 0)
+ {
+ /* Seed is 0. Result is C % M. Assume table is sensibly stored,
+- with C smaller than M*/
++ with C smaller than M. */
+ *rp = c;
+-
+- ASSERT_ALWAYS (((mp_limb_t) 1 << m2exp) > c);
+
+ *seedp = c;
+ SIZ (rstate->_mp_seed) = 1;
diff --git a/devel/gmp/patches/patch-gb b/devel/gmp/patches/patch-gb
new file mode 100644
index 00000000000..d65b0ad2a25
--- /dev/null
+++ b/devel/gmp/patches/patch-gb
@@ -0,0 +1,33 @@
+$NetBSD: patch-gb,v 1.1 2002/08/24 00:39:07 mjl Exp $
+
+This is a patch for 4.1 from the GNU MP Homepage, it should be
+removed in future versions
+
+--- mpz/powm_ui.c.~1.16.~ Thu May 16 09:20:49 2002
++++ mpz/powm_ui.c Sat Jun 1 10:41:34 2002
+@@ -115,6 +115,17 @@
+
+ /* Main loop. */
+
++ /* If m is already normalized (high bit of high limb set), and b is the
++ same size, but a bigger value, and e==1, then there's no modular
++ reductions done and we can end up with a result out of range at the
++ end. */
++ if (c == 0)
++ {
++ if (xn == mn && mpn_cmp (xp, mp, mn) >= 0)
++ mpn_sub_n (xp, xp, mp, mn);
++ goto finishup;
++ }
++
+ while (c != 0)
+ {
+ mpn_sqr_n (tp, xp, xn);
+@@ -149,6 +160,7 @@
+ c--;
+ }
+
++ finishup:
+ /* We shifted m left m_zero_cnt steps. Adjust the result by reducing
+ it with the original MOD. */
+ if (m_zero_cnt != 0)
diff --git a/devel/gmp/patches/patch-gc b/devel/gmp/patches/patch-gc
new file mode 100644
index 00000000000..00a77a4bff8
--- /dev/null
+++ b/devel/gmp/patches/patch-gc
@@ -0,0 +1,27 @@
+$NetBSD: patch-gc,v 1.1 2002/08/24 00:39:08 mjl Exp $
+
+This is a patch for 4.1 from the GNU MP Homepage, it should be
+removed in future versions
+
+--- mpf/inp_str.c.old Tue Jan 2 18:53:42 2001
++++ mpf/inp_str.c Wed Jul 3 10:57:33 2002
+@@ -64,6 +64,7 @@
+ c = getc (stream);
+ }
+ ungetc (c, stream);
++ nread--;
+
+ if (str_size >= alloc_size)
+ {
+@@ -74,9 +75,10 @@
+ str[str_size] = 0;
+
+ retval = mpf_set_str (rop, str, base);
++ (*__gmp_free_func) (str, alloc_size);
++
+ if (retval == -1)
+ return 0; /* error */
+
+- (*__gmp_free_func) (str, alloc_size);
+ return str_size + nread;
+ }
diff --git a/devel/gmp/patches/patch-gd b/devel/gmp/patches/patch-gd
new file mode 100644
index 00000000000..c2a30d496e8
--- /dev/null
+++ b/devel/gmp/patches/patch-gd
@@ -0,0 +1,30 @@
+$NetBSD: patch-gd,v 1.1 2002/08/24 00:39:08 mjl Exp $
+
+This is a patch for 4.1 from the GNU MP Homepage, it should be
+removed in future versions
+
+--- gmpxx.h.old Wed Jul 3 10:45:48 2002
++++ gmpxx.h Wed Jul 3 10:49:28 2002
+@@ -2633,10 +2633,18 @@
+ }
+
+ // conversion functions
+- const mpz_classref get_num() const { return mpz_classref(mpq_numref(mp)); }
+- mpz_classref get_num() { return mpz_classref(mpq_numref(mp)); }
+- const mpz_classref get_den() const { return mpz_classref(mpq_denref(mp)); }
+- mpz_classref get_den() { return mpz_classref(mpq_denref(mp)); }
++
++ // casting a reference to an mpz_t to mpz_class & is a dirty hack,
++ // but works because the internal representation of mpz_class is
++ // exactly an mpz_t
++ const mpz_class & get_num() const
++ { return reinterpret_cast<const mpz_class &>(*mpq_numref(mp)); }
++ mpz_class & get_num()
++ { return reinterpret_cast<mpz_class &>(*mpq_numref(mp)); }
++ const mpz_class & get_den() const
++ { return reinterpret_cast<const mpz_class &>(*mpq_denref(mp)); }
++ mpz_class & get_den()
++ { return reinterpret_cast<mpz_class &>(*mpq_denref(mp)); }
+
+ mpq_srcptr get_mpq_t() const { return mp; }
+ mpq_ptr get_mpq_t() { return mp; }