changeset 780:c5315f472912

ia32/powerpc regression test
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Fri, 19 Nov 2010 16:39:48 +0900
parents a0f84a0a990a
children b8cb4e1ac922
files Makefile mc-code-ia32.c mc-code-powerpc.c mc-codegen.c
diffstat 4 files changed, 9 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Fri Nov 19 14:09:56 2010 +0900
+++ b/Makefile	Fri Nov 19 16:39:48 2010 +0900
@@ -231,7 +231,7 @@
                 mc-code-mips.c
 
 clean :
-	-rm -f mc mc-spu mc-ia32 mc-powerpc mc-mips mc-arm *.bak *.s *.o *.cc mc mc1 mc2 a.out *~ core* */*.o *.bak test/*.s test/*.cc test/*.o test/*.bak test/*~ conv/*.s conv/*.cc conv/*.o conv/*.bak conv/*~ *.out */*.out *.i */*.i mc-include.c
+	-rm -rf mc mc-spu mc-ia32 mc-powerpc mc-mips mc-arm *.bak *.s *.o *.cc mc mc1 mc2 a.out *~ core* */*.o *.bak test/*.s test/*.cc test/*.o test/*.bak test/*~ conv/*.s conv/*.cc conv/*.o conv/*.bak conv/*~ *.out */*.out *.i */*.i mc-include.c *.dSYM
 
 mc1 : b00.s b01.s mc-codegen.o mc-tree.o mc-switch.o mc-macro.o mc-inline.o $(CONVERTER)
 	$(CC) -g -o $@ $(PRINTF) b00.s b01.s mc-codegen.o mc-tree.o mc-switch.o mc-macro.o mc-inline.o $(CONVERTER)
--- a/mc-code-ia32.c	Fri Nov 19 14:09:56 2010 +0900
+++ b/mc-code-ia32.c	Fri Nov 19 16:39:48 2010 +0900
@@ -3161,7 +3161,7 @@
     int sz;
     Value value;
     value.d = dcadr(e2);
-    use_float(d,freg);
+    // use_float(d,freg);
     if (value.d==0.0) {
 	printf("\tfldz\n"); return;
     }
@@ -3178,9 +3178,9 @@
     long d_mode = d;
     int lb = get_data_label(&value,sz,emit_dconst0, (void*) d_mode);
 #ifdef __APPLE__
-    printf("\tfldl _%d-_%d(%%ebx)\n",lb,goffset_label);
+    printf("\t%s _%d-_%d(%%ebx)\n",fload(d),lb,goffset_label);
 #else
-    printf("\tfldl _%d\n",lb);
+    printf("\t%s _%d\n",fload(d),lb);
 #endif
 }
 
--- a/mc-code-powerpc.c	Fri Nov 19 14:09:56 2010 +0900
+++ b/mc-code-powerpc.c	Fri Nov 19 16:39:48 2010 +0900
@@ -4246,7 +4246,6 @@
 {
     long d = (long) arg;
     printf(" \t.data\n\t.align 3\n");
-    lb=fwdlabel();
     printf("%s%d:\n",lpfx,lb);
     if (d) {
 #if ENDIAN_D==0
@@ -4255,7 +4254,7 @@
 	printf("\t.long\t0x%x,0x%x\n",code_d2(value->d),code_d1(value->d));
 #endif
     } else {
-	printf("\t.long\t0x%x\n",code_f(value->i));
+	printf("\t.long\t0x%x\n",code_f(value->f));
     }
     if (output_mode==TEXT_EMIT_MODE) {
 	printf(".text\n");
@@ -4271,7 +4270,7 @@
 void
 code_dconst(int e2,int freg,int d)
 { 
-    int lb;
+    int sz;
     Value value;
     value.d = dcadr(e2);
     int r;
@@ -4303,7 +4302,7 @@
     int lb = get_data_label(&value,sz,emit_dconst0, (void*) d_mode);
 
     rrn = register_name((r=get_register()));
-    use_reg(r); // to clear ptr cache
+    // use_reg(r); // to clear ptr cache
     code_label_value(lb,r);
     if (d) {
 	printf("\tlfd %s,0(%s)\n",frn,rrn);
--- a/mc-codegen.c	Fri Nov 19 14:09:56 2010 +0900
+++ b/mc-codegen.c	Fri Nov 19 16:39:48 2010 +0900
@@ -1923,8 +1923,8 @@
     case LVAR:     code_lvar(cadr(e4),reg);   return;
     case CONST:    code_const(cadr(e4),reg); return;
     case ADDRESS: 
-	if (car(cadr(e4))==STRING) code_string(cadr(e4),reg);
-	if (car(cadr(e4))==STRINGS) {
+	if (car(cadr(e4))==STRING) { code_string(cadr(e4),reg);
+	} else if (car(cadr(e4))==STRINGS) {
 	    code_strings(cadr(e4),reg);
 	} else code_gvar(cadr(e4),reg);   
 	return;