[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [f-cpu] GCC 3.1 for F-CPU port



Very interesting...

but why 'short' is 32-bit ??? (I can see ".d" in your generated code)


----- Original Message ----- 
From: "devik" <devik@cdi.cz>
To: <f-cpu@seul.org>
Sent: Tuesday, December 03, 2002 2:53 AM
Subject: [f-cpu] GCC 3.1 for F-CPU port


> Hi,
> there was a lot of discussion about ISA. Lets create
> assembler, emulator and compiler and test it (boot
> linux kernel for example and count cycles it takes
> until /sbin/init is launched).
> As maintainer of part of Linux kernel I know that if
> I want to bug people with my ideas I should also do
> something.
> I created port of GCC for F-CPU. Just now it compiles
> rather complex functions however there are known bugs
> in stack handling (pointer inc) and some others.
> Also insns other than add and shift should be add (just
> now gcc uses its libs).
> There is problem with jump optimizer because it needs
> labels tied to jumps but we have them in registers. Just
> now I suppose assembler to handle it (ineffecient).
> Also conditional branching is not tuned - it supresses
> loop optimization :(
> 
> But at least something to play with :)
> Test:
> long f(short a,short b)
> {
>     short i;
>     for (i=(short)0;i<(short)10;i++) a += b;
>     return a+(long)0x100000;
> }
> 
> ; FCPU ASM; CC by devik@cdi.cz.text
> .extern f
> f:
>     move.d a0,a3
>     loadcons.0 0,a2
>     loadcons.0 9,a4
> @L6:
>     addi.d 1,a2,a2
>     add.d a3,a1,a3
>     cmples.d a4,a2,a0
>     jmp_direct.nz a0,@L6
>     widen.d a3,a1
>     bseti log2(1048576),r0,a0
>     add a0,a1,rv
>     jmp ra
> 
> 
*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/