changeset 407:dafb9110d70b

ARM continue... emit_copy bug
author kono
date Mon, 18 Oct 2004 08:33:00 +0900
parents 8528af42e7f7
children b4375f895fd5
files Makefile mc-code-arm.c
diffstat 2 files changed, 20 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Mon Oct 18 00:17:09 2004 +0900
+++ b/Makefile	Mon Oct 18 08:33:00 2004 +0900
@@ -1,6 +1,8 @@
 CC = gcc
 # -O3
 CFLAGS = -g -Wall -I.
+# for Linux Zaurus
+# CFLAGS = -fsigned-char -pipe -g -I. -I/home/zaurus/develop/include
 BASE=0
 STAGE=1
 MFLAGS=$(MFALGS) BASE=$(BASE) STAGE=$(STAGE)
--- a/mc-code-arm.c	Mon Oct 18 00:17:09 2004 +0900
+++ b/mc-code-arm.c	Mon Oct 18 08:33:00 2004 +0900
@@ -1891,17 +1891,17 @@
     case 1: case -1:
 	inc_inst(2);
 	printf("\tldrb\t%s, [%s,#%d]\n",drn,frn,offset);
-	printf("\tstrb\t%s, [%s,#%d]\n",drn,frn,offset);
+	printf("\tstrb\t%s, [%s,#%d]\n",drn,trn,offset);
 	break;
     case 2: case -2:
 	inc_inst(2);
 	printf("\tldrh\t%s, [%s,#%d]\n",drn,frn,offset);
-	printf("\tstrh\t%s, [%s,#%d]\n",drn,frn,offset);
+	printf("\tstrh\t%s, [%s,#%d]\n",drn,trn,offset);
 	break;
     case 4: case -4:
 	inc_inst(2);
 	printf("\tldr\t%s, [%s,#%d]\n",drn,frn,offset);
-	printf("\tstr\t%s, [%s,#%d]\n",drn,frn,offset);
+	printf("\tstr\t%s, [%s,#%d]\n",drn,trn,offset);
 	break;
     default:
         if (length <0) {
@@ -1982,7 +1982,7 @@
         for(count=0;count<length;count+=SIZE_OF_INT) {
 	    inc_inst(2);
             printf("\tldr\t%s, [%s, #%d]\n",srn,crn,count);
-            printf("\tstr\t%s, [%s, #%d]\n",srn,crn,count);
+            printf("\tstr\t%s, [%s, #%d]\n",srn,drn,count);
         }
         free_register(sreg);
         free_register(dreg);
@@ -2177,13 +2177,18 @@
 static int
 not_simple_p(int e3)
 {
-    return (e3==FUNCTION||e3==CONV||e3==RSTRUCT||e3==STASS||e3==ALLOCA||
-	e3==LDIV||e3==LUDIV||e3==LMOD||e3==LUMOD||
-		e3==LLSHIFT||e3==LULSHIFT||e3==LRSHIFT||e3==LURSHIFT||
-	e3==DDIV||e3==DADD||e3==DSUB||e3==DMUL||e3==DMINUS||
-            e3== DPOSTINC || e3==DPREINC || e3==DASSOP ||
-            e3== DOP+LT || e3== DOP+LE || e3== DOP+GT ||
-            e3== DOP+GE || e3== DOP+EQ || e3== DOP+NEQ);
+    switch(e3) {
+	case FUNCTION: case CONV: case RSTRUCT: case STASS: case ALLOCA:
+	case DIV : case UDIV : case MOD : case UMOD :
+	case LDIV: case LUDIV: case LMOD: case LUMOD:
+	case LLSHIFT: case LULSHIFT: case LRSHIFT: case LURSHIFT:
+	case DDIV: case DADD: case DSUB: case DMUL: case DMINUS:
+	case DPOSTINC : case DPREINC : case DASSOP :
+	case DOP+LT : case DOP+LE : case DOP+GT : case DOP+GE :
+	case DOP+EQ : case DOP+NEQ:
+	return 1;
+    }
+    return 0;
 }
 
 int
@@ -2445,7 +2450,8 @@
 	fn=(NMTBL *)cadr(e2);
     } else {	
 	if (car(e2)==INDIRECT) e2=cadr(e2); // (*func)(i) case
-	jmp = get_register_var(0);
+	// jmp = get_register_var(0);
+	jmp = list2(REGISTER,REG_ip);
 	if (!simple_arg(e2)) {
 	    e3=get_register_var(0);
 	    reg_arg_list = list2(e3,reg_arg_list);