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

mercurial at gmplib.org mercurial at gmplib.org
Mon May 18 21:43:21 UTC 2020


details:   /var/hg/gmp-6.2/rev/ae699fdc8bd2
changeset: 18035:ae699fdc8bd2
user:      Torbjorn Granlund <tg at gmplib.org>
date:      Mon May 18 23:42:39 2020 +0200
description:
(DO_mpn_addlsh_n): Define only when needed.

details:   /var/hg/gmp-6.2/rev/7be295455155
changeset: 18036:7be295455155
user:      Torbjorn Granlund <tg at gmplib.org>
date:      Mon May 18 23:43:16 2020 +0200
description:
ChangeLog

diffstat:

 ChangeLog                            |   6 +++
 mpn/generic/toom_interpolate_12pts.c |  58 +++++++++++++++++++----------------
 mpn/generic/toom_interpolate_16pts.c |  34 +++++++++++---------
 3 files changed, 56 insertions(+), 42 deletions(-)

diffs (188 lines):

diff -r 69a362c9c427 -r 7be295455155 ChangeLog
--- a/ChangeLog	Mon May 18 17:40:17 2020 +0200
+++ b/ChangeLog	Mon May 18 23:43:16 2020 +0200
@@ -1,3 +1,9 @@
+2020-05-18  Torbjörn Granlund  <tg at gmplib.org>
+
+	* mpn/generic/toom_interpolate_12pts.c (DO_mpn_addlsh_n): Define only
+	when needed.
+	* mpn/generic/toom_interpolate_16pts.c: Likewise.
+
 2020-05-17 Marco Bodrato <bodrato at mail.dm.unipi.it>
 
 	* mpz/cmp.c: Avoid overflow on int even for huge sizes.
diff -r 69a362c9c427 -r 7be295455155 mpn/generic/toom_interpolate_12pts.c
--- a/mpn/generic/toom_interpolate_12pts.c	Mon May 18 17:40:17 2020 +0200
+++ b/mpn/generic/toom_interpolate_12pts.c	Mon May 18 23:43:16 2020 +0200
@@ -6,7 +6,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 2009, 2010, 2012, 2015 Free Software Foundation, Inc.
+Copyright 2009, 2010, 2012, 2015, 2020 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library.
 
@@ -38,6 +38,34 @@
 #include "gmp-impl.h"
 
 
+#if GMP_NUMB_BITS < 21
+#error Not implemented: Both sublsh_n(,,,20) should be corrected.
+#endif
+
+#if GMP_NUMB_BITS < 16
+#error Not implemented: divexact_by42525 needs splitting.
+#endif
+
+#if GMP_NUMB_BITS < 12
+#error Not implemented: Hard to adapt...
+#endif
+
+
+/* FIXME: tuneup should decide the best variant */
+#ifndef AORSMUL_FASTER_AORS_AORSLSH
+#define AORSMUL_FASTER_AORS_AORSLSH 1
+#endif
+#ifndef AORSMUL_FASTER_AORS_2AORSLSH
+#define AORSMUL_FASTER_AORS_2AORSLSH 1
+#endif
+#ifndef AORSMUL_FASTER_2AORSLSH
+#define AORSMUL_FASTER_2AORSLSH 1
+#endif
+#ifndef AORSMUL_FASTER_3AORSLSH
+#define AORSMUL_FASTER_3AORSLSH 1
+#endif
+
+
 #if HAVE_NATIVE_mpn_sublsh_n
 #define DO_mpn_sublsh_n(dst,src,n,s,ws) mpn_sublsh_n(dst,dst,src,n,s)
 #else
@@ -57,6 +85,7 @@
 #if HAVE_NATIVE_mpn_addlsh_n
 #define DO_mpn_addlsh_n(dst,src,n,s,ws) mpn_addlsh_n(dst,dst,src,n,s)
 #else
+#if !defined (AORSMUL_FASTER_2AORSLSH) && !defined (AORSMUL_FASTER_AORS_2AORSLSH)
 static mp_limb_t
 DO_mpn_addlsh_n(mp_ptr dst, mp_srcptr src, mp_size_t n, unsigned int s, mp_ptr ws)
 {
@@ -69,6 +98,7 @@
 #endif
 }
 #endif
+#endif
 
 #if HAVE_NATIVE_mpn_subrsh
 #define DO_mpn_subrsh(dst,nd,src,ns,s,ws) mpn_subrsh(dst,nd,src,ns,s)
@@ -84,32 +114,6 @@
 #endif
 
 
