changeset 496:5640fb7a270d

more bugs...
author kono
date Thu, 22 Dec 2005 00:20:09 +0900
parents b6c10a4c0367
children dbbc07bca089
files Changes mc-code-powerpc.c test/basic.c test/bitfield1.c test/code-gen.c test/putenemy.c test/simp.c
diffstat 7 files changed, 95 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/Changes	Wed Dec 21 23:29:41 2005 +0900
+++ b/Changes	Thu Dec 22 00:20:09 2005 +0900
@@ -7447,3 +7447,8 @@
 来年は64bit version だな。
 
 今の実装でできるの?
+
+あぁあぁ、PowerPCのprintfがぼろぼろじゃん。っていうか、
+dots & freg  の扱いが間違ってるな。
+
+ia32 の cond の float も間違ってる。
--- a/mc-code-powerpc.c	Wed Dec 21 23:29:41 2005 +0900
+++ b/mc-code-powerpc.c	Thu Dec 22 00:20:09 2005 +0900
@@ -2122,9 +2122,9 @@
 		}
 	    }
 	    if (dots && freg_arg>=3 && freg_arg<MAX_INPUT_DREGISTER_VAR) { 
-		/* oh my god! 
+		/* 
                    it requires integer register and floating register and
-                   stack value. You are crazy.
+                   stack value.
                  */
 		arg_assign = list2(
 		    assign_expr0(list3(LVAR,caller_arg_offset_v(nargs),0),
--- a/test/basic.c	Wed Dec 21 23:29:41 2005 +0900
+++ b/test/basic.c	Thu Dec 22 00:20:09 2005 +0900
@@ -19,7 +19,7 @@
 extern float refff;
 #endif
 
-int i;
+int
 print(double d)
 {
     float f;
@@ -164,6 +164,67 @@
 
 }
 
+void
+double_int()
+{
+    printf("#0169:%d %f %f %f %f %f %f %f %f %f %f %f\n",
+            1,0.1,.2,.3,.4,.5,.6,.7,.8,.9,.1,.2);
+    printf("#0171:%d %d %f %f %f %f %f %f %f %f %f %f\n",
+            1,  1,.2,.3,.4,.5,.6,.7,.8,.9,.1,.2);
+    printf("#0173:%d %d %d %f %f %f %f %f %f %f %f %f\n",
+            1,  1, 2,.3,.4,.5,.6,.7,.8,.9,.1,.2);
+    printf("#0175:%d %d %d %d %f %f %f %f %f %f %f %f\n",
+            1,  1, 2, 3,.4,.5,.6,.7,.8,.9,.1,.2);
+    printf("#0177:%d %d %d %d %d %f %f %f %f %f %f %f\n",
+            1,  1, 2, 3, 4,.5,.6,.7,.8,.9,.1,.2);
+    printf("#0179:%d %d %d %d %d %d %f %f %f %f %f %f\n",
+            1,  1, 2, 3, 4, 5,.6,.7,.8,.9,.1,.2);
+    printf("#0181:%d %d %d %d %d %d %d %f %f %f %f %f\n",
+            1,  1, 2, 3, 4, 5, 6,.7,.8,.9,.1,.2);
+    printf("#0183:%d %d %d %d %d %d %d %d %f %f %f %f\n",
+            1,  1, 2, 3, 4, 5, 6, 7,.8,.9,.1,.2);
+    printf("#0185:%d %d %d %d %d %d %d %d %d %f %f %f\n",
+            1,  1, 2, 3, 4, 5, 6, 7, 8,.9,.1,.2);
+    printf("#0187:%d %d %d %d %d %d %d %d %d %d %f %f\n",
+            1,  1, 2, 3, 4, 5, 6, 7, 8, 9,.1,.2);
+    printf("#0189:%d %d %d %d %d %d %d %d %d %d %d %f\n",
+            1,  1, 2, 3, 4, 5, 6, 7, 8, 9, 1,.2);
+    printf("#0191:%d %d %d %d %d %d %d %d %d %d %d %d\n",
+            1,  1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2);
+
+    printf("#0194:%f %d %d %d %d %d %d %d %d %d %d %d\n",
+           .1,  1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2);
+    printf("#0196:%f %f %d %d %d %d %d %d %d %d %d %d\n",
+           .1, .1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2);
+    printf("#0198:%f %f %f %d %d %d %d %d %d %d %d %d\n",
+           .1, .1,.2, 3, 4, 5, 6, 7, 8, 9, 1, 2);
+    printf("#0200:%f %f %f %f %d %d %d %d %d %d %d %d\n",
+           .1, .1,.2,.3, 4, 5, 6, 7, 8, 9, 1, 2);
+    printf("#0202:%f %f %f %f %f %d %d %d %d %d %d %d\n",
+           .1, .1,.2,.3,.4, 5, 6, 7, 8, 9, 1, 2);
+    printf("#0204:%f %f %f %f %f %f %d %d %d %d %d %d\n",
+           .1, .1,.2,.3,.4,.5, 6, 7, 8, 9, 1, 2);
+    printf("#0206:%f %f %f %f %f %f %f %d %d %d %d %d\n",
+           .1, .1,.2,.3,.4,.5,.6, 7, 8, 9, 1, 2);
+    printf("#0208:%f %f %f %f %f %f %f %f %d %d %d %d\n",
+           .1, .1,.2,.3,.4,.5,.6,.7, 8, 9, 1, 2);
+    printf("#0210:%f %f %f %f %f %f %f %f %f %d %d %d\n",
+           .1, .1,.2,.3,.4,.5,.6,.7,.8, 9, 1, 2);
+    printf("#0212:%f %f %f %f %f %f %f %f %f %f %d %d\n",
+           .1, .1,.2,.3,.4,.5,.6,.7,.8,.9, 1, 2);
+    printf("#0214:%f %f %f %f %f %f %f %f %f %f %f %d\n",
+           .1, .1,.2,.3,.4,.5,.6,.7,.8,.9,.1, 2);
+    printf("#0216:%f %f %f %f %f %f %f %f %f %f %f %f\n",
+           .1, .1,.2,.3,.4,.5,.6,.7,.8,.9,.1,.2);
+
+    printf("#0219:%f %d %f %d %f %d %f %d %f %d %f %d\n",
+           .1,  1,.2, 3,.4, 5,.6, 7,.8, 9,.1, 2);
+
+    printf("#0222:%d %f %d %f %d %f %d %f %d %f %d %f\n",
+            1, .1, 2,.3, 4,.5, 6,.7, 8,.9, 1,.2);
+}
+
+
 int
 main() {
     print(1.0);
@@ -171,5 +232,6 @@
     print(1.234e10);
     print(1.234e-10);
     tmp1();
+    double_int();
     return 0;
 }
--- a/test/bitfield1.c	Wed Dec 21 23:29:41 2005 +0900
+++ b/test/bitfield1.c	Thu Dec 22 00:20:09 2005 +0900
@@ -80,33 +80,33 @@
 
      ll1.b.v = -1;
      printf("#0081:01:%llx\n",ll1.b.v);
-     printf("#0082:02:"); for(i=0;i<32;i++) printf("#0082:%02x",ll1.a[i]); printf("\n");
+     printf("#0082:02:"); for(i=0;i<32;i++) printf("#0082:%02x",ll1.a[i]); printf("#0082:\n");
      ll1.b.v = 0;
      ll1.b.w = -1;
-     printf("#0085:02:"); for(i=0;i<32;i++) printf("#0085:%02x",ll1.a[i]); printf("\n");
+     printf("#0085:02:"); for(i=0;i<32;i++) printf("#0085:%02x",ll1.a[i]); printf("#0085:\n");
      ll1.b.w = 0;
      ll1.b.x = -1;
-     printf("#0088:02:"); for(i=0;i<32;i++) printf("#0088:%02x",ll1.a[i]); printf("\n");
+     printf("#0088:02:"); for(i=0;i<32;i++) printf("#0088:%02x",ll1.a[i]); printf("#0088:\n");
 
      ll0.b.v = -1;
      printf("#0091:01:%llx\n",ll0.b.v);
-     printf("#0092:02:"); for(i=0;i<32;i++) printf("#0092:%02x",ll0.a[i]); printf("\n");
+     printf("#0092:02:"); for(i=0;i<32;i++) printf("#0092:%02x",ll0.a[i]); printf("#0092:\n");
      ll0.b.v = 0;
      ll0.b.w = -1;
-     printf("#0095:02:"); for(i=0;i<32;i++) printf("#0095:%02x",ll0.a[i]); printf("\n");
+     printf("#0095:02:"); for(i=0;i<32;i++) printf("#0095:%02x",ll0.a[i]); printf("#0095:\n");
      ll0.b.w = 0;
      ll0.b.x = -1;
-     printf("#0098:02:"); for(i=0;i<32;i++) printf("#0098:%02x",ll0.a[i]); printf("\n");
+     printf("#0098:02:"); for(i=0;i<32;i++) printf("#0098:%02x",ll0.a[i]); printf("#0098:\n");
 
      ll.b.v = -1;
      printf("#0101:1:%llx\n",ll.b.v);
-     printf("#0102:02:"); for(i=0;i<32;i++) printf("#0102:%02x",ll.a[i]); printf("\n");
+     printf("#0102:02:"); for(i=0;i<32;i++) printf("#0102:%02x",ll.a[i]); printf("#0102:\n");
      ll.b.v = 0;
      ll.b.w = -1;
-     printf("#0105:02:"); for(i=0;i<32;i++) printf("#0105:%02x",ll.a[i]); printf("\n");
+     printf("#0105:02:"); for(i=0;i<32;i++) printf("#0105:%02x",ll.a[i]); printf("#0105:\n");
      ll.b.w = 0;
      ll.b.x = -1;
-     printf("#0108:02:"); for(i=0;i<32;i++) printf("#0108:%02x",ll.a[i]); printf("\n");
+     printf("#0108:02:"); for(i=0;i<32;i++) printf("#0108:%02x",ll.a[i]); printf("#0108:\n");
 
      printf("#0110:char a:1; char b:4; char c:7; char d:4; char e:4; char f:4;\n");
      cc.b.a = -1;
--- a/test/code-gen.c	Wed Dec 21 23:29:41 2005 +0900
+++ b/test/code-gen.c	Thu Dec 22 00:20:09 2005 +0900
@@ -3442,9 +3442,9 @@
 
     for(i=0;i<2;i++) {
 	k = i==0? -4:4;
-	printf("#3444: cond_lll %dll\n",k);
+	printf("#3444: cond_lll %lld\n",k);
 	k = i==0? i:j;
-	printf("#3446: cond_lll %dll\n",k);
+	printf("#3446: cond_lll %lld\n",k);
     }
 }
 
@@ -3456,9 +3456,9 @@
 
     for(i=0;i<2;i++) {
 	k = i==0? -4:4;
-	printf("#3458: cond_ulll %ull\n",k);
+	printf("#3458: cond_ulll %llu\n",k);
 	k = i==0? i:j;
-	printf("#3460: cond_ulll %ull\n",k);
+	printf("#3460: cond_ulll %llu\n",k);
     }
 }
 
@@ -3470,9 +3470,9 @@
 
     for(i=0;i<2;i++) {
 	k = i==0? -4:4;
-	printf("#3472: cond_luu %dll\n",k);
+	printf("#3472: cond_luu %lld\n",k);
 	k = i==0? i:j;
-	printf("#3474: cond_luu %dll\n",k);
+	printf("#3474: cond_luu %lld\n",k);
     }
 }
 
