mod_1 tuning

Torbjorn Granlund tg at gmplib.org
Thu Mar 3 17:17:04 CET 2011


nisse at lysator.liu.se (Niels Möller) writes:

  This means that tuned values of MOD_1_1P_METHOD now ought to be included
  in gmp-mparam.h, otherwise other MOD_1* values will be suboptimal. And
  hence, the new method 2 is going to be enabled on several machines.
  
OK.  The default is still 1?

  I tested this on a --disable-assembler build, before this change tuneup
  selected
  
  #define MOD_1N_TO_MOD_1_1_THRESHOLD         18
  #define MOD_1U_TO_MOD_1_1_THRESHOLD         42
  #define MOD_1_1_TO_MOD_1_2_THRESHOLD         0  /* never mpn_mod_1_1p */
  #define MOD_1_2_TO_MOD_1_4_THRESHOLD         0  /* never mpn_mod_1s_2p */
  
  After, 
  
  #define MOD_1_1P_METHOD                      2
  #define MOD_1N_TO_MOD_1_1_THRESHOLD          4
  #define MOD_1U_TO_MOD_1_1_THRESHOLD         42
  #define MOD_1_1_TO_MOD_1_2_THRESHOLD         0  /* never mpn_mod_1_1p */
  #define MOD_1_2_TO_MOD_1_4_THRESHOLD         0  /* never mpn_mod_1s_2p */
  
  I don't understand why the MOD_1U_TO_MOD_1_1_THRESHOLD didn't change,
  though.

Perhaps the (old) code in tuneup.c isn't quite right?

  I also don't understand why tune/mod_1.c (generated by make) needs the
  define
  
  #define __gmpn_mod_1  mpn_mod_1_tune
  
I don't recall.  Isn't it to allow for multiple version of the code to
be compiled into the same binary, which demands for some renaming?

-- 
Torbjörn


More information about the gmp-devel mailing list