changeset 290:4598e751af55

MIPS code_bool
author kono
date Thu, 03 Jun 2004 21:10:46 +0900
parents 55e611476cba
children 7b6df595b205
files mc-code-mips.c
diffstat 1 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mc-code-mips.c	Thu Jun 03 20:41:36 2004 +0900
+++ b/mc-code-mips.c	Thu Jun 03 21:10:46 2004 +0900
@@ -2738,9 +2738,9 @@
     char *eq = "eq";
     char *ne = "ne";
     int t;
-    char *rn2 =		register_name(r2);
-    char *rn1 =		register_name(r1);
-    char *rn0 =		register_name(r0);
+    char *rn2;
+    char *rn1;
+    char *rn0;
 
 // printf("# pcond %d cond %d\n",op,cond);
     switch(op+(!cond)*BNOT) {
@@ -2769,6 +2769,10 @@
 		    break;
     default:        error(-1);
     }
+    rn2 =		register_name(r2);
+    rn1 =		register_name(r1);
+    rn0 =		register_name(r0);
+
 
     if (mode==COND_BRANCH) {
 	if (op==EQ||op==NEQ) {
@@ -2786,9 +2790,9 @@
 	    printf("\tsltu\t%s,$0,%s\n",rn2,rn2);
 	} else {
 	    printf("\t%s\t%s,%s,%s\n",slt,rn2,rn1,rn0);
-	}
-	if (eq==ne) {
-	    printf("\txor\t%s,%s,1\n",rn2,rn2);
+	    if (eq==ne) {
+		printf("\txor\t%s,%s,1\n",rn2,rn2);
+	    }
 	}
     } else error(-1);
 }