changeset 399:9d0015a1fa54

lvar address fix
author kono
date Sat, 16 Oct 2004 10:29:51 +0900
parents bf583e04936f
children a9427845ca4c
files Changes mc-code-arm.c
diffstat 2 files changed, 21 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/Changes	Fri Oct 15 13:33:03 2004 +0900
+++ b/Changes	Sat Oct 16 10:29:51 2004 +0900
@@ -6044,3 +6044,18 @@
 は局所変数分だけ。fp の#4は戻り番地だけ?
 
 でも、それだと va_next が困るんだけど。
+
+Fri Oct 15 20:51:19 JST 2004
+
+        mov     r3, #0
+        str     r3, [sp, #0]
+        mov     r3, #1069547520
+        add     r3, r3, #3145728
+        ldr     r0, .L28+388
+        adr     r1, .L28+392
+        ldmia   r1, {r1-r2}     @ double
+        bl      printf
+
+ってわけで、またがったdouble/longは、半分だけレジスタに置かれる
+みたいね。
+
--- a/mc-code-arm.c	Fri Oct 15 13:33:03 2004 +0900
+++ b/mc-code-arm.c	Sat Oct 16 10:29:51 2004 +0900
@@ -448,7 +448,7 @@
 	trn = register_name(tmp = get_register());
 	disp = search_const(LVAR,glist2(lvar_offset_label,FUNC_LVAR(l)),&label);
         printf("\tldr\t%s, .L%d+%d\n",trn,label,disp);
-	printf("\tsub\t%s, fp, %s\n",register_name(creg),trn);
+	printf("\tadd\t%s, fp, %s\n",register_name(creg),trn);
     } else if (l>=ARG_LVAR_OFFSET) {  /* caller's arguments */
 	code_add(creg,CALLER_ARG(l-ARG_LVAR_OFFSET),REG_sp);
     } else { /* callee's arguments */
@@ -3814,11 +3814,11 @@
 dconst(int l,int h,double value)
 {
 #if ENDIAN==0
+    code_const(code_d1(value),h);
+    code_const(code_d2(value),l);
+#else
     code_const(code_d1(value),l);
     code_const(code_d2(value),h);
-#else
-    code_const(code_d1(value),h);
-    code_const(code_d2(value),l);
 #endif
 }
 
@@ -3854,10 +3854,10 @@
 	} else if (d) {
 #if ENDIAN==0
 	    disp = search_double_const(DCONST,
-		code_d1(value),code_d2(value),&label);
+		code_d2(value),code_d1(value),&label);
 #else
 	    disp = search_double_const(DCONST,
-		code_d2(value),code_d1(value),&label);
+		code_d1(value),code_d2(value),&label);
 #endif
 	    printf("\tldfd\t%s, .L%d+%d\n",frn,label,disp);
 	} else {