From: ceriel Date: Tue, 27 Feb 1990 16:31:10 +0000 (+0000) Subject: Added pattern for cmp A,A X-Git-Tag: release-5-5~1804 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=239d634ab1125351959b0bb61672ffa258009156;p=ack.git Added pattern for cmp A,A --- diff --git a/mach/m68020/top/table b/mach/m68020/top/table index 719d8b549..d2169954e 100644 --- a/mach/m68020/top/table +++ b/mach/m68020/top/table @@ -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) { - 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) { + while (i <= 16) { 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;