Skip to content

Commit ea9a964

Browse files
committed
another clean-up before rebasing
1 parent b98ef1f commit ea9a964

File tree

8 files changed

+7
-44
lines changed

8 files changed

+7
-44
lines changed

etc/makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ mont: mont.o
4141
getlimbsize: get_limbsize.o
4242
$(CC) $(LTM_TUNE_CFLAGS) get_limbsize.o $(LIBNAME) -o get_limbsize
4343

44-
# Make pretty pictures (2000 is the maximum number of limbs to print for mul/sqr)
44+
# Make pretty pictures (3000 is the maximum number of limbs to print for mul/sqr)
4545
# "tune" runs twice because it runs automatically when build.
4646
graphs: tune get_limbsize
47-
./tune_it.sh 2000
47+
./tune_it.sh 3000
4848
gnuplot -c plot_graphs.gp `./get_limbsize`
4949

5050
clean:

etc/makefile.icc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ tune: tune.o
3737
getlimbsize: get_limbsize.o
3838
$(CC) $(LTM_TUNE_CFLAGS) get_limbsize.o $(LIBNAME) -o get_limbsize
3939

40-
# Make pretty pictures (2000 is the maximum number of limbs to print for mul/sqr)
40+
# Make pretty pictures (3000 is the maximum number of limbs to print for mul/sqr)
4141
# "tune" runs twice because it runs automatically when build.
4242
graphs: tune get_limbsize
43-
./tune_it.sh 2000
43+
./tune_it.sh 3000
4444
gnuplot -c plot_graphs.gp `./get_limbsize`
4545

4646

etc/tune.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -680,22 +680,13 @@ int main(int argc, char **argv)
680680
if (test[n].fn != NULL) {
681681
s_run(test[n].name, test[n].fn, test[n].cutoff);
682682
*test[n].update = *test[n].cutoff;
683-
*test[n].cutoff = INT_MAX;
684-
};
685-
}
686-
687-
/* We need the updated fast multiplication cutoffs for the radix conversion, set them */
688-
for (n = 0; n < (sizeof(test)/sizeof(test[0]) - 2); ++n) {
689-
if (test[n].fn != NULL) {
690-
*test[n].cutoff = *test[n].update;
691683
};
692684
}
693685

694686
/* Cutoffs for radix conversions are in bits to make handling of 62 different radices easier */
695687
for (; n < sizeof(test)/sizeof(test[0]); ++n) {
696688
if (test[n].fn != NULL) {
697689
s_run(test[n].name, test[n].fn, test[n].cutoff);
698-
/* TODO: can overflow for small INT_MAX */
699690
*test[n].update = (*test[n].cutoff) * MP_DIGIT_BIT;
700691
*test[n].cutoff = INT_MAX;
701692
}

etc/tune_it.sh

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,3 @@ if [ $# -eq 1 ]; then
122122
"$MPWD"/tune -p -r $RLOOPS -L $LAG -S "$RNUM" -o $OFFSET -M $1 -G $(./get_limbsize) -s $TMP0,$TMP1,$TMP2,$TMP3,$TMP4,$TMP5
123123
fi
124124

125-
126-
127-
128-
129-
130-
131-
132-
133-
134-

makefile.shared

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,6 @@ $(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo))))
9393
mtest:
9494
cd mtest ; $(CC) $(LTM_CFLAGS) -O0 mtest.c $(LTM_LDFLAGS) -o mtest
9595

96-
tuneold: $(LIBNAME)
97-
$(LTCOMPILE) $(LTM_CFLAGS) -c etc/tune.c -o etc/tune.o
98-
$(LTLINK) $(LTM_LDFLAGS) -o etc/tune etc/tune.o $(LIBNAME)
99-
cd etc/; /bin/sh tune_it.sh; cd ..
100-
$(MAKE) -f makefile.shared
101-
10296
# etc/tune.c uses hidden symbols, so we assume that only difference between the shared and static
10397
# libraries is just that: they are shared or static and simply build a static library to run
10498
# etc/tune
@@ -107,18 +101,6 @@ tune:
107101
$(MAKE) -f makefile clean
108102
$(MAKE) -f makefile.shared
109103

110-
111-
graphsold: $(LIBNAME)
112-
$(LTCOMPILE) $(LTM_CFLAGS) -c etc/tune.c -o etc/tune.o
113-
$(LTLINK) $(LTM_LDFLAGS) -o etc/tune etc/tune.o $(LIBNAME)
114-
$(LTCOMPILE) $(LTM_CFLAGS) -c etc/get_limbsize.c -o etc/get_limbsize.o
115-
$(LTLINK) $(LTM_LDFLAGS) -o etc/get_limbsize etc/get_limbsize.o $(LIBNAME)
116-
cd etc/;\
117-
/bin/sh tune_it.sh 2000;\
118-
gnuplot -c plot_graphs.gp `./get_limbsize`;\
119-
cd ..
120-
$(MAKE) -f makefile.shared
121-
122104
graphs:
123105
$(MAKE) -f makefile graphs
124106
$(MAKE) -f makefile clean

mp_read_radix.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
44
/* SPDX-License-Identifier: Unlicense */
55

6+
/* TODO: strlen() shouldn't be problematic but you'll never know */
67
#ifdef MP_USE_MEMOPS
78
# include <string.h>
89
# define MP_STRLEN(s) strlen(s)

mp_to_radix.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ mp_err mp_to_radix(const mp_int *a, char *str, size_t maxlen, size_t *written, i
4949

5050

5151
if (MP_HAS(S_MP_FASTER_TO_RADIX) && (a->used > (MP_RADIX_WRITE_CUTOFF / MP_DIGIT_BIT))) {
52-
if ((err = s_mp_faster_to_radix(&a_bar, str, maxlen, &part_written, radix)) != MP_OKAY) goto LBL_ERR;
52+
if ((err = s_mp_faster_to_radix(&a_bar, str, maxlen, &part_written, radix)) != MP_OKAY) goto LBL_ERR;
5353
} else if (MP_HAS(S_MP_SLOWER_TO_RADIX)) {
5454
char *start = str;
5555
if ((err = s_mp_slower_to_radix(&a_bar, &str, &maxlen, &part_written, radix, false)) != MP_OKAY) goto LBL_ERR;

tommath_private.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ do { \
9090
# define MP_RADIX_WRITE_CUTOFF MP_DEFAULT_RADIX_WRITE_CUTOFF
9191
#endif
9292

93+
/* Changing it has not much effect on speed but will reduce the tree height/stack use if incremented */
9394
#ifndef MP_RADIX_BARRETT_START_MULTIPLICATOR
9495
# define MP_RADIX_BARRETT_START_MULTIPLICATOR 10
9596
/* Better safe than sorry */
@@ -105,8 +106,6 @@ do { \
105106

106107

107108

108-
109-
110109
/* define heap macros */
111110
#ifndef MP_MALLOC
112111
/* default to libc stuff */

0 commit comments

Comments
 (0)