--- a/test/putenemy.c	Wed Dec 21 23:29:41 2005 +0900
+++ b/test/putenemy.c	Thu Dec 22 00:20:09 2005 +0900
@@ -2,9 +2,9 @@
 void
 Putenemy(int charno,float x,float y,float sx,float sy,int move) {
      if(x)
-          printf("%d %f %f %f %f %d\n",charno,x,y,sx,sy,move);
+          printf("#0004:%d %f %f %f %f %d\n",charno,x,y,sx,sy,move);
      else
-          printf("check\n");
+          printf("#0006:check\n");
 }
 int
 main()
--- a/test/simp.c	Wed Dec 21 23:29:41 2005 +0900
+++ b/test/simp.c	Thu Dec 22 00:20:09 2005 +0900
@@ -16,9 +16,9 @@
 {
     int i;
 
-    printf("#0013:%d\n",ac);
+    printf("#0018:%d\n",ac);
     for(i=0;i<ac;i++) {
-	printf("#0015:%s\n",&av[i][3]);
+	printf("#0020:%s\n",&av[i][3]);
     }
     ch = 'E';
     main1(-8);
@@ -32,21 +32,21 @@
 char *av[];
 {
     int i;
-    printf("#0028:%d %c\n",ac,ch);
+    printf("#0034:%d %c\n",ac,ch);
     for(i=0;i<ac;i++) {
-	printf("#0030:%s\n",&av[i][3]);
+	printf("#0036:%s\n",&av[i][3]);
     }
-    printf("#0032:%d==1\n",alpha(ch));
+    printf("#0038:%d==1\n",alpha(ch));
     return 0;
 }
 
 void
 main1(int l)
 {
-   printf("#0038:%d\n", ((l+0)<-511||(l+0)>511));
-   if ((l+0)<-511||(l+0)>511) printf("#0039:yes\n");
+   printf("#0045:%d\n", ((l+0)<-511||(l+0)>511));
+   if ((l+0)<-511||(l+0)>511) printf("#0046:yes\n");
    l = -1;
-   printf("#0041:%d\n", l==-1? 555:333);
+   printf("#0048:%d\n", l==-1? 555:333);
 }