From patchwork Wed Mar 20 15:27:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Hayward X-Patchwork-Id: 31916 Received: (qmail 77293 invoked by alias); 20 Mar 2019 15:27:21 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 77146 invoked by uid 89); 20 Mar 2019 15:27:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: EUR02-HE1-obe.outbound.protection.outlook.com Received: from mail-eopbgr10058.outbound.protection.outlook.com (HELO EUR02-HE1-obe.outbound.protection.outlook.com) (40.107.1.58) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 20 Mar 2019 15:27:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4sfRHsmR4imv9bUbgDQQpbBC0OMdadx9rnw3JeaEkR4=; b=WOxRw+/0NbDJJSxbmZKJsKHi3si8iU3l92QPE2h0nWQ25M6xJPovyKWAcmiQxC5dqMkIvCwsKDS8GRebRJ7AeVs2rLJMzkBoKSaIDb4pR691aQuVuehxzjL57mMOkohjyri0xfiOZJaD6aUF1wvTZVo0Hc2GurHHuJ8tRvuf4vg= Received: from AM4PR0802MB2129.eurprd08.prod.outlook.com (10.172.216.148) by AM4PR0802MB2162.eurprd08.prod.outlook.com (10.172.217.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1730.15; Wed, 20 Mar 2019 15:27:17 +0000 Received: from AM4PR0802MB2129.eurprd08.prod.outlook.com ([fe80::39ee:53d8:6053:d3fe]) by AM4PR0802MB2129.eurprd08.prod.outlook.com ([fe80::39ee:53d8:6053:d3fe%10]) with mapi id 15.20.1709.015; Wed, 20 Mar 2019 15:27:17 +0000 From: Alan Hayward To: "gdb-patches@sourceware.org" CC: nd , Alan Hayward Subject: [PATCH] AArch64: View the pseudo V registers as vectors Date: Wed, 20 Mar 2019 15:27:17 +0000 Message-ID: <20190320152713.73821-1-alan.hayward@arm.com> authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alan.Hayward@arm.com; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 MIME-Version: 1.0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-IsSubscribed: yes When SVE is enabled, the V registers become pseudo registers based on the Z registers. They should look the same as they do when there is no SVE. The existing code viewed them as single value registers. Switch this to a vector. gdb/ChangeLog: 2019-03-20 Alan Hayward * aarch64-tdep.c (aarch64_vnv_type): Use vector types. --- gdb/aarch64-tdep.c | 53 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 5 deletions(-) diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index 9ab5fd2b96..51c33e0725 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -1811,14 +1811,57 @@ aarch64_vnv_type (struct gdbarch *gdbarch) if (tdep->vnv_type == NULL) { + /* The other AArch64 psuedo registers (Q,D,H,S,B) refer to a single value + slice from the non-pseudo vector registers. However NEON V registers + are always vector registers, and need constructing as such. */ + const struct builtin_type *bt = builtin_type (gdbarch); + struct type *t = arch_composite_type (gdbarch, "__gdb_builtin_type_vnv", TYPE_CODE_UNION); - append_composite_type_field (t, "d", aarch64_vnd_type (gdbarch)); - append_composite_type_field (t, "s", aarch64_vns_type (gdbarch)); - append_composite_type_field (t, "h", aarch64_vnh_type (gdbarch)); - append_composite_type_field (t, "b", aarch64_vnb_type (gdbarch)); - append_composite_type_field (t, "q", aarch64_vnq_type (gdbarch)); + struct type *sub = arch_composite_type (gdbarch, "__gdb_builtin_type_vnd", + TYPE_CODE_UNION); + append_composite_type_field (sub, "f", + init_vector_type (bt->builtin_double, 2)); + append_composite_type_field (sub, "u", + init_vector_type (bt->builtin_uint64, 2)); + append_composite_type_field (sub, "s", + init_vector_type (bt->builtin_int64, 2)); + append_composite_type_field (t, "d", sub); + + sub = arch_composite_type (gdbarch, "__gdb_builtin_type_vns", + TYPE_CODE_UNION); + append_composite_type_field (sub, "f", + init_vector_type (bt->builtin_float, 4)); + append_composite_type_field (sub, "u", + init_vector_type (bt->builtin_uint32, 4)); + append_composite_type_field (sub, "s", + init_vector_type (bt->builtin_int32, 4)); + append_composite_type_field (t, "s", sub); + + sub = arch_composite_type (gdbarch, "__gdb_builtin_type_vnh", + TYPE_CODE_UNION); + append_composite_type_field (sub, "u", + init_vector_type (bt->builtin_uint16, 8)); + append_composite_type_field (sub, "s", + init_vector_type (bt->builtin_int16, 8)); + append_composite_type_field (t, "h", sub); + + sub = arch_composite_type (gdbarch, "__gdb_builtin_type_vnb", + TYPE_CODE_UNION); + append_composite_type_field (sub, "u", + init_vector_type (bt->builtin_uint8, 16)); + append_composite_type_field (sub, "s", + init_vector_type (bt->builtin_int8, 16)); + append_composite_type_field (t, "b", sub); + + sub = arch_composite_type (gdbarch, "__gdb_builtin_type_vnq", + TYPE_CODE_UNION); + append_composite_type_field (sub, "u", + init_vector_type (bt->builtin_uint128, 1)); + append_composite_type_field (sub, "s", + init_vector_type (bt->builtin_int128, 1)); + append_composite_type_field (t, "q", sub); tdep->vnv_type = t; }