From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29017 invoked by alias); 27 Feb 2002 12:33:08 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 28792 invoked from network); 27 Feb 2002 12:32:47 -0000 Received: from unknown (HELO malonne.lifl.fr) (134.206.10.29) by sources.redhat.com with SMTP; 27 Feb 2002 12:32:47 -0000 Received: from lifl.lifl.fr (lifl.lifl.fr [134.206.10.18]) by malonne.lifl.fr (8.9.3/jtpda-5.3.3) with ESMTP id NAA26351 for ; Wed, 27 Feb 2002 13:32:46 +0100 (MET) Received: from localhost.localdomain (gnurou@bruyere [134.206.11.7]) by lifl.lifl.fr (8.9.3/jtpda-5.3.3) with ESMTP id NAA18493 for ; Wed, 27 Feb 2002 13:32:45 +0100 (MET) Subject: Porting GCC to a register-less, stack-less architecture From: Alexandre Courbot To: GCC List Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Evolution/1.0.2 Date: Wed, 27 Feb 2002 05:06:00 -0000 Message-Id: <1014814467.18242.28.camel@bruyere> Mime-Version: 1.0 X-SW-Source: 2002-02/txt/msg01640.txt.bz2 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.