[Gmp-commit] /var/hg/gmp: Define and use sublsh2_n*_ip1.

mercurial at gmplib.org mercurial at gmplib.org
Fri Mar 11 07:39:02 CET 2011


details:   /var/hg/gmp/rev/042d12fa4384
changeset: 14032:042d12fa4384
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Fri Mar 11 07:38:08 2011 +0100
description:
Define and use sublsh2_n*_ip1.

diffstat:

 configure.in                        |   6 ++++++
 gmp-impl.h                          |  16 +++++++++++++++-
 mpn/asm-defs.m4                     |   7 +++++++
 mpn/generic/toom_interpolate_6pts.c |   8 ++++----
 mpn/generic/toom_interpolate_8pts.c |   4 ++--
 mpn/x86/atom/aorslshC_n.asm         |   8 ++++----
 mpn/x86/atom/sublsh2_n.asm          |  10 +++++-----
 7 files changed, 43 insertions(+), 16 deletions(-)

diffs (145 lines):

diff -r 747f8faeb304 -r 042d12fa4384 configure.in
--- a/configure.in	Thu Mar 10 22:31:09 2011 +0100
+++ b/configure.in	Fri Mar 11 07:38:08 2011 +0100
@@ -3078,6 +3078,12 @@
 #undef HAVE_NATIVE_mpn_sublsh1_nc
 #undef HAVE_NATIVE_mpn_sublsh2_nc
 #undef HAVE_NATIVE_mpn_sublsh_nc
+#undef HAVE_NATIVE_mpn_sublsh1_n_ip1
+#undef HAVE_NATIVE_mpn_sublsh2_n_ip1
+#undef HAVE_NATIVE_mpn_sublsh_n_ip1
+#undef HAVE_NATIVE_mpn_sublsh1_nc_ip1
+#undef HAVE_NATIVE_mpn_sublsh2_nc_ip1
+#undef HAVE_NATIVE_mpn_sublsh_nc_ip1
 #undef HAVE_NATIVE_mpn_submul_1c
 #undef HAVE_NATIVE_mpn_udiv_qrnnd
 #undef HAVE_NATIVE_mpn_udiv_qrnnd_r
diff -r 747f8faeb304 -r 042d12fa4384 gmp-impl.h
--- a/gmp-impl.h	Thu Mar 10 22:31:09 2011 +0100
+++ b/gmp-impl.h	Fri Mar 11 07:38:08 2011 +0100
@@ -832,11 +832,25 @@
 __GMP_DECLSPEC mp_limb_signed_t mpn_rsblsh1_nc __GMP_PROTO ((mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t));
 
 /* mpn_sublsh2_n(c,a,b,n), when it exists, sets {c,n} to {a,n}-4*{b,n}, and
-   returns the borrow out (0, ..., 4).  */
+   returns the borrow out (0, ..., 4). Use _ip1 when a=c. */
 #define mpn_sublsh2_n __MPN(sublsh2_n)
 __GMP_DECLSPEC mp_limb_t mpn_sublsh2_n __GMP_PROTO ((mp_ptr, mp_srcptr, mp_srcptr, mp_size_t));
 #define mpn_sublsh2_nc __MPN(sublsh2_nc)
 __GMP_DECLSPEC mp_limb_t mpn_sublsh2_nc __GMP_PROTO ((mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t));
