Browse Source

Added pattern for cmp A,A

ceriel 34 years ago
parent
commit
9117eab57d
1 changed files with 10 additions and 16 deletions
  1. 10 16
      mach/m68020/top/table

+ 10 - 16
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;