diff mc-code-ia32.c @ 258:22949117768f

Complex function argments. Struct is done. Long long is odd.
author kono
date Sat, 15 May 2004 20:07:24 +0900
parents 5aaca4f9d96b
children c922bade771d
line wrap: on
line diff
--- a/mc-code-ia32.c	Sat May 15 12:05:17 2004 +0900
+++ b/mc-code-ia32.c	Sat May 15 20:07:24 2004 +0900
@@ -971,30 +971,32 @@
 	    register_name(to,0));
 	break;
     default:
-	if (-MAX_COPY_LEN<length && length <0) {
-	    for(;length<=4;length+=4,offset-=4)
-		emit_copy(from,to,4,offset,0,det);
-	    for(;length<=2;length+=2,offset-=2)
-		emit_copy(from,to,2,offset,0,det);
-	    if(length>0)
-		emit_copy(from,to,length,offset,0,det);
-	    break;
-	} else if (length <=MAX_COPY_LEN) {
-	    for(;length>=4;length-=4,offset+=4)
-		emit_copy(from,to,4,offset,0,det);
-	    for(;length>=2;length-=2,offset+=2)
-		emit_copy(from,to,2,offset,0,det);
-	    if(length>0)
-		emit_copy(from,to,length,offset,0,det);
-	    break;
-	}
+        if (length <0) {
+            if (length > -MAX_COPY_LEN) {
+                for(;length<=-4;length+=4,offset-=4)
+                    emit_copy(from,to,-4,offset-4,0,det);
+                for(;length<=-2;length+=2,offset-=2)
+                    emit_copy(from,to,-2,offset-2,0,det);
+                if(length<0)
+                    emit_copy(from,to,length,offset-1,0,det);
+                break;
+            }
+        } else if (length <=MAX_COPY_LEN) {
+            for(;length>=4;length-=4,offset+=4)
+                emit_copy(from,to,4,offset,0,det);
+            for(;length>=2;length-=2,offset+=2)
+                emit_copy(from,to,2,offset,0,det);
+            if(length>0)
+                emit_copy(from,to,length,offset,0,det);
+            break;
+        }
+/*
 	if (det) {
-/*
    call bcopy
 	    g_expr(list3(FUNCTION,,);
 	    break;
+	}
  */
-	}
 	use_register(from,REG_ESI,1);
 	use_register(to,  REG_EDI,1);
 	use_register(dreg,REG_ECX,0);
@@ -1004,14 +1006,14 @@
 	    printf("\taddl $%d,%%edi\n",-length);
 	    printf("\tstd\n\trep\n\tmovsl\n");
 	    if(length%4) {
-		emit_copy(from,to,length,offset+length/4,0,det);
+		emit_copy(from,to,length,offset+length/SIZE_OF_INT,0,det);
 	    }
 	} else {
 	    printf("\tmovl $%d,%%ecx\n",length/4);
 	    fix = (length/4)*4;
 	    printf("\tcld\n\trep\n\tmovsl\n");
 	    if(length%4) {
-		emit_copy(from,to,length,offset+length/4,0,det);
+		emit_copy(from,to,length,offset+length/SIZE_OF_INT,0,det);
 	    }
 	}
     }