[Gmp-commit] /var/hg/gmp: 3 new changesets

mercurial at gmplib.org mercurial at gmplib.org
Sat Jan 2 16:58:25 UTC 2021


details:   /var/hg/gmp/rev/211351cb3487
changeset: 18193:211351cb3487
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sat Jan 02 17:54:52 2021 +0100
description:
mpn/generic/toom32_mul.c: Simplify carry propagation

details:   /var/hg/gmp/rev/561db69266a7
changeset: 18194:561db69266a7
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sat Jan 02 17:55:16 2021 +0100
description:
mpn/x86_64/zen3/mul_1.asm: Remove duplicated code.

details:   /var/hg/gmp/rev/6fed56750f6f
changeset: 18195:6fed56750f6f
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sat Jan 02 17:57:33 2021 +0100
description:
mini-gmp/mini-gmp.c (mpz_export): Correct error message (tx: Guillermo Monguia)

diffstat:

 mini-gmp/mini-gmp.c       |  2 +-
 mpn/generic/toom32_mul.c  |  8 +++-----
 mpn/x86_64/zen3/mul_1.asm |  6 +-----
 3 files changed, 5 insertions(+), 11 deletions(-)

diffs (54 lines):

diff -r 0178d0bbdd66 -r 6fed56750f6f mini-gmp/mini-gmp.c
--- a/mini-gmp/mini-gmp.c	Fri Jan 01 20:24:27 2021 +0100
+++ b/mini-gmp/mini-gmp.c	Sat Jan 02 17:57:33 2021 +0100
@@ -4521,7 +4521,7 @@
   mp_size_t un;
 
   if (nails != 0)
-    gmp_die ("mpz_import: Nails not supported.");
+    gmp_die ("mpz_export: Nails not supported.");
 
   assert (order == 1 || order == -1);
   assert (endian >= -1 && endian <= 1);
diff -r 0178d0bbdd66 -r 6fed56750f6f mpn/generic/toom32_mul.c
--- a/mpn/generic/toom32_mul.c	Fri Jan 01 20:24:27 2021 +0100
+++ b/mpn/generic/toom32_mul.c	Sat Jan 02 17:57:33 2021 +0100
@@ -11,7 +11,7 @@
    SAFE TO REACH IT THROUGH DOCUMENTED INTERFACES.  IN FACT, IT IS ALMOST
    GUARANTEED THAT IT WILL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
 
-Copyright 2006-2010, 2020 Free Software Foundation, Inc.
+Copyright 2006-2010, 2020, 2021 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library.
 
@@ -312,10 +312,8 @@
     {
       hi -= mpn_sub (pp + 2*n, pp + 2*n, 2*n, pp + 4*n, s+t-n);
 
-      if (hi < 0)
-	MPN_DECR_U (pp + 4*n, s+t-n, -hi);
-      else
-	MPN_INCR_U (pp + 4*n, s+t-n, hi);
+      ASSERT (hi >= 0); /* contribution of the middle terms >= 0 */
+      MPN_INCR_U (pp + 4*n, s+t-n, hi);
     }
   else
     ASSERT (hi == 0);
diff -r 0178d0bbdd66 -r 6fed56750f6f mpn/x86_64/zen3/mul_1.asm
--- a/mpn/x86_64/zen3/mul_1.asm	Fri Jan 01 20:24:27 2021 +0100
+++ b/mpn/x86_64/zen3/mul_1.asm	Sat Jan 02 17:57:33 2021 +0100
@@ -154,12 +154,8 @@
 
 L(f1):	mulx(	(up), %r9, %rax)
 	adc	%r11, %r9	
-	jrcxz	L(1)
+	jrcxz	L(end)
 	jmp	L(b1)
-L(1):	mov	%r9, (rp)
-	adc	$0, %rax
-	FUNC_EXIT()
-	ret
 
 L(end):	mov	%r9, (rp)
 	adc	%rcx, %rax		C relies on rcx = 0


More information about the gmp-commit mailing list