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

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



Nice work !!

I was really interrested of the code size. How much instruction for a
fonction like printf compare to x86 or sparc ?

-----Message d'origine-----
De: devik <devik@cdi.cz>
A: <f-cpu@seul.org>
Date: 03/12/02
Objet: [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


_____________________________________________________________________
GRAND JEU SMS : Pour gagner un NOKIA 7650, envoyez le mot IF au 61321
(prix d'un SMS + 0.35 euro). Un SMS vous dira si vous avez gagné.
Règlement : http://www.ifrance.com/_reloc/sign.sms

*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/