From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22903 invoked by alias); 30 Nov 2011 14:03:56 -0000 Received: (qmail 22893 invoked by uid 22791); 30 Nov 2011 14:03:55 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-ey0-f175.google.com (HELO mail-ey0-f175.google.com) (209.85.215.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 30 Nov 2011 14:03:41 +0000 Received: by eaad13 with SMTP id d13so750169eaa.20 for ; Wed, 30 Nov 2011 06:03:40 -0800 (PST) MIME-Version: 1.0 Received: by 10.213.27.205 with SMTP id j13mr368318ebc.104.1322661820361; Wed, 30 Nov 2011 06:03:40 -0800 (PST) Received: by 10.14.28.7 with HTTP; Wed, 30 Nov 2011 06:03:40 -0800 (PST) In-Reply-To: <4ED5FA7C.8080209@gjlay.de> References: <4ED5FA7C.8080209@gjlay.de> Date: Wed, 30 Nov 2011 21:18:00 -0000 Message-ID: Subject: Re: best ABI strategy ? From: Aurelien Buhrig To: gcc-help@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-11/txt/msg00313.txt.bz2 2011/11/30 Georg-Johann Lay : > Aurelien Buhrig wrote: >> Hi, >> >> I'm trying to optimize our target ABI, and I'm wondering what is the >> best strategy to define it. >> Is there a paper, or any hint, dealing with this topic ? >> For instance, >> - which ratio between call-used-reg vs "static regs" >> - which ratio between arg regs vs call-used-reg >> - what should be return regs >> - ... >> I guess this problem is very target dependent, but there are maybe >> general ideas about this. > > If it's about new hardware/silicon/controller, it is a good idea to do a > controller compiler co-design. That way you can get the best out of a new > architecture as you have the most degrees of freedom to find a good point= in > the ISA/ABI plane. > > This requires of course to start the compiler development early and in a = stage > where the ISA is still work in progress, i.e. there is no final silicon b= ut > just an instruction set simulator for the upcoming hardware. > > In many cases, you cannot really say what's the best except you actually > implement it and look how smooth it works. =A0My experience is that ISA d= esigners > just think up to the assembler level, but have no idea how a compiler wor= ks and > what it needs and which features it can use and which not. > > If the silicon/ISA is already fix and there is no feedback possible, it is > often easy to parametrize different ABI flavours through compiler switche= s so > you can benchmark, switch back and forth between ABIs and see what their = pros > and contras are. > > Johann Hi Johann, We actually tried to optimize both the ISA and the comp=EEler for the new extended version, although there was some legacy. Now ISA is almost fixed. I'm just trying to see which register convention is the best. I will try to use/define those switches to benchmak the ABI, but I wanted to know if such studies were available. Thanks for your reply, Aur=E9lien