From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id KWfVJxLkumgDzxYAWB0awg (envelope-from ) for ; Fri, 05 Sep 2025 09:22:26 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=hvGmw8kq; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=hvGmw8kq; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 98F721E087; Fri, 05 Sep 2025 09:22:26 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=no autolearn_force=no version=4.0.1 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 9385A1E023 for ; Fri, 05 Sep 2025 09:22:23 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 308663858431 for ; Fri, 5 Sep 2025 13:22:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 308663858431 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=hvGmw8kq; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=hvGmw8kq Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11011046.outbound.protection.outlook.com [52.101.65.46]) by sourceware.org (Postfix) with ESMTPS id 78DA9385801D for ; Fri, 5 Sep 2025 13:17:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 78DA9385801D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 78DA9385801D Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=52.101.65.46 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1757078255; cv=pass; b=lyOOT7duprFAtTh3u0CZsoedZsuOb9Yee4pYdX7g6uUhxq5GGsxStDc1NAilH9//Y5mlgnBPkNWiEBfflhFGl3IZuLp54m/sRgWXNGKI3i7K8K8JIN2RFP3Dmp3t5lXfY/vPs8DofyS+UeJtX2JlkJ8+ds/txjpj61ASJzVGIS0= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1757078255; c=relaxed/simple; bh=IWbB2dnLrwJX/RbR3RjFFW2JB6Vvlt/p3CCgAh+w3k4=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=vL5opMtHhu2EKiqEg4nBNlSbpUZkEaPm7BvJ1VI6aj9shqhrL5A28Zqr3kGYWVByfJAI7W6wYLEWUZlx20PwWJhaMcPYy3z28uyVCSK1Te9CTaYK4Mva59jfZU138OToTPB7Tv48SJTn28Xd0I7QOrmA4Gmb2kknfnEW3NPzTO0= ARC-Authentication-Results: i=3; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 78DA9385801D ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=I1Z0x5cfXI70uOQd4opCjo+VQuojn1ouRANdA9hWxdqYZBH1uBebG9zFoiJqUaqlQMV13jKqRuvM9U9cpa+9n/dujcPNtC7jq9ERnibSBW/6orY5ffgRwI68qFOmOooZUgluh3bkcpWVUIINgfM4OPmf2mBwASqE4cxalcgKlVhHIihaTLvCH6Frc2YzT6KcRs1FgY7plGpvi8LH+4trRMo14iTAir03isn/riopYhNerGYILFHyMqKRST7b6WbCSapQ4bRmi92QyMMzwdfP51BX70r6F+/Ycm+QP7lkiJpJEwLIg/gr9v7neG/zEzt3jal8vJmcgSCFlXcEU1wP8g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=chOs5dLOuRkstmvanDwQ0d2COUYQqb9tZDAoRBm8Bn8=; b=BIFxNNWVeBQN0B/sKFYU1llRMpC499GkOqNxMUYM9q1TBPDl/ij92AXBMKz9oH8JHt4pkvwMCH7Gz3msoRFBfxqM/SHKzw8EmJTKqBn2Jt9Ot2BQpd5sQixLs8tv4YK727Gh/kDrPoDPBuXd4tMjbrJKoWElSpisA3NHlL73tgE7bg91Mfg1uY/Ihvhtg+on/7j6DofqPI7xUBJELMLjjrQwUUZ3L65cG6M7vwkGVIR1yvmyCKuH47UoQoXpRMKPiy1HKv9yCPN5IFZldbAIlrUhDjpSA6UZHdlkvWumwoFdp0+7q1dzrWOhxAtZqanv0w2QfOaCJDhrk0u11oBxDw== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=chOs5dLOuRkstmvanDwQ0d2COUYQqb9tZDAoRBm8Bn8=; b=hvGmw8kqu0gDSBxIQsQWw4iZ610FZU+o96ICIkNyF41mXKq/UimOmE7f5311n4BpY8CD5jhnl5K7JgbdFG7g+0gZugtf5u6qW6bkZJMfvKj5/pZtxQ975W84XMA/TehlwXt5UAJhz0IP9YHkgmX0pYKFTBi37PLHJa2szT/P+dQ= Received: from AS4P250CA0004.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:5df::12) by DB9PR08MB6521.eurprd08.prod.outlook.com (2603:10a6:10:254::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.17; Fri, 5 Sep 2025 13:17:28 +0000 Received: from AM3PEPF0000A79A.eurprd04.prod.outlook.com (2603:10a6:20b:5df:cafe::19) by AS4P250CA0004.outlook.office365.com (2603:10a6:20b:5df::12) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9094.20 via Frontend Transport; Fri, 5 Sep 2025 13:17:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=arm.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 4.158.2.129 as permitted sender) receiver=protection.outlook.com; client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by AM3PEPF0000A79A.mail.protection.outlook.com (10.167.16.105) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9094.14 via Frontend Transport; Fri, 5 Sep 2025 13:17:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BXbo4xrePenonJ38GzSsx0siFcVlWXClCyxh+X6lhmIFih3dGZkfXz2bfSRo3U+B2UZrFDTee1zWanIdaQpXSpY3sCJSMVQ9QCVDUHctikMO1vU1a8icQK0S6jC2NB8k1TriUpvnbnLWfT1IkbSVgY0TlJe9F9oKZXpcnAtQui56e9MgdUlPvbPtOvPtrR1Qct8kZf8D1LbRo/Z/wy5bFsI0hvaa8QmMAB4UmvGzLTDH/6yMMdIU1o+Ju9U3bpmjSaIjPH9f08O0rWkXr0wtC9OYaMekUgTBA4Z/b3NraaBbYsNeAlEGcRbw7OyfHwX8lur8q1mhxzyFjalT9zDY4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=chOs5dLOuRkstmvanDwQ0d2COUYQqb9tZDAoRBm8Bn8=; b=HVNiTC+S8j9/OdgvcuiOkDjDAq9Ai/YB7yyeU8GQ+hnaOhSNHT6J4NEnh2yTYjMcjae5429CdiGL6q0Obdbopn1xWxRtUauPdoRluQtIVNbsl0dqw1ZxL9EHtBWtTyysdw3DdxyFxnI5rjBHKNDJdJUSAbzBfQih7e/V3YoU+tCsK7rK+GpooBLstuxHTGEm0YyPubK9uE1Z9R+qSba1edpfx/Nbd5f2NlLamKq9q1/FXMJvdtxgtDsLC2L0kIhvnzzpPbyG87fFTBt5augUClUswJJfhlvZO+opMCWjyF8CK9AWRNA7IKGWe28LYk2+yHZf8AARkEQBLhTJguhZ9A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 172.205.89.229) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=chOs5dLOuRkstmvanDwQ0d2COUYQqb9tZDAoRBm8Bn8=; b=hvGmw8kqu0gDSBxIQsQWw4iZ610FZU+o96ICIkNyF41mXKq/UimOmE7f5311n4BpY8CD5jhnl5K7JgbdFG7g+0gZugtf5u6qW6bkZJMfvKj5/pZtxQ975W84XMA/TehlwXt5UAJhz0IP9YHkgmX0pYKFTBi37PLHJa2szT/P+dQ= Received: from PR1P264CA0163.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:347::13) by DU0PR08MB8472.eurprd08.prod.outlook.com (2603:10a6:10:404::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9073.27; Fri, 5 Sep 2025 13:16:48 +0000 Received: from AM4PEPF00025F9C.EURPRD83.prod.outlook.com (2603:10a6:102:347:cafe::47) by PR1P264CA0163.outlook.office365.com (2603:10a6:102:347::13) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9094.19 via Frontend Transport; Fri, 5 Sep 2025 13:16:48 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 172.205.89.229) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 172.205.89.229 as permitted sender) receiver=protection.outlook.com; client-ip=172.205.89.229; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (172.205.89.229) by AM4PEPF00025F9C.mail.protection.outlook.com (10.167.16.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.9137.0 via Frontend Transport; Fri, 5 Sep 2025 13:16:48 +0000 Received: from AZ-NEU-EX04.Arm.com (10.240.25.138) by AZ-NEU-EX05.Arm.com (10.240.25.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 5 Sep 2025 13:16:47 +0000 Received: from AZ-NEU-EX06.Arm.com (10.240.25.134) by AZ-NEU-EX04.Arm.com (10.240.25.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.2562.17; Fri, 5 Sep 2025 13:16:47 +0000 Received: from D2G2X7XGD1.arm.com (10.57.60.116) by mail.arm.com (10.240.25.134) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Fri, 5 Sep 2025 13:16:47 +0000 From: To: CC: , Ezra Sitorus Subject: [RFC PATCH 5/5] gdb/aarch64: Tests for fpmr Date: Fri, 5 Sep 2025 14:17:07 +0100 Message-ID: <20250905131707.77027-6-Ezra.Sitorus@arm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250905131707.77027-1-Ezra.Sitorus@arm.com> References: <20250905131707.77027-1-Ezra.Sitorus@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM4PEPF00025F9C:EE_|DU0PR08MB8472:EE_|AM3PEPF0000A79A:EE_|DB9PR08MB6521:EE_ X-MS-Office365-Filtering-Correlation-Id: 6925f560-ad36-4b4f-d56a-08ddec7e8f0f x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|36860700013|82310400026|1800799024|376014|13003099007; X-Microsoft-Antispam-Message-Info-Original: =?us-ascii?Q?1Ho1vLDa5Xfsq4vTQOpxF6Nk0AlUC/NoULtgusIbr3yHWF4CzGACJgzHavX9?= =?us-ascii?Q?OSetYrgp0VFXX7rmOLnQ6gYd5d0//20COnyftsJyiRg6J81xS92IwwbCfael?= =?us-ascii?Q?r7k7Ptf7goW5JWHypvBSBer3666lvj8UtPT/fZWGihiFhAd3bTstucIZVy9R?= =?us-ascii?Q?MeIWa7HeEUDN28WSrjH/N5eer7nIiAfZGR/rKr+DsYJHpHINONVME9Aisu7d?= =?us-ascii?Q?6IF3X5MqlRVc3bKw/gmMV3pHbrfwS58MJZr6Bz0bZkvhorziwcJvKkW/8uS4?= =?us-ascii?Q?LlRTIKFtuBaFhVOl3dCSZoriWOyzLqRI8vfAKtTGofTO92lkjFw8p8ONNGDE?= =?us-ascii?Q?qBvwztg9qn5cN2Y9dQIxD2MypRsOPxdOlsDCiyeoaSC2GM6zypq7MavtWKYA?= =?us-ascii?Q?H5LSXqpaBpfmWlwNPsXkKk6PkrG9x63qG2rfaTN0VywKp62eI/Ku4umqq1TE?= =?us-ascii?Q?PjSHnKyqIaIcvmqeiClrX9GWy2Fpujr/YdBGMUpGEwTX0MOPxRcSeuqSimet?= =?us-ascii?Q?WC/qTKGi1Ubb1zRXkU9mTnvXRNvwckp+oJp6JLpItQLtjaRFc0NuZMIjFRJH?= =?us-ascii?Q?lHs6ECsCQeU5sMwnvdBR+3SXKcL+tN2cCxT2ijsCeeBP4iiHLaRa935VeuIT?= =?us-ascii?Q?mER+P49qnPR4RDOurVhEJv4Md25kRCZA4rCGAdbRw7uzqrrq2PCRkAF/Od1Z?= =?us-ascii?Q?QUexwmpVxfuuVhX6mGB1WJW2v5xTJDh+466GtFXJoEbYAVa5tFn8XR1P0Xvz?= =?us-ascii?Q?nobf7JN/cU/LAGZudKdeFYIb5oWWemQsaoHSjrBOrE958frxIwKG07t7f/4n?= =?us-ascii?Q?tapPDL6BY8n0fpKZEw4vPGT5bruxnRdWoze0F3I3/AF7u8cFy2jE72Q3ZRkU?= =?us-ascii?Q?0rhlxTapnfaTs2+sZouerCsXqJMxCsmi19QLrz7K7lB1fuEMVfMUz0/Iiynd?= =?us-ascii?Q?uB/F4GwJK4Sq7Ypr8XG7EZwE8McI5DDwmHnYZvg7c6MDBqKBE4x3HGNfbH90?= =?us-ascii?Q?NxIoDyel1yD0MhF1RJX5dnYFqP9ocgGs3kLwmU8dUWHOslmHn7DJ+IWds7hR?= =?us-ascii?Q?UuoBuElruK5MoMteV51w3P9NhJJAv9VXP3a61VIZ38jAQL0ukaOAwXcflpGe?= =?us-ascii?Q?qqrCMFyD4xdKRYYvaFvqUta2J+ybUee9llzZYbZJcg0L7of0uae2DBL6FCAg?= =?us-ascii?Q?6ofWYuA4kbb6wgbBMe5N61VNZ4z3DRdzbnof+O5dnp8J6/U29hTvL8XHR+S4?= =?us-ascii?Q?XyCI0E5dUBxtWvUlJOlO1fcyBHgX7UNHumZ74asB7EubU2XrnHBRMk9POaLd?= =?us-ascii?Q?Zi9OQqRlTAI5FyOEpa/Vky0coZTLyEQW3Mad04B73320/yGawwXHKGTinCh2?= =?us-ascii?Q?L3Pbg5IeYFN7oB6N0ZjqgL/gRly2SM3JwN05tnwu9IJsGPcDfuVIaqdahJk5?= =?us-ascii?Q?efbVf/3vzBa9smH5NDqCLNDYHJHXL9LT6BWcazhLzrhEfsPu6CBjw5XeuI5c?= =?us-ascii?Q?6p7acskJpkb17KE=3D?= X-Forefront-Antispam-Report-Untrusted: CIP:172.205.89.229; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(36860700013)(82310400026)(1800799024)(376014)(13003099007); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8472 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM3PEPF0000A79A.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: c2a95e9f-b079-491b-ff3a-08ddec7e784b X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|1800799024|14060799003|376014|35042699022|36860700013|13003099007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?6WiBPhE02NUQAGoDdOsChpyhn9wVJ9+QWtSpjNu3rBS/R9pPJWum/nistdUu?= =?us-ascii?Q?/ezhg4CJnmMmtkyPALgxSupmm5M7Pp3v8x2jxh3XihKIGXNv70wfsZHSDpfk?= =?us-ascii?Q?wAf84V8dta3Dj1nxph4DH0qfkLP6CBGHfVUSjLdvZKRXuIOBoMnL/7tIXuli?= =?us-ascii?Q?zF90JLewl1wvoigvH+3nw8YVm36wDsXLfC9L93wklcx0vx2UH+gDEd0FfMA8?= =?us-ascii?Q?qfMa6CjbfsXhAsRj1hybCfPaCnca/g152lE5LEKbNhAjxlreld5CoGSusMqU?= =?us-ascii?Q?V/4yjZs7AHHsH4CmxFndeDHXjfKcanXO6XPoGZqWDjsV+KrrN8ihNzLd+DQ6?= =?us-ascii?Q?l0KgZs9I3ewG23kRhGDhL2YGpYhbFgDbBSrzVHsZXx64QLzygZDDoKVm57A8?= =?us-ascii?Q?XUjyBskEAUP257uv3B4VRhqGV5sp2xb5TiX09/iBB9BePIikgB/LxNyIGuZG?= =?us-ascii?Q?D17FslqYLYjGhchPERzVYY71Wz0xo0eT/NG82hLXbNb7PFwFxgx9BDYumlmR?= =?us-ascii?Q?1AY5rm4iZFeeWQvOWOX7ZPOrWjJHh82DCkYAhCRnj0ba2HA+Qg6VOujpZtwL?= =?us-ascii?Q?S24Rjzz7N7GGvO0yYZ3xQ0maHm4ieDijV/3Db5BDd1wVtx3Metf4Tlq9g549?= =?us-ascii?Q?DzuAxHCDfWh24HWJ0AUqkbOaWw4JckxZVa+fTHyZ7udOxG2XnyZYqzDKL/vS?= =?us-ascii?Q?GtTP+FVhpWB5lD87GzvEfIVpTEqgvomDL48sVm51hLR3JFe6V10NxOJb88FG?= =?us-ascii?Q?HIMZyNinRSyIOpOmLrhA2bKaTPUN622DQeHBMwBzoTSCOoDVycXocDlYRDya?= =?us-ascii?Q?sEGh0sJ3od4NzEGtHEcq0PrIrSn89hl3rOj5aLHsHGShpf7KQTrntEYoyXvI?= =?us-ascii?Q?ZyirQWMyOlizLHmTDI9LnaMYjDmSjcDW5GadNAvLsEze04Y3gpSOf1Mhtj/Q?= =?us-ascii?Q?+6b5CjnPLYvJJibT5DcjsXMeor1m32iGjrdqaLBqzxtncoQWPUdboPu4zTki?= =?us-ascii?Q?nHZacMOj5ThJkLV49njtRV53KklrvqN0MDLeRFRoZ2LHrBO+/sZck0cW2h/E?= =?us-ascii?Q?MFDd4sJUV6GwZi+5Jj18UvJBFMqcRv/HueynQCFLnHkrz9jQ2xo8sI/kwukM?= =?us-ascii?Q?Y1R2Y3ze2d/dqGLzecPWEp0iBm136J9fdqUrK6o2Eq6ax5+wL4OZXXZQcHYK?= =?us-ascii?Q?CsGqtW6LAY8WMLUgxO5FreZIe0gLMorSOtSq5HAT2OzTcCc3UpGvbzqmmRUP?= =?us-ascii?Q?iwmCM+lgSfqWzFL8AZlrDKg1h5vlsGDbSfBTVDAOHMmSP//a5/h15rdPWAIw?= =?us-ascii?Q?O5vw0XG+IHU/tjAMeSCoTnJlMMZELBCeIMIp3LDvYxmnbyeKffJeya14Q0xe?= =?us-ascii?Q?liM/qshm2x/uraVHawK38dnsbQ6dd0KMnIq/NQvQXbQSU0qJViwcVIyee0F0?= =?us-ascii?Q?7S8ypKGxHHu8BH/MnNGE/FCOuA5Gy/FflOwfhF+R1w+ThBob6jIW/ErduYNF?= =?us-ascii?Q?e/kxhbEb77WLQ7xzgH2nU7EUW7wOlQ+MIMSDX5o1wyeyu/1LgeSm7dTnBw?= =?us-ascii?Q?=3D=3D?= X-Forefront-Antispam-Report: CIP:4.158.2.129; CTRY:GB; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:outbound-uk1.az.dlp.m.darktrace.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(82310400026)(1800799024)(14060799003)(376014)(35042699022)(36860700013)(13003099007); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2025 13:17:26.6139 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6925f560-ad36-4b4f-d56a-08ddec7e8f0f X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[4.158.2.129]; Helo=[outbound-uk1.az.dlp.m.darktrace.com] X-MS-Exchange-CrossTenant-AuthSource: AM3PEPF0000A79A.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6521 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org From: Ezra Sitorus Add tests for FPMR support in gdb/gdbserver. These tests check availability of FPMR, reading/writing to FPMR and core file generation. For these tests, I have used shrinkwrap for FPMR emulation. I am not sure on how to do these tests properly as there are some things I'm not sure about: * Which board file do I use to test this? I've resorted to adapting remote-stdio-gdbserver.exp to use tcp when starting gdbserver remotely. * Do I need to run the whole regression test? This is quite slow, and comes up with a lot of failures. * Since gdbserver doesn't support core files, I've had to adapt core_find so that the core file is generated on target (where gdbserver runs), but then it's copied over to host (where gdb runs) to do the actual test. You can find this on aarch64-fpmr-core.exp (remote_core_find). Please let me know if there's a better way of doing this, or how I can improve the way I've done it. * Another issue with the core file test is that sometimes it says all the tests pass, but there's 1 unexpected core file or that core files can't be generated and I need to do ulimit -c unlimited, despite having done that already. --- gdb/testsuite/gdb.arch/aarch64-fpmr-core.c | 109 +++++++++++++ gdb/testsuite/gdb.arch/aarch64-fpmr-core.exp | 143 ++++++++++++++++++ .../gdb.arch/aarch64-fpmr-sighandler.c | 134 ++++++++++++++++ .../gdb.arch/aarch64-fpmr-sighandler.exp | 75 +++++++++ gdb/testsuite/gdb.arch/aarch64-fpmr.c | 117 ++++++++++++++ gdb/testsuite/gdb.arch/aarch64-fpmr.exp | 116 ++++++++++++++ gdb/testsuite/lib/gdb.exp | 49 ++++++ 7 files changed, 743 insertions(+) create mode 100644 gdb/testsuite/gdb.arch/aarch64-fpmr-core.c create mode 100644 gdb/testsuite/gdb.arch/aarch64-fpmr-core.exp create mode 100644 gdb/testsuite/gdb.arch/aarch64-fpmr-sighandler.c create mode 100644 gdb/testsuite/gdb.arch/aarch64-fpmr-sighandler.exp create mode 100644 gdb/testsuite/gdb.arch/aarch64-fpmr.c create mode 100644 gdb/testsuite/gdb.arch/aarch64-fpmr.exp diff --git a/gdb/testsuite/gdb.arch/aarch64-fpmr-core.c b/gdb/testsuite/gdb.arch/aarch64-fpmr-core.c new file mode 100644 index 00000000000..95c6f302ad7 --- /dev/null +++ b/gdb/testsuite/gdb.arch/aarch64-fpmr-core.c @@ -0,0 +1,109 @@ +/* This file is part of GDB, the GNU debugger. + + Copyright 2008-2025 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +uint64_t crash_address = 0; + +enum FPM_FORMAT +{ + E5M2, + E4M3, +}; + +enum FPM_OVERFLOW +{ + INFNAN, + SATURATE, +}; + +void +set_fpmr (uint64_t value) +{ + register uint64_t x0_val asm ("x0") = value; + __asm__ volatile (".inst 0xd51b4440" : : ); +} + +uint64_t +modify_src1_fmt (uint64_t fpmr, uint64_t fmt) +{ + return (fpmr & ~(0x7)) | (fmt & 0x7); +} + +uint64_t +modify_src2_fmt (uint64_t fpmr, uint64_t fmt) +{ + return (fpmr & ~((0x7) << 3)) | ((fmt & 0x7) << 3); +} + +uint64_t +modify_dst_fmt (uint64_t fpmr, uint64_t fmt) +{ + return (fpmr & ~((0x7) << 6)) | ((fmt & 0x7) << 6); +} + +uint64_t +modify_osm (uint64_t fpmr, uint64_t overflow) +{ + return (fpmr & ~((0x1) << 14)) | ((overflow & 0x1) << 14); +} + +uint64_t +modify_osc (uint64_t fpmr, uint64_t overflow) +{ + return (fpmr & ~((0x1) << 15)) | ((overflow & 0x1) << 15); +} + +uint64_t +modify_lscale (uint64_t fpmr, uint64_t scale) +{ + return (fpmr & ~((0x7f) << 16)) | ((scale & 0x7f) << 16); +} + +uint64_t +modify_nscale (uint64_t fpmr, uint64_t scale) +{ + return (fpmr & ~((0xff) << 24)) | ((scale & 0xff) << 24); +} + +uint64_t +modify_lscale2 (uint64_t fpmr, uint64_t scale) +{ + return (fpmr & ~((uint64_t)(0x3f) << 32)) | ((uint64_t)(scale & 0x3f) << 32); +} + +int +main (void) +{ + uint64_t fpmr = 0; + /* CHECK SRC1 0 */ + + fpmr = modify_src1_fmt (fpmr, E4M3); + fpmr = modify_src2_fmt (fpmr, E4M3); + fpmr = modify_dst_fmt (fpmr, E4M3); + fpmr = modify_osm (fpmr, SATURATE); + fpmr = modify_osc (fpmr, SATURATE); + fpmr = modify_lscale (fpmr, -1); + fpmr = modify_nscale (fpmr, -1); + fpmr = modify_lscale2 (fpmr, -1); + set_fpmr (fpmr); + /* Check FPMR */ + + *((uint64_t *) crash_address) = 0xDEAD; /* crash point */ + + return 1; +} diff --git a/gdb/testsuite/gdb.arch/aarch64-fpmr-core.exp b/gdb/testsuite/gdb.arch/aarch64-fpmr-core.exp new file mode 100644 index 00000000000..52acfd7291b --- /dev/null +++ b/gdb/testsuite/gdb.arch/aarch64-fpmr-core.exp @@ -0,0 +1,143 @@ +# Copyright (C) 2018-2025 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# This file is part of the gdb testsuite. + +# Test generating and reading a core file with FPMR. + +proc check_fpmr_core_file { core_filename } { + # Load the core file. + if [gdb_test "core $core_filename" \ + [multi_line \ + "Core was generated by .*" \ + "Program terminated with signal SIGSEGV, Segmentation fault\\." \ + "#0 ${::hex} in main \\(.*\\) at .*" \ + ".* \\*\\(\\(uint64_t \\*\\) crash_address\\) = 0xDEAD.*"] \ + "load core file"] { + untested "failed to generate core file" + return -1 + } + + # Check the value of FPMR in the core file. + gdb_test "print/x \$fpmr" " = 0x3fff7fc049" \ + "fpmr contents from core file" +} + +proc remote_core_find {binfile {deletefiles {}} {arg ""}} { + global objdir subdir REMOTE_TMPDIR + + set target_binfile [gdbserver_download_current_prog] + + set destcore "$target_binfile.core" + remote_exec target delete $destcore + + set found 0 + set coredir "${REMOTE_TMPDIR}/coredir.[getpid]" + remote_exec target "mkdir $coredir" + remote_exec target "(cd ${coredir}; ulimit -c unlimited; ${target_binfile} ${arg}; true) >/dev/null 2>&1" + set binfile_basename [file tail $target_binfile] + foreach i [list \ + ${coredir}/core \ + ${coredir}/core.coremaker.c \ + ${coredir}/${binfile_basename}.core \ + ${coredir}/${binfile_basename}.exe.core] { + if [remote_file target exists $i] { + remote_exec target "mv $i $destcore" + set found 1 + } + } + + if { $found == 0 } { + set names [glob -nocomplain -directory $coredir core.*] + if {[llength $names] == 1} { + set corefile [file join $coredir [lindex $names 0]] + remote_exec target "mv $corefile $destcore" + set found 1 + } + } + + foreach deletefile $deletefiles { + remote_file target delete [file join $coredir $deletefile] + } + remote_exec target "rmdir $coredir" + + if { $found == 0 } { + warning "can't generate a core file - core tests suppressed - check ulimit -c" + return "" + } + set native_corefile "${binfile}.core" + remote_download host [remote_upload target $destcore] $native_corefile + + return $native_corefile +} + +require is_aarch64_target +require allow_aarch64_fpmr_tests + +standard_testfile +if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { + return -1 +} + +set binfile [standard_output_file ${testfile}] + +if ![runto_main] { + untested "could not run to main" + return -1 +} + +set crash_breakpoint "crash point" +gdb_breakpoint [gdb_get_line_number $crash_breakpoint] +gdb_continue_to_breakpoint $crash_breakpoint + +gdb_test "print/x \$fpmr" " = 0x3fff7fc049" \ + "fpmr contents from core file" + +gdb_test "continue" \ +[multi_line \ + "Program received signal SIGSEGV, Segmentation fault\\." \ + "${::hex} in main \\(\\).* at .*" \ + ".* \\*\\(\\(uint64_t \\*\\) crash_address\\) = 0xDEAD.*"] \ + "run to crash" + +# Generate the gcore core file. +set gcore_filename [standard_output_file "${testfile}.gcore"] +set gcore_generated [gdb_gcore_cmd "$gcore_filename" "generate gcore file"] + +# Generate a native core file. +set core_filename [remote_core_find ${binfile}] +set core_generated [expr {$core_filename != ""}] + +# At this point we have a couple core files, the gcore one generated by GDB +# and the native one generated by the Linux Kernel. Make sure GDB can read +# both correctly. + +if {$gcore_generated} { + clean_restart ${binfile} + with_test_prefix "gcore corefile" { + check_fpmr_core_file $gcore_filename + } +} else { + fail "gcore corefile not generated" +} + +if {$core_generated} { + clean_restart ${binfile} + with_test_prefix "native corefile" { + check_fpmr_core_file $core_filename + } +} else { + untested "native corefile not generated" +} diff --git a/gdb/testsuite/gdb.arch/aarch64-fpmr-sighandler.c b/gdb/testsuite/gdb.arch/aarch64-fpmr-sighandler.c new file mode 100644 index 00000000000..4ca68a38072 --- /dev/null +++ b/gdb/testsuite/gdb.arch/aarch64-fpmr-sighandler.c @@ -0,0 +1,134 @@ +/* This file is part of GDB, the GNU debugger. + + Copyright 2008-2025 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include +#include +#include +#include + +enum FPM_FORMAT +{ + E5M2, + E4M3, +}; + +enum FPM_OVERFLOW +{ + INFNAN, + SATURATE, +}; + +void +set_fpmr (uint64_t value) +{ + register uint64_t x0_val asm ("x0") = value; + __asm__ volatile (".inst 0xd51b4440" : : ); +} + +uint64_t +modify_src1_fmt (uint64_t fpmr, uint64_t fmt) +{ + return (fpmr & ~(0x7)) | (fmt & 0x7); +} + +uint64_t +modify_src2_fmt (uint64_t fpmr, uint64_t fmt) +{ + return (fpmr & ~((0x7) << 3)) | ((fmt & 0x7) << 3); +} + +uint64_t +modify_dst_fmt (uint64_t fpmr, uint64_t fmt) +{ + return (fpmr & ~((0x7) << 6)) | ((fmt & 0x7) << 6); +} + +uint64_t +modify_osm (uint64_t fpmr, uint64_t overflow) +{ + return (fpmr & ~((0x1) << 14)) | ((overflow & 0x1) << 14); +} + +uint64_t +modify_osc (uint64_t fpmr, uint64_t overflow) +{ + return (fpmr & ~((0x1) << 15)) | ((overflow & 0x1) << 15); +} + +uint64_t +modify_lscale (uint64_t fpmr, uint64_t scale) +{ + return (fpmr & ~((0x7f) << 16)) | ((scale & 0x7f) << 16); +} + +uint64_t +modify_nscale (uint64_t fpmr, uint64_t scale) +{ + return (fpmr & ~((0xff) << 24)) | ((scale & 0xff) << 24); +} + +uint64_t +modify_lscale2 (uint64_t fpmr, uint64_t scale) +{ + return (fpmr & ~((uint64_t)(0x3f) << 32)) | ((uint64_t)(scale & 0x3f) << 32); +} + +void +handler (int sig) +{ + uint64_t fpmr = 0; + fpmr = modify_src1_fmt (fpmr, E4M3); + fpmr = modify_src2_fmt (fpmr, E5M2); + fpmr = modify_dst_fmt (fpmr, E4M3); + fpmr = modify_osm (fpmr, INFNAN); + fpmr = modify_osc (fpmr, SATURATE); + fpmr = modify_lscale (fpmr, 0); + fpmr = modify_nscale (fpmr, -1); + fpmr = modify_lscale2 (fpmr, 0); + set_fpmr (fpmr); + + exit(0); +} + +int +main () +{ + /* Ensure all the signals aren't blocked. */ + sigset_t newset; + sigemptyset (&newset); + sigprocmask (SIG_SETMASK, &newset, NULL); + + signal (SIGILL, handler); + + uint64_t fpmr = 0; + + fpmr = modify_src1_fmt (fpmr, E5M2); + fpmr = modify_src2_fmt (fpmr, E4M3); + fpmr = modify_dst_fmt (fpmr, E5M2); + fpmr = modify_osm (fpmr, SATURATE); + fpmr = modify_osc (fpmr, INFNAN); + fpmr = modify_lscale (fpmr, -1); + fpmr = modify_nscale (fpmr, 0); + fpmr = modify_lscale2 (fpmr, -1); + set_fpmr (fpmr); + + /* 0x06000000 : Cause an illegal instruction. Value undefined as per ARM + Architecture Reference Manual ARMv8, Section C4.1. */ + __asm __volatile (".inst 0x06000000"); + + return 0; +} diff --git a/gdb/testsuite/gdb.arch/aarch64-fpmr-sighandler.exp b/gdb/testsuite/gdb.arch/aarch64-fpmr-sighandler.exp new file mode 100644 index 00000000000..2ba9818b42c --- /dev/null +++ b/gdb/testsuite/gdb.arch/aarch64-fpmr-sighandler.exp @@ -0,0 +1,75 @@ +# Copyright 2018-2025 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# This file is part of the gdb testsuite. + +require is_aarch64_target +require allow_aarch64_fpmr_tests + +standard_testfile +if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { + return -1 +} + +if ![runto_main] { + return -1 +} + +set reg_main_value "0x3f007f4008" +set reg_handler_value "0xff008041" + +proc check_fpmr {value} { + gdb_test "print /x \$fpmr" \ + ".* = {?$value}?" \ + "check register \$fpmr has value $value" +} + +# Run until end of signal handler + +gdb_test "continue" \ + "Continuing.*Program received signal SIGILL.*" \ + "continue until signal" + +gdb_breakpoint [gdb_get_line_number "exit(0)"] +gdb_continue_to_breakpoint "exit" ".*exit.*" + +set handlerframe [get_current_frame_number] +set mainframe [expr $handlerframe + 2] + +# Check register values + +with_test_prefix "handler frame 1st" { + check_fpmr $reg_handler_value +} + +# Switch to the frame for main(), and check register values + +gdb_test "frame $mainframe" \ + "#$mainframe.*main ().*" \ + "set to main frame" + +with_test_prefix "main frame" { + check_fpmr $reg_main_value +} + +# Switch back to the signal handler frame, and check register values + +gdb_test "frame $handlerframe" \ + "#$handlerframe.*handler \\\(sig=4\\\).*" \ + "set to signal handler frame" + +with_test_prefix "handler frame 2nd" { + check_fpmr $reg_handler_value +} diff --git a/gdb/testsuite/gdb.arch/aarch64-fpmr.c b/gdb/testsuite/gdb.arch/aarch64-fpmr.c new file mode 100644 index 00000000000..f4bf889c3a8 --- /dev/null +++ b/gdb/testsuite/gdb.arch/aarch64-fpmr.c @@ -0,0 +1,117 @@ +/* This file is part of GDB, the GNU debugger. + + Copyright 2008-2025 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +enum FPM_FORMAT +{ + E5M2, + E4M3, +}; + +enum FPM_OVERFLOW +{ + INFNAN, + SATURATE, +}; + +void +set_fpmr (uint64_t value) +{ + register uint64_t x0_val asm ("x0") = value; + __asm__ volatile (".inst 0xd51b4440" : : ); +} + +uint64_t +modify_src1_fmt (uint64_t fpmr, uint64_t fmt) +{ + return (fpmr & ~(0x7)) | (fmt & 0x7); +} + +uint64_t +modify_src2_fmt (uint64_t fpmr, uint64_t fmt) +{ + return (fpmr & ~((0x7) << 3)) | ((fmt & 0x7) << 3); +} + +uint64_t +modify_dst_fmt (uint64_t fpmr, uint64_t fmt) +{ + return (fpmr & ~((0x7) << 6)) | ((fmt & 0x7) << 6); +} + +uint64_t +modify_osm (uint64_t fpmr, uint64_t overflow) +{ + return (fpmr & ~((0x1) << 14)) | ((overflow & 0x1) << 14); +} + +uint64_t +modify_osc (uint64_t fpmr, uint64_t overflow) +{ + return (fpmr & ~((0x1) << 15)) | ((overflow & 0x1) << 15); +} + +uint64_t +modify_lscale (uint64_t fpmr, uint64_t scale) +{ + return (fpmr & ~((0x7f) << 16)) | ((scale & 0x7f) << 16); +} + +uint64_t +modify_nscale (uint64_t fpmr, uint64_t scale) +{ + return (fpmr & ~((0xff) << 24)) | ((scale & 0xff) << 24); +} + +uint64_t +modify_lscale2 (uint64_t fpmr, uint64_t scale) +{ + return (fpmr & ~((uint64_t)(0x3f) << 32)) | ((uint64_t)(scale & 0x3f) << 32); +} + +int +main (void) +{ + uint64_t fpmr = 0; + + fpmr = modify_src1_fmt (fpmr, E4M3); + set_fpmr (fpmr); /* MODIFY SRC1 */ + + fpmr = modify_src2_fmt (fpmr, E4M3); + set_fpmr (fpmr); /* MODIFY SRC2 */ + + fpmr = modify_dst_fmt (fpmr, E4M3); + set_fpmr (fpmr); /* MODIFY DST */ + + fpmr = modify_osm (fpmr, SATURATE); + set_fpmr (fpmr); /* MODIFY OSM */ + + fpmr = modify_osc (fpmr, SATURATE); + set_fpmr (fpmr); /* MODIFY OSC */ + + fpmr = modify_lscale (fpmr, -1); + set_fpmr (fpmr); /* MODIFY LSCALE */ + + fpmr = modify_nscale (fpmr, -1); + set_fpmr (fpmr); /* MODIFY NSCALE */ + + fpmr = modify_lscale2 (fpmr, -1); + set_fpmr (fpmr); /* MODIFY LSCALE2 */ + + return 1; +} diff --git a/gdb/testsuite/gdb.arch/aarch64-fpmr.exp b/gdb/testsuite/gdb.arch/aarch64-fpmr.exp new file mode 100644 index 00000000000..211f6fdd40a --- /dev/null +++ b/gdb/testsuite/gdb.arch/aarch64-fpmr.exp @@ -0,0 +1,116 @@ +# Copyright 2023-2025 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . */ + +# Exercise reading/writing FPMR when there is FPMR. + +require is_aarch64_target +require allow_aarch64_fpmr_tests + +standard_testfile +if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { + return -1 +} + +if ![runto_main] { + untested "could not run to main" + return -1 +} + +gdb_test_multiple "info register \$fpmr" "Test FPMR SRC1 E5M2" { + -re ".*\r\n.*\[ F8S1=E5M2 F8S2=E5M2 F8D=E5M2 OSM=Inf OSC=Inf/NaN LSCALE=0 NSCALE=0 LSCALE2=0 \]" { + pass "FPMR SRC1 matches E5M2" + } +} + +set modify_src1_bp "MODIFY SRC1" +gdb_breakpoint [gdb_get_line_number $modify_src1_bp] +gdb_continue_to_breakpoint $modify_src1_bp + +gdb_test_multiple "info register \$fpmr" "" { + -re ".*\r\n.*\[ F8S1=E4M3 F8S2=E5M2 F8D=E5M2 OSM=Inf OSC=Inf/NaN LSCALE=0 NSCALE=0 LSCALE2=0 \]" { + pass "FPMR SRC1 matches E4M3, SRC2 matches E5M2" + } +} + +set modify_src2_bp "MODIFY SRC2" +gdb_breakpoint [gdb_get_line_number $modify_src2_bp] +gdb_continue_to_breakpoint $modify_src2_bp + +gdb_test_multiple "info register \$fpmr" "" { + -re ".*\r\n.*\[ F8S1=E4M3 F8S2=E4M3 F8D=E5M2 OSM=Inf OSC=Inf/NaN LSCALE=0 NSCALE=0 LSCALE2=0 \]" { + pass "FPMR SRC2 matches E4M3" + } +} + +set modify_dst_bp "MODIFY DST" +gdb_breakpoint [gdb_get_line_number $modify_dst_bp] +gdb_continue_to_breakpoint $modify_dst_bp + +gdb_test_multiple "info register \$fpmr" "" { + -re ".*\r\n.*\[ F8S1=E4M3 F8S2=E4M3 F8D=E4M3 OSM=Inf OSC=Inf/NaN LSCALE=0 NSCALE=0 LSCALE2=0 \]" { + pass "FPMR DST matches E4M3" + } +} + +set modify_osm_bp "MODIFY OSM" +gdb_breakpoint [gdb_get_line_number $modify_osm_bp] +gdb_continue_to_breakpoint $modify_osm_bp + +gdb_test_multiple "info register \$fpmr" "" { + -re ".*\r\n.*\[ F8S1=E4M3 F8S2=E4M3 F8D=E4M3 OSM=MaxNormal OSC=Inf/NaN LSCALE=0 NSCALE=0 LSCALE2=0 \]" { + pass "FPMR OSM matches MaxNormal" + } +} + +set modify_osc_bp "MODIFY OSC" +gdb_breakpoint [gdb_get_line_number $modify_osc_bp] +gdb_continue_to_breakpoint $modify_osc_bp + +gdb_test_multiple "info register \$fpmr" "" { + -re ".*\r\n.*\[ F8S1=E4M3 F8S2=E4M3 F8D=E4M3 OSM=MaxNormal OSC=MaxNormal LSCALE=0 NSCALE=0 LSCALE2=0 \]" { + pass "FPMR OSC matches MaxNormal" + } +} + +set modify_lscale_bp "MODIFY LSCALE" +gdb_breakpoint [gdb_get_line_number $modify_lscale_bp] +gdb_continue_to_breakpoint $modify_lscale_bp + +gdb_test_multiple "info register \$fpmr" "" { + -re ".*\r\n.*\[ F8S1=E4M3 F8S2=E4M3 F8D=E4M3 OSM=MaxNormal OSC=MaxNormal LSCALE=127 NSCALE=0 LSCALE2=0 \]" { + pass "FPMR LSCALE matches" + } +} + +set modify_nscale_bp "MODIFY NSCALE" +gdb_breakpoint [gdb_get_line_number $modify_nscale_bp] +gdb_continue_to_breakpoint $modify_nscale_bp + +# GDB does not present bitfields as signed value. +gdb_test_multiple "info register \$fpmr" "" { + -re ".*\r\n.*\[ F8S1=E4M3 F8S2=E4M3 F8D=E4M3 OSM=MaxNormal OSC=MaxNormal LSCALE=127 NSCALE=255 LSCALE2=0 \]" { + pass "FPMR NSCALE matches" + } +} + +set modify_lscale2_bp "MODIFY LSCALE2" +gdb_breakpoint [gdb_get_line_number $modify_lscale2_bp] +gdb_continue_to_breakpoint $modify_lscale2_bp + +gdb_test_multiple "info register \$fpmr" "" { + -re ".*\r\n.*\[ F8S1=E4M3 F8S2=E4M3 F8D=E4M3 OSM=MaxNormal OSC=MaxNormal LSCALE=127 NSCALE=255 LSCALE2=63 \]" { + pass "FPMR LSCALE2 matches" + } +} diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index ab4506a4455..a6961fb8719 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -5266,6 +5266,55 @@ proc aarch64_supports_sme_svl { length } { return 1 } +# Run a test on the target to see if it supports AArch64 FPMR hardware. +# Return 1 if so, 0 if it does not. Note this causes a restart of GDB. + +gdb_caching_proc allow_aarch64_fpmr_tests {} { + global srcdir subdir gdb_prompt inferior_exited_re + + set me "allow_aarch64_fpmr_tests" + + if { ![is_aarch64_target]} { + return 0 + } + + set compile_flags "{additional_flags=-march=armv8-a}" + + # Compile a test program that writes to FPMR. + set src { + int main() { + asm volatile (".inst 0xd51b4440"); + return 0; + } + } + if {![gdb_simple_compile $me $src executable $compile_flags]} { + return 0 + } + + # Compilation succeeded so now run it via gdb. + clean_restart $obj + gdb_run_cmd + gdb_expect { + -re ".*Illegal instruction.*${gdb_prompt} $" { + verbose -log "\n$me fpmr not detected" + set allow_fpmr_tests 0 + } + -re ".*$inferior_exited_re normally.*${gdb_prompt} $" { + verbose -log "\n$me: fpmr hardware detected" + set allow_fpmr_tests 1 + } + default { + warning "\n$me: default case taken" + set allow_fpmr_tests 0 + } + } + gdb_exit + remote_file build delete $obj + + verbose "$me: returning $allow_fpmr_tests" 2 + return $allow_fpmr_tests +} + # Run a test on the target to see if it supports AArch64 MOPS (Memory # Operations) extensions. Return 1 if so, 0 if it does not. Note this # causes a restart of GDB. -- 2.45.2