Skip to content

Commit 37ba942

Browse files
committed
Refined tuning
1 parent ac33ffb commit 37ba942

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

etc/tune.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -633,25 +633,33 @@ int main(int argc, char **argv)
633633
"\"Faster radix conversion (writing)\"", &MP_RADIX_WRITE_CUTOFF,
634634
&(updated.RADIX_WRITE),MP_HAS(S_MP_FASTER_TO_RADIX) ? s_time_radix_conversion_write : NULL
635635
}
636+
636637
#undef T_MUL_SQR
637638
};
638639
/* Turn all limits from bncore.c to the max */
639640
set_cutoffs(&max_cutoffs);
641+
640642
for (n = 0; n < (sizeof(test)/sizeof(test[0]) - 2); ++n) {
641643
if (test[n].fn != NULL) {
642644
s_run(test[n].name, test[n].fn, test[n].cutoff);
643645
*test[n].update = *test[n].cutoff;
644646
*test[n].cutoff = INT_MAX;
645647
};
646648
}
647-
/* Cutoffs for radix conversions are in bits to make handling of 62 different radices
648-
more feasible. */
649+
650+
/* We need the updated fast multiplication cutoffs for the radix conversion, set them */
651+
for (n = 0; n < (sizeof(test)/sizeof(test[0]) - 2); ++n) {
652+
if (test[n].fn != NULL) {
653+
*test[n].cutoff = *test[n].update;
654+
};
655+
}
656+
657+
/* Cutoffs for radix conversions are in bits to make handling of 62 different radices easier */
649658
for (; n < sizeof(test)/sizeof(test[0]); ++n) {
650659
if (test[n].fn != NULL) {
651660
s_run(test[n].name, test[n].fn, test[n].cutoff);
652661
/* TODO: can overflow for small INT_MAX */
653662
*test[n].update = ((*test[n].cutoff) * MP_DIGIT_BIT * 93)/28;
654-
*test[n].cutoff = INT_MAX;
655663
}
656664
}
657665
}

0 commit comments

Comments
 (0)