From e34cec1068473de8c4778175f4604d478a82a8d1 Mon Sep 17 00:00:00 2001 From: jasonmoxham Date: Thu, 16 Dec 2010 02:32:35 +0000 Subject: [PATCH] change name of redc_basecase to redc_1 and export --- config.in | 2 +- configure | 4 +- configure.in | 6 +-- doc/devel/mpn_functions.txt | 2 +- gmp-h.in | 3 ++ gmp-impl.h | 13 +---- mpn/asm-defs.m4 | 2 +- mpn/generic/{redc_basecase.c => redc_1.c} | 4 +- mpn/x86/fat/fat.c | 2 +- mpn/x86/fat/{redc_basecase.c => redc_1.c} | 4 +- mpn/x86/x86-defs.m4 | 2 +- .../redc_basecase.as => atom/redc_1.as} | 4 +- .../redc_basecase.as => core2/redc_1.as} | 4 +- mpn/x86_64/fat/fat.c | 2 +- mpn/x86_64/fat/{redc_basecase.c => redc_1.c} | 4 +- mpn/x86_64/k8/{redc_basecase.as => redc_1.as} | 4 +- .../redc_basecase.as => nehalem/redc_1.as} | 4 +- .../redc_basecase.as => netburst/redc_1.as} | 4 +- mpn/x86_64/x86_64-defs.m4 | 2 +- .../atom/{redc_basecase.asm => redc_1.asm} | 6 +-- mpn/x86_64w/core2/cfg.h | 2 +- .../core2/{redc_basecase.asm => redc_1.asm} | 6 +-- mpn/x86_64w/fat/fat.c | 2 +- mpn/x86_64w/fat/{redc_basecase.c => redc_1.c} | 4 +- mpn/x86_64w/k8/cfg.h | 2 +- mpn/x86_64w/k8/k10/cfg.h | 2 +- .../k8/{redc_basecase.asm => redc_1.asm} | 6 +-- mpn/x86_64w/nehalem/cfg.h | 2 +- .../nehalem/{redc_basecase.asm => redc_1.asm} | 6 +-- .../{redc_basecase.asm => redc_1.asm} | 6 +-- mpz/powm.c | 16 +++---- tests/devel/try.c | 4 +- tests/mpn/Makefile.am | 2 +- tests/mpn/Makefile.in | 47 +++++++++---------- tests/mpn/t-fat.c | 2 +- tests/mpn/{t-redc_basecase.c => t-redc_1.c} | 20 ++++---- tests/refmpn.c | 2 +- tests/tests.h | 2 +- tune/common.c | 2 +- 39 files changed, 103 insertions(+), 110 deletions(-) rename mpn/generic/{redc_basecase.c => redc_1.c} (92%) rename mpn/x86/fat/{redc_basecase.c => redc_1.c} (91%) rename mpn/x86_64/{netburst/redc_basecase.as => atom/redc_1.as} (99%) rename mpn/x86_64/{nehalem/redc_basecase.as => core2/redc_1.as} (99%) rename mpn/x86_64/fat/{redc_basecase.c => redc_1.c} (91%) rename mpn/x86_64/k8/{redc_basecase.as => redc_1.as} (99%) rename mpn/x86_64/{atom/redc_basecase.as => nehalem/redc_1.as} (99%) rename mpn/x86_64/{core2/redc_basecase.as => netburst/redc_1.as} (99%) rename mpn/x86_64w/atom/{redc_basecase.asm => redc_1.asm} (93%) rename mpn/x86_64w/core2/{redc_basecase.asm => redc_1.asm} (93%) rename mpn/x86_64w/fat/{redc_basecase.c => redc_1.c} (91%) rename mpn/x86_64w/k8/{redc_basecase.asm => redc_1.asm} (93%) rename mpn/x86_64w/nehalem/{redc_basecase.asm => redc_1.asm} (93%) rename mpn/x86_64w/netburst/{redc_basecase.asm => redc_1.asm} (93%) rename tests/mpn/{t-redc_basecase.c => t-redc_1.c} (76%) diff --git a/config.in b/config.in index df2672d3..565dde4b 100644 --- a/config.in +++ b/config.in @@ -270,7 +270,7 @@ MA 02110-1301, USA. #undef HAVE_NATIVE_mpn_nior_n #undef HAVE_NATIVE_mpn_preinv_divrem_1 #undef HAVE_NATIVE_mpn_preinv_mod_1 -#undef HAVE_NATIVE_mpn_redc_basecase +#undef HAVE_NATIVE_mpn_redc_1 #undef HAVE_NATIVE_mpn_rsh1add_n #undef HAVE_NATIVE_mpn_rsh1sub_n #undef HAVE_NATIVE_mpn_rshift1 diff --git a/configure b/configure index d0304987..2706db7d 100755 --- a/configure +++ b/configure @@ -5025,7 +5025,7 @@ echo "include_mpn(\`sparc32/sparc-defs.m4')" >> $gmp_tmpconfigm4i divrem_euclidean_qr_1 divrem_euclidean_qr_2 gcd_1 lshift mod_1 mod_34lsub1 modexact_1c_odd mul_1 mul_basecase - preinv_divrem_1 preinv_mod_1 redc_basecase rshift + preinv_divrem_1 preinv_mod_1 redc_1 rshift sqr_basecase sub_n submul_1 sumdiff_n" fat_exclude="" fat_thresholds="MUL_KARATSUBA_THRESHOLD MUL_TOOM3_THRESHOLD @@ -25809,7 +25809,7 @@ gmp_mpn_functions="$extra_functions \ urandomb urandomm randomb rrandom invert dc_divappr_q_n \ rootrem sqrtrem get_str set_str scan0 scan1 popcount hamdist cmp perfect_square_p \ bdivmod gcd gcd_1 gcdext tdiv_qr jacobi_base get_d \ - mullow_n mulhigh_n mullow_n_basecase mullow_basecase redc_basecase \ + mullow_n mulhigh_n mullow_n_basecase mullow_basecase redc_1 \ sb_divappr_q toom3_mul toom3_mul_n toom4_mul toom4_mul_n \ dc_div_q dc_divappr_q sb_div_q sb_div_qr dc_div_qr dc_div_qr_n inv_divappr_q_n \ inv_divappr_q inv_div_q inv_div_qr inv_div_qr_n rootrem_basecase \ diff --git a/configure.in b/configure.in index f9ff3364..fc2a59f3 100644 --- a/configure.in +++ b/configure.in @@ -1320,7 +1320,7 @@ case $host in divrem_euclidean_qr_1 divrem_euclidean_qr_2 gcd_1 lshift mod_1 mod_34lsub1 modexact_1c_odd mul_1 mul_basecase - preinv_divrem_1 preinv_mod_1 redc_basecase rshift + preinv_divrem_1 preinv_mod_1 redc_1 rshift sqr_basecase sub_n submul_1 sumdiff_n" fat_exclude="" fat_thresholds="MUL_KARATSUBA_THRESHOLD MUL_TOOM3_THRESHOLD @@ -2350,7 +2350,7 @@ gmp_mpn_functions="$extra_functions \ urandomb urandomm randomb rrandom invert dc_divappr_q_n \ rootrem sqrtrem get_str set_str scan0 scan1 popcount hamdist cmp perfect_square_p \ bdivmod gcd gcd_1 gcdext tdiv_qr jacobi_base get_d \ - mullow_n mulhigh_n mullow_n_basecase mullow_basecase redc_basecase \ + mullow_n mulhigh_n mullow_n_basecase mullow_basecase redc_1 \ sb_divappr_q toom3_mul toom3_mul_n toom4_mul toom4_mul_n \ dc_div_q dc_divappr_q sb_div_q sb_div_qr dc_div_qr dc_div_qr_n inv_divappr_q_n \ inv_divappr_q inv_div_q inv_div_qr inv_div_qr_n rootrem_basecase \ @@ -2902,7 +2902,7 @@ AH_VERBATIM([HAVE_NATIVE], #undef HAVE_NATIVE_mpn_nior_n #undef HAVE_NATIVE_mpn_preinv_divrem_1 #undef HAVE_NATIVE_mpn_preinv_mod_1 -#undef HAVE_NATIVE_mpn_redc_basecase +#undef HAVE_NATIVE_mpn_redc_1 #undef HAVE_NATIVE_mpn_rsh1add_n #undef HAVE_NATIVE_mpn_rsh1sub_n #undef HAVE_NATIVE_mpn_rshift1 diff --git a/doc/devel/mpn_functions.txt b/doc/devel/mpn_functions.txt index 371ee91a..ae27851b 100644 --- a/doc/devel/mpn_functions.txt +++ b/doc/devel/mpn_functions.txt @@ -74,7 +74,7 @@ mp_limb_t mpn_lshift1(mp_ptr rp, mp_srcptr up, mp_size_t n) /* Set cp[] <- tp[]/B^n mod mp[]. Clobber tp[]. mp[] is n limbs; tp[] is 2n limbs. where Nprim*mp[0] == 1 mod B */ -void mpn_redc_basecase (mp_ptr cp, mp_srcptr mp, mp_size_t n, mp_limb_t Nprim, mp_ptr tp) +void mpn_redc_1 (mp_ptr cp, mp_srcptr mp, mp_size_t n, mp_limb_t Nprim, mp_ptr tp) /* {rp, n} = {up, n}/2^shift with 0 < shift < BITS_PER_LIMB and return msl diff --git a/gmp-h.in b/gmp-h.in index 3996fc73..de73d60f 100644 --- a/gmp-h.in +++ b/gmp-h.in @@ -1546,6 +1546,9 @@ __GMP_DECLSPEC void mpn_mulmod_2expm1 __GMP_PROTO ((mp_ptr, mp_ptr, mp_ptr,unsig __GMP_DECLSPEC int mpn_cmp __GMP_PROTO ((mp_srcptr, mp_srcptr, mp_size_t)) __GMP_NOTHROW __GMP_ATTRIBUTE_PURE; #endif +#define mpn_redc_1 __MPN(redc_1) +__GMP_DECLSPEC void mpn_redc_1 __GMP_PROTO ((mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);) + #define mpn_divexact_by3(dst,src,size) \ mpn_divexact_by3c (dst, src, size, __GMP_CAST (mp_limb_t, 0)) diff --git a/gmp-impl.h b/gmp-impl.h index 17a7c724..447d865f 100644 --- a/gmp-impl.h +++ b/gmp-impl.h @@ -95,7 +95,7 @@ along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */ mp_limb_t name __GMP_PROTO ((mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t, int)) #define DECL_preinv_mod_1(name) \ mp_limb_t name __GMP_PROTO ((mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t)) -#define DECL_redc_basecase(name) \ +#define DECL_redc_1(name) \ void name __GMP_PROTO ((mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_ptr)) #define DECL_rshift(name) \ DECL_lshift (name) @@ -1026,12 +1026,6 @@ __GMP_DECLSPEC void mpn_mulmid __GMP_PROTO ((mp_ptr, mp_srcptr, mp_size_t, mp_sr #define mpn_mulmid_n __MPN(mulmid_n) __GMP_DECLSPEC void mpn_mulmid_n __GMP_PROTO ((mp_ptr, mp_srcptr, mp_srcptr, mp_size_t)); - -#ifndef mpn_redc_basecase /* if not done with cpuvec in a fat binary */ -#define mpn_redc_basecase __MPN(redc_basecase) -__GMP_DECLSPEC void mpn_redc_basecase __GMP_PROTO ((mp_ptr, mp_srcptr, mp_size_t,mp_limb_t , mp_ptr)); -#endif - #ifndef mpn_sqr_basecase /* if not done with cpuvec in a fat binary */ #define mpn_sqr_basecase __MPN(sqr_basecase) __GMP_DECLSPEC void mpn_sqr_basecase __GMP_PROTO ((mp_ptr, mp_srcptr, mp_size_t)); @@ -1049,9 +1043,6 @@ __GMP_DECLSPEC mp_limb_t mpn_submul_1c __GMP_PROTO ((mp_ptr, mp_srcptr, mp_size_ #define mpn_invert_2exp __MPN(invert_2exp) __GMP_DECLSPEC void mpn_invert_2exp __GMP_PROTO ((mp_ptr, mp_srcptr, mp_size_t, mp_ptr)); -#define mpn_redc_1 __MPN(redc_1) -__GMP_DECLSPEC void mpn_redc_1 __GMP_PROTO ((mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);) - #define mpn_redc_2 __MPN(redc_2) __GMP_DECLSPEC void mpn_redc_2 __GMP_PROTO ((mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_srcptr)); @@ -4079,7 +4070,7 @@ struct cpuvec_t { DECL_mul_basecase ((*mul_basecase)); DECL_preinv_divrem_1 ((*preinv_divrem_1)); DECL_preinv_mod_1 ((*preinv_mod_1)); - DECL_redc_basecase ((*redc_basecase)); + DECL_redc_1 ((*redc_1)); DECL_rshift ((*rshift)); DECL_sqr_basecase ((*sqr_basecase)); DECL_sub_n ((*sub_n)); diff --git a/mpn/asm-defs.m4 b/mpn/asm-defs.m4 index c70909f9..042a3c13 100644 --- a/mpn/asm-defs.m4 +++ b/mpn/asm-defs.m4 @@ -1401,7 +1401,7 @@ define_mpn(nand_n) define_mpn(nior_n) define_mpn(random) define_mpn(random2) -define_mpn(redc_basecase) +define_mpn(redc_1) define_mpn(rsh1add_n) define_mpn(rsh1sub_n) define_mpn(rshift) diff --git a/mpn/generic/redc_basecase.c b/mpn/generic/redc_1.c similarity index 92% rename from mpn/generic/redc_basecase.c rename to mpn/generic/redc_1.c index 26477a76..5142db7b 100644 --- a/mpn/generic/redc_basecase.c +++ b/mpn/generic/redc_1.c @@ -1,4 +1,4 @@ -/* mpn_redc_basecase +/* mpn_redc_1 Copyright 1991, 1993, 1994, 1996, 1997, 2000, 2001, 2002, 2005 Free Software Foundation, Inc. Contributed by Paul Zimmermann. @@ -26,7 +26,7 @@ MA 02110-1301, USA. */ /* Set cp[] <- tp[]/R^n mod mp[]. Clobber tp[]. mp[] is n limbs; tp[] is 2n limbs. */ -void mpn_redc_basecase (mp_ptr cp, mp_srcptr mp, mp_size_t n, mp_limb_t Nprim, mp_ptr tp) +void mpn_redc_1 (mp_ptr cp, mp_srcptr mp, mp_size_t n, mp_limb_t Nprim, mp_ptr tp) { mp_limb_t cy; mp_limb_t q; diff --git a/mpn/x86/fat/fat.c b/mpn/x86/fat/fat.c index c88667fc..1601c9e6 100644 --- a/mpn/x86/fat/fat.c +++ b/mpn/x86/fat/fat.c @@ -149,7 +149,7 @@ struct cpuvec_t __gmpn_cpuvec = { __MPN(mul_basecase_init), __MPN(preinv_divrem_1_init), __MPN(preinv_mod_1_init), - __MPN(redc_basecase_init), + __MPN(redc_1_init), __MPN(rshift_init), __MPN(sqr_basecase_init), __MPN(sub_n_init), diff --git a/mpn/x86/fat/redc_basecase.c b/mpn/x86/fat/redc_1.c similarity index 91% rename from mpn/x86/fat/redc_basecase.c rename to mpn/x86/fat/redc_1.c index 849f8f1d..94ca0213 100644 --- a/mpn/x86/fat/redc_basecase.c +++ b/mpn/x86/fat/redc_1.c @@ -1,4 +1,4 @@ -/* Fat binary fallback mpn_redc_basecase +/* Fat binary fallback mpn_redc_1 Copyright 2003 Free Software Foundation, Inc. @@ -20,4 +20,4 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "mpn/generic/redc_basecase.c" +#include "mpn/generic/redc_1.c" diff --git a/mpn/x86/x86-defs.m4 b/mpn/x86/x86-defs.m4 index fa2c7d90..cd7a6987 100644 --- a/mpn/x86/x86-defs.m4 +++ b/mpn/x86/x86-defs.m4 @@ -78,7 +78,7 @@ define(CPUVEC_FUNCS_LIST, `mul_basecase', `preinv_divrem_1', `preinv_mod_1', -`redc_basecase', +`redc_1', `rshift', `sqr_basecase', `sub_n', diff --git a/mpn/x86_64/netburst/redc_basecase.as b/mpn/x86_64/atom/redc_1.as similarity index 99% rename from mpn/x86_64/netburst/redc_basecase.as rename to mpn/x86_64/atom/redc_1.as index f87c7170..47a17179 100644 --- a/mpn/x86_64/netburst/redc_basecase.as +++ b/mpn/x86_64/atom/redc_1.as @@ -1,5 +1,5 @@ -; core2 mpn_redc_basecase +; core2 mpn_redc_1 ; Copyright 2009 Jason Moxham ; This file is part of the MPIR Library. ; The MPIR Library is free software; you can redistribute it and/or modify @@ -346,7 +346,7 @@ BITS 64 - GLOBAL_FUNC mpn_redc_basecase + GLOBAL_FUNC mpn_redc_1 cmp rdx, 1 je one push r13 diff --git a/mpn/x86_64/nehalem/redc_basecase.as b/mpn/x86_64/core2/redc_1.as similarity index 99% rename from mpn/x86_64/nehalem/redc_basecase.as rename to mpn/x86_64/core2/redc_1.as index f87c7170..47a17179 100644 --- a/mpn/x86_64/nehalem/redc_basecase.as +++ b/mpn/x86_64/core2/redc_1.as @@ -1,5 +1,5 @@ -; core2 mpn_redc_basecase +; core2 mpn_redc_1 ; Copyright 2009 Jason Moxham ; This file is part of the MPIR Library. ; The MPIR Library is free software; you can redistribute it and/or modify @@ -346,7 +346,7 @@ BITS 64 - GLOBAL_FUNC mpn_redc_basecase + GLOBAL_FUNC mpn_redc_1 cmp rdx, 1 je one push r13 diff --git a/mpn/x86_64/fat/fat.c b/mpn/x86_64/fat/fat.c index a37d58f8..e981b35d 100644 --- a/mpn/x86_64/fat/fat.c +++ b/mpn/x86_64/fat/fat.c @@ -149,7 +149,7 @@ struct cpuvec_t __gmpn_cpuvec = { __MPN(mul_basecase_init), __MPN(preinv_divrem_1_init), __MPN(preinv_mod_1_init), - __MPN(redc_basecase_init), + __MPN(redc_1_init), __MPN(rshift_init), __MPN(sqr_basecase_init), __MPN(sub_n_init), diff --git a/mpn/x86_64/fat/redc_basecase.c b/mpn/x86_64/fat/redc_1.c similarity index 91% rename from mpn/x86_64/fat/redc_basecase.c rename to mpn/x86_64/fat/redc_1.c index 849f8f1d..94ca0213 100644 --- a/mpn/x86_64/fat/redc_basecase.c +++ b/mpn/x86_64/fat/redc_1.c @@ -1,4 +1,4 @@ -/* Fat binary fallback mpn_redc_basecase +/* Fat binary fallback mpn_redc_1 Copyright 2003 Free Software Foundation, Inc. @@ -20,4 +20,4 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "mpn/generic/redc_basecase.c" +#include "mpn/generic/redc_1.c" diff --git a/mpn/x86_64/k8/redc_basecase.as b/mpn/x86_64/k8/redc_1.as similarity index 99% rename from mpn/x86_64/k8/redc_basecase.as rename to mpn/x86_64/k8/redc_1.as index d148dade..c15b02cd 100644 --- a/mpn/x86_64/k8/redc_basecase.as +++ b/mpn/x86_64/k8/redc_1.as @@ -1,5 +1,5 @@ -; AMD64 mpn_redc_basecase +; AMD64 mpn_redc_1 ; Copyright 2009 Jason Moxham ; This file is part of the MPIR Library. ; The MPIR Library is free software; you can redistribute it and/or modify @@ -347,7 +347,7 @@ jmp end %endmacro - GLOBAL_FUNC mpn_redc_basecase + GLOBAL_FUNC mpn_redc_1 cmp rdx, 1 je one push r13 diff --git a/mpn/x86_64/atom/redc_basecase.as b/mpn/x86_64/nehalem/redc_1.as similarity index 99% rename from mpn/x86_64/atom/redc_basecase.as rename to mpn/x86_64/nehalem/redc_1.as index f87c7170..47a17179 100644 --- a/mpn/x86_64/atom/redc_basecase.as +++ b/mpn/x86_64/nehalem/redc_1.as @@ -1,5 +1,5 @@ -; core2 mpn_redc_basecase +; core2 mpn_redc_1 ; Copyright 2009 Jason Moxham ; This file is part of the MPIR Library. ; The MPIR Library is free software; you can redistribute it and/or modify @@ -346,7 +346,7 @@ BITS 64 - GLOBAL_FUNC mpn_redc_basecase + GLOBAL_FUNC mpn_redc_1 cmp rdx, 1 je one push r13 diff --git a/mpn/x86_64/core2/redc_basecase.as b/mpn/x86_64/netburst/redc_1.as similarity index 99% rename from mpn/x86_64/core2/redc_basecase.as rename to mpn/x86_64/netburst/redc_1.as index f87c7170..47a17179 100644 --- a/mpn/x86_64/core2/redc_basecase.as +++ b/mpn/x86_64/netburst/redc_1.as @@ -1,5 +1,5 @@ -; core2 mpn_redc_basecase +; core2 mpn_redc_1 ; Copyright 2009 Jason Moxham ; This file is part of the MPIR Library. ; The MPIR Library is free software; you can redistribute it and/or modify @@ -346,7 +346,7 @@ BITS 64 - GLOBAL_FUNC mpn_redc_basecase + GLOBAL_FUNC mpn_redc_1 cmp rdx, 1 je one push r13 diff --git a/mpn/x86_64/x86_64-defs.m4 b/mpn/x86_64/x86_64-defs.m4 index 40f6a0ab..9646e2da 100644 --- a/mpn/x86_64/x86_64-defs.m4 +++ b/mpn/x86_64/x86_64-defs.m4 @@ -63,7 +63,7 @@ define(CPUVEC_FUNCS_LIST, `mul_basecase', `preinv_divrem_1', `preinv_mod_1', -`redc_basecase', +`redc_1', `rshift', `sqr_basecase', `sub_n', diff --git a/mpn/x86_64w/atom/redc_basecase.asm b/mpn/x86_64w/atom/redc_1.asm similarity index 93% rename from mpn/x86_64w/atom/redc_basecase.asm rename to mpn/x86_64w/atom/redc_1.asm index a6d94e20..e63e18e2 100644 --- a/mpn/x86_64w/atom/redc_basecase.asm +++ b/mpn/x86_64w/atom/redc_1.asm @@ -18,7 +18,7 @@ ; to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ; Boston, MA 02110-1301, USA. ; -; mp_limb_t mpn_redc_basecase(mp_ptr, mp_ptr, mp_size_t, mp_limb_t, mp_ptr) +; mp_limb_t mpn_redc_1(mp_ptr, mp_ptr, mp_size_t, mp_limb_t, mp_ptr) ; rax rdi rsi rdx rcx r8 ; rax rcx rdx r8 r9 [rsp+40] @@ -368,10 +368,10 @@ %endmacro - LEAF_PROC mpn_redc_basecase + LEAF_PROC mpn_redc_1 cmp r8, 1 je one - FRAME_PROC ?mpn_atom_redc_basecase, 0, reg_save_list + FRAME_PROC ?mpn_atom_redc_1, 0, reg_save_list mov rdi, rcx mov rsi, rdx mov rdx, r8 diff --git a/mpn/x86_64w/core2/cfg.h b/mpn/x86_64w/core2/cfg.h index ae2dad50..17e47d60 100644 --- a/mpn/x86_64w/core2/cfg.h +++ b/mpn/x86_64w/core2/cfg.h @@ -44,7 +44,7 @@ mpn_mul_1c mpn_mul_2 mpn_mul_basecase mpn_popcount -mpn_redc_basecase +mpn_redc_1 mpn_rsh1add_n mpn_rsh1sub_n mpn_rsh_divrem_hensel_qr_1_2 diff --git a/mpn/x86_64w/core2/redc_basecase.asm b/mpn/x86_64w/core2/redc_1.asm similarity index 93% rename from mpn/x86_64w/core2/redc_basecase.asm rename to mpn/x86_64w/core2/redc_1.asm index 706e1196..9c870d9c 100644 --- a/mpn/x86_64w/core2/redc_basecase.asm +++ b/mpn/x86_64w/core2/redc_1.asm @@ -18,7 +18,7 @@ ; to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ; Boston, MA 02110-1301, USA. ; -; mp_limb_t mpn_redc_basecase(mp_ptr, mp_ptr, mp_size_t, mp_limb_t, mp_ptr) +; mp_limb_t mpn_redc_1(mp_ptr, mp_ptr, mp_size_t, mp_limb_t, mp_ptr) ; rax rdi rsi rdx rcx r8 ; rax rcx rdx r8 r9 [rsp+40] @@ -368,10 +368,10 @@ %endmacro - LEAF_PROC mpn_redc_basecase + LEAF_PROC mpn_redc_1 cmp r8, 1 je one - FRAME_PROC ?mpn_core2_redc_basecase, 0, reg_save_list + FRAME_PROC ?mpn_core2_redc_1, 0, reg_save_list mov rdi, rcx mov rsi, rdx mov rdx, r8 diff --git a/mpn/x86_64w/fat/fat.c b/mpn/x86_64w/fat/fat.c index a37d58f8..e981b35d 100644 --- a/mpn/x86_64w/fat/fat.c +++ b/mpn/x86_64w/fat/fat.c @@ -149,7 +149,7 @@ struct cpuvec_t __gmpn_cpuvec = { __MPN(mul_basecase_init), __MPN(preinv_divrem_1_init), __MPN(preinv_mod_1_init), - __MPN(redc_basecase_init), + __MPN(redc_1_init), __MPN(rshift_init), __MPN(sqr_basecase_init), __MPN(sub_n_init), diff --git a/mpn/x86_64w/fat/redc_basecase.c b/mpn/x86_64w/fat/redc_1.c similarity index 91% rename from mpn/x86_64w/fat/redc_basecase.c rename to mpn/x86_64w/fat/redc_1.c index 849f8f1d..94ca0213 100644 --- a/mpn/x86_64w/fat/redc_basecase.c +++ b/mpn/x86_64w/fat/redc_1.c @@ -1,4 +1,4 @@ -/* Fat binary fallback mpn_redc_basecase +/* Fat binary fallback mpn_redc_1 Copyright 2003 Free Software Foundation, Inc. @@ -20,4 +20,4 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "mpn/generic/redc_basecase.c" +#include "mpn/generic/redc_1.c" diff --git a/mpn/x86_64w/k8/cfg.h b/mpn/x86_64w/k8/cfg.h index 69e075d6..331ef05c 100644 --- a/mpn/x86_64w/k8/cfg.h +++ b/mpn/x86_64w/k8/cfg.h @@ -52,7 +52,7 @@ mpn_mul_1c mpn_mul_2 mpn_mul_basecase mpn_popcount -mpn_redc_basecase +mpn_redc_1 mpn_rsh1add_n mpn_rsh1sub_n mpn_rsh_divrem_hensel_qr_1_1 diff --git a/mpn/x86_64w/k8/k10/cfg.h b/mpn/x86_64w/k8/k10/cfg.h index e30166a6..445f35c7 100644 --- a/mpn/x86_64w/k8/k10/cfg.h +++ b/mpn/x86_64w/k8/k10/cfg.h @@ -47,7 +47,7 @@ mpn_mul_1c mpn_mul_2 mpn_mul_basecase mpn_popcount -mpn_redc_basecase +mpn_redc_1 mpn_rsh1add_n mpn_rsh1sub_n mpn_rsh_divrem_hensel_qr_1_1 diff --git a/mpn/x86_64w/k8/redc_basecase.asm b/mpn/x86_64w/k8/redc_1.asm similarity index 93% rename from mpn/x86_64w/k8/redc_basecase.asm rename to mpn/x86_64w/k8/redc_1.asm index 5dbceb8e..b8fed13b 100644 --- a/mpn/x86_64w/k8/redc_basecase.asm +++ b/mpn/x86_64w/k8/redc_1.asm @@ -18,7 +18,7 @@ ; to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ; Boston, MA 02110-1301, USA. ; -; mp_limb_t mpn_redc_basecase(mp_ptr, mp_ptr, mp_size_t, mp_limb_t, mp_ptr) +; mp_limb_t mpn_redc_1(mp_ptr, mp_ptr, mp_size_t, mp_limb_t, mp_ptr) ; rax rdi rsi rdx rcx r8 ; rax rcx rdx r8 r9 [rsp+40] @@ -368,10 +368,10 @@ %endmacro - LEAF_PROC mpn_redc_basecase + LEAF_PROC mpn_redc_1 cmp r8, 1 je one - FRAME_PROC ?mpn_k8_redc_basecase, 0, reg_save_list + FRAME_PROC ?mpn_k8_redc_1, 0, reg_save_list mov rdi, rcx mov rsi, rdx mov rdx, r8 diff --git a/mpn/x86_64w/nehalem/cfg.h b/mpn/x86_64w/nehalem/cfg.h index 960a2a17..66d90ec2 100644 --- a/mpn/x86_64w/nehalem/cfg.h +++ b/mpn/x86_64w/nehalem/cfg.h @@ -44,7 +44,7 @@ mpn_mul_1c mpn_mul_2 mpn_mul_basecase mpn_popcount -mpn_redc_basecase +mpn_redc_1 mpn_rsh1add_n mpn_rsh1sub_n mpn_rsh_divrem_hensel_qr_1_2 diff --git a/mpn/x86_64w/nehalem/redc_basecase.asm b/mpn/x86_64w/nehalem/redc_1.asm similarity index 93% rename from mpn/x86_64w/nehalem/redc_basecase.asm rename to mpn/x86_64w/nehalem/redc_1.asm index cab283f6..e115f9d5 100644 --- a/mpn/x86_64w/nehalem/redc_basecase.asm +++ b/mpn/x86_64w/nehalem/redc_1.asm @@ -18,7 +18,7 @@ ; to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ; Boston, MA 02110-1301, USA. ; -; mp_limb_t mpn_redc_basecase(mp_ptr, mp_ptr, mp_size_t, mp_limb_t, mp_ptr) +; mp_limb_t mpn_redc_1(mp_ptr, mp_ptr, mp_size_t, mp_limb_t, mp_ptr) ; rax rdi rsi rdx rcx r8 ; rax rcx rdx r8 r9 [rsp+40] @@ -368,10 +368,10 @@ %endmacro - LEAF_PROC mpn_redc_basecase + LEAF_PROC mpn_redc_1 cmp r8, 1 je one - FRAME_PROC ?mpn_nehalem_redc_basecase, 0, reg_save_list + FRAME_PROC ?mpn_nehalem_redc_1, 0, reg_save_list mov rdi, rcx mov rsi, rdx mov rdx, r8 diff --git a/mpn/x86_64w/netburst/redc_basecase.asm b/mpn/x86_64w/netburst/redc_1.asm similarity index 93% rename from mpn/x86_64w/netburst/redc_basecase.asm rename to mpn/x86_64w/netburst/redc_1.asm index 9c0afbb5..c0d1d493 100644 --- a/mpn/x86_64w/netburst/redc_basecase.asm +++ b/mpn/x86_64w/netburst/redc_1.asm @@ -18,7 +18,7 @@ ; to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ; Boston, MA 02110-1301, USA. ; -; mp_limb_t mpn_redc_basecase(mp_ptr, mp_ptr, mp_size_t, mp_limb_t, mp_ptr) +; mp_limb_t mpn_redc_1(mp_ptr, mp_ptr, mp_size_t, mp_limb_t, mp_ptr) ; rax rdi rsi rdx rcx r8 ; rax rcx rdx r8 r9 [rsp+40] @@ -368,10 +368,10 @@ %endmacro - LEAF_PROC mpn_redc_basecase + LEAF_PROC mpn_redc_1 cmp r8, 1 je one - FRAME_PROC ?mpn_netburst_redc_basecase, 0, reg_save_list + FRAME_PROC ?mpn_netburst_redc_1, 0, reg_save_list mov rdi, rcx mov rsi, rdx mov rdx, r8 diff --git a/mpz/powm.c b/mpz/powm.c index 4757a275..e97a5d1d 100644 --- a/mpz/powm.c +++ b/mpz/powm.c @@ -271,7 +271,7 @@ pow (mpz_srcptr b, mpz_srcptr e, mpz_srcptr m, mpz_ptr r) xp = TMP_ALLOC_LIMBS (mn); mpn_sqr (tp, gp, mn); if (use_redc) - mpn_redc_basecase (xp, mp, mn, invm, tp); /* xx = x^2*R^n */ + mpn_redc_1 (xp, mp, mn, invm, tp); /* xx = x^2*R^n */ else mpn_tdiv_qr (qp, xp, 0L, tp, 2 * mn, mp, mn); this_gp = gp; @@ -280,7 +280,7 @@ pow (mpz_srcptr b, mpz_srcptr e, mpz_srcptr m, mpz_ptr r) mpn_mul_n (tp, this_gp, xp, mn); this_gp += mn; if (use_redc) - mpn_redc_basecase (this_gp, mp, mn, invm, tp); /* g[i] = x^(2i+1)*R^n */ + mpn_redc_1 (this_gp, mp, mn, invm, tp); /* g[i] = x^(2i+1)*R^n */ else mpn_tdiv_qr (qp, this_gp, 0L, tp, 2 * mn, mp, mn); } @@ -312,7 +312,7 @@ pow (mpz_srcptr b, mpz_srcptr e, mpz_srcptr m, mpz_ptr r) { mpn_sqr (tp, xp, mn); if (use_redc) - mpn_redc_basecase (xp, mp, mn, invm, tp); + mpn_redc_1 (xp, mp, mn, invm, tp); else mpn_tdiv_qr (qp, xp, 0L, tp, 2 * mn, mp, mn); } @@ -346,7 +346,7 @@ pow (mpz_srcptr b, mpz_srcptr e, mpz_srcptr m, mpz_ptr r) { mpn_sqr (tp, xp, mn); if (use_redc) - mpn_redc_basecase (xp, mp, mn, invm, tp); + mpn_redc_1 (xp, mp, mn, invm, tp); else mpn_tdiv_qr (qp, xp, 0L, tp, 2 * mn, mp, mn); if (sh != 0) @@ -374,13 +374,13 @@ pow (mpz_srcptr b, mpz_srcptr e, mpz_srcptr m, mpz_ptr r) { mpn_sqr (tp, xp, mn); if (use_redc) - mpn_redc_basecase (xp, mp, mn, invm, tp); + mpn_redc_1 (xp, mp, mn, invm, tp); else mpn_tdiv_qr (qp, xp, 0L, tp, 2 * mn, mp, mn); } mpn_mul_n (tp, xp, gp + mn * (c >> 1), mn); if (use_redc) - mpn_redc_basecase (xp, mp, mn, invm, tp); + mpn_redc_1 (xp, mp, mn, invm, tp); else mpn_tdiv_qr (qp, xp, 0L, tp, 2 * mn, mp, mn); } @@ -390,7 +390,7 @@ pow (mpz_srcptr b, mpz_srcptr e, mpz_srcptr m, mpz_ptr r) { mpn_sqr (tp, xp, mn); if (use_redc) - mpn_redc_basecase (xp, mp, mn, invm, tp); + mpn_redc_1 (xp, mp, mn, invm, tp); else mpn_tdiv_qr (qp, xp, 0L, tp, 2 * mn, mp, mn); } @@ -401,7 +401,7 @@ pow (mpz_srcptr b, mpz_srcptr e, mpz_srcptr m, mpz_ptr r) /* Convert back xx to xx/R^n. */ MPN_COPY (tp, xp, mn); MPN_ZERO (tp + mn, mn); - mpn_redc_basecase (xp, mp, mn, invm, tp); + mpn_redc_1 (xp, mp, mn, invm, tp); if (mpn_cmp (xp, mp, mn) >= 0) mpn_sub_n (xp, xp, mp, mn); } diff --git a/tests/devel/try.c b/tests/devel/try.c index 553a80bf..94f050e7 100644 --- a/tests/devel/try.c +++ b/tests/devel/try.c @@ -1325,7 +1325,7 @@ param_init (void) p->data = DATA_SRC0_ODD ; p->size2 = SIZE_DOUBLE; p->overlap = OVERLAP_NONE; - REFERENCE (refmpn_redc_basecase); + REFERENCE (refmpn_redc_1); p = ¶m[TYPE_SQR]; p->dst[0] = 1; @@ -1897,7 +1897,7 @@ const struct choice_t choice_array[] = { #endif { TRY(mpn_mul_basecase), TYPE_MUL_BASECASE }, - { TRY(mpn_redc_basecase), TYPE_REDC_BASECASE }, + { TRY(mpn_redc_1), TYPE_REDC_BASECASE }, #if SQR_KARATSUBA_THRESHOLD > 0 { TRY(mpn_sqr_basecase), TYPE_SQR }, #endif diff --git a/tests/mpn/Makefile.am b/tests/mpn/Makefile.am index 94895029..5df82c09 100644 --- a/tests/mpn/Makefile.am +++ b/tests/mpn/Makefile.am @@ -26,7 +26,7 @@ LDADD = $(top_builddir)/tests/libtests.la $(top_builddir)/libmpir.la check_PROGRAMS = t-asmtype t-aors_1 t-divrem_1 t-fat t-get_d \ t-instrument t-iord_u t-mulmid t-mp_bases t-perfsqr t-scan \ t-lorrshift1 t-divebyff t-addadd_n t-addsub_n t-subadd_n \ - t-redc_basecase t-divebyfobm1 t-mullowhigh t-mullow_basecase \ + t-redc_1 t-divebyfobm1 t-mullowhigh t-mullow_basecase \ t-neg t-mulmod_2expp1 t-mulmod_2expm1 t-tdiv_q t-sb_divappr_q \ t-dc_divappr_q_n t-inv_divappr_q_n t-invert t-sb_div_q t-sb_div_qr \ t-dc_div_q t-dc_div_qr t-dc_divappr_q t-dc_div_qr_n t-inv_divappr_q \ diff --git a/tests/mpn/Makefile.in b/tests/mpn/Makefile.in index f07c91f4..782a2f24 100644 --- a/tests/mpn/Makefile.in +++ b/tests/mpn/Makefile.in @@ -57,19 +57,18 @@ check_PROGRAMS = t-asmtype$(EXEEXT) t-aors_1$(EXEEXT) \ t-instrument$(EXEEXT) t-iord_u$(EXEEXT) t-mulmid$(EXEEXT) \ t-mp_bases$(EXEEXT) t-perfsqr$(EXEEXT) t-scan$(EXEEXT) \ t-lorrshift1$(EXEEXT) t-divebyff$(EXEEXT) t-addadd_n$(EXEEXT) \ - t-addsub_n$(EXEEXT) t-subadd_n$(EXEEXT) \ - t-redc_basecase$(EXEEXT) t-divebyfobm1$(EXEEXT) \ - t-mullowhigh$(EXEEXT) t-mullow_basecase$(EXEEXT) \ - t-neg$(EXEEXT) t-mulmod_2expp1$(EXEEXT) \ - t-mulmod_2expm1$(EXEEXT) t-tdiv_q$(EXEEXT) \ - t-sb_divappr_q$(EXEEXT) t-dc_divappr_q_n$(EXEEXT) \ - t-inv_divappr_q_n$(EXEEXT) t-invert$(EXEEXT) \ - t-sb_div_q$(EXEEXT) t-sb_div_qr$(EXEEXT) t-dc_div_q$(EXEEXT) \ - t-dc_div_qr$(EXEEXT) t-dc_divappr_q$(EXEEXT) \ - t-dc_div_qr_n$(EXEEXT) t-inv_divappr_q$(EXEEXT) \ - t-inv_div_q$(EXEEXT) t-inv_div_qr$(EXEEXT) \ - t-inv_div_qr_n$(EXEEXT) t-tdiv_qr$(EXEEXT) \ - t-sb_bdiv_q$(EXEEXT) t-sb_bdiv_qr$(EXEEXT) \ + t-addsub_n$(EXEEXT) t-subadd_n$(EXEEXT) t-redc_1$(EXEEXT) \ + t-divebyfobm1$(EXEEXT) t-mullowhigh$(EXEEXT) \ + t-mullow_basecase$(EXEEXT) t-neg$(EXEEXT) \ + t-mulmod_2expp1$(EXEEXT) t-mulmod_2expm1$(EXEEXT) \ + t-tdiv_q$(EXEEXT) t-sb_divappr_q$(EXEEXT) \ + t-dc_divappr_q_n$(EXEEXT) t-inv_divappr_q_n$(EXEEXT) \ + t-invert$(EXEEXT) t-sb_div_q$(EXEEXT) t-sb_div_qr$(EXEEXT) \ + t-dc_div_q$(EXEEXT) t-dc_div_qr$(EXEEXT) \ + t-dc_divappr_q$(EXEEXT) t-dc_div_qr_n$(EXEEXT) \ + t-inv_divappr_q$(EXEEXT) t-inv_div_q$(EXEEXT) \ + t-inv_div_qr$(EXEEXT) t-inv_div_qr_n$(EXEEXT) \ + t-tdiv_qr$(EXEEXT) t-sb_bdiv_q$(EXEEXT) t-sb_bdiv_qr$(EXEEXT) \ t-dc_bdiv_q_n$(EXEEXT) t-dc_bdiv_qr_n$(EXEEXT) \ t-dc_bdiv_qr$(EXEEXT) t-dc_bdiv_q$(EXEEXT) t-gcdext$(EXEEXT) \ $(am__EXEEXT_1) @@ -287,10 +286,10 @@ t_perfsqr_OBJECTS = t-perfsqr.$(OBJEXT) t_perfsqr_LDADD = $(LDADD) t_perfsqr_DEPENDENCIES = $(top_builddir)/tests/libtests.la \ $(top_builddir)/libmpir.la -t_redc_basecase_SOURCES = t-redc_basecase.c -t_redc_basecase_OBJECTS = t-redc_basecase.$(OBJEXT) -t_redc_basecase_LDADD = $(LDADD) -t_redc_basecase_DEPENDENCIES = $(top_builddir)/tests/libtests.la \ +t_redc_1_SOURCES = t-redc_1.c +t_redc_1_OBJECTS = t-redc_1.$(OBJEXT) +t_redc_1_LDADD = $(LDADD) +t_redc_1_DEPENDENCIES = $(top_builddir)/tests/libtests.la \ $(top_builddir)/libmpir.la t_sb_bdiv_q_SOURCES = t-sb_bdiv_q.c t_sb_bdiv_q_OBJECTS = t-sb_bdiv_q.$(OBJEXT) @@ -359,7 +358,7 @@ SOURCES = $(st_fat_SOURCES) $(st_instrument_SOURCES) t-addadd_n.c \ t-inv_divappr_q_n.c t-invert.c t-iord_u.c t-lorrshift1.c \ t-mp_bases.c t-mullow_basecase.c t-mullowhigh.c t-mulmid.c \ t-mulmod_2expm1.c t-mulmod_2expp1.c t-neg.c t-perfsqr.c \ - t-redc_basecase.c t-sb_bdiv_q.c t-sb_bdiv_qr.c t-sb_div_q.c \ + t-redc_1.c t-sb_bdiv_q.c t-sb_bdiv_qr.c t-sb_div_q.c \ t-sb_div_qr.c t-sb_divappr_q.c t-scan.c t-subadd_n.c \ t-tdiv_q.c t-tdiv_qr.c DIST_SOURCES = $(am__st_fat_SOURCES_DIST) \ @@ -373,7 +372,7 @@ DIST_SOURCES = $(am__st_fat_SOURCES_DIST) \ t-invert.c t-iord_u.c t-lorrshift1.c t-mp_bases.c \ t-mullow_basecase.c t-mullowhigh.c t-mulmid.c \ t-mulmod_2expm1.c t-mulmod_2expp1.c t-neg.c t-perfsqr.c \ - t-redc_basecase.c t-sb_bdiv_q.c t-sb_bdiv_qr.c t-sb_div_q.c \ + t-redc_1.c t-sb_bdiv_q.c t-sb_bdiv_qr.c t-sb_div_q.c \ t-sb_div_qr.c t-sb_divappr_q.c t-scan.c t-subadd_n.c \ t-tdiv_q.c t-tdiv_qr.c ETAGS = etags @@ -763,9 +762,9 @@ t-neg$(EXEEXT): $(t_neg_OBJECTS) $(t_neg_DEPENDENCIES) t-perfsqr$(EXEEXT): $(t_perfsqr_OBJECTS) $(t_perfsqr_DEPENDENCIES) @rm -f t-perfsqr$(EXEEXT) $(LINK) $(t_perfsqr_OBJECTS) $(t_perfsqr_LDADD) $(LIBS) -t-redc_basecase$(EXEEXT): $(t_redc_basecase_OBJECTS) $(t_redc_basecase_DEPENDENCIES) - @rm -f t-redc_basecase$(EXEEXT) - $(LINK) $(t_redc_basecase_OBJECTS) $(t_redc_basecase_LDADD) $(LIBS) +t-redc_1$(EXEEXT): $(t_redc_1_OBJECTS) $(t_redc_1_DEPENDENCIES) + @rm -f t-redc_1$(EXEEXT) + $(LINK) $(t_redc_1_OBJECTS) $(t_redc_1_LDADD) $(LIBS) t-sb_bdiv_q$(EXEEXT): $(t_sb_bdiv_q_OBJECTS) $(t_sb_bdiv_q_DEPENDENCIES) @rm -f t-sb_bdiv_q$(EXEEXT) $(LINK) $(t_sb_bdiv_q_OBJECTS) $(t_sb_bdiv_q_LDADD) $(LIBS) @@ -1051,8 +1050,8 @@ t-addsub_n.log: t-addsub_n$(EXEEXT) @p='t-addsub_n$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) t-subadd_n.log: t-subadd_n$(EXEEXT) @p='t-subadd_n$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) -t-redc_basecase.log: t-redc_basecase$(EXEEXT) - @p='t-redc_basecase$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) +t-redc_1.log: t-redc_1$(EXEEXT) + @p='t-redc_1$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) t-divebyfobm1.log: t-divebyfobm1$(EXEEXT) @p='t-divebyfobm1$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post) t-mullowhigh.log: t-mullowhigh$(EXEEXT) diff --git a/tests/mpn/t-fat.c b/tests/mpn/t-fat.c index 6150a0bf..3497262e 100644 --- a/tests/mpn/t-fat.c +++ b/tests/mpn/t-fat.c @@ -261,7 +261,7 @@ check_functions (void) r=-r; yp[0]=43; yp[1]=75; - mpn_redc_basecase (wp, xp, (mp_size_t) 1,r,yp); + mpn_redc_1 (wp, xp, (mp_size_t) 1,r,yp); ASSERT_ALWAYS (wp[0] == 78); } diff --git a/tests/mpn/t-redc_basecase.c b/tests/mpn/t-redc_1.c similarity index 76% rename from tests/mpn/t-redc_basecase.c rename to tests/mpn/t-redc_1.c index af9c3488..7308c95d 100644 --- a/tests/mpn/t-redc_basecase.c +++ b/tests/mpn/t-redc_1.c @@ -1,4 +1,4 @@ -/* Test mpn_redc_basecase +/* Test mpn_redc_1 Copyright 2009 Jason Moxham @@ -30,7 +30,7 @@ /* Set cp[] <- tp[]/R^n mod mp[]. Clobber tp[]. mp[] is n limbs; tp[] is 2n limbs. */ -void ref_redc_basecase (mp_ptr cp, mp_srcptr mp, mp_size_t n, mp_limb_t Nprim, mp_ptr tp) +void ref_redc_1 (mp_ptr cp, mp_srcptr mp, mp_size_t n, mp_limb_t Nprim, mp_ptr tp) { mp_limb_t cy; mp_limb_t q; mp_size_t j; ASSERT_MPN (tp, 2*n); for (j = 0; j < n; j++) @@ -54,10 +54,10 @@ main (void) {for(j=1;j<100;j++) {mpn_randomb(mp,rands,n);mp[0]|=1;modlimb_invert(inv,mp[0]);inv=-inv;mpn_randomb(tp1,rands,2*n); MPN_COPY(tp2,tp1,2*n); - ref_redc_basecase(cp1,mp,n,inv,tp1); - mpn_redc_basecase(cp2,mp,n,inv,tp2); - if(mpn_cmp(cp1,cp2,n)!=0){printf("mpn_redc_basecase error %d\n",n);abort();} - if(n!=1 && mpn_cmp(tp1,tp2,2*n)!=0){printf("mpn_redc_basecase possible error\n");abort();} + ref_redc_1(cp1,mp,n,inv,tp1); + mpn_redc_1(cp2,mp,n,inv,tp2); + if(mpn_cmp(cp1,cp2,n)!=0){printf("mpn_redc_1 error %d\n",n);abort();} + if(n!=1 && mpn_cmp(tp1,tp2,2*n)!=0){printf("mpn_redc_1 possible error\n");abort();} /* we dont require the above to be the same but it could be a useful test */ } } @@ -65,10 +65,10 @@ main (void) {for(j=1;j<100;j++) {mpn_rrandom(mp,rands,n);mp[0]|=1;modlimb_invert(inv,mp[0]);inv=-inv;mpn_rrandom(tp1,rands,2*n); MPN_COPY(tp2,tp1,2*n); - ref_redc_basecase(cp1,mp,n,inv,tp1); - mpn_redc_basecase(cp2,mp,n,inv,tp2); - if(mpn_cmp(cp1,cp2,n)!=0){printf("mpn_redc_basecase error %d\n",n);abort();} - if(n!=1 && mpn_cmp(tp1,tp2,2*n)!=0){printf("mpn_redc_basecase possible error\n");abort();} + ref_redc_1(cp1,mp,n,inv,tp1); + mpn_redc_1(cp2,mp,n,inv,tp2); + if(mpn_cmp(cp1,cp2,n)!=0){printf("mpn_redc_1 error %d\n",n);abort();} + if(n!=1 && mpn_cmp(tp1,tp2,2*n)!=0){printf("mpn_redc_1 possible error\n");abort();} /* we dont require the above to be the same but it could be a useful test */ } } diff --git a/tests/refmpn.c b/tests/refmpn.c index e9c85f14..a2668ad9 100644 --- a/tests/refmpn.c +++ b/tests/refmpn.c @@ -2502,7 +2502,7 @@ refmpn_sqrtrem (mp_ptr sp, mp_ptr rp, mp_srcptr np, mp_size_t nsize) } void -refmpn_redc_basecase (mp_ptr cp, mp_srcptr mp, mp_size_t n, mp_limb_t Nd, mp_ptr tp) +refmpn_redc_1 (mp_ptr cp, mp_srcptr mp, mp_size_t n, mp_limb_t Nd, mp_ptr tp) { mp_limb_t cy, q; mp_size_t j; diff --git a/tests/tests.h b/tests/tests.h index 6ea1ac56..64a45348 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -446,7 +446,7 @@ int refmpz_ui_kronecker __GMP_PROTO ((unsigned long, mpz_srcptr)); void refmpz_pow_ui __GMP_PROTO ((mpz_ptr w, mpz_srcptr b, unsigned long e)); -void refmpn_redc_basecase __GMP_PROTO ((mp_ptr cp, mp_srcptr mp, mp_size_t n, +void refmpn_redc_1 __GMP_PROTO ((mp_ptr cp, mp_srcptr mp, mp_size_t n, mp_limb_t Nd, mp_ptr tp)); #if defined (__cplusplus) diff --git a/tune/common.c b/tune/common.c index 99b71f79..a25b9191 100644 --- a/tune/common.c +++ b/tune/common.c @@ -892,7 +892,7 @@ speed_mpz_mod (struct speed_params *s) double speed_redc (struct speed_params *s) { - SPEED_ROUTINE_REDC (mpn_redc_basecase); + SPEED_ROUTINE_REDC (mpn_redc_1); }