+#if HAVE_NATIVE_mpn_sublsh2_n && ! HAVE_NATIVE_mpn_sublsh2_n_ip1
+#define mpn_sublsh2_n_ip1(dst,src,n) mpn_sublsh2_n(dst,dst,src,n)
+#define HAVE_NATIVE_mpn_sublsh2_n_ip1 1
+#else
+#define mpn_sublsh2_n_ip1 __MPN(sublsh2_n_ip1)
+__GMP_DECLSPEC mp_limb_t mpn_sublsh2_n_ip1 __GMP_PROTO ((mp_ptr, mp_srcptr, mp_size_t));
+#endif
+#if HAVE_NATIVE_mpn_sublsh2_nc && ! HAVE_NATIVE_mpn_sublsh2_nc_ip1
+#define mpn_sublsh2_nc_ip1(dst,src,n,c) mpn_sublsh2_nc(dst,dst,src,n,c)
+#define HAVE_NATIVE_mpn_sublsh2_nc_ip1 1
+#else
+#define mpn_sublsh2_nc_ip1 __MPN(sublsh2_nc_ip1)
+__GMP_DECLSPEC mp_limb_t mpn_sublsh2_nc_ip1 __GMP_PROTO ((mp_ptr, mp_srcptr, mp_size_t, mp_limb_t));
+#endif
 
 /* mpn_sublsh_n(c,a,b,n,k), when it exists, sets {c,n} to {a,n}-2^k*{b,n}, and
    returns the carry out (0, ..., 2^k).  */
diff -r 747f8faeb304 -r 042d12fa4384 mpn/asm-defs.m4
--- a/mpn/asm-defs.m4	Thu Mar 10 22:31:09 2011 +0100
+++ b/mpn/asm-defs.m4	Fri Mar 11 07:38:08 2011 +0100
@@ -1415,9 +1415,16 @@
 define_mpn(sub_n)
 define_mpn(sublsh1_n)
 define_mpn(sublsh1_nc)
+define_mpn(sublsh1_n_ip1)
+define_mpn(sublsh1_nc_ip1)
 define_mpn(sublsh2_n)
 define_mpn(sublsh2_nc)
+define_mpn(sublsh2_n_ip1)
+define_mpn(sublsh2_nc_ip1)
 define_mpn(sublsh_n)
+define_mpn(sublsh_nc)
+define_mpn(sublsh_n_ip1)
+define_mpn(sublsh_nc_ip1)
 define_mpn(sqrtrem)
 define_mpn(sub)
 define_mpn(sub_1)
diff -r 747f8faeb304 -r 042d12fa4384 mpn/generic/toom_interpolate_6pts.c
--- a/mpn/generic/toom_interpolate_6pts.c	Thu Mar 10 22:31:09 2011 +0100
+++ b/mpn/generic/toom_interpolate_6pts.c	Fri Mar 11 07:38:08 2011 +0100
@@ -167,11 +167,11 @@
   MPN_INCR_U (pp + 3 * n + 1, n, cy);
 
   /* W2 -= W0<<2 */
-#if HAVE_NATIVE_mpn_sublsh_n || HAVE_NATIVE_mpn_sublsh2_n
-#if HAVE_NATIVE_mpn_sublsh2_n
-  cy = mpn_sublsh2_n(w2, w2, w0, w0n);
+#if HAVE_NATIVE_mpn_sublsh_n || HAVE_NATIVE_mpn_sublsh2_n_ip1
+#if HAVE_NATIVE_mpn_sublsh2_n_ip1
+  cy = mpn_sublsh2_n_ip1 (w2, w0, w0n);
 #else
-  cy = mpn_sublsh_n(w2, w2, w0, w0n, 2);
+  cy = mpn_sublsh_n (w2, w2, w0, w0n, 2);
 #endif
 #else
   /* {W4,2*n+1} is now free and can be overwritten. */
diff -r 747f8faeb304 -r 042d12fa4384 mpn/generic/toom_interpolate_8pts.c
--- a/mpn/generic/toom_interpolate_8pts.c	Thu Mar 10 22:31:09 2011 +0100
+++ b/mpn/generic/toom_interpolate_8pts.c	Fri Mar 11 07:38:08 2011 +0100
@@ -54,8 +54,8 @@
 #endif
 #endif
 