-#if GMP_NUMB_BITS < 21
-#error Not implemented: Both sublsh_n(,,,20) should be corrected.
-#endif
-
-#if GMP_NUMB_BITS < 16
-#error Not implemented: divexact_by42525 needs splitting.
-#endif
-
-#if GMP_NUMB_BITS < 12
-#error Not implemented: Hard to adapt...
-#endif
-
-/* FIXME: tuneup should decide the best variant */
-#ifndef AORSMUL_FASTER_AORS_AORSLSH
-#define AORSMUL_FASTER_AORS_AORSLSH 1
-#endif
-#ifndef AORSMUL_FASTER_AORS_2AORSLSH
-#define AORSMUL_FASTER_AORS_2AORSLSH 1
-#endif
-#ifndef AORSMUL_FASTER_2AORSLSH
-#define AORSMUL_FASTER_2AORSLSH 1
-#endif
-#ifndef AORSMUL_FASTER_3AORSLSH
-#define AORSMUL_FASTER_3AORSLSH 1
-#endif
-
 #define BINVERT_9 \
   ((((GMP_NUMB_MAX / 9) << (6 - GMP_NUMB_BITS % 6)) * 8 & GMP_NUMB_MAX) | 0x39)
 
diff -r 69a362c9c427 -r 7be295455155 mpn/generic/toom_interpolate_16pts.c
--- a/mpn/generic/toom_interpolate_16pts.c	Mon May 18 17:40:17 2020 +0200
+++ b/mpn/generic/toom_interpolate_16pts.c	Mon May 18 23:43:16 2020 +0200
@@ -6,7 +6,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 2009, 2010, 2012, 2015 Free Software Foundation, Inc.
+Copyright 2009, 2010, 2012, 2015, 2020 Free Software Foundation, Inc.
 
 This file is part of the GNU MP Library.
 
@@ -37,6 +37,7 @@
 
 #include "gmp-impl.h"
 
+
 #if GMP_NUMB_BITS < 29
 #error Not implemented: Both sublsh_n(,,,28) should be corrected; r2 and r5 need one more LIMB.
 #endif
@@ -46,6 +47,21 @@
 #endif
 
 
+/* FIXME: tuneup should decide the best variant */
+#ifndef AORSMUL_FASTER_AORS_AORSLSH
+#define AORSMUL_FASTER_AORS_AORSLSH 1
+#endif
+#ifndef AORSMUL_FASTER_AORS_2AORSLSH
+#define AORSMUL_FASTER_AORS_2AORSLSH 1
+#endif
+#ifndef AORSMUL_FASTER_2AORSLSH
+#define AORSMUL_FASTER_2AORSLSH 1
+#endif
+#ifndef AORSMUL_FASTER_3AORSLSH
+#define AORSMUL_FASTER_3AORSLSH 1
+#endif
+
+
 #if HAVE_NATIVE_mpn_sublsh_n
 #define DO_mpn_sublsh_n(dst,src,n,s,ws) mpn_sublsh_n(dst,dst,src,n,s)
 #else
@@ -65,6 +81,7 @@
 #if HAVE_NATIVE_mpn_addlsh_n
 #define DO_mpn_addlsh_n(dst,src,n,s,ws) mpn_addlsh_n(dst,dst,src,n,s)
 #else
+#if !defined (AORSMUL_FASTER_2AORSLSH) && !defined (AORSMUL_FASTER_AORS_2AORSLSH)
 static mp_limb_t
 DO_mpn_addlsh_n(mp_ptr dst, mp_srcptr src, mp_size_t n, unsigned int s, mp_ptr ws)
 {
@@ -77,6 +94,7 @@
 #endif
 }
 #endif
+#endif
 
 #if HAVE_NATIVE_mpn_subrsh
 #define DO_mpn_subrsh(dst,nd,src,ns,s,ws) mpn_subrsh(dst,nd,src,ns,s)
@@ -92,20 +110,6 @@
 #endif
 
 
-/* FIXME: tuneup should decide the best variant */
-#ifndef AORSMUL_FASTER_AORS_AORSLSH
-#define AORSMUL_FASTER_AORS_AORSLSH 1
-#endif
-#ifndef AORSMUL_FASTER_AORS_2AORSLSH
-#define AORSMUL_FASTER_AORS_2AORSLSH 1
-#endif
-#ifndef AORSMUL_FASTER_2AORSLSH
-#define AORSMUL_FASTER_2AORSLSH 1
-#endif
-#ifndef AORSMUL_FASTER_3AORSLSH
-#define AORSMUL_FASTER_3AORSLSH 1
-#endif
-
 #if GMP_NUMB_BITS < 43
 #define BIT_CORRECTION 1
 #define CORRECTION_BITS GMP_NUMB_BITS



More information about the gmp-commit mailing list