@@ -702,6 +702,14 @@ int main(int argc, char **argv)
702702 }
703703
704704 }
705+ if (printpreset == 1 ) {
706+ updated .MUL_KARATSUBA = MP_MUL_KARATSUBA_CUTOFF ;
707+ updated .SQR_KARATSUBA = MP_SQR_KARATSUBA_CUTOFF ;
708+ updated .MUL_TOOM = MP_MUL_TOOM_CUTOFF ;
709+ updated .SQR_TOOM = MP_SQR_TOOM_CUTOFF ;
710+ updated .RADIX_READ = MP_RADIX_READ_CUTOFF ;
711+ updated .RADIX_WRITE = MP_RADIX_WRITE_CUTOFF ;
712+ }
705713 if (args .terse == 1 ) {
706714 printf ("%d %d %d %d %d %d\n" ,
707715 updated .MUL_KARATSUBA ,
@@ -747,7 +755,8 @@ int main(int argc, char **argv)
747755 }
748756
749757
750- for (x = 8 ; x < args .upper_limit_print ; x += args .increment_print ) {
758+ for (x = 1 ; x < args .upper_limit_print ; x += args .increment_print ) {
759+ printf ("\r%d" , (rgs .upper_limit_print - x ));
751760 set_cutoffs (& max_cutoffs );
752761 t1 = s_time_mul (x );
753762 set_cutoffs (& orig );
@@ -768,29 +777,32 @@ int main(int argc, char **argv)
768777 printf ("SQR %d: %9" PRIu64 " %9" PRIu64 ", %9" PRIi64 "\n" , x , t1 , t2 , (int64_t )t2 - (int64_t )t1 );
769778 fflush (stdout );
770779 }
771-
772-
773- set_cutoffs (& max_cutoffs );
774- t1 = s_time_radix_conversion_read (x );
775- set_cutoffs (& orig );
776- t2 = s_time_radix_conversion_read (x );
777- fprintf (readradix ,"%d: %9" PRIu64 " %9" PRIu64 ", %9" PRIi64 "\n" , x * MP_DIGIT_BIT , t1 , t2 , (int64_t )t2 - (int64_t )t1 );
778- fflush (readradix );
779- if (args .verbose == 1 ) {
780- printf ("RCR %d: %9" PRIu64 " %9" PRIu64 ", %9" PRIi64 "\n" , x * MP_DIGIT_BIT , t1 , t2 , (int64_t )t2 - (int64_t )t1 );
781- fflush (stdout );
780+ /* The cutoffs are so low, we would see nothing interesting in the graphs with the default args.upper_limit_print */
781+ if ((x * MP_DIGIT_BIT ) < (3 * updated .RADIX_READ )) {
782+ set_cutoffs (& max_cutoffs );
783+ t1 = s_time_radix_conversion_read (x );
784+ set_cutoffs (& orig );
785+ t2 = s_time_radix_conversion_read (x );
786+ fprintf (readradix ,"%d: %9" PRIu64 " %9" PRIu64 ", %9" PRIi64 "\n" , x * MP_DIGIT_BIT , t1 , t2 , (int64_t )t2 - (int64_t )t1 );
787+ fflush (readradix );
788+ if (args .verbose == 1 ) {
789+ printf ("RCR %d: %9" PRIu64 " %9" PRIu64 ", %9" PRIi64 "\n" , x * MP_DIGIT_BIT , t1 , t2 , (int64_t )t2 - (int64_t )t1 );
790+ fflush (stdout );
791+ }
782792 }
783793
784- set_cutoffs (& max_cutoffs );
785- t1 = s_time_radix_conversion_write (x );
786- set_cutoffs (& orig );
787- t2 = s_time_radix_conversion_write (x );
788- fprintf (writeradix ,"%d: %9" PRIu64 " %9" PRIu64 ", %9" PRIi64 "\n" , x * MP_DIGIT_BIT , t1 , t2 ,
789- (int64_t )t2 - (int64_t )t1 );
790- fflush (writeradix );
791- if (args .verbose == 1 ) {
792- printf ("RCW %d: %9" PRIu64 " %9" PRIu64 ", %9" PRIi64 "\n" , x * MP_DIGIT_BIT , t1 , t2 , (int64_t )t2 - (int64_t )t1 );
793- fflush (stdout );
794+ if ((x * MP_DIGIT_BIT ) < (5 * updated .RADIX_WRITE )) {
795+ set_cutoffs (& max_cutoffs );
796+ t1 = s_time_radix_conversion_write (x );
797+ set_cutoffs (& orig );
798+ t2 = s_time_radix_conversion_write (x );
799+ fprintf (writeradix ,"%d: %9" PRIu64 " %9" PRIu64 ", %9" PRIi64 "\n" , x * MP_DIGIT_BIT , t1 , t2 ,
800+ (int64_t )t2 - (int64_t )t1 );
801+ fflush (writeradix );
802+ if (args .verbose == 1 ) {
803+ printf ("RCW %d: %9" PRIu64 " %9" PRIu64 ", %9" PRIi64 "\n" , x * MP_DIGIT_BIT , t1 , t2 , (int64_t )t2 - (int64_t )t1 );
804+ fflush (stdout );
805+ }
794806 }
795807
796808 }
0 commit comments