tinycc-devel
[Top][All Lists]
Advanced

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

RE: [Tinycc-devel] C6x Port


From: Peter \"Firefly\" Lund
Subject: RE: [Tinycc-devel] C6x Port
Date: Sat, 8 Mar 2003 01:24:20 +0100 (MET)

On Fri, 7 Mar 2003, Peter "Firefly" Lund wrote:

> On Fri, 7 Mar 2003, Tom Kerekes wrote:
>
> > Yes.  Basically 1 instruction per cycle as well as nops placed after so
> > the next bit of code can't use a result before it is ready.  This makes
> > the generated code look really silly.  Probably a second pass could be
> > added to eliminate unnecessary nops, store/loads, and even parallel up
> > some things.  My main emphasis was getting it to generate correct code.

I have now found some time to glance through the code.  After doing the
obvious things (telling unzip to do text file conversion, renaming tcc.cpp
back to tcc.c, adding more files to my list of files to exclude from the
diff) I got a gargantuan patch of slightly over 160K.

Some of this is "noise", though:

 o a few changes to tcctest.c that shouldn't have happened.
 o casts of return values from tcc_mallocz() because tcc.c was renamed to
   tcc.cpp and C++ doesn't allow implicit coercions from void * to any
   other kind of pointer whereas C does.
 o at least one case of whitespace change (spurious tab before sh_offset
   in elf.h).
 o TheTCCState doesn't seem to be used.

At least one of the types also seems to have been changed:

  CString -> CTString

Another contributor to the size is the fact that Tom has done some of the
modularization work (creation of tcc.h, separate compilation of tcc.cpp
and WriteCoff.cpp).  Nice, but it does make comparisons and merging of the
source a bit harder ;)

diffstat:
 TCC67/COFF.H            |only
 TCC67/WriteCoff.cpp     |only
 TCC67/WriteCoff.h       |only
 TCC67/elf.h             |   29
 TCC67/i386-asm.c        |   17
 TCC67/i386-gen.c        | 2790 +++++++++++++++++++++++++++++++++++++++++++++++-
 TCC67/i386-gen.original |only
 TCC67/libtcc.h          |    4
 TCC67/out.txt           |only
 TCC67/tcc.c             |  625 +++-------
 TCC67/tcc.h             |only
 TCC67/tccasm.c          |   34
 TCC67/tccelf.c          |  282 +++-
 TCC67/tcctest.c         |   14
 tcc-0.9.16/tcc_g        |only
 tcc-0.9.16/tcctest.ref  |only
 tcc-0.9.16/test.out2    |only
 tcc-0.9.16/test.ref     |only
 18 files changed, 3246 insertions(+), 549 deletions(-)

As you can see, I need to add *.ref and *.out2 to my list of files to
exclude from the diff :)

Tom, there's one thing I'm curious about:  why did you interweave the new
code generator with the old one in i386-gen.c instead of making a new
"stand-alone" generator based on i386-gen.c?

My experience agrees completely with the view expressed in:

    "#ifdef Considered Harmful, or Portability Experience With C News",
    Henry Spencer and Geoff Collyer.

    http://www.chris-lott.org/resources/cstyle/ifdefs.pdf

-Peter




reply via email to

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