changeset 904:6f9513a6a37f

Linux i64 error
author kono
date Tue, 08 Apr 2014 12:10:52 +0900
parents b885e393a2bd
children df2d5295218f
files Makefile mc-code-i64.c
diffstat 2 files changed, 35 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Tue Apr 08 11:24:32 2014 +0900
+++ b/Makefile	Tue Apr 08 12:10:52 2014 +0900
@@ -214,10 +214,10 @@
 incpri:
 	perl tools/incpri.pl test/*.c
 
-tags:   tags-$(ARCH)
+tags:    # tags-$(ARCH)
 
 tags-$(ARCH):  
-	ctags -w mc.h mc-code.h mc-code-$(ARCH).c  mc-codegen.c mc-codegen.h \
+	-ctags -w mc.h mc-code.h mc-code-$(ARCH).c  mc-codegen.c mc-codegen.h \
 		mc-parse.h mc-tree.c mc-inline.h mc-switch.h \
 		mc-macro.h mc-macro.c \
 	    conv/c.c conv/c.h \
--- a/mc-code-i64.c	Tue Apr 08 11:24:32 2014 +0900
+++ b/mc-code-i64.c	Tue Apr 08 12:10:52 2014 +0900
@@ -529,9 +529,10 @@
 static 
 NMTBL float_one_f = {"_float_one_f",0,STATIC,FLOAT,0};
 
+#ifdef __APPLE__
 static char *float_one_lib[] = {
-  "        .literal8",
-"        .align 3",
+//  "        .literal8",
+"        .align 8",
 "__float_one:",
 "        .long   0",
 "        .long   1072693248",
@@ -539,12 +540,30 @@
 };
 
 static char *float_one_f_lib[] = {
-  "        .literal4",
-  "        .align 2",
+//  "        .literal4",
+  "        .align 4",
   "__float_one_f:",
   "        .long   1065353216",
         0
 };
+#else
+static char *float_one_lib[] = {
+//  "        .literal8",
+"        .align 8",
+"_float_one:",
+"        .long   0",
+"        .long   1072693248",
+        0
+};
+
+static char *float_one_f_lib[] = {
+//  "        .literal4",
+  "        .align 4",
+  "_float_one_f:",
+  "        .long   1065353216",
+        0
+};
+#endif
 
 
 /*
@@ -2373,7 +2392,11 @@
 code_call(int e2,NMTBL *fn,int jmp)
 {
     if (car(e2) == FNAME) {     
+#ifdef __APPLE__
         printf("\tcall\t_%s\n",fn->nm);
+#else
+        printf("\tcall\t%s\n",fn->nm);
+#endif
     } else {
         printf("\tcall\t*%s\n",register_name(REG_R10,0));
     }
@@ -4238,7 +4261,6 @@
 code_dload_1(int d, int g)
 {
     int r;
-    char *drn,*grn;
     NMTBL *one;
     // load 1
     if (d) {
@@ -4248,10 +4270,14 @@
         float_one_f_lib_used=1;
         one = &float_one_f;
     }
+    char *grn=fregister_name(g);
+#ifdef __APPLE__
     r = get_ptr_cache(one);
-    drn=register_name(r,0);
-    grn=fregister_name(g);
+    char *drn=register_name(r,0);
     printf("\tmovs%s 0(%s),%s\n",d?"d":"s",drn,grn);
+#else
+    printf("\tmovs%s %s,%s\n",d?"d":"s",one->nm,grn);
+#endif
     return g;
 }