From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11563 invoked by alias); 11 Jan 2002 23:55:59 -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 11519 invoked from network); 11 Jan 2002 23:55:58 -0000 Received: from unknown (HELO nevyn.them.org) (128.2.145.6) by sources.redhat.com with SMTP; 11 Jan 2002 23:55:58 -0000 Received: from drow by nevyn.them.org with local (Exim 3.33 #1 (Debian)) id 16PBWi-0004S5-00 for ; Fri, 11 Jan 2002 18:56:00 -0500 Date: Fri, 11 Jan 2002 15:55:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Subject: Re: [RFA] gdbtypes.[ch] rs6000-tdep.c--AltiVec regs types Message-ID: <20020111185600.A17032@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com References: <15423.26637.972974.400390@localhost.cygnus.com> <20020111182846.A15924@nevyn.them.org> <3C3F7858.694D1AD8@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3C3F7858.694D1AD8@redhat.com> User-Agent: Mutt/1.3.23i X-SW-Source: 2002-01/txt/msg00312.txt.bz2 On Fri, Jan 11, 2002 at 03:42:16PM -0800, Michael Snyder wrote: > Daniel Jacobowitz wrote: > > > > On Fri, Jan 11, 2002 at 05:32:45PM -0500, Elena Zannoni wrote: > > > > > > This patch provides a builtin union type for the AltiVec registers, > > > so that the printing of such regs is a bit more enlightening, like: > > > > > > > > > (gdb) p $vr0 > > > $2 = {uint128 = 0x00000064000000c80000012c00000190, > > > v4sf = {f = {1.40129846e-43, 2.80259693e-43, 4.20389539e-43, 5.60519386e-43}}, > > > v4si = {f = {100, 200, 300, 400}}, > > > v8hi = {f = {0, 100, 0, 200, 0, 300, 0, 400}}, > > > v16qi = {f = "\0\0\0d\0\0\0È\0\0\001,\0\0\001\220"}} > > > (gdb) p $vr0.v4si > > > $3 = {f = {100, 200, 300, 400}} > > > (gdb) p $vr0.v4si.f[2] > > > $4 = 300 > > > (gdb) p $vr0.v4si.f[2]=444 > > > $5 = 444 > > > > Why is the .f necessary? Why not make $vr0.v4si an array rather than > > struct type? > > I know this is historical (it's been done the same way for other > targets), > and I'm guessing it's because a struct type can be passed by value, > while > an array type is always passed by reference. You want a type that can > be passed to a function. > > I should know this (I've dealt with it before), but my > memory cache is shrinking with age and misuse. ;-( Hmm, could we accomplish this with an analogue to anonymous unions, I wonder?... a question for another time. union altivec_register { struct v4sf { float v4sf[4]; }; ... }; -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer