From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8413 invoked by alias); 22 May 2003 20:16:42 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 8406 invoked from network); 22 May 2003 20:16:41 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 22 May 2003 20:16:41 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h4MKGfH30266 for ; Thu, 22 May 2003 16:16:41 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h4MKGeI22708; Thu, 22 May 2003 16:16:40 -0400 Received: from localhost.localdomain (vpn50-3.rdu.redhat.com [172.16.50.3]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h4MKGdo22565; Thu, 22 May 2003 16:16:39 -0400 Received: (from kev@localhost) by localhost.localdomain (8.11.6/8.11.6) id h4MKGXl31134; Thu, 22 May 2003 13:16:33 -0700 Date: Thu, 22 May 2003 20:16:00 -0000 From: Kevin Buettner Message-Id: <1030522201633.ZM31133@localhost.localdomain> In-Reply-To: Andrew Cagney "Re: [RFA] MIPS: Introduce struct mips_regnums and accessors" (May 22, 3:40pm) References: <1030515235130.ZM7492@localhost.localdomain> <3ECBD5C3.3000706@redhat.com> <1030521204035.ZM32420@localhost.localdomain> <3ECD27B0.1060906@redhat.com> To: Andrew Cagney , Kevin Buettner Subject: Re: [RFA] MIPS: Introduce struct mips_regnums and accessors Cc: gdb-patches@sources.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-05/txt/msg00439.txt.bz2 On May 22, 3:40pm, Andrew Cagney wrote: > + /* Raw register number initializations. They are initialized in the > + same order that they appear in the struct to make it easier to > + verify that they're all initialized. */ > + tdep->raw_regnums.zero_regnum = 0; > + tdep->raw_regnums.v0_regnum = 2; > + tdep->raw_regnums.a0_regnum = 4; > + tdep->raw_regnums.t9_regnum = 25; > + tdep->raw_regnums.sp_regnum = 29; > + tdep->raw_regnums.ra_regnum = 31; > > and, at least for v0_regnum, it doesn't change. V0 is an offset in the > selected block of registers. It could be either: > > enum { V0_OFFSET = 2 }; > > cookednum->gp0 + V0_OFFSET > or > rawnum->gp0 + V0_OFFSET > > however, either way, it doesn't change. The only thing that changes is > things like where the general purpose, for floating point, registers start. I have the following objections to the use of offsets: 1) They don't work for floating point registers. (That's assuming that I can convince you that it's desirable to have 16 cooked registers for o32...) The reason that it won't work is that, e.g, an FPA0_OFFSET will need to have different values for the raw and cooked cases. 2) The conversion from *_REGNUM is much less transparent. 3) The use of offsets is more error prone. There's nothing to prevent you from adding an offset to the wrong boundary start. 4) The notation is more cumbersome. Furthermore, I really don't understand the problem that you had with my proposed layout. Could you please explain the underlying reasons for proposing the offset idea? E.g, are you concerned about the initialization and the maintenance thereof? Or do you just want to present a minimal view of the raw register numbers to clients outside of mips-tdep.c? Or something else altogether? Kevin