[gmp-ecm] 13/77: Merge branch 'upstream'

Jerome Benoit calculus-guest at moszumanska.debian.org
Sat Jun 6 12:33:48 UTC 2015


This is an automated email from the git hooks/post-receive script.

calculus-guest pushed a commit to branch master
in repository gmp-ecm.

commit eb43823206cbbc56166257264805f68d49df8b26
Merge: c61d42d 261f3dd
Author: Laurent Fousse <laurent at komite.net>
Date:   Thu May 15 13:17:12 2008 +0200

    Merge branch 'upstream'

 AUTHORS                                        |     7 +-
 COPYING                                        |     4 +-
 COPYING.LIB                                    |     4 +-
 ChangeLog                                      |  2959 +++-
 Fgw.c                                          |   894 +-
 INSTALL                                        |    42 +-
 Makefile.am                                    |    89 +-
 Makefile.in                                    |   475 +-
 NEWS                                           |    20 +-
 README                                         |   294 +-
 TODO                                           |    98 +-
 acinclude.m4                                   |     2 +-
 aclocal.m4                                     |  6590 +++++++
 asmredc.h                                      |     2 +-
 athlon/Makefile.in                             |    45 +-
 auxarith.c                                     |   151 +
 auxi.c                                         |    34 +-
 auxlib.c                                       |   170 +-
 b1_ainc.c                                      |     2 +-
 bestd.c                                        |    25 +-
 build.vc9/Makefile.am                          |     4 +
 build.vc9/Makefile.in                          |   495 +
 build.vc9/assembler/Makefile.am                |     3 +
 {pentium4 => build.vc9/assembler}/Makefile.in  |    61 +-
 build.vc9/assembler/a_win32a_mulredc.asm       |   181 +
 build.vc9/assembler/a_win32a_redc.asm          |   135 +
 build.vc9/assembler/a_win32p_mulredc.asm       |   148 +
 build.vc9/assembler/a_win32p_redc.asm          |   147 +
 build.vc9/assembler/a_x64_mulredc.asm          |   231 +
 build.vc9/assembler/a_x64_redc.asm             |   163 +
 {x86_64 => build.vc9/assembler}/test_mulredc.c |   145 +-
 config.h.in => build.vc9/config.h              |   438 +-
 build.vc9/ecm-params.h                         |    21 +
 build.vc9/ecm.sln                              |    37 +
 build.vc9/ecm/Makefile.am                      |     1 +
 {pentium4 => build.vc9/ecm}/Makefile.in        |    60 +-
 build.vc9/ecm/ecm.vcproj                       |   411 +
 build.vc9/file_copy.bat                        |     4 +
 build.vc9/libecm/Makefile.am                   |     1 +
 {pentium4 => build.vc9/libecm}/Makefile.in     |    60 +-
 build.vc9/libecm/libecm.vcproj                 |   712 +
 build.vc9/readme.txt                           |    73 +
 build.vc9/tests.py                             |   166 +
 build.vc9/yasm.rules                           |   114 +
 candi.c                                        |     2 +-
 compile                                        |    92 +-
 config.guess                                   |     4 +-
 config.h.in                                    |    12 +-
 config.sub                                     |     4 +-
 configfsf.guess                                |     4 +-
 configfsf.sub                                  |     5 +-
 configure                                      | 20894 ++++++++++++++++++++---
 configure.in                                   |   157 +-
 depcomp                                        |    66 +-
 ecm-ecm.h                                      |    26 +-
 ecm-gmp.h                                      |    21 +-
 ecm-impl.h                                     |   326 +-
 ecm-params.h                                   |    24 +-
 ecm-params.h.athlon64                          |    24 +-
 ecm-params.h.pentium3                          |    16 +
 ecm-params.h.pentium4                          |    16 +
 ecm-params.h.pentiumm                          |    10 +
 ecm.1                                          |   743 +-
 ecm.c                                          |   269 +-
 ecm.h                                          |    49 +-
 ecm.xml                                        |    44 +-
 ecm2.c                                         |   489 +-
 ecm_ntt.c                                      |    51 +-
 ecmfactor.c                                    |     2 +-
 eval.c                                         |    43 +-
 factor.c                                       |    41 +-
 getprime.c                                     |   327 +-
 install-sh                                     |   147 +-
 ks-multiply.c                                  |    57 +-
 listz.c                                        |   151 +-
 longlong.h                                     |    80 +-
 ltmain.sh                                      |  6930 ++++++++
 lucas.c                                        |    10 +-
 main.c                                         |   117 +-
 median.c                                       |    75 +-
 memory.c                                       |     4 +-
 missing                                        |    92 +-
 mpmod.c                                        |   644 +-
 mpzspm.c                                       |   152 +-
 mpzspv.c                                       |   124 +-
 mul_fft.c                                      |  2559 +++
 mul_lo.c                                       |     4 +-
 ntt_gfp.c                                      |   579 +-
 pentium4/Makefile.in                           |    45 +-
 pm1.c                                          |   535 +-
 pm1fs2.c                                       |  4620 +++++
 polyeval.c                                     |    14 +-
 pp1.c                                          |   480 +-
 random.c                                       |    10 +-
 resume.c                                       |    57 +-
 rho.c                                          |     4 +-
 schoen_strass.c                                |   165 +-
 sets_long.c                                    |   634 +
 sp.c                                           |    50 +-
 sp.h                                           |   425 +-
 spm.c                                          |   173 +-
 spv.c                                          |   535 +-
 stage2.c                                       |   182 +-
 test.ecm                                       |    10 +-
 test.pm1                                       |    14 +-
 test.pp1                                       |    16 +-
 toomcook.c                                     |     4 +-
 trial.c                                        |    14 +-
 tune.c                                         |    65 +-
 x86_64/Makefile.am                             |    12 +-
 x86_64/Makefile.dev                            |    12 +-
 x86_64/Makefile.in                             |    57 +-
 x86_64/README                                  |    22 +-
 x86_64/bench.c                                 |   218 +-
 x86_64/generate_all                            |     5 +-
 x86_64/mulredc.m4                              |   338 +
 x86_64/mulredc10.asm                           |   857 +-
 x86_64/mulredc11.asm                           |   930 +-
 x86_64/mulredc12.asm                           |  1005 +-
 x86_64/mulredc13.asm                           |  1078 +-
 x86_64/mulredc14.asm                           |  1153 +-
 x86_64/mulredc15.asm                           |  1226 +-
 x86_64/mulredc16.asm                           |  1301 +-
 x86_64/mulredc17.asm                           |  1374 +-
 x86_64/mulredc18.asm                           |  1449 +-
 x86_64/mulredc19.asm                           |  1522 +-
 x86_64/mulredc20.asm                           |  1597 +-
 x86_64/mulredc3.asm                            |   338 +-
 x86_64/mulredc4.asm                            |   413 +-
 x86_64/mulredc5.asm                            |   486 +-
 x86_64/mulredc6.asm                            |   561 +-
 x86_64/mulredc7.asm                            |   634 +-
 x86_64/mulredc8.asm                            |   709 +-
 x86_64/mulredc9.asm                            |   782 +-
 x86_64/redc.asm                                |     9 +
 x86_64/test_mulredc.c                          |   145 +-
 136 files changed, 65647 insertions(+), 11842 deletions(-)

