From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2083.outbound.protection.outlook.com [40.107.21.83]) by sourceware.org (Postfix) with ESMTPS id 8DB17385828D for ; Wed, 3 Jan 2024 01:17:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8DB17385828D 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 8DB17385828D Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.21.83 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1704244685; cv=pass; b=wDZeGnbzjWg6Q+LKeA/TvLSTDj4eXIwF2wzSlM/e2kyHOAkkQZ0OLGAOwHAn3pQzEqjLYbGBmHdX7/ah2z5D+P6tMQCp5dnO9vSTXsAOyyxEdU0cYX+0r0U85jkWIKEcFr7j6WwmiFebBBDRsknuu40WoprvEaR5lJ6r+cYVT0g= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1704244685; c=relaxed/simple; bh=XYrMCm4ShPoZ69G/zZHsOdJghyhqv+BhCMr4xNmFkxs=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=Uvqw9aenrXCD9uhBoqP3iGEHG7uHxALSVYFVSgnOmtm0eU1GFH9E+5CqgomfYAYpncy26vt5sk7lubCyaGQK5TGwIZrNJrUkNtP3HpE5A+5j8++1l7yry3u31D6kmJGk5kwumPVgRyhWtKQfy9hvmuOl+uDdik8agnItkhhaiPk= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=PBgQXlM3TyhzZGBSuQMkjxYKqhjr8CZRm70XWE2upvJv5g4gObkOAvrr8Lr14pku/ZVALAm4Na3IYlPDfIlgoqd+t6ECfLq/91YTI/wYoYMGv7+wrETsnOxgPk7qBYi3K34+pq6HqvGkoluJN8xvDaV/RdtSGCeqiwm4CTL+dHqyO9FkaJYPAeuwN76Tg6HDYsyYT0OnRZlyb7FCvXlSMDClXb5YYQo3LBgcPo0N4+4UuEimNulczFTj56PuAkRa1uyIsY2cXA0d1OPucGsqC82e3VEJFMnpEX5tb2QfbZgFWDwgNzQTGieX2370YkYSeqnJAx+Vf0426SXecpTerg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=trb8O4JdhFfJ23EmIjibJBx4QkfnykZxaSKGVVsCYG4=; b=N5kxkvmr/Tca3+6pv1isCdS7TKP7bMDChvvkPevOlVMMjuBybgWEobz3JZuyL8Wo/A+/P+E7XVY2Uuie+nFx8YXnu3Px7afk/sfq2qkdDIybo+C/m8cRF53mMa6cjTNdPXiiawomvdxLP2J0pDYwwGXYcLrxwvLIC3iBFV5hX0O5gMRyZUgv6brLkHeY3AAjShyyUw+3YnCu5CuHYeruS3FGX8XohEgBdmVAgKY1HRO8ei0bgybP9YpsNanaLBA3Vq8/Jgwmd1TzBnLjSWb+IPvLw62RLJHNfqxI4YHslyeev06yF4qboGuJLHPJxJWdXlOekMEHgXvt3P3MNpjzww== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) 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=armh.onmicrosoft.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=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=trb8O4JdhFfJ23EmIjibJBx4QkfnykZxaSKGVVsCYG4=; b=iZlRbYyzRk34XpM0eezyz8JaYeeKzVjQj04Ar1s39KpR3XL5ECfpsGgpWkiyQSvuoXkJOmwZaHUE1fedBF3qGtFEhFX2M1/TI61ezQ9OiOyETOLRyQW92DLjG3wNzITIabs+jvCo3F8MZGFwEPfqQxOEvcqD28cobBUqs917OwM= Received: from AS4P192CA0002.EURP192.PROD.OUTLOOK.COM (2603:10a6:20b:5da::9) by DU0PR08MB7995.eurprd08.prod.outlook.com (2603:10a6:10:3e2::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.25; Wed, 3 Jan 2024 01:17:54 +0000 Received: from AM4PEPF00027A5F.eurprd04.prod.outlook.com (2603:10a6:20b:5da:cafe::67) by AS4P192CA0002.outlook.office365.com (2603:10a6:20b:5da::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.25 via Frontend Transport; Wed, 3 Jan 2024 01:17:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM4PEPF00027A5F.mail.protection.outlook.com (10.167.16.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.9 via Frontend Transport; Wed, 3 Jan 2024 01:17:53 +0000 Received: ("Tessian outbound 7671e7ddc218:v228"); Wed, 03 Jan 2024 01:17:53 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 57338d4e78b5e570 X-CR-MTA-TID: 64aa7808 Received: from 6bae1c37f56e.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 15256870-70E2-4BE2-9E0C-98FF480CA200.1; Wed, 03 Jan 2024 01:17:46 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 6bae1c37f56e.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 03 Jan 2024 01:17:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MRRllpioawFwCB2CDi25o89B2I/H4LXAn3CM5c6s64rol47QhEI9kxrbBvpV025ppgRES8zzXi30Piw/sUm+WaHZv6pMsLkUZ3GE0gSwaB565QDq5ztGII5eWBknPNrmLcOBFVfTZF99L3OABQgKQO7qLxWQbTop+83mA4pEknjc+HYcIYi3tIVl7QYH46N2Ubx3Kic8CskqsQYc+yDLEUV5p13zDVgwpfGj7FZhpYV2R4xJWAUdRgY+CGeEMPpCQ1F1vkO2E2H+QMpXd57OWDQpSUMhZ8x2m/gZVOyGurdeX2wjxN8HgNQwLrytI++ckdYSRjUyw3ug6RN9wGpZag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=trb8O4JdhFfJ23EmIjibJBx4QkfnykZxaSKGVVsCYG4=; b=m5WxmLehD+waDzapY5RiRTLPkmsZaeHQnNKOmcT2XwBdWvCc3Q3hF4FxJwiWrWA/oSXYUJ+qKhwDZXWjqxWYfFGD701qAAIDiKOWKSoQUUlxPLbkiPe63Vp1JhLb9iVjKaRPgSmAAq2tuqutFi6onCTQ/flfDUrl4Qi2snKrqIMo80vPjnf/+OCsXPiYRjIToIdkKJLOrOZwbo1oxVaaRT3EGztjr+pMiKx8llou2ee8Zt9Rrk/u2UnRM23ioLxbeZNeJhtWnHdJCFCxtlBQMRGFvyYO+pKfCHhw5hXUf3mpKZcbvsQssruOASjE/5UaUtZ9Lbj98wN+qkVF6DRbgA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) 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=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=trb8O4JdhFfJ23EmIjibJBx4QkfnykZxaSKGVVsCYG4=; b=iZlRbYyzRk34XpM0eezyz8JaYeeKzVjQj04Ar1s39KpR3XL5ECfpsGgpWkiyQSvuoXkJOmwZaHUE1fedBF3qGtFEhFX2M1/TI61ezQ9OiOyETOLRyQW92DLjG3wNzITIabs+jvCo3F8MZGFwEPfqQxOEvcqD28cobBUqs917OwM= Received: from DU2PR04CA0162.eurprd04.prod.outlook.com (2603:10a6:10:2b0::17) by DB3PR08MB9900.eurprd08.prod.outlook.com (2603:10a6:10:43e::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.25; Wed, 3 Jan 2024 01:17:45 +0000 Received: from DU2PEPF0001E9BF.eurprd03.prod.outlook.com (2603:10a6:10:2b0:cafe::ee) by DU2PR04CA0162.outlook.office365.com (2603:10a6:10:2b0::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.25 via Frontend Transport; Wed, 3 Jan 2024 01:17:45 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) 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 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by DU2PEPF0001E9BF.mail.protection.outlook.com (10.167.8.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7159.9 via Frontend Transport; Wed, 3 Jan 2024 01:17:45 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Wed, 3 Jan 2024 01:17:44 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Wed, 3 Jan 2024 01:17:44 +0000 Received: from e125768.cambridge.arm.com (10.2.78.50) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.32 via Frontend Transport; Wed, 3 Jan 2024 01:17:44 +0000 From: Victor Do Nascimento To: CC: , , Victor Do Nascimento Subject: [PATCH 06/12] aarch64: Apply narrowing of allowed immediate values for SYSP Date: Wed, 3 Jan 2024 01:17:20 +0000 Message-ID: <20240103011739.2444792-7-victor.donascimento@arm.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240103011739.2444792-1-victor.donascimento@arm.com> References: <20240103011739.2444792-1-victor.donascimento@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DU2PEPF0001E9BF:EE_|DB3PR08MB9900:EE_|AM4PEPF00027A5F:EE_|DU0PR08MB7995:EE_ X-MS-Office365-Filtering-Correlation-Id: d9f5baaf-0d39-4f0d-2bd3-08dc0bf9cfb2 X-LD-Processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: JItwDdfzRhwyqwuTCHK4crDeqFaEa5M8Lu3bUDQhFE2utX9j3u1i/FVaxgucOs/heI8zbJ7KldYwclewbLsUSewIjof7+f1Pc0/WuiVn2XdkyIJIdCEt8Mw8fgHkJLe0Uc7HBWTXJFnBK7gWmlxBC74w8REbOE2CDGtl4D81jdTtSi4/h1x9jvfuoQTOnN1zAadUltdCZ2eqWtEr/lr1B8+AlltW04Ma7psZCtiBATx97McGN4ba7SJWt06/RJZbWlmu6PCFBhe+3DL2jl67GbAyU6Eq3smTMQ4dpOBUaLfeGKqj+a/mjocJayvOBMY7iQsx9OgPTcKxMDr2nwXnaO0uirsT7POpv586vOD7Fg91GRDREJspZ7ppruyxXoYW3UdzvyBqM5CxSIzBjRC0840KUkg2+Twgyvj8nOye4KfraXBbMnDyoz//UAXliadAoqaQQ+Gd6nyrngivfe/fOnxowry0CIqrZegkrociHiAuvvqqJIqf0jX0BhbdR/escrt+seZ2j55JB85iige60p7Qx9alztwqSDsPUXAVqcpRIY9TO3ScEQRsKH9vA1Y0A9l1+TyKmd/gtW2fz9z6ERLV/cADTAKwII+rs2f1FTVWuT1moXyZN8DFI7O8TFXj0Vm60Cw0kXu+XpSYQnjWMrNA9gE7UNr3Qo0EzI6HC6xOknLEH2Cr6DdEC5JU7epiBTYdOdabMnDDZaBiVa+927SmrN+/RmG4DIL2cfnpfuaTb9eiIz4Y+NbCSdEfk0ZAoMMH/LUjOXqgPCLS5JaRzw== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(39850400004)(396003)(136003)(376002)(346002)(230922051799003)(186009)(64100799003)(82310400011)(1800799012)(451199024)(46966006)(36840700001)(36756003)(40480700001)(14773004)(70206006)(6916009)(86362001)(82740400003)(81166007)(356005)(83380400001)(1076003)(70586007)(41300700001)(2616005)(26005)(47076005)(4326008)(336012)(2906002)(426003)(7696005)(478600001)(8676002)(8936002)(316002)(36860700001)(5660300002)(6666004)(54906003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR08MB9900 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM4PEPF00027A5F.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 69611503-7ad8-4c10-c029-08dc0bf9ca79 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oEqj+Rgprgdk+8K3zNw8qLJuPDkD50hXrq1p08s1pmIjaFblPCLAEyaCMejTkGR0UkQv4drOL/DTCQEXE4yFNzD2EtAOaxDcCSv9asbwDPceGbSziBunyYFxsUHbj4rSpeQrCA6uYg06ovLSZaCImlrrXE/HH/2P8U9oh6z6Y9EPDqfbweAds0XafiAPtg1n6ZQyc/o3+Rn+ZSXoNcD4PVl7FWLLVIQpSidwhHxgxvhh1QENbmHmHfxj2FcgbHl1/is7sru40kCs8f9wh5S7bgigUE28iRtSWrxtaVTHCnFLHJapC/CuvGhVCRNZAUuTRYS1Edt0I4Dp2zfKFiTasmdSorND17FP+FdAOTQ4xOD2hcChqQrcktUmwd7v/3ZlX1/c/gBPBVF47auMWT3GtUFfP23q2vB63/7g025C2z8iQe1iNGJR21PYW6DoJjrGTLmQg/70V26B7uowFkc6mHzMxgUVuNyxK5OCNva3Ph5sf2/eQNDmmE4WHDzf7hzhiJuMqiCLq3KX0IZdMYs1CptaW6WxksmLzhMzw2zS5tssnTad5OqQUnxy3R3k/l/YdvyxDhAAxE7ylt2NtcXBMaaYREOdYVwSCQRQmPMf57mcXGIoGjDP6DF5h88RxAe7NbQBLEWyQPAB+s8lpuGRLRSdMDBIe/uWgkUinqMX7NjR3UnfTcedYcaC6VE5+R4pva2j2Nt3h8C6XkWcGuVUT2bNt/lsp6mVQc51GKecNJ6DJCOxG7eUubaBx1mMm/NQHjSAMASWKbcQC26rUETgPw== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230031)(4636009)(39860400002)(376002)(346002)(136003)(396003)(230922051799003)(1800799012)(64100799003)(82310400011)(451199024)(186009)(40470700004)(46966006)(36840700001)(40460700003)(36756003)(40480700001)(70586007)(70206006)(14773004)(6916009)(86362001)(336012)(426003)(5660300002)(81166007)(6666004)(41300700001)(1076003)(2616005)(47076005)(26005)(2906002)(478600001)(7696005)(82740400003)(8936002)(36860700001)(316002)(54906003)(4326008)(8676002)(83380400001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jan 2024 01:17:53.8621 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d9f5baaf-0d39-4f0d-2bd3-08dc0bf9cfb2 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM4PEPF00027A5F.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB7995 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,GIT_PATCH_0,KAM_DMARC_NONE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: While CRn and CRm fields in the SYSP instruction are 4-bit wide and are thus able to accommodate values in the range 0-15, the specifications for the SYSP instructions limit their ranges to 8-9 for CRm and 0-7 in the case of CRn. This led to the need to signal in some way to the operand parser that a given operand is under special restrictions regarding its use. This is done via the new `F_OPD_NARROW' flag, indicating a narrowing in the range of operand values for fields in the instruction tagged with the flag. The flag is then used in `parse_operands' when the instruction is assembled, but needs not be taken into consideration during disassembly. --- gas/config/tc-aarch64.c | 18 +++++++++++++++++- gas/testsuite/gas/aarch64/illegal-sys128.d | 3 +++ gas/testsuite/gas/aarch64/sysp.d | 10 ++++++++++ gas/testsuite/gas/aarch64/sysp.s | 4 ++++ include/opcode/aarch64.h | 7 ++++++- opcodes/aarch64-tbl.h | 2 +- 6 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 gas/testsuite/gas/aarch64/illegal-sys128.d create mode 100644 gas/testsuite/gas/aarch64/sysp.d create mode 100644 gas/testsuite/gas/aarch64/sysp.s diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c index 12fb1740635..cc08fd31dd4 100644 --- a/gas/config/tc-aarch64.c +++ b/gas/config/tc-aarch64.c @@ -6485,6 +6485,7 @@ parse_operands (char *str, const aarch64_opcode *opcode) int i; char *backtrack_pos = 0; const enum aarch64_opnd *operands = opcode->operands; + const uint64_t flags = opcode->flags; aarch64_reg_type imm_reg_type; clear_error (); @@ -6833,7 +6834,22 @@ parse_operands (char *str, const aarch64_opcode *opcode) goto failure; po_imm_nc_or_fail (); - if (val > 15) + if (flags & F_OPD_NARROW) + { + if ((operands[i] == AARCH64_OPND_CRn) + && (val < 8 || val > 9)) + { + set_fatal_syntax_error (_(N_ ("C8 - C9 expected"))); + goto failure; + } + else if ((operands[i] == AARCH64_OPND_CRm) + && (val > 7)) + { + set_fatal_syntax_error (_(N_ ("C0 - C7 expected"))); + goto failure; + } + } + else if (val > 15) { set_fatal_syntax_error (_(N_ ("C0 - C15 expected"))); goto failure; diff --git a/gas/testsuite/gas/aarch64/illegal-sys128.d b/gas/testsuite/gas/aarch64/illegal-sys128.d new file mode 100644 index 00000000000..891b9347167 --- /dev/null +++ b/gas/testsuite/gas/aarch64/illegal-sys128.d @@ -0,0 +1,3 @@ +#name: Out-of-bounds SYSP operand tests +#source: illegal-sys128.s +#error_output: illegal-sys128.l diff --git a/gas/testsuite/gas/aarch64/sysp.d b/gas/testsuite/gas/aarch64/sysp.d new file mode 100644 index 00000000000..80286c19ffd --- /dev/null +++ b/gas/testsuite/gas/aarch64/sysp.d @@ -0,0 +1,10 @@ +#objdump: -dr + +.* + + +Disassembly of section \.text: + +0+ <\.text>: +[^:]*: d5488000 sysp #0, C8, C0, #0, x0, x1 +[^:]*: d54e97fa sysp #6, C9, C7, #7, x26, x27 \ No newline at end of file diff --git a/gas/testsuite/gas/aarch64/sysp.s b/gas/testsuite/gas/aarch64/sysp.s new file mode 100644 index 00000000000..f50d3ab05a8 --- /dev/null +++ b/gas/testsuite/gas/aarch64/sysp.s @@ -0,0 +1,4 @@ + .arch armv9.4-a+d128 + + sysp #0, C8, C0, #0, x0, x1 + sysp #6, C9, C7, #7, x26, x27 diff --git a/include/opcode/aarch64.h b/include/opcode/aarch64.h index c69f85557d0..d170bdf0bde 100644 --- a/include/opcode/aarch64.h +++ b/include/opcode/aarch64.h @@ -1224,7 +1224,12 @@ extern const aarch64_opcode aarch64_opcode_table[]; to be optional, then we also implicitly specify (N+1)th operand to also be optional. */ #define F_OPD_PAIR_OPT (1ULL << 32) -/* Next bit is 33. */ +/* This instruction does not allow the full range of values that the + width of fields in the assembler instruction would theoretically + allow. This impacts the constraintts on assembly but yelds no + impact on disassembly. */ +#define F_OPD_NARROW (1ULL << 33) +/* Next bit is 34. */ /* Instruction constraints. */ /* This instruction has a predication constraint on the instruction at PC+4. */ diff --git a/opcodes/aarch64-tbl.h b/opcodes/aarch64-tbl.h index 79830e007d5..98feb56e08a 100644 --- a/opcodes/aarch64-tbl.h +++ b/opcodes/aarch64-tbl.h @@ -4201,7 +4201,7 @@ const struct aarch64_opcode aarch64_opcode_table[] = GCS_INSN ("gcssttr", 0xd91f1c00, 0xfffffc00, OP2 (Rt, Rn_SP), QL_I2SAMEX, 0), CORE_INSN ("gcsb", 0xd503227f, 0xffffffff, ic_system, 0, OP1 (BARRIER_GCSB), {}, F_ALIAS), CORE_INSN ("sys", 0xd5080000, 0xfff80000, ic_system, 0, OP5 (UIMM3_OP1, CRn, CRm, UIMM3_OP2, Rt), QL_SYS, F_HAS_ALIAS | F_OPD4_OPT | F_DEFAULT (0x1F)), - D128_INSN ("sysp", 0xd5480000, 0xfff80000, OP6 (UIMM3_OP1, CRn, CRm, UIMM3_OP2, Rt, PAIRREG_OR_XZR), QL_SYSP, F_HAS_ALIAS | F_OPD4_OPT | F_OPD_PAIR_OPT | F_DEFAULT (0x1f)), + D128_INSN ("sysp", 0xd5480000, 0xfff80000, OP6 (UIMM3_OP1, CRn, CRm, UIMM3_OP2, Rt, PAIRREG_OR_XZR), QL_SYSP, F_HAS_ALIAS | F_OPD_NARROW | F_OPD4_OPT | F_OPD_PAIR_OPT | F_DEFAULT (0x1f)), CORE_INSN ("at", 0xd5080000, 0xfff80000, ic_system, 0, OP2 (SYSREG_AT, Rt), QL_SRC_X, F_ALIAS), CORE_INSN ("dc", 0xd5080000, 0xfff80000, ic_system, 0, OP2 (SYSREG_DC, Rt), QL_SRC_X, F_ALIAS), CORE_INSN ("ic", 0xd5080000, 0xfff80000, ic_system, 0, OP2 (SYSREG_IC, Rt_SYS), QL_SRC_X, F_ALIAS | F_OPD1_OPT | F_DEFAULT (0x1F)), -- 2.42.0