This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Porting GCC to a register-less, stack-less architecture
- From: Alexandre Courbot <Alexandre dot Courbot at lifl dot fr>
- To: GCC List <gcc at gcc dot gnu dot org>
- Date: 27 Feb 2002 13:54:26 +0100
- Subject: Porting GCC to a register-less, stack-less architecture
Hello everybody,
I'm currently trying to port GCC to a new Smartcard architecture that
has been developped in my university labs. This architecture doesn't
have any hardware register or any stack (all the operations are handled
in memory), which raises a lot of questions about the porting.
I've seen that many MD macros are dealing with hard registers. But I
have nothing to fill them with. I had to define FIRST_PSEUDO_REGISTER to
0, and of course some registers arrays (as reg_names) have a size of 0.
Can I write a machine description for a register-less machine? Shall I
emulate hard-registers and stack by using variables, which would result
in an overhead? Do you guys have some general advices for porting GCC to
such an architecture?
Also more generally, and as writing a MD for the first time is quite a
hard sport, could someone point me to a very simple (simplistic?) MD
example or template for GCC 3, if it exists? The ones that are provided
with the sources are quite complex, and although the manual is very
complete and helpfull in that respect, I'm rather the kind of guy who
learn by example. I'd like to come as fast as possible with a very basic
"working" compiler, so I can tune it step by step and experiment code
generation.
Thank you for your time,
Alexandre Courbot.