labdef LAB ;
/* some strength reduction */
mulu.l #NUM,DREG -> muls.l #NUM,DREG ;
+muls.l #NUM,DREG
+ {isshift_once(NUM,X,Y)} -> asl.l #X,DREG :
+ asl.l #Y,DREG ;
muls.l #NUM,DREG
{is_shift_twice(NUM,X,Y)} -> asl.l #X,DREG :
move.l DREG,-(sp) :
/* NOTREACHED */
}
+int isshift_once(s, c1, c2)
+ char *s, *c1, *c2;
+{
+ long atol();
+ register int i = 0;
+ long val = atol(s), pow = 1;
+
+ while (i <= 8) {
+ if (pow & val) {
+ val -= pow;
+ sprintf(c1, "%d", i);
+ strcpy(c2, "0");
+ if (val == 0) return 1;
+ return 0;
+ }
+ pow <<= 1;
+ i++;
+ }
+ i = 0;
+ strcpy(c1, "8");
+ while (i <= 8) {
+ if (pow & val) {
+ val -= pow;
+ sprintf(c2, "%d", i);
+ if (val == 0) return 1;
+ return 0;
+ }
+ pow <<= 1;
+ i++;
+ }
+ return 0;
+}
int is_shift_twice(s, c1, c2)
char *s, *c1, *c2;
pow <<= 1;
i++;
}
+ if (i > 8) return 0;
if (pow > 0 && val) {
i = 0;
while (i <= 8) {