diff --cc sp.h
index f141f2f,48cabc8..9689a22
--- a/sp.h
+++ b/sp.h
@@@ -74,105 -76,51 +76,54 @@@ typedef mp_limb_t UDItype
  #define ULONG_MAX __GMP_ULONG_MAX
  #endif
  
 +#if defined (__s390__) || defined (__hppa__)
 +#define NO_ASM
 +#endif
  #include "longlong.h"
  
- /* Use a library function for invert_limb, if available. */
- #if ! defined (invert_limb) && HAVE_NATIVE_mpn_invert_limb
- #define mpn_invert_limb  __MPN(invert_limb)
- mp_limb_t mpn_invert_limb _PROTO ((mp_limb_t)) ATTRIBUTE_CONST;
- #define invert_limb(invxl,xl)  (invxl = mpn_invert_limb (xl))
- #endif
+ /*********
+  * TYPES *
+  *********/
  
- /* this was inspired by gmp-impl.h */
- #ifndef invert_limb
- #define invert_limb(invxl,xl)                   \
-   do {                                          \
-     mp_limb_t dummy;                            \
-     ASSERT ((xl) != 0);                         \
-     if (xl << 1 == 0)                           \
-       invxl = ~(mp_limb_t) 0;                   \
-     else                                        \
-       udiv_qrnnd (invxl, dummy, -xl, 0, xl);    \
-   } while (0)
- #endif
+ /* SP */
  
