From patchwork Wed Jan 3 01:17:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Do Nascimento X-Patchwork-Id: 83176 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A66483857BAF for ; Wed, 3 Jan 2024 01:21:00 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2080.outbound.protection.outlook.com [40.107.6.80]) by sourceware.org (Postfix) with ESMTPS id 7AB32385800B for ; Wed, 3 Jan 2024 01:17:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7AB32385800B 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 7AB32385800B Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.6.80 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1704244687; cv=pass; b=gw12hsHexg5xvJiTWtKw51YZgFfN7BH6Zzq1HdeFslAcYNwVSaKQsdZ2OoJzFICVz326ZI+nLSVKdQSV/cpVI4RFk1ilSdp+ccXnjI4rhkY4/NJcoSkkisVhy1luE05woJBh+7ScGWz8WhtC0CwuspAXHEhdgNfWpfj1cUAXc4o= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1704244687; c=relaxed/simple; bh=o2FpSfWQFHDD1MCuLPeHLKv9DVzvH0zy+So49Nyv900=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=oVVUhUDvGXPy7bkvTyvRqAxWRQRSlWUnEYssTRU0y6HTGtPW92jeDDBLlGSZRPKlE1NbQfLDWf+5g852PkkbkAsWdUTGUHQt0fNUwFiL6yBoZltbsoylvFyskZRgClCJjRwFuBMxa3an+tAZoG2FkqQOtNKyv7EP4m+XQFdRabs= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=AY5j5VUtrvXU6hTWbgvmm3mYnrS6jeacYqAooRP++mn8+BtsdvJlAWonEnHc+DimJWabVnXCp5GMkyPadI9nu6+NQdJNqC3k4WhyPfmtY9la1k1mW5kYB8/WlYCAqlKnkMuHKw8tdBumulduisb/td1eE61EYANviq2Neh6lRGcK0gbPdWgVuQDL06HKcraExI2WMJe4j+CvuGniyRjfZNR4YB15wHj2MsU7Yn3YXgDHitkjHSq3mXuBkF3z1G98KGzStineYMs0eIM5y1It53U0gv4BifRKczxfFoTNqJtLMZD4l7eE53LH7Dmqc/oNT8IKcVEgvfbUbk7GuMq94A== 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=ddKuzc22nUhZl42hRp9wEMYMtLDol5q/1ZBAbMtRFgA=; b=ix6PHrLjF9Ius4nIiPhhXrM7ohUdPXwkN3MUvBqNupBIzxr1iIfGgXIHJhq9mmsfVHDhokSwO2AJiSx034s9Eio65BGcRQPpn+61aGhnib4g0yuZSm+oueUSz88b26TnS7NiMLZxDfYQsJCVOWIy2oKOLGtBA6vG2fLl/Syr/4MO3i8UCVsIOeTWtrs7yQr3qFSmkZhdHCNldt8D9SgZjUBs9c55rWZO72Uk/MsApNKTLOlUBqykkDAI5mBbekq46Zrwx2cpQXYZYnfYcXIVKgPx/u8wcBH9ImNCgR3YkPi76aXtm48cvnXcuPkFGaG6H1yj6qjkcxmunDLtVxGd9w== 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=ddKuzc22nUhZl42hRp9wEMYMtLDol5q/1ZBAbMtRFgA=; b=XXxnzvB35SC1bF77snHugHPqvcSsuQ8r0iX9/e2zD8F3MzEOzi69AQ/mJwi8ofUDSrOxi5PpjsjbgqfBxr7KF6+00Mt5xtip7MahR/l8T5TXKv6Vxnob0bhZGgzsjD9ETBtnriv8UIUpgBGILBP23TIOM7S5RvvwRGHZuaQgd7o= Received: from DU2PR04CA0237.eurprd04.prod.outlook.com (2603:10a6:10:2b1::32) by DU0PR08MB9559.eurprd08.prod.outlook.com (2603:10a6:10:44c::18) 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:57 +0000 Received: from DB5PEPF00014B8F.eurprd02.prod.outlook.com (2603:10a6:10:2b1:cafe::f6) by DU2PR04CA0237.outlook.office365.com (2603:10a6:10:2b1::32) 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:56 +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 DB5PEPF00014B8F.mail.protection.outlook.com (10.167.8.203) 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:56 +0000 Received: ("Tessian outbound 7671e7ddc218:v228"); Wed, 03 Jan 2024 01:17:56 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 8cdd36c972b682f6 X-CR-MTA-TID: 64aa7808 Received: from f6e036823d9a.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 2B98F941-888E-460A-9C77-B9FB60318F7D.1; Wed, 03 Jan 2024 01:17:49 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f6e036823d9a.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 03 Jan 2024 01:17:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T90uwHCgXgYHW4C/iR+p+VTxQFVfgV+Ro6Tu66Dx6p3s55xpHVas9bb2q/e9KXhy7mO2SPkHnCUCY6ojSEUQXd74dWeqI+LDgIKhQF9gspZCh6QHz+Da25Hu/wHH92/fAYpIMvRSIaLJ30t4mFGw+xPDXLrfVPw4ozFurb9rbpfPt1+HpumWniENUGG7gE9rgHCKaTRhvMyi5eQzVsqeqMbXJADYLt0c4B6LeRcCbVwkzsO6wUTs3QcxAZ40Gzq9SI+iERm2/AHFshqnJ9G8NztKCbCkZTZBC2sR1Qt/9WBRSjsOI6OOVS0HB8UbvIa3ad94Bak3CUjdt/WkLb3/WA== 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=ddKuzc22nUhZl42hRp9wEMYMtLDol5q/1ZBAbMtRFgA=; b=ImL5fzR4ZpI3xZzL1cGjWCVhCeeVB78Jr+RHeDwdqU01o0+SNRdbH8xBxGLz9pcjqYlRLH0GKVHHPB2fxRJ0X8vTpgTD2KnOe1GfcddaJ23KqVq4r7gw+nUJGbyrs7NKUzHZN21Mrx76+C1QxBxKnsyLA0XqhuahbKyKB9nENh8dHw4VAnAkgGrRm/iMyXmSRq1L5TgBZVjO7QKLVJiMdzXe8q7dWIvnMWhMw9lU1DSC/znVKPwAd+3GtQdcbOH4ZUFH24wk0PWt/iFvr0xdsYBnLvEozkjwdsTOD0sOtlR5iHTYs0ZNNNpRoScg0zRyAUqDlS0VlCfJ0Qm4641P9A== 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=ddKuzc22nUhZl42hRp9wEMYMtLDol5q/1ZBAbMtRFgA=; b=XXxnzvB35SC1bF77snHugHPqvcSsuQ8r0iX9/e2zD8F3MzEOzi69AQ/mJwi8ofUDSrOxi5PpjsjbgqfBxr7KF6+00Mt5xtip7MahR/l8T5TXKv6Vxnob0bhZGgzsjD9ETBtnriv8UIUpgBGILBP23TIOM7S5RvvwRGHZuaQgd7o= Received: from AM0PR02CA0130.eurprd02.prod.outlook.com (2603:10a6:20b:28c::27) by AS8PR08MB6134.eurprd08.prod.outlook.com (2603:10a6:20b:291::22) 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 AM4PEPF00025F99.EURPRD83.prod.outlook.com (2603:10a6:20b:28c:cafe::62) by AM0PR02CA0130.outlook.office365.com (2603:10a6:20b:28c::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.13 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 AM4PEPF00025F99.mail.protection.outlook.com (10.167.16.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7181.1 via Frontend Transport; Wed, 3 Jan 2024 01:17:45 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX03.Arm.com (10.251.24.31) 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:43 +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:43 +0000 From: Victor Do Nascimento To: CC: , , Victor Do Nascimento Subject: [PATCH 03/12] aarch64: Add support for xzr register in register pair operands Date: Wed, 3 Jan 2024 01:17:17 +0000 Message-ID: <20240103011739.2444792-4-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 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM4PEPF00025F99:EE_|AS8PR08MB6134:EE_|DB5PEPF00014B8F:EE_|DU0PR08MB9559:EE_ X-MS-Office365-Filtering-Correlation-Id: c772bf3f-473e-43ad-f168-08dc0bf9d171 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: 6dAKsvpylYiEF9rs/lhpKmeJN0EM8ZwngbdXoMLMfO7SlEFgVfKjV/96K5tlhfGOzgYvQXRSv5QhlKJF/A0pG6e/Ek+gBUkOVSaEcLlNvhUBtyCVhNNCsoASODDIqXvv/Zic+4vm/ornkOIJSjZ9AYjAdXTmNg/Oaeu1hndQZ/gpmvJcVtQ8pcryz5Orgn9cw2Kr9esK6HUB0x0VHk5muN2ZaQqJMoa2z32zTQYY90V59Bf1Fe2ApikgUjmTkMufyQq56PaxTc5liBr9aoiJaiRdHTYFMhzYI+2fQXHcbaJaAy3W3heooPgjUYXEj6z/5qEs9ilhXXS8iu02Hcr8RRrtuCCS58UX0/F+0/lOIt3ydDRMLjCQWQ89B1vy/J7zBgfLI/c34pFqwnzXWVG2YprBkEW0QS8an78s4ULPcdaKeGr/RR9jDl7Nn+94ySaUTeggTRw5n8l2a77xXkif+gbrcREqeNxPRUUNMtHHE/WZJ/VfvQ5qnI35jdZKtM3Rg0WcycGbvIp0/3uzNtKMBXCfWEtJqwy06F4E0+i3mZ4y6WxoCxbauSs/XjbTH7Q1t/VcdBX1y/vaZ23qcXFcAncfebJag6JosA9eCkCdRmmLadHi5TQyE+m1GMszrsqtoSfKzhVM4DyVssaRlxPsUIaIKycaGvVzUNm8q5L0Hw3pPYpvdFUAQ20GdeSWyHz4nrWhrjmtqzcpk+IZuk8O1mcE8X8bz7ixfa3/igdrXdyvlJRo0F3+OnffVmiwQKwt/SM4nPv9vrqBBm7kJT8eLw== 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)(346002)(396003)(376002)(136003)(39860400002)(230922051799003)(64100799003)(82310400011)(186009)(1800799012)(451199024)(46966006)(36840700001)(40470700004)(36756003)(40480700001)(40460700003)(70206006)(7696005)(86362001)(70586007)(336012)(426003)(82740400003)(41300700001)(81166007)(356005)(47076005)(1076003)(2616005)(26005)(83380400001)(2906002)(4326008)(36860700001)(5660300002)(478600001)(6916009)(6666004)(54906003)(8936002)(316002)(8676002)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6134 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5PEPF00014B8F.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: ccc960d1-57bd-4ea7-cd63-08dc0bf9cac0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1i8PRhLIA3zDGhvKeHDO/W6ek9jtuwaeVBkobFDE/FZo7HbkeaMQMl/rdnHue7RuoRWUvWq5YpgZIrToRiTszWvuXqqOTkN8XRRlhQ8rkSFHIBv/WlWllotNrJ1ewvJrZBOeUK/hCwfqrFF5AnFcU0DlD77fVWI87XNjsJ9AL5nHqhmOBkM25cqTUUU1OxUAUexp9w99DYF/0Tsgi6j0fHavWccdmniIr9w1zyAiivfIydG4QXwL76eIS2jJxS9WQQwyJYo7Tud5Xf4xExgf/luofvf/gn/FDwSenHV0NqHM92HIeh0iarTZjvT3Z3q90YAhDgSCUYy2mkxEitnRseEKGgqseqUGer1+Pnf7FIuQmZy2O5VcJy4aL0EubB53PtZNcrbsgSTLWNCj+6daUNXHr6RwNP+gLSp5PmLQ/GT6+wkpsZLNrWcawWhlz1m0f+ns3l/kF8isAg9AlkTepc2EqxN52n3SHE+2kGRT11xfgE+AO4T0PljGYdi5J06C4JkVSRW8mbrKawqw1QPiDkNrNZauhIVibNmcBdBqIG8bzceqBwWEmVGc381+y/fauWUlqEIDW2VbCRwvTAbjzSMSK98VywPFMX2PPk1H3D00lUjv9P1OG3bZj3t+X7QRvpvL6aKPWo3JBUdqtlFjV12ncb6dEJV50K/ST4OBTGfIBmK9h0tCVqFcxq4UvNzupKbNA8WAAj+AzQGGRoj02Jbz0MO1CcabkMKxiKHSPLQzOWsHzIbw4WzoJgBPeO0i 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)(396003)(376002)(136003)(346002)(39860400002)(230922051799003)(451199024)(1800799012)(186009)(82310400011)(64100799003)(40470700004)(36840700001)(46966006)(82740400003)(81166007)(36756003)(40460700003)(40480700001)(86362001)(2616005)(426003)(83380400001)(36860700001)(1076003)(26005)(41300700001)(316002)(6916009)(54906003)(7696005)(70206006)(478600001)(6666004)(47076005)(8936002)(8676002)(70586007)(336012)(5660300002)(2906002)(4326008); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jan 2024 01:17:56.8435 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c772bf3f-473e-43ad-f168-08dc0bf9d171 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: DB5PEPF00014B8F.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB9559 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 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+patchwork=sourceware.org@sourceware.org Analysis of the allowed operand values for `sysp' and `tlbip' reveals a significant departure from the allowed behavior for operand register pairs (hitherto labeled AARCH64_OPND_PAIRREG) observed for other insns in this category. For instructions `casp', `mrrs' and `msrr' the register pair must always start at an even index and the second register in the pair is the index + 1. This precludes the use of xzr as the first register, given it corresponds to register number 31. This is different in the case of `sysp' and `tlbip', however. These allow the use of xzr and, where the first operand in the pair is omitted, this is the default value assigned to it. When this operand is assigned xzr, it is expected that the second operand will likewise take on a value of xzr. These two instructions therefore "break" two rules of register pairs: * The first of the two registers is odd-numbered. * The index of the second register is equal to that of the first, and not n+1. To allow for this departure from hitherto standard behavior, we extend the functionality of the assembler by defining an extension of the AARCH64_OPND_PAIRREG, called AARCH64_OPND_PAIRREG_OR_XZR. It is used in defining `sysp' and `tlbip' and allows `operand_general_constraint_met_p' to allow the pair to both take on the value of xzr. --- gas/config/tc-aarch64.c | 1 + include/opcode/aarch64.h | 1 + opcodes/aarch64-dis.c | 7 +++++-- opcodes/aarch64-opc.c | 19 +++++++++++++++++-- opcodes/aarch64-tbl.h | 2 ++ 5 files changed, 26 insertions(+), 4 deletions(-) diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c index bfe91c90139..796a6da267b 100644 --- a/gas/config/tc-aarch64.c +++ b/gas/config/tc-aarch64.c @@ -6532,6 +6532,7 @@ parse_operands (char *str, const aarch64_opcode *opcode) case AARCH64_OPND_Rt_LS64: case AARCH64_OPND_Rt_SYS: case AARCH64_OPND_PAIRREG: + case AARCH64_OPND_PAIRREG_OR_XZR: case AARCH64_OPND_SVE_Rm: po_int_fp_reg_or_fail (REG_TYPE_R_ZR); diff --git a/include/opcode/aarch64.h b/include/opcode/aarch64.h index b9ea73c4259..d3db252e5c2 100644 --- a/include/opcode/aarch64.h +++ b/include/opcode/aarch64.h @@ -455,6 +455,7 @@ enum aarch64_opnd AARCH64_OPND_Rn_SP, /* Integer Rn or SP. */ AARCH64_OPND_Rm_SP, /* Integer Rm or SP. */ AARCH64_OPND_PAIRREG, /* Paired register operand. */ + AARCH64_OPND_PAIRREG_OR_XZR, /* Paired register operand, optionally xzr. */ AARCH64_OPND_Rm_EXT, /* Integer Rm extended. */ AARCH64_OPND_Rm_SFT, /* Integer Rm shifted. */ diff --git a/opcodes/aarch64-dis.c b/opcodes/aarch64-dis.c index 3bf5f50effc..e9f47807654 100644 --- a/opcodes/aarch64-dis.c +++ b/opcodes/aarch64-dis.c @@ -302,8 +302,11 @@ aarch64_ext_regno_pair (const aarch64_operand *self ATTRIBUTE_UNUSED, aarch64_op aarch64_operand_error *errors ATTRIBUTE_UNUSED) { assert (info->idx == 1 - || info->idx ==3); - info->reg.regno = inst->operands[info->idx - 1].reg.regno + 1; + || info->idx == 3); + + unsigned prev_regno = inst->operands[info->idx - 1].reg.regno; + info->reg.regno = (prev_regno == 0x1f) ? 0x1f + : prev_regno + 1; return true; } diff --git a/opcodes/aarch64-opc.c b/opcodes/aarch64-opc.c index 4d84071ba8c..4530591b329 100644 --- a/opcodes/aarch64-opc.c +++ b/opcodes/aarch64-opc.c @@ -1693,8 +1693,22 @@ operand_general_constraint_met_p (const aarch64_opnd_info *opnds, int idx, switch (aarch64_operands[type].op_class) { case AARCH64_OPND_CLASS_INT_REG: - /* Check pair reg constraints for cas* instructions. */ - if (type == AARCH64_OPND_PAIRREG) + /* Check for pair of xzr registers. */ + if (type == AARCH64_OPND_PAIRREG_OR_XZR + && opnds[idx - 1].reg.regno == 0x1f) + { + if (opnds[idx].reg.regno != 0x1f) + { + set_syntax_error (mismatch_detail, idx - 1, + _("second reg in pair should be xzr if first is" + " xzr")); + return 0; + } + } + /* Check pair reg constraints for instructions taking a pair of + consecutively-numbered general-purpose registers. */ + else if (type == AARCH64_OPND_PAIRREG + || type == AARCH64_OPND_PAIRREG_OR_XZR) { assert (idx == 1 || idx == 3); if (opnds[idx - 1].reg.regno % 2 != 0) @@ -3771,6 +3785,7 @@ aarch64_print_operand (char *buf, size_t size, bfd_vma pc, case AARCH64_OPND_Rt_LS64: case AARCH64_OPND_Rt_SYS: case AARCH64_OPND_PAIRREG: + case AARCH64_OPND_PAIRREG_OR_XZR: case AARCH64_OPND_SVE_Rm: case AARCH64_OPND_LSE128_Rt: case AARCH64_OPND_LSE128_Rt2: diff --git a/opcodes/aarch64-tbl.h b/opcodes/aarch64-tbl.h index 605f6f2438f..1dfbee25786 100644 --- a/opcodes/aarch64-tbl.h +++ b/opcodes/aarch64-tbl.h @@ -6174,6 +6174,8 @@ const struct aarch64_opcode aarch64_opcode_table[] = "an integer or stack pointer register") \ X(INT_REG, 0, ext_regno_pair, "PAIRREG", 0, F(), \ "the second reg of a pair") \ + X(INT_REG, 0, ext_regno_pair, "PAIRREG_OR_XZR", 0, F(), \ + "the second reg of a pair") \ Y(MODIFIED_REG, reg_extended, "Rm_EXT", 0, F(), \ "an integer register with optional extension") \ Y(MODIFIED_REG, reg_shifted, "Rm_SFT", 0, F(), \