Added pattern for cmp A,A

This commit is contained in:
ceriel 1990-02-27 16:31:10 +00:00
parent 9d4e978a1e
commit 239d634ab1

View file

@ -78,6 +78,10 @@ move.l DREG,DREG2 : ANY A,DREG2 : move.l DREG2,DREG
{no_part(DREG2,A)} -> ANY A,DREG : move.l DREG,DREG2 ;
/* change some compares to tests */
cmp.w A,A -> tst.w A ;
cmp.l A,A -> tst.l A ;
cmp.b A,A -> tst.b A ;
cmp.w #0,D : beq LAB -> tst.w D : beq LAB ;
cmp.w #0,D : bne LAB -> tst.w D : bne LAB ;
cmp.w #0,D : blt LAB -> tst.w D : bgt LAB ;
@ -189,24 +193,14 @@ int isshift_once(s, c1, c2)
register int i = 0;
long val = atol(s), pow = 1;
while (i <= 8) {
while (i <= 16) {
if (pow & val) {
val -= pow;
sprintf(c1, "%d", i);
strcpy(c2, "0");
if (val == 0) return 1;
return 0;
}
pow <<= 1;
i++;
}
i = 1;
strcpy(c1, "8");
while (i <= 8) {
if (pow & val) {
val -= pow;
sprintf(c2, "%d", i);
if (val == 0) return 1;
if (val == 0) {
sprintf(c1, "%d", i <= 8 ? i : 8);
strcpy(c2, "%d", i <= 8 ? 0 : i - 8);
return 1;
}
return 0;
}
pow <<= 1;