From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32406 invoked by alias); 10 Aug 2002 05:12:03 -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 32396 invoked from network); 10 Aug 2002 05:12:01 -0000 Received: from unknown (HELO localhost.redhat.com) (24.112.240.27) by sources.redhat.com with SMTP; 10 Aug 2002 05:12:01 -0000 Received: from ges.redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 5498D3F10 for ; Sat, 10 Aug 2002 01:11:54 -0400 (EDT) Message-ID: <3D54A09A.2070409@ges.redhat.com> Date: Fri, 09 Aug 2002 22:12:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020802 X-Accept-Language: en-us, en MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [patch/in] Add some more vector types Content-Type: multipart/mixed; boundary="------------060702050003000504050207" X-SW-Source: 2002-08/txt/msg00236.txt.bz2 This is a multi-part message in MIME format. --------------060702050003000504050207 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 157 This adds two more builtin vector types: vec64 vec64i (integer only) It also sets the missing vector bit on the existing 128 bit types. committed, Andrew --------------060702050003000504050207 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 4304 2002-08-10 Andrew Cagney Elena Zannoni Martin M. Hunt * gdbtypes.c (build_builtin_type_vec128): Set the vector bit. (build_builtin_type_vec128i): Set the vector bit. * gdbtypes.h (builtin_type_vec64, builtin_type_vec64i): Declare. * gdbtypes.c (builtin_type_vec64, builtin_type_vec64i): Define. (build_builtin_type_vec64): New function. (build_builtin_type_vec64i): New function. (build_gdbtypes): Initialize builtin_type_vec64 and builtin_type_vec64i. Index: gdbtypes.c =================================================================== RCS file: /cvs/src/src/gdb/gdbtypes.c,v retrieving revision 1.54 diff -u -r1.54 gdbtypes.c --- gdbtypes.c 1 Aug 2002 17:18:32 -0000 1.54 +++ gdbtypes.c 10 Aug 2002 05:01:43 -0000 @@ -92,6 +92,8 @@ struct type *builtin_type_v8hi; struct type *builtin_type_v4hi; struct type *builtin_type_v2si; +struct type *builtin_type_vec64; +struct type *builtin_type_vec64i; struct type *builtin_type_vec128; struct type *builtin_type_vec128i; struct type *builtin_type_ieee_single_big; @@ -819,6 +821,62 @@ } static struct type * +build_builtin_type_vec64 (void) +{ + /* Construct a type for the 64 bit registers. The type we're + building is this: */ +#if 0 + union __gdb_builtin_type_vec64 + { + int64_t uint64; + float v2_float[2]; + int32_t v2_int32[2]; + int16_t v4_int16[4]; + int8_t v8_int8[8]; + }; +#endif + + struct type *t; + + t = init_composite_type ("__gdb_builtin_type_vec64", TYPE_CODE_UNION); + append_composite_type_field (t, "uint64", builtin_type_int64); + append_composite_type_field (t, "v2_float", builtin_type_v2_float); + append_composite_type_field (t, "v2_int32", builtin_type_v2_int32); + append_composite_type_field (t, "v4_int16", builtin_type_v4_int16); + append_composite_type_field (t, "v8_int8", builtin_type_v8_int8); + + TYPE_FLAGS (t) |= TYPE_FLAG_VECTOR; + return t; +} + +static struct type * +build_builtin_type_vec64i (void) +{ + /* Construct a type for the 64 bit registers. The type we're + building is this: */ +#if 0 + union __gdb_builtin_type_vec64i + { + int64_t uint64; + int32_t v2_int32[2]; + int16_t v4_int16[4]; + int8_t v8_int8[8]; + }; +#endif + + struct type *t; + + t = init_composite_type ("__gdb_builtin_type_vec64i", TYPE_CODE_UNION); + append_composite_type_field (t, "uint64", builtin_type_int64); + append_composite_type_field (t, "v2_int32", builtin_type_v2_int32); + append_composite_type_field (t, "v4_int16", builtin_type_v4_int16); + append_composite_type_field (t, "v8_int8", builtin_type_v8_int8); + + TYPE_FLAGS (t) |= TYPE_FLAG_VECTOR; + return t; +} + +static struct type * build_builtin_type_vec128 (void) { /* Construct a type for the 128 bit registers. The type we're @@ -843,6 +901,7 @@ append_composite_type_field (t, "v8_int16", builtin_type_v8_int16); append_composite_type_field (t, "v16_int8", builtin_type_v16_int8); + TYPE_FLAGS (t) |= TYPE_FLAG_VECTOR; return t; } @@ -861,6 +920,7 @@ append_composite_type_field (t, "v2_int64", builtin_type_v2_int64); append_composite_type_field (t, "uint128", builtin_type_int128); + TYPE_FLAGS (t) |= TYPE_FLAG_VECTOR; return t; } @@ -3324,7 +3384,9 @@ builtin_type_v4_int16 = init_vector_type (builtin_type_int16, 4); builtin_type_v8_int8 = init_vector_type (builtin_type_int8, 8); - /* Vector types. */ + /* Vector types. */ + builtin_type_vec64 = build_builtin_type_vec64 (); + builtin_type_vec64i = build_builtin_type_vec64i (); builtin_type_vec128 = build_builtin_type_vec128 (); builtin_type_vec128i = build_builtin_type_vec128i (); Index: gdbtypes.h =================================================================== RCS file: /cvs/src/src/gdb/gdbtypes.h,v retrieving revision 1.34 diff -u -r1.34 gdbtypes.h --- gdbtypes.h 1 Aug 2002 17:18:32 -0000 1.34 +++ gdbtypes.h 10 Aug 2002 05:01:43 -0000 @@ -952,6 +952,10 @@ extern struct type *builtin_type_v4hi; extern struct type *builtin_type_v2si; +/* Type for 64 bit vectors. */ +extern struct type *builtin_type_vec64; +extern struct type *builtin_type_vec64i; + /* Type for 128 bit vectors. */ extern struct type *builtin_type_vec128; extern struct type *builtin_type_vec128i; --------------060702050003000504050207--