changeset 798:df9861be349f

i64 make diff passed. make diff2 failed.
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 23 Nov 2010 21:59:14 +0900
parents e2f7680a574a
children 56ba015b37ca
files mc-code-i64.c mc-codegen.c mc-parse.c
diffstat 3 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mc-code-i64.c	Tue Nov 23 20:34:17 2010 +0900
+++ b/mc-code-i64.c	Tue Nov 23 21:59:14 2010 +0900
@@ -3221,7 +3221,9 @@
 void
 code_set_fixed_creg(int reg,int mode,int type) {
     if (type==FLOAT||type==DOUBLE) {
+	set_freg(reg,mode);
     } else if (type==LONGLONG||type==ULONGLONG) {
+	set_ireg(reg,mode);
     } else {
 	set_ireg(reg,mode);
     }
@@ -3374,7 +3376,7 @@
 emit_longlong(int e)
 {
 #if LONGLONG_CODE
-    long long ll = lcadr(e);
+    long long ll = car(e)==CONST?cadr(e):lcadr(e);
     data_mode(0);
     printf("\t.quad\t0x%llx\n",ll);
 #endif
--- a/mc-codegen.c	Tue Nov 23 20:34:17 2010 +0900
+++ b/mc-codegen.c	Tue Nov 23 21:59:14 2010 +0900
@@ -3681,10 +3681,10 @@
 {
 	switch(car(e)) {
 	case CONST:
-	    if (lp64) emit_longlong(cadr(e)); else emit_int(cadr(e));
+	    if (lp64) emit_longlong(e); else emit_int(cadr(e));
 	    return 1;
 	case LCONST:
-	    if (lp64) emit_longlong(lcadr(e)); else emit_int(lcadr(e));
+	    if (lp64) emit_longlong(e); else emit_int(lcadr(e));
 	    return 1;
 	case ADDRESS:
 	    if (car(cadr(e))==GVAR)
--- a/mc-parse.c	Tue Nov 23 20:34:17 2010 +0900
+++ b/mc-parse.c	Tue Nov 23 21:59:14 2010 +0900
@@ -4891,7 +4891,7 @@
 	nptr = get_nptr();
 	nptr->dsp = strings = reverse0(strings);
 	int j;
-	for(j = strings, i = 0; j ; j = car(j)) {
+	for(j = strings, i = 0; j ; j = cadr(j)) {
 	    i += car(j);
 	}
 	symval = i;