From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28735 invoked by alias); 27 May 2002 09:17:39 -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 28706 invoked from network); 27 May 2002 09:17:37 -0000 Received: from unknown (HELO potter.sfbay.redhat.com) (205.180.83.107) by sources.redhat.com with SMTP; 27 May 2002 09:17:37 -0000 Received: from localhost.localdomain (IDENT:9YcZsju7qg7PEdynZf8sv70dqzA2iGat@romulus.sfbay.redhat.com [172.16.27.251]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id g4R9Ffv08593; Mon, 27 May 2002 02:15:41 -0700 Content-Type: text/plain; charset="iso-8859-1" From: "Martin M. Hunt" Organization: Red Hat Inc To: Elena Zannoni Subject: Re: [RFA] SSE register type fix Date: Mon, 27 May 2002 06:18:00 -0000 User-Agent: KMail/1.4.1 Cc: gdb-patches@sources.redhat.com References: <200205171228.09802.hunt@redhat.com> <15589.24050.270161.515964@localhost.redhat.com> In-Reply-To: <15589.24050.270161.515964@localhost.redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200205270207.57685.hunt@redhat.com> X-SW-Source: 2002-05/txt/msg00926.txt.bz2 OK, I finally just checked this in as-is. If we decide on a new name scheme, we can update later. Martin On Friday 17 May 2002 12:45 pm, Elena Zannoni wrote: > Martin M. Hunt writes: > > This patch adds better support for displaying SSE2 registers and changes > > support for SSE registers. It also allows them to work with the latest > > Insight. > > > > Previously registers were displayed as: > > (gdb) p $xmm0 > > $1 = {f = {0, 0, 0, 0}} > > > > With this patch they will be printed as: > > > > (gdb) p $xmm0 > > $1 = {v4_float = {0, 0, 0, 0}, v2_double = {0, 0}, v16_int8 = '\0' > > , v8_int16 = {0, 0, 0, 0, 0, 0, 0, 0}, v4_int32 = {0, > > 0, 0, 0}, v2_int64 = {0, 0}, uint128 = > > 0x00000000000000000000000000000000} > > > > or you can do > > > > (gdb) p $xmm0.v4_float > > $2 = {0, 0, 0, 0} > > > > Right now the code prints the register as if it were SSE2. For SSE > > registers, only v4_float is actually used. > > I know zilch about SSE registers, but the gdbtypes.c and gdbtypes.h > changes make sense and are approved.... > > However... can we now remove the old machinery for creating the old > style types? The v4si, v2si, etc types? I think the sse regs were the > only ones using it. > > However #2... what's the 'i' in vec128i for? Intel? I would think that 'i' > would be more like 'integer', i.e. vectors w/o floating point variants. > Maybe we need a new naming scheme. Groan. > > Hey, how about some kind soul adding tests for these registers in the > new gdb.arch directory? I think it would be possible to clone the > altivec-regs files. > > > Elena > > > -- > > Martin Hunt > > GDB Engineer > > Red Hat, Inc. > > > > 2002-05-17 Martin M. Hunt > > > > * i386-tdep.c (i386_register_virtual_type): Return > > builtin_type_vec128i for SSE registers. > > > > * gdbtypes.h (builtin_type_vec128i): Declare. > > > > * gdbtypes.c (build_builtin_type_vec128i): New function. > > (builtin_type_v2_double, builtin_type_v4_int64): New types. > > (builtin_type_vec128i): New type for SSE2 128-bit registers. > > (build_gdbtypes): Initialize new builtin vector types. > > (_initialize_gdbtypes): Register new vector types with gdbarch. > > > > > > Index: i386-tdep.c > > =================================================================== > > RCS file: /cvs/src/src/gdb/i386-tdep.c,v > > retrieving revision 1.54 > > diff -u -u -r1.54 i386-tdep.c > > --- i386-tdep.c 9 May 2002 13:53:36 -0000 1.54 > > +++ i386-tdep.c 17 May 2002 19:15:01 -0000 > > @@ -1058,7 +1058,7 @@ > > return builtin_type_i387_ext; > > > > if (IS_SSE_REGNUM (regnum)) > > - return builtin_type_v4sf; > > + return builtin_type_vec128i; > > > > return builtin_type_int; > > } > > Index: gdbtypes.h > > =================================================================== > > RCS file: /cvs/src/src/gdb/gdbtypes.h,v > > retrieving revision 1.31 > > diff -u -u -r1.31 gdbtypes.h > > --- gdbtypes.h 16 May 2002 03:59:58 -0000 1.31 > > +++ gdbtypes.h 17 May 2002 19:15:01 -0000 > > @@ -963,6 +963,7 @@ > > > > /* Type for 128 bit vectors. */ > > extern struct type *builtin_type_vec128; > > +extern struct type *builtin_type_vec128i; > > > > /* Explicit floating-point formats. See "floatformat.h". */ > > extern struct type *builtin_type_ieee_single_big; > > Index: gdbtypes.c > > =================================================================== > > RCS file: /cvs/src/src/gdb/gdbtypes.c,v > > retrieving revision 1.51 > > diff -u -u -r1.51 gdbtypes.c > > --- gdbtypes.c 14 May 2002 18:30:50 -0000 1.51 > > +++ gdbtypes.c 17 May 2002 19:15:02 -0000 > > @@ -73,7 +73,9 @@ > > struct type *builtin_type_bool; > > > > /* 128 bit long vector types */ > > +struct type *builtin_type_v2_double; > > struct type *builtin_type_v4_float; > > +struct type *builtin_type_v2_int64; > > struct type *builtin_type_v4_int32; > > struct type *builtin_type_v8_int16; > > struct type *builtin_type_v16_int8; > > @@ -91,6 +93,7 @@ > > struct type *builtin_type_v4hi; > > struct type *builtin_type_v2si; > > struct type *builtin_type_vec128; > > +struct type *builtin_type_vec128i; > > struct type *builtin_type_ieee_single_big; > > struct type *builtin_type_ieee_single_little; > > struct type *builtin_type_ieee_double_big; > > @@ -844,6 +847,24 @@ > > return t; > > } > > > > +static struct type * > > +build_builtin_type_vec128i (void) > > +{ > > + /* 128-bit Intel SIMD registers */ > > + struct type *t; > > + > > + t = init_composite_type ("__gdb_builtin_type_vec128i", > > TYPE_CODE_UNION); + append_composite_type_field (t, "v4_float", > > builtin_type_v4_float); + append_composite_type_field (t, "v2_double", > > builtin_type_v2_double); + append_composite_type_field (t, "v16_int8", > > builtin_type_v16_int8); + append_composite_type_field (t, "v8_int16", > > builtin_type_v8_int16); + append_composite_type_field (t, "v4_int32", > > builtin_type_v4_int32); + append_composite_type_field (t, "v2_int64", > > builtin_type_v2_int64); + append_composite_type_field (t, "uint128", > > builtin_type_int128); + > > + return t; > > +} > > + > > /* Smash TYPE to be a type of members of DOMAIN with type TO_TYPE. > > A MEMBER is a wierd thing -- it amounts to a typed offset into > > a struct, e.g. "an int at offset 8". A MEMBER TYPE doesn't > > @@ -3300,7 +3321,9 @@ > > = init_simd_type ("__builtin_v2si", builtin_type_int32, "f", 2); > > > > /* 128 bit vectors. */ > > + builtin_type_v2_double = init_vector_type (builtin_type_double, 2); > > builtin_type_v4_float = init_vector_type (builtin_type_float, 4); > > + builtin_type_v2_int64 = init_vector_type (builtin_type_int64, 2); > > builtin_type_v4_int32 = init_vector_type (builtin_type_int32, 4); > > builtin_type_v8_int16 = init_vector_type (builtin_type_int16, 8); > > builtin_type_v16_int8 = init_vector_type (builtin_type_int8, 16); > > @@ -3312,6 +3335,7 @@ > > > > /* Vector types. */ > > builtin_type_vec128 = build_builtin_type_vec128 (); > > + builtin_type_vec128i = build_builtin_type_vec128i (); > > > > /* Pointer/Address types. */ > > > > @@ -3400,7 +3424,9 @@ > > register_gdbarch_swap (&builtin_type_v8hi, sizeof (struct type *), > > NULL); register_gdbarch_swap (&builtin_type_v4hi, sizeof (struct type > > *), NULL); register_gdbarch_swap (&builtin_type_v2si, sizeof (struct > > type *), NULL); + register_gdbarch_swap (&builtin_type_v2_double, > > sizeof (struct type *), NULL); register_gdbarch_swap > > (&builtin_type_v4_float, sizeof (struct type *), NULL); + > > register_gdbarch_swap (&builtin_type_v2_int64, sizeof (struct type *), > > NULL); register_gdbarch_swap (&builtin_type_v4_int32, sizeof (struct > > type *), NULL); register_gdbarch_swap (&builtin_type_v8_int16, sizeof > > (struct type *), NULL); register_gdbarch_swap (&builtin_type_v16_int8, > > sizeof (struct type *), NULL); @@ -3409,6 +3435,7 @@ > > register_gdbarch_swap (&builtin_type_v8_int8, sizeof (struct type *), > > NULL); register_gdbarch_swap (&builtin_type_v4_int16, sizeof (struct > > type *), NULL); register_gdbarch_swap (&builtin_type_vec128, sizeof > > (struct type *), NULL); + register_gdbarch_swap (&builtin_type_vec128i, > > sizeof (struct type *), NULL); REGISTER_GDBARCH_SWAP > > (builtin_type_void_data_ptr); > > REGISTER_GDBARCH_SWAP (builtin_type_void_func_ptr); > > REGISTER_GDBARCH_SWAP (builtin_type_CORE_ADDR);