From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13515 invoked by alias); 27 Sep 2006 15:31:42 -0000 Received: (qmail 13497 invoked by uid 22791); 27 Sep 2006 15:31:41 -0000 X-Spam-Check-By: sourceware.org Received: from saraswati.hathway.com (HELO saraswati.hathway.com) (202.88.156.6) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 27 Sep 2006 15:31:35 +0000 Received: from lab102371 ([60.254.70.211]) by saraswati.hathway.com (iPlanet Messaging Server 5.2 Patch 1 (built Aug 19 2002)) with ESMTP id <0J6900DODCG6FH@saraswati.hathway.com> for gcc-help@gcc.gnu.org; Wed, 27 Sep 2006 21:01:18 +0530 (IST) Date: Wed, 27 Sep 2006 15:31:00 -0000 From: Ravishankar S Subject: RE: Arguments in registers In-reply-to: To: 'Ian Lance Taylor' Cc: gcc-help@gcc.gnu.org Message-id: <000001c6e249$fe864460$d346fe3c@lab102371> MIME-version: 1.0 X-Mailer: Microsoft Outlook, Build 10.0.2627 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2006-09/txt/msg00304.txt.bz2 Thanks Ian, I see now: for functions with many arguments (and I have seen ones with 25 args in our software!) it could be a bit more efficient have more registers to pass arguments. While Im in this discussion, I might present some other issues that I current face. We use a MPC5xx variant. Our software uses only SDA addressing for all vars and consts. This by far the most efficient , runtime and code-size wise for a RISC processor. Sutability of ARM for a load/store intensive application: =========================================================== -> If im right, ARM though RISC, does not have SDA addressing. For constants it uses PC relative addressing (which means thet constants must be embedded within text section ?). How does variable addressing happen ? Does it use two instructions (like lis and ori in PPC) to form the 32 bit address ? -> For a RISC ARM has lesser number of registers. I presume, if we have lesser registers then there will be more load/store operations. (And probably the stack is also bigger ?). Is there any way in which one can predict the number of extra load/stores due to reduced number of registers (other than compiling and measuring!) ? Misc: ======= -> Is there any open source tool which counts only executable lines of code. Is it possible to do this with gcc ? -> Is there an open source GNU C grammer. What intermediate representations (tree etc ?) can be used for the source ? Is it possible to make this persistent ? Many Thanks and Best Regards, Ravishankar -----Original Message----- From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On Behalf Of Ian Lance Taylor Sent: Monday, September 25, 2006 10:35 PM To: Ravishankar S Cc: gcc-help@gcc.gnu.org Subject: Re: Arguments in registers Ravishankar S writes: > But TriCore's EABI specifies separate registers for passing arguments > and returning values. D2-D3 for returning values and D4-D7 for passing > arguments. > > My question is : Will it make a difference from a compiler writer's > point for this type of calling convention. From experience, will it > make for a differnce in performance. It won't make much difference. There are other architectures with similar characteristics. For example, on MIPS arguments are passed in $4 through $7 or $11 (depending on the ABI), but values are returned in $2 and $3. > On the surface, it seems like it does, as there most of functions do > not return values and most anyway don't return 64 bit values. So > reusing the registers as PowerPC does may be better. The return registers are essentially just caller-saved scratch registers. I suppose if you are short on registers you might prefer to have more callee-saved registers. But if you have enough registers, it doesn't matter much either way. Ian __________ NOD32 1.1454 (20060321) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com