Added code to optimize multiplies with constants

This commit is contained in:
ceriel
1991-11-20 15:53:11 +00:00
parent aa0b70d921
commit 17352b8b8d
5 changed files with 163 additions and 3 deletions

View File

@@ -28,7 +28,7 @@ main(argc,argv) int argc; char *argv[]; {
while (argc-->1 && **++argv == '-')
flags(*argv);
if (argc>1) {
fprintf(stderr,"Usage: %s [-Ln] [name]\n",progname);
fprintf(stderr,"Usage: %s [-Ln] [-m<num>] [name]\n",progname);
exit(-1);
}
if (argc)
@@ -47,6 +47,11 @@ flags(s) register char *s; {
switch(*s) {
case 'L': Lflag = TRUE; break;
case 'n': nflag = TRUE; break;
case 'm': if (*(s+1) == 'l') {
s++;
repl_longmuls = TRUE;
}
repl_muls = atoi(s+1); break;
}
}