From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6240 invoked by alias); 11 Jan 2002 23:47:34 -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 6209 invoked from network); 11 Jan 2002 23:47:33 -0000 Received: from unknown (HELO cygnus.com) (205.180.230.5) by sources.redhat.com with SMTP; 11 Jan 2002 23:47:33 -0000 Received: from redhat.com (reddwarf.sfbay.redhat.com [205.180.231.12]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id PAA21069; Fri, 11 Jan 2002 15:47:30 -0800 (PST) Message-ID: <3C3F7858.694D1AD8@redhat.com> Date: Fri, 11 Jan 2002 15:47:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.4.2-2smp i686) X-Accept-Language: en MIME-Version: 1.0 To: Daniel Jacobowitz CC: gdb-patches@sources.redhat.com Subject: Re: [RFA] gdbtypes.[ch] rs6000-tdep.c--AltiVec regs types References: <15423.26637.972974.400390@localhost.cygnus.com> <20020111182846.A15924@nevyn.them.org> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by cygnus.com id PAA21069 X-SW-Source: 2002-01/txt/msg00311.txt.bz2 Daniel Jacobowitz wrote: >=20 > 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 =3D {uint128 =3D 0x00000064000000c80000012c00000190, > > v4sf =3D {f =3D {1.40129846e-43, 2.80259693e-43, 4.20389539e-43, = 5.60519386e-43}}, > > v4si =3D {f =3D {100, 200, 300, 400}}, > > v8hi =3D {f =3D {0, 100, 0, 200, 0, 300, 0, 400}}, > > v16qi =3D {f =3D "\0\0\0d\0\0\0=C8\0\0\001,\0\0\001\220"}} > > (gdb) p $vr0.v4si > > $3 =3D {f =3D {100, 200, 300, 400}} > > (gdb) p $vr0.v4si.f[2] > > $4 =3D 300 > > (gdb) p $vr0.v4si.f[2]=3D444 > > $5 =3D 444 >=20 > 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),=20 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=20 memory cache is shrinking with age and misuse. ;-(