tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Modularisation


From: Peter \"Firefly\" Lund
Subject: Re: [Tinycc-devel] Modularisation
Date: Thu, 6 Mar 2003 17:15:25 +0100 (MET)

On Thu, 6 Mar 2003, Laurent DESNOGUES wrote:

>    The PS2 has a 64 bit little-endian processor, so I
> may hit assumptions about integer/pointer sizes...

If you are going to work on that, I think most of the work towards a
recent pet idea of mine will be done.

The idea is to be able to tell the compiler what size pointers/ints/longs
to use (and perhaps also endianness) and then just Make it Work on
whatever CPU/platform you are coding for.

I realise that calls to standard libraries will be difficult to handle.
There needs to be some sort of endianness storage modifier attached to
every short/int/long/pointer in the program together with implicit casts
in functions calls.

I think it would make cross platform development so much easier :)

>    My guess is that the main problem will be in the
> ABI.  The MIPS ABI used by PS2Linux expects params in
> registers whereas the x86 ABI expects them in the
> stack IIRC.  Anyway it will just be a matter of moving
> things around...

You should be able to fix that by working on the function
prologue/epilogue and on the parameter passing/call mechanism.  Should be
rather isolated.

Of course you won't get /good/ code that way -- but you need proper
register allocation (graph colouring) over whole functions instead of
as-you-go on expressions to get good code on a non-register starved
machine anyway.

-Peter

``Average programmers should be rounded up and placed in internment camps
to keep them away from keyboards.''




reply via email to

[Prev in Thread] Current Thread [Next in Thread]