# HG changeset patch # User kono # Date 1097890191 -32400 # Node ID 9d0015a1fa54d3ab23efaf0d90966f53c10194ec # Parent bf583e04936f5e363b1a7caf7c223b05f5593c92 lvar address fix diff -r bf583e04936f -r 9d0015a1fa54 Changes --- 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は、半分だけレジスタに置かれる +みたいね。 + diff -r bf583e04936f -r 9d0015a1fa54 mc-code-arm.c --- 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 {