changeset 243:c311c26e006a

*** empty log message ***
author kono
date Thu, 06 May 2004 00:01:40 +0900
parents c68f618b71f9
children 39e28d6cfa56
files mc-code-ia32.c
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mc-code-ia32.c	Tue May 04 09:51:28 2004 +0900
+++ b/mc-code-ia32.c	Thu May 06 00:01:40 2004 +0900
@@ -378,7 +378,7 @@
 free_all_register(void)
 {
     int i;
-    for(i=0;i<MAX_REGISTER+REAL_MAX_REGISTER;i++) {
+    for(i=0;i<MAX_REGISTER+REAL_MAX_LREGISTER;i++) {
 	regs[i]=regv[i]=0;
     }
     creg = get_register();
@@ -1164,12 +1164,13 @@
     }
     regv[save]=0;
     if (ret_type==DOUBLE||ret_type==FLOAT) {
-	fregv[freg]=1; regv[creg]=0;
     } else if (ret_type==LONGLONG||ret_type==ULONGLONG) {
-	fregv[freg]=0; regv[creg]=0;
+	use_longlong0(USE_CREG);
+	regv[creg]=1;
     } else if (ret_type==VOID) {
-	fregv[freg]=0; regv[creg]=0;
+	regv[freg]=0; regv[creg]=0;
     } else {
+	use_register(creg,REG_EAX,0);
 	fregv[freg]=0; regv[creg]=1;
     }
     return ret_type;
@@ -1743,6 +1744,7 @@
 code_set_return_register(int mode) {
     if (fnptr->ty==DOUBLE||fnptr->ty==FLOAT) {
     } else if (fnptr->ty==LONGLONG||fnptr->ty==ULONGLONG) {
+	use_longlong0(USE_CREG);
     } else {
 	use_register(creg,REG_EAX,mode);
     }
@@ -1828,7 +1830,7 @@
 #if LONGLONG_CODE
     } else if(t==LONGLONG||t==ULONGLONG) {       
         ll = lcadr(e);
-        printf("\t.long\t0x%x,0x%x\n",code_l2(ll),code_l1(ll));
+        printf("\t.long\t0x%x,0x%x\n",code_l1(ll),code_l2(ll));
 #endif
 #if FLOAT_CODE
     } else if(t==DOUBLE) {