Mercurial > hg > CbC > old > device
changeset 410:5a3b1b65c6a8
ARM self compile almost passed.
author | kono |
---|---|
date | Tue, 19 Oct 2004 16:01:15 +0900 |
parents | b72682778d75 |
children | 32c1914308db |
files | .gdbinit .gdbinit.arm Changes mc-code-arm.c mc-code-mips.c stdio.h |
diffstat | 6 files changed, 75 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/.gdbinit Tue Oct 19 09:14:01 2004 +0900 +++ b/.gdbinit Tue Oct 19 16:01:15 2004 +0900 @@ -1,6 +1,6 @@ tb main # run -s test/arg.c -# run -s mc-parse.c +run -s mc-parse.c # run -s mc-codegen.c # run -s nkf203/nkf.c # run -s -ob01.s mc-switch.c @@ -8,7 +8,7 @@ # run -s test/const.c # run -s test/basic.c # run -s test/code-gen-all.c -run -s test/tmp7.c +# run -s test/tmp7.c define regs printf "pc =%08x lr =%08x r0 =%08x r1 =%08x r3= %08x r4= %08x\n",$pc,$lr,$r0,$r1,$r3,$r4 printf "r10=%08x r11=%08x r12=%08x r13=%08x r14=%08x r15=%08x\n",$r10,$r11,$r12,$r13,$r14,$r15
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.gdbinit.arm Tue Oct 19 16:01:15 2004 +0900 @@ -0,0 +1,39 @@ +tb main +# run -s test/arg.c +# run -s mc-parse.c +# run -s mc-codegen.c +# run -s nkf203/nkf.c +# run -s -ob01.s mc-switch.c +# run -s l.c +run -s test/bitfield.c +# run -s test/basic.c +# run -s test/code-gen-all.c +define regs +printf "pc=%08x lr=%08x r0=%08x r1=%08x r2=%08x r3=%08x r4=%08x\n",$pc,$lr,$r0,$r1,$r2,$r3,$r4 +printf "r5=%08x r6=%08x r7=%08x r8=%08x r9=%08x\n",$r5,$r6,$r7,$r8,$r9 +end +define fregs +printf "f1=%g f2=%g f3=%g f4=%g f5=%g f6=%g\n",$f1,$f2,$f3,$f4,$f5,$f6 +printf "f10=%g f11=%g f12=%g f13=%g f14=%g f15=%g\n",$f10,$f11,$f12,$f13,$f14,$f15 +end +define allreg +printf "pc =%08x lr =%08x r0 =%08x r1 =%08x r3= %08x r4= %08x\n",$pc,$lr,$r0,$r1,$r3,$r4 +printf "r5=%08x r6=%08x r7=%08x r8=%08x r9=%08x\n",$r5,$r6,$r7,$r8,$r9 +printf "sl=%08x lr=%08x ip=%08x fp=%08x sp=%08x pc=%08x\n",$sl,$lr,$ip,$fp,$sp,$pc +printf "f1=%g f2=%g f3=%g f4=%g f5=%g f6=%g f7=%g\n",$f1,$f2,$f3,$f4,$f5,$f6,$f7 +end +define sh +regs +x/20i $pc-36 +end +define si +stepi +regs +x/1i $pc +end +define ni +nexti +regs +x/1i $pc +end +b errmsg
--- a/Changes Tue Oct 19 09:14:01 2004 +0900 +++ b/Changes Tue Oct 19 16:01:15 2004 +0900 @@ -6130,3 +6130,28 @@ 残りは、stdarg と bitfield だけか。まぁ、いいんじゃない? stdarg は、 stdarg.h を自分で作れば良いみたい。 +Tue Oct 19 11:12:16 JST 2004 + +また、? のエラーか。 +## mode=(s==STRUCT?GSDECL:GUDECL); +# 1287: : creg=r4 freg=f0 + ldr r4, [fp, #4] + mvn r7, #6 + cmp r4, r7 + bne .L713 + mov r7, #2 + b .L714 +.L713: + mov r7, #3 + mov r0, r7 +.L714: + ldr r7, .L709+4 + str r0, [r7, #0] +テストルーチンが必要だね。 + +(MIPSとかPowerPCとか、だいぶ壊しちゃったみたい...) + +C との呼出しがずれている(やっぱりレジスタ?) mc と gcc のオブジェクトを +混在させるとだめだね。 + +浮動小数点関係の Endian がおかしい
--- a/mc-code-arm.c Tue Oct 19 09:14:01 2004 +0900 +++ b/mc-code-arm.c Tue Oct 19 16:01:15 2004 +0900 @@ -478,9 +478,8 @@ /* #define __builtin_va_list int */\n\ /* #define __builtin_va_start(ap,arg) ap=(((int)(&arg))+sizeof(arg)) */\n\ /* #define __builtin_va_arg(ap,type) (*((type *)ap)++) */\n\ -#define __builtin_next_arg(arg) (__gnuc_va_list)((char *)(&arg) + __va_rounded_size (typeof(arg))) +#define __builtin_next_arg(arg) (__gnuc_va_list)((char *)(&arg) + __va_rounded_size (typeof(arg)))\n\ #define __arm__ 1\n\ -#define __LITTLE_ENDIAN__ 1\n\ #define __inline__\n\ #define __STDC__ 1\n\ #define __SIZE_TYPE__ int\n\ @@ -3411,6 +3410,7 @@ default: if (reg==USE_CREG) { if (regs[CREG_REGISTER]==0||regs[CREG_REGISTER]==PTRC_REG) { + set_ireg(CREG_REGISTER,is_int_reg(creg)&®s[creg]==USING_REG); return CREG_REGISTER; } } @@ -3872,11 +3872,11 @@ dconst(int l,int h,double value) { #if ENDIAN==0 + 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); -#else - code_const(code_d1(value),l); - code_const(code_d2(value),h); #endif } @@ -4932,7 +4932,7 @@ code_ldf(cstore(0),lregister_name_low(creg),cadr(e2),r,""); code_ldf(cstore(0),lregister_name_high(creg),cadr(e2)+SIZE_OF_INT,r,""); #else - code_ldf(cstore(0),lregister_name_high(creg),cadr(e2),r); + code_ldf(cstore(0),lregister_name_high(creg),cadr(e2),r,""); code_ldf(cstore(0),lregister_name_low(creg),cadr(e2)+SIZE_OF_INT,r,""); #endif } @@ -5022,7 +5022,7 @@ code_ldf("ldr",crn_l,cadr(e1),r,""); code_ldf("ldr",crn_h,cadr(e1)+SIZE_OF_INT,r,""); #else - code_ldf("ldr",crn_h,cadr(e1),r); + code_ldf("ldr",crn_h,cadr(e1),r,""); code_ldf("ldr",crn_l,cadr(e1)+SIZE_OF_INT,r,""); #endif }
--- a/mc-code-mips.c Tue Oct 19 09:14:01 2004 +0900 +++ b/mc-code-mips.c Tue Oct 19 16:01:15 2004 +0900 @@ -3172,6 +3172,7 @@ default: if (reg==USE_CREG) { if (regs[CREG_REGISTER]==0||regs[CREG_REGISTER]==PTRC_REG) { + set_ireg(CREG_REGISTER,is_int_reg(creg)&®s[creg]==USING_REG); return CREG_REGISTER; } }