Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Retargeting lcc for our architecture

211 views
Skip to first unread message

Jesse Leonard Marlin

unread,
Apr 13, 1996, 3:00:00 AM4/13/96
to
In our senior design course we designed a microprocessor, without
going into the specifics of the design we are interested in finding
some info on retargeting it with lcc. In general the steps involved
in redesigning the compiler. We have looked at the source code and it
is a lot to take in one quarter. I wonder if there are specific files
that we are supposed to modify. The processor is based on MIPS
architecture. Any help related to this would be greatly
appreciated. Also I have looked at the lcc home page and have bought
the book (A Retargetable C Compiler, by Hanson and Fraser), they are
both cryptic in describing the steps needed in retargeting. They tend
to describe the steps in designing a compiler. Thanks in advance.

l8er
--
Send compilers articles to comp...@iecc.com,
meta-mail to compiler...@iecc.com.

Chris Fraser

unread,
Apr 14, 1996, 3:00:00 AM4/14/96
to
If your processor does indeed share a lot with the MIPS, then you can
probably retarget lcc by editing a copy of the file "mips.md" and
little or nothing else. You don't have to read all of the book; read
Chapters 5 and 16 for sure, and probably 13 and 14 too, because they
tell you the most about the one file that you'll be modifying. Good
luck.

Chris Fraser, Bell Labs

Michael J. Wirthlin

unread,
Apr 16, 1996, 3:00:00 AM4/16/96
to

Chris Fraser <c...@research.att.com> writes:
|> If your processor does indeed share a lot with the MIPS, then you can
|> probably retarget lcc by editing a copy of the file "mips.md" and
|> little or nothing else. You don't have to read all of the book; read
|> Chapters 5 and 16 for sure, and probably 13 and 14 too, because they
|> tell you the most about the one file that you'll be modifying. Good
|> luck.

We found porting lcc to 'MIPs like' processors quite straight-forward.
Using an existing .md file is the best way to start. We did find,
however, that porting lcc to register or stack-based machines
non-trivial. Has anybody else ported lcc to non-register based
machines? We had problems disabling the register allocator (especially
for temporaries).

- Mike

Larry Rau

unread,
Apr 16, 1996, 3:00:00 AM4/16/96
to
Has anyone ever taken lcc and pasted a new language frontend on top?

If this was to be done what would be the best method? Generate the
same tree's as lcc or generate DAGS directly??

Could the lcc symbol table be used? perhaps modified a little for
languages with different scoping.

I have the lcc book and I belive they mentioned things like this in
the book, but has anyone ever tried it?

.....thanks........larry
[Having been one of the earlier suckers who spliced a Fortran front end onto
a C compiler (a little earlier than f77) I can report that small semantic
differences between analogous constructs in different languages can drive
you nuts, particularly if you want to code to be good. -John]

Ram Meenakshisundaram

unread,
Apr 19, 1996, 3:00:00 AM4/19/96
to

Chris Fraser <c...@research.att.com> writes:
|> If your processor does indeed share a lot with the MIPS, then you can
|> probably retarget lcc by editing a copy of the file "mips.md" and
|> little or nothing else. ...

Michael J. Wirthlin (wirt...@fpga.ee.byu.edu) wrote:
: We found porting lcc to 'MIPs like' processors quite straight-forward.
: ... Has anybody else ported lcc to non-register based


: machines? We had problems disabling the register allocator (especially
: for temporaries).

Micheal Haardt ported lcc to the transputers, which is pretty much a
stack-based machine. Check out the source in ftp://unix.hensa.ac.uk under
/parallel/transputer/software/oses/minix/aachen. Good luck...


Ram
Ram Meenakshisundaram
Systems Administrator
BlackRock Financial Management Inc
Phone: (212) 754-5577
dEmail: rmee...@bfm.com

0 new messages