From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6057 invoked by alias); 1 Dec 2011 13:09:43 -0000 Received: (qmail 5884 invoked by uid 22791); 1 Dec 2011 13:09:41 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-ee0-f47.google.com (HELO mail-ee0-f47.google.com) (74.125.83.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 01 Dec 2011 13:09:28 +0000 Received: by eekc1 with SMTP id c1so1267797eek.20 for ; Thu, 01 Dec 2011 05:09:26 -0800 (PST) MIME-Version: 1.0 Received: by 10.14.6.146 with SMTP id 18mr943741een.58.1322744966631; Thu, 01 Dec 2011 05:09:26 -0800 (PST) Received: by 10.14.28.7 with HTTP; Thu, 1 Dec 2011 05:09:26 -0800 (PST) In-Reply-To: References: Date: Thu, 01 Dec 2011 13:09:00 -0000 Message-ID: Subject: Re: best ABI strategy ? From: Aurelien Buhrig To: Ian Lance Taylor Cc: 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-12/txt/msg00007.txt.bz2 2011/11/30 Ian Lance Taylor : > Aurelien Buhrig writes: > >> 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. > > I don't know of any papers on this topic. > > There are several things that feed into this, including: > > * The relative cost of saving registers on the stack. > > * How orthogonal your register set is--e.g., are there any registers > =A0with special purposes in the ISA? =A0Are there different register > =A0classes that hold different types of values? =A0Are there any > =A0restrictions on which registers can be used in a memory address? > > * How many registers you have overall. > > * What kind of code you are most interested in optimizing. =A0E.g., image > =A0processing code tends to lead to functions with lots of loops with > =A0lots of loop local variables that benefit from being in registers. > > Ian This pb is indeed highly hardware and application dependent. I will experiment to see what is the best... Thanks for your help, Aur=E9lien