diff mc-code-ia32.c @ 81:f94ca1168520

float first try...
author kono
date Mon, 03 Mar 2003 20:59:51 +0900
parents 8418d4b7caa7
children 25654dc29ecc
line wrap: on
line diff
--- a/mc-code-ia32.c	Mon Mar 03 05:41:10 2003 +0900
+++ b/mc-code-ia32.c	Mon Mar 03 20:59:51 2003 +0900
@@ -39,6 +39,9 @@
 int jump_offset = 0;
 
 int size_of_int = 4;
+int size_of_float = 4;
+int size_of_dobule = 8;
+int size_of_longlong = 8;
 int endian = 0;
 int MAX_REGISTER=6;         /* intel386のレジスタを4つまで使う*/
 int REAL_MAX_REGISTER=8;    /* intel386のレジスタが8つということ*/
@@ -657,18 +660,18 @@
 int
 struct_push(int e4,int t) 
 {
-    int length,xreg,save,lreg;
+    int length,xreg,save,lreg,count;
     g_expr(e4);
     length=size(t); 
     if(length%size_of_int) {
 	length += size_of_int - (length%size_of_int);
     }
-    if (length==4) {
-	printf("\tpushl (%s)\n",register_name(creg,0)); return 1;
-    }
-    if (length==8) {
-	printf("\tpushl 4(%s)\n",register_name(creg,0));
-	printf("\tpushl (%s)\n",register_name(creg,0)); return 2;
+    for(count=0;length<MAX_COPY_LEN;count++,length-=size_of_int) {
+	if (length==0) return count;
+	else {
+	    printf("\tpushl %d(%s)\n",
+		length-size_of_int,register_name(creg,0));
+	}
     }
     printf("\tsubl $%d,%%esp\n",length);
     if (register_full()) {
@@ -1291,4 +1294,67 @@
     }
 }
 
+/* floating point */
+
+
+void code_cmp_drgvar(int e)
+{ }
+
+
+void code_cmp_drlvar(int e)
+{ }
+
+
+void code_dassign_gvar(int e2,int byte)
+{ }
+
+
+void code_dassign_lvar(int e,int byte)
+{ }
+
+void code_dassign(int e)
+{ }
+
+
+void code_dconst(int e2)
+{ }
+
+
+void code_dneg()
+{ }
+
+
+void code_drgvar(int e1)
+{ }
+
+
+void code_drlvar(int e1)
+{ }
+
+
+void code_frgvar(int e1)
+{ }
+
+
+void code_frlvar(int e1)
+{ }
+
+
+void dtosop(int e,int e1)
+{ }
+
+int dpop_register()
+{ return 1;}
+
+int emit_dpop(int e1)
+{ return 1;}
+
+void emit_dpop_free(int e1)
+{ }
+
+void emit_dpush()
+{ }
+
+
+
 /* end */