- /* this was inspired by gmp-impl.h */
- /* Divide the two-limb number in (NH,,NL) by D, with DI being the largest
-    limb not larger than (2**(2*BITS_PER_MP_LIMB))/D - (2**BITS_PER_MP_LIMB).
-    If this would yield overflow, DI should be the largest possible number
-    (i.e., only ones).  For correct operation, the most significant bit of D
-    has to be set.  Put the quotient in Q and the remainder in R.  */
- #define udiv_qrnnd_preinv(q, r, nh, nl, d, di)                            \
-   do {                                                                    \
-     mp_limb_t _q, _ql, _r;                                                \
-     mp_limb_t _xh, _xl;                                                   \
-     ASSERT ((d) != 0);                                                    \
-     umul_ppmm (_q, _ql, (nh), (di));                                      \
-     _q += (nh);                 /* DI is 2**BITS_PER_MP_LIMB too small */ \
-     umul_ppmm (_xh, _xl, _q, (d));                                        \
-     sub_ddmmss (_xh, _r, (nh), (nl), _xh, _xl);                           \
-     if (_xh != 0)                                                         \
-       {                                                                   \
- 	sub_ddmmss (_xh, _r, _xh, _r, 0, (d));                            \
- 	_q += 1;                                                          \
- 	if (_xh != 0)                                                     \
- 	  {                                                               \
- 	    _r -= (d);                                                    \
- 	    _q += 1;                                                      \
- 	  }                                                               \
-       }                                                                   \
-     if (_r >= (d))                                                        \
-       {                                                                   \
- 	_r -= (d);                                                        \
- 	_q += 1;                                                          \
-       }                                                                   \
-     (r) = _r;                                                             \
-     (q) = _q;                                                             \
-   } while (0)
- /* Exactly like udiv_qrnnd_preinv, but branch-free.  It is not clear which
-    version to use.  */
- #define udiv_qrnnd_preinv2norm(q, r, nh, nl, d, di) \
-   do {									\
-     mp_limb_t _n2, _n10, _n1, _nadj, _q1;				\
-     mp_limb_t _xh, _xl;							\
-     _n2 = (nh);								\
-     _n10 = (nl);							\
-     _n1 = ((mp_limb_signed_t) _n10 >> (BITS_PER_MP_LIMB - 1));		\
-     _nadj = _n10 + (_n1 & (d));						\
-     umul_ppmm (_xh, _xl, di, _n2 - _n1);				\
-     add_ssaaaa (_xh, _xl, _xh, _xl, 0, _nadj);				\
-     _q1 = ~(_n2 + _xh);							\
-     umul_ppmm (_xh, _xl, _q1, d);					\
-     add_ssaaaa (_xh, _xl, _xh, _xl, nh, nl);				\
-     _xh -= (d);								\
-     (r) = _xl + ((d) & _xh);						\
-     (q) = _xh - _q1;							\
-   } while (0)
+ /* the type for both a small prime, and a residue modulo a small prime.
+  * Small primes must be 1 bit smaller than the word size for 32-bit
+  * systems (otherwise there may not be enough suitable primes), but 
+  * may be 2+ bits smaller when the word size exceeds 32 bits (and this
+  * simplifies modular reductions)
+  *
+  * For a residue x modulo a sp p, we require 0 <= x < p */
+ typedef UWtype sp_t;
  
- #define MAX(x,y) (((x)<(y))?(y):(x))
- #define MIN(x,y) (((x)<(y))?(x):(y))
+ #if W_TYPE_SIZE <= 32
+ #define SP_NUMB_BITS (W_TYPE_SIZE - 1)
+ #else
+ #define SP_NUMB_BITS (W_TYPE_SIZE - 2)
+ #endif
  
- #define SIZ(x) ((x)->_mp_size)
- #define PTR(x) ((x)->_mp_d)
+ #define SP_MIN ((sp_t)1 << (SP_NUMB_BITS - 1))
+ #define SP_MAX ((sp_t)(-1) >> (W_TYPE_SIZE - SP_NUMB_BITS))
  
+ /* vector of residues modulo a common small prime */
+ typedef sp_t * spv_t;
  
- /*********
-  * TYPES *
-  *********/
+ /* length of a spv */
+ typedef unsigned long spv_size_t;
  
- /* SP */
+ typedef struct
+ {
+   spv_t ntt_roots;
+   spv_size_t twiddle_size;
+   spv_t twiddle;
+ } __sp_nttdata;
  
- /* the type for both a small prime, and a residue modulo a small prime
-  *  - for a sp, we require the top bit to be set
-  *  - for a residue x modulo a sp p, we require 0 <= x < p */
- typedef UWtype sp_t;
+ typedef __sp_nttdata sp_nttdata_t[1];
+ 
+ #define NTT_GFP_TWIDDLE_BREAKOVER 11
  
- #define SP_NUMB_BITS (8 * sizeof (sp_t))
- #define SP_MAX ULONG_MAX
- #define SP_MIN (ULONG_MAX >> 1)
+ #define LOG2_NTT_TWIDDLE_BLOCK_SIZE 7
+ #define NTT_TWIDDLE_BLOCK_SIZE (1 << LOG2_NTT_TWIDDLE_BLOCK_SIZE)
  
  /* SPM */
  

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/gmp-ecm.git



More information about the debian-science-commits mailing list