diff mc-code-ia32.c @ 186:6391432ca002

nkf binary fix
author kono
date Mon, 01 Dec 2003 15:36:22 +0900
parents 1d80ad165831
children dffcccf8b1cb
line wrap: on
line diff
--- a/mc-code-ia32.c	Mon Dec 01 03:24:30 2003 +0900
+++ b/mc-code-ia32.c	Mon Dec 01 15:36:22 2003 +0900
@@ -542,6 +542,52 @@
     return xreg;
 }
 
+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;
+}
+
+
+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)
 {