-#if HAVE_NATIVE_mpn_sublsh2_n
-#define DO_mpn_sublsh2_n(dst,src,n,ws) mpn_sublsh2_n(dst,dst,src,n)
+#if HAVE_NATIVE_mpn_sublsh2_n_ip1
+#define DO_mpn_sublsh2_n(dst,src,n,ws) mpn_sublsh2_n_ip1(dst,src,n)
 #else
 #define DO_mpn_sublsh2_n(dst,src,n,ws) DO_mpn_sublsh_n(dst,src,n,2,ws)
 #endif
diff -r 747f8faeb304 -r 042d12fa4384 mpn/x86/atom/aorslshC_n.asm
--- a/mpn/x86/atom/aorslshC_n.asm	Thu Mar 10 22:31:09 2011 +0100
+++ b/mpn/x86/atom/aorslshC_n.asm	Fri Mar 11 07:38:08 2011 +0100
@@ -21,11 +21,11 @@
 
 include(`../config.m4')
 
-C mp_limb_t mpn_ip1_addlshC_n (mp_ptr dst, mp_srcptr src, mp_size_t size);
-C mp_limb_t mpn_ip1_addlshC_nc (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_limb_t mpn_addlshC_n_ip1 (mp_ptr dst, mp_srcptr src, mp_size_t size);
+C mp_limb_t mpn_addlshC_nc_ip1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
 C				mp_limb_t carry);
-C mp_limb_t mpn_ip1_sublshC_n (mp_ptr dst, mp_srcptr src, mp_size_t size,);
-C mp_limb_t mpn_ip1_sublshC_nc (mp_ptr dst, mp_srcptr src, mp_size_t size,
+C mp_limb_t mpn_sublshC_n_ip1 (mp_ptr dst, mp_srcptr src, mp_size_t size,);
+C mp_limb_t mpn_sublshC_nc_ip1 (mp_ptr dst, mp_srcptr src, mp_size_t size,
 C				mp_signed_limb_t borrow);
 
 defframe(PARAM_CORB,	16)
diff -r 747f8faeb304 -r 042d12fa4384 mpn/x86/atom/sublsh2_n.asm
--- a/mpn/x86/atom/sublsh2_n.asm	Thu Mar 10 22:31:09 2011 +0100
+++ b/mpn/x86/atom/sublsh2_n.asm	Fri Mar 11 07:38:08 2011 +0100
@@ -29,18 +29,18 @@
 	define(M4_opp,		subl)
 	define(M4_function,	mpn_addlsh2_n)
 	define(M4_function_c,	mpn_addlsh2_nc)
-	define(M4_ip_function_c, mpn_ip1_addlsh2_nc)
-	define(M4_ip_function,	mpn_ip1_addlsh2_n)
+	define(M4_ip_function_c, mpn_addlsh2_nc_ip1)
+	define(M4_ip_function,	mpn_addlsh2_n_ip1)
 ',`ifdef(`OPERATION_sublsh2_n', `
 	define(M4_inst,		sbbl)
 	define(M4_opp,		addl)
 	define(M4_function,	mpn_sublsh2_n)
 	define(M4_function_c,	mpn_sublsh2_nc)
-	define(M4_ip_function_c, mpn_ip1_sublsh2_nc)
-	define(M4_ip_function,	mpn_ip1_sublsh2_n)
+	define(M4_ip_function_c, mpn_sublsh2_nc_ip1)
+	define(M4_ip_function,	mpn_sublsh2_n_ip1)
 ',`m4_error(`Need OPERATION_addlsh2_n or OPERATION_sublsh2_n
 ')')')
 
-MULFUNC_PROLOGUE(mpn_sublsh2_n mpn_sublsh2_nc mpn_ip1_sublsh2_n mpn_ip1_sublsh2_nc)
+MULFUNC_PROLOGUE(mpn_sublsh2_n mpn_sublsh2_nc mpn_sublsh2_n_ip1 mpn_sublsh2_nc_ip1)
 
 include_mpn(`x86/atom/aorslshC_n.asm')


More information about the gmp-commit mailing list