diff mc-code-ia32.c @ 187:dffcccf8b1cb

nested COND
author kono
date Mon, 01 Dec 2003 19:06:30 +0900
parents 6391432ca002
children f53d70110377
line wrap: on
line diff
--- a/mc-code-ia32.c	Mon Dec 01 15:36:22 2003 +0900
+++ b/mc-code-ia32.c	Mon Dec 01 19:06:30 2003 +0900
@@ -557,7 +557,7 @@
         xreg = freg_stack[freg_sp];
         if (xreg<= -REG_LVAR_OFFSET) {
             return list2(LVAR,REG_LVAR_OFFSET+xreg);
-        else {
+        } else {
             return list2(DREGISTER,xreg);
         }
     }
@@ -565,28 +565,6 @@
 }
 
 
-int
-stack_top(int type)
-{
-    int xreg;
-    if (type==INT) {
-        xreg = reg_stack[reg_sp];
-        if (xreg<= -REG_LVAR_OFFSET) {
-            return list2(LVAR,REG_LVAR_OFFSET+xreg);
-        } else {
-            return list2(REGISTER,xreg);
-        }
-    } else {
-        xreg = freg_stack[freg_sp];
-        if (xreg<= -REG_LVAR_OFFSET) {
-            return list2(LVAR,REG_LVAR_OFFSET+xreg);
-        else {
-            return list2(DREGISTER,xreg);
-        }
-    }
-    return xreg;
-}
-
 
 void 
 code_label(int labelno)
@@ -1507,12 +1485,21 @@
     free_all_register();
 }
 
+int
+code_get_fixed_creg(int reg,int type) {
+    if (type==FLOAT||type==DOUBLE) {
+	return 0;
+    } else {
+	return rname[reg];
+    }
+}
 
 void
-code_set_fixed_creg(int mode,int type) {
+code_set_fixed_creg(int reg,int mode,int type) {
     if (type==FLOAT||type==DOUBLE) {
-    } else
-	use_register(creg,REG_EAX,mode);
+    } else {
+	use_register(creg,reg,mode);
+    }
 }
 
 void