small c compiler status...

Eric W. Biederman ebiederman at lnxi.com
Wed Mar 26 02:49:00 CET 2003


O.k.  I have been going incrementally and have just finished
the register allocator.  I built the compiler on an optimization
framework which took a little more work than I expected but things
have been going good so far.

My test code base is the L440GX ram initialization in C, that I wrong
a while ago.    With a small change smbus_read_byte so that it does
not take a pointer argument but instead does the classic getchar trick
for return a status and a data byte in the same return value.

So far it compiles it all with just 8 registers except for 2 lines of
code.  So a little bit of tweaking of will probably be called for.

I will publish the code as soon as I have it generating x86 assembly.
The big thing I want to measure now is how much of a code size
increase all of that unconditional inline gives.  If it significant I
have a optimization on the back burner that will not inline a function
if there are sufficient registers available to call it out of line.

Upgrading the compiler to optionally use the MMX and/or the SSE
registers for additional storage should take about an hour.  The
generic code really does not care.  Of almost as much usefulness
I have not yet implemented constant propagation which should reduce
the register pressure as well.

The compiler itself is probably not especially shareable with other
projects as it first and foremost optimizes register usage.  But
I don't think it will be a major maintenance burden either.  So far
it comes to about 8000 lines of code with a noticeable chunk of that
being code to dump the the various forms of intermediate code.  Though
I expect it to probably stabilize around 10000 lines of code.

My tentative name for the compiler is romcc.  If anyone has a better
one I'm all ears.   So far romcc is the only name I have thought of
that someone else isn't already using.

Eric




More information about the coreboot mailing list