From patchwork Wed Feb 1 19:25:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamar Christina X-Patchwork-Id: 51529 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp466896wrn; Wed, 1 Feb 2023 11:25:54 -0800 (PST) X-Google-Smtp-Source: AK7set+owaIJRJhBpf/AhqHpC1HyCvnThmg2a/+8Y4sq0dgXGY5lROrx2rLauMoFeouFUsqsEZKe X-Received: by 2002:a17:906:4787:b0:884:37fd:bf4c with SMTP id cw7-20020a170906478700b0088437fdbf4cmr3566997ejc.19.1675279554744; Wed, 01 Feb 2023 11:25:54 -0800 (PST) Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id ee44-20020a056402292c00b004a26b77da15si5553141edb.57.2023.02.01.11.25.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 11:25:54 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b="MoaqU/IP"; arc=fail (signature failed); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9C4D43858404 for ; Wed, 1 Feb 2023 19:25:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9C4D43858404 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675279553; bh=SCFsVg5Oj05RZ5o3Ue0ah5mAROjGwH/+qRNnYFztM2U=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=MoaqU/IPJ9AQAWVVFe1kF7HLW5B/LI7pX6eVvDIbe/ITyZhVP6LG5MJp63LEenQ6C uycFNU9EfIea9xjU7qNZh4olRA/tyO0dmssTbWGa/JRkgiDMS50C31ArpiI5zykdEJ GefKu/h0K9zpSqgMIlhQF1+UitI8bqfdF2mnZ3IY= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2052.outbound.protection.outlook.com [40.107.247.52]) by sourceware.org (Postfix) with ESMTPS id 3348E3858D37 for ; Wed, 1 Feb 2023 19:25:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3348E3858D37 Received: from DU2P250CA0020.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:231::25) by DB9PR08MB9921.eurprd08.prod.outlook.com (2603:10a6:10:3d3::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.24; Wed, 1 Feb 2023 19:25:39 +0000 Received: from DBAEUR03FT060.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:231:cafe::f8) by DU2P250CA0020.outlook.office365.com (2603:10a6:10:231::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38 via Frontend Transport; Wed, 1 Feb 2023 19:25:39 +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 DBAEUR03FT060.mail.protection.outlook.com (100.127.142.238) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.23 via Frontend Transport; Wed, 1 Feb 2023 19:25:38 +0000 Received: ("Tessian outbound b1d3ffe56e73:v132"); Wed, 01 Feb 2023 19:25:38 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: b6ad8e734c432a3f X-CR-MTA-TID: 64aa7808 Received: from 94fb03a9970e.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id AE445B90-CC3A-49A2-828E-029033DA4224.1; Wed, 01 Feb 2023 19:25:32 +0000 Received: from EUR03-DBA-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 94fb03a9970e.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 01 Feb 2023 19:25:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HoKAqg+JwRXF+08dIbTtYKc56wYwldMZYSzaV06wHZiJEaZ1w6jJRRmZkGkl2t64r2x9vaQK6VuUVCM29MZ8srY8LM+D/a7CbyBlvRNwtUa9iqAW8faLlFhQExiKe6UfISQW9mNiO/wMctstTP+Hw0oeRF2IE9wIMcXwzSXqq365wjLaS93OhtEdWxqLY8o5nR8hC/bGFQnvMPA4W3DeBWWD+MOj1lMbp+47cmQxxr9jrkyF5ZGccndIuUH8IT1s3eT7Q4KJ07YM2l7sJIdaXaliiDL5VFN3SjXYHzektLAoz5ze2vInibh8w9bti/XUqi+VK4Jb3jXvk8N9u91BnQ== 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=SCFsVg5Oj05RZ5o3Ue0ah5mAROjGwH/+qRNnYFztM2U=; b=oM0bPSSvUzWMW2H0IGlP4SywKTo5baJ/8qeRBV9k3W3ljsIykA6gRRNdMP8PwGoHRbDyBtmA0DcpN8kiar2C2vrefmW2chaduCnuOdzbIQIiYE5SJMn6yIfrpS3HsQUbora+YvH8xP/Uu+gfUgTRNjE90zTc6waJNlA3gHVXupDZTDM100YJhFL4SWkhWuxnKrCSBL3zJVT+ypKwSBfRqRT4J8R7I/2OgDgG4ptwnrXBd17lgrqIm04cLh0Qf4dy4YcILKiErAZvG0PAlsmJjzgHIUtpE1a4+Ms128bmZxzCbjjXR6GKWfsr23nqcOlxiDQNm6j4uwTCOJFqfLoOUQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) by AM0PR08MB5458.eurprd08.prod.outlook.com (2603:10a6:208:185::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36; Wed, 1 Feb 2023 19:25:30 +0000 Received: from VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::7e84:c35c:e966:c886]) by VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::7e84:c35c:e966:c886%7]) with mapi id 15.20.6064.022; Wed, 1 Feb 2023 19:25:29 +0000 Date: Wed, 1 Feb 2023 19:25:23 +0000 To: binutils@sourceware.org Cc: nd@arm.com, Richard.Earnshaw@arm.com, marcus.shawcroft@arm.com Subject: [PATCH][Binutils]AArch64 gas: relax ordering constriants on enabling and disabling feature extensions Message-ID: Content-Disposition: inline X-ClientProxiedBy: LO4P123CA0440.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a9::13) To VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB5325:EE_|AM0PR08MB5458:EE_|DBAEUR03FT060:EE_|DB9PR08MB9921:EE_ X-MS-Office365-Filtering-Correlation-Id: 9dea6daf-ed93-47c3-a18f-08db048a19ee 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: BcIfG5iI7jRBgbTrQq/nAmcIhDD3EGnPMigns+4m61ahE68Vi8xG2oyVm+uavANqut3bPrW6dXnisF5kYMYCxyebRRS44tThsBM2vIsB6GXHLvhjdN+WAPBWB7NUIx11OLaCpAph8YuYBH/C2NCbL0NQjfWedawd87YuTrN4FsPdaf+QSaqgcaTxkeMvM0yoWK3T9R69PptEfvTJzIJcnm2F/oyaNqpp37rfyxQVKEkqTJKDU20zQqA9SZ56KSUwuy+trAufAIWmW8cC3pvqeSjPEHFwdUdWYmndLBZzmGzWMsomvhPWcMhn+OWKNl2aIuA8rCmKFkRPFs9CNFfLArDyJ7htdYVCT28/0+JUK0OdfA/zTl2eiFWoSJh1ND38FjielOPSmuF5dEzpC/WSaMopa/7noxVsyDGn+GVo6bcHKEO/21UfCBFX6mg8fIJX7PZGX18jbcCLqXzxqFA3jsN+tde8dX3rPU9t7yIhdXDW5MALoYgglFimlEe7S8HlsLiquI+dfYbTKlCNvCm+VBg3k5RqMi+1GPBce1C4DELPbAjIQjI9bvNivKQRQ4tBriUFiaYBI//fbrgKlr/k8WIImVT/ZS7zPiTAWDV+dgzCmDb6LdFYbG5cEKeiLe6x/6zLM1m3Co/58cAm5B5j+W8zsTymQ3+uqSCo1/gYLbq7NBuu74HkNMcdGS4hk2C5FvxtoOxVmRcdZ2o7Wm5RkEW/CM8zEbfYflmjdMvRtPE= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR08MB5325.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(136003)(376002)(366004)(346002)(396003)(39860400002)(451199018)(36756003)(66476007)(8936002)(316002)(6916009)(6666004)(41300700001)(4326008)(66556008)(8676002)(66946007)(26005)(33964004)(6506007)(478600001)(186003)(2616005)(6486002)(86362001)(6512007)(83380400001)(44144004)(4743002)(235185007)(2906002)(44832011)(38100700002)(5660300002)(4216001)(2700100001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5458 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT060.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 416f4428-762e-41a4-b261-08db048a1329 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xw56nIXqlM+B6UhmyOPqoS+KKuOIsi13Nn50QIpo8KbAFG3Q/Mjwlffa2GTWqk/JBC/PE0hOL0Pc42lZWd5HFnAFqLOKd8Dq+mlGvXVcJXDVXKnIW7o1WEWwdWR2h0QmO6bxFbtcd0utXETP3dsX+E3dtYCjtvn9eWC2XhIFxWbJC7iNwlK+Fh5wV+oCG88JIQ9CgtsqLHcDLZD0Hyxg1vv6H2bxWAU+5A3Oqzudl4IkoePaz3xBjKMa1oNfiErQTgNXRY9d+7n9amV8WeJiTCLcOuV0EGDG1U6pgQfhb8Kj/GvZBOWAy6F0XQi8bEqbr8I0XrVqSXuRV9QBU7bpDIAF4CiJ0huoxlwiCjmEFENYWWhYcMGJ/PwO7ytXLl6mA1zj2GvJ3Sx92kRoQAU0W5bmdXItsKvnJmAK04sC0B4BjZA4mwujcVbdz83/DG16PKw1zuvNLrHmz4RbR58PsZOK0DTu1JBhAGGQvJL24xdpP8bG5FURP1R84nijWWJMGtpf90PWIgc26FpoY1SXsktqi+V0Y1aqP0t/Xx3anWR5NOdlKNga3QoOVway2rbibCRQb+bclhsDzovL7Cbjn1zD39BC23GhMaOIm1eoPlDx45es6078uQBSQhAJhUuU7PKg0+8LIGMZp46/TbpJjI7dH3Io3v70KQn/pev9szxU3cFF7cm5eolMG8tVRScTuHekD/IWWPIZYWhoPcVS4+lQ2IilZPDlJkD2Q0Ciefv7p4D8GA+S3yWVU75N8Nke 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:(13230025)(4636009)(39860400002)(346002)(396003)(376002)(136003)(451199018)(46966006)(40470700004)(36840700001)(316002)(36756003)(47076005)(36860700001)(82740400003)(44832011)(8936002)(2906002)(82310400005)(5660300002)(235185007)(86362001)(356005)(81166007)(40480700001)(70586007)(70206006)(40460700003)(8676002)(4326008)(83380400001)(6916009)(41300700001)(478600001)(2616005)(6486002)(44144004)(33964004)(6512007)(4743002)(6666004)(26005)(186003)(6506007)(336012)(4216001)(2700100001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2023 19:25:38.9968 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9dea6daf-ed93-47c3-a18f-08db048a19ee 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: DBAEUR03FT060.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB9921 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, KAM_LOTSOFHASH, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, 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.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tamar Christina via Binutils From: Tamar Christina Reply-To: Tamar Christina Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756657934724631236?= X-GMAIL-MSGID: =?utf-8?q?1756657934724631236?= Hi All, At the beginning of the port it was decided that enabling features should always come before disabling features. i.e. +foo should always be before any +nofoo. For years now this has been relaxed in GCC but binutils has remained rather strict. This removes the restriction from gas as well giving users less friction. build on native hardware and regtested on aarch64-none-elf, aarch64-none-elf (32 bit host), aarch64-none-linux-gnu, aarch64-none-linux-gnu (32 bit host) Cross-compiled and regtested on aarch64-none-linux-gnu, aarch64_be-none-linux-gnu and no issues. Ok for master? Thanks, Tamar gas/ChangeLog: 2023-02-01 Tamar Christina * config/tc-aarch64.c (aarch64_parse_features): Remove feature ordering checks. * testsuite/gas/aarch64/opt_order.l: New test. * testsuite/gas/aarch64/opt_order.s: New test. * testsuite/gas/aarch64/opt_order_1.d: New test. * testsuite/gas/aarch64/opt_order_2.d: New test. * testsuite/gas/aarch64/opt_order_3.d: New test. * testsuite/gas/aarch64/opt_order_4.d: New test. * testsuite/gas/aarch64/opt_order_5.d: New test. * testsuite/gas/aarch64/opt_order_6.d: New test. --- inline copy of patch -- diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c index 2aeab6f958ac6435c528b4394412d6395932a6d5..0c2ffd7bb85dbf892f265b6b394de7709de2f60e 100644 --- diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c index 2aeab6f958ac6435c528b4394412d6395932a6d5..0c2ffd7bb85dbf892f265b6b394de7709de2f60e 100644 --- a/gas/config/tc-aarch64.c +++ b/gas/config/tc-aarch64.c @@ -10234,11 +10234,7 @@ static int aarch64_parse_features (const char *str, const aarch64_feature_set **opt_p, bool ext_only) { - /* We insist on extensions being added before being removed. We achieve - this by using the ADDING_VALUE variable to indicate whether we are - adding an extension (1) or removing it (0) and only allowing it to - change in the order -1 -> 1 -> 0. */ - int adding_value = -1; + bool adding_value = false; aarch64_feature_set *ext_set = XNEW (aarch64_feature_set); /* Copy the feature set, so that we can modify it. */ @@ -10269,31 +10265,20 @@ aarch64_parse_features (const char *str, const aarch64_feature_set **opt_p, if (optlen >= 2 && startswith (str, "no")) { - if (adding_value != 0) - adding_value = 0; + adding_value = 0; optlen -= 2; str += 2; } else if (optlen > 0) { - if (adding_value == -1) - adding_value = 1; - else if (adding_value != 1) - { - as_bad (_("must specify extensions to add before specifying " - "those to remove")); - return false; - } + adding_value = 1; } - - if (optlen == 0) + else if (optlen == 0) { as_bad (_("missing architectural extension")); return 0; } - gas_assert (adding_value != -1); - for (opt = aarch64_features; opt->name != NULL; opt++) if (strncmp (opt->name, str, optlen) == 0) { diff --git a/gas/testsuite/gas/aarch64/opt_order.l b/gas/testsuite/gas/aarch64/opt_order.l new file mode 100644 index 0000000000000000000000000000000000000000..94820513356d2d3c2a02c1f348e2c5423e43f1cd --- /dev/null +++ b/gas/testsuite/gas/aarch64/opt_order.l @@ -0,0 +1 @@ +#... diff --git a/gas/testsuite/gas/aarch64/opt_order.s b/gas/testsuite/gas/aarch64/opt_order.s new file mode 100644 index 0000000000000000000000000000000000000000..e0642b3a811ad7d944418f36e237e6fd87771051 --- /dev/null +++ b/gas/testsuite/gas/aarch64/opt_order.s @@ -0,0 +1 @@ +UDOT V0.2S, V0.8B, V0.8B diff --git a/gas/testsuite/gas/aarch64/opt_order_1.d b/gas/testsuite/gas/aarch64/opt_order_1.d new file mode 100644 index 0000000000000000000000000000000000000000..862f7be85f462bfc470a466e9652471d0d268652 --- /dev/null +++ b/gas/testsuite/gas/aarch64/opt_order_1.d @@ -0,0 +1,4 @@ +# source: opt_order.s +# as: -march=armv8.2-a+nodotprod+fp16+dotprod +# objdump: -dr +#... diff --git a/gas/testsuite/gas/aarch64/opt_order_2.d b/gas/testsuite/gas/aarch64/opt_order_2.d new file mode 100644 index 0000000000000000000000000000000000000000..77bd6c57ec9be2e24c3b673f4eccb2c0f7bfc16c --- /dev/null +++ b/gas/testsuite/gas/aarch64/opt_order_2.d @@ -0,0 +1,4 @@ +# source: opt_order.s +# as: -march=armv8.2-a+fp16+nodotprod+dotprod +# objdump: -dr +#... diff --git a/gas/testsuite/gas/aarch64/opt_order_3.d b/gas/testsuite/gas/aarch64/opt_order_3.d new file mode 100644 index 0000000000000000000000000000000000000000..5b22090331d11965097a35bad181693c75d51f3c --- /dev/null +++ b/gas/testsuite/gas/aarch64/opt_order_3.d @@ -0,0 +1,4 @@ +# source: opt_order.s +# as: -march=armv8.2-a+dotprod+fp16+dotprod +# objdump: -dr +#... diff --git a/gas/testsuite/gas/aarch64/opt_order_4.d b/gas/testsuite/gas/aarch64/opt_order_4.d new file mode 100644 index 0000000000000000000000000000000000000000..7ffe2a3011632fdcf25aa32eeb1bedbcc1f408ba --- /dev/null +++ b/gas/testsuite/gas/aarch64/opt_order_4.d @@ -0,0 +1,5 @@ +# source: opt_order.s +# as: -march=armv8.2-a+nodotprod+fp16+nodotprod +# objdump: -dr +#error_output: opt_order.l +#... diff --git a/gas/testsuite/gas/aarch64/opt_order_5.d b/gas/testsuite/gas/aarch64/opt_order_5.d new file mode 100644 index 0000000000000000000000000000000000000000..e7d057c77e7efa14caf55c96cba321e99c36ca21 --- /dev/null +++ b/gas/testsuite/gas/aarch64/opt_order_5.d @@ -0,0 +1,5 @@ +# source: opt_order.s +# as: -march=armv8.2-a+dotprod+fp16+nodotprod +# objdump: -dr +#error_output: opt_order.l +#... diff --git a/gas/testsuite/gas/aarch64/opt_order_6.d b/gas/testsuite/gas/aarch64/opt_order_6.d new file mode 100644 index 0000000000000000000000000000000000000000..b39247de3b3c7261a700b96be8cfbf6b781cbb6b --- /dev/null +++ b/gas/testsuite/gas/aarch64/opt_order_6.d @@ -0,0 +1,5 @@ +# source: opt_order.s +# as: -march=armv8.2-a+fp16+dotprod+nodotprod +# objdump: -dr +#error_output: opt_order.l +#... --- a/gas/config/tc-aarch64.c +++ b/gas/config/tc-aarch64.c @@ -10234,11 +10234,7 @@ static int aarch64_parse_features (const char *str, const aarch64_feature_set **opt_p, bool ext_only) { - /* We insist on extensions being added before being removed. We achieve - this by using the ADDING_VALUE variable to indicate whether we are - adding an extension (1) or removing it (0) and only allowing it to - change in the order -1 -> 1 -> 0. */ - int adding_value = -1; + bool adding_value = false; aarch64_feature_set *ext_set = XNEW (aarch64_feature_set); /* Copy the feature set, so that we can modify it. */ @@ -10269,31 +10265,20 @@ aarch64_parse_features (const char *str, const aarch64_feature_set **opt_p, if (optlen >= 2 && startswith (str, "no")) { - if (adding_value != 0) - adding_value = 0; + adding_value = 0; optlen -= 2; str += 2; } else if (optlen > 0) { - if (adding_value == -1) - adding_value = 1; - else if (adding_value != 1) - { - as_bad (_("must specify extensions to add before specifying " - "those to remove")); - return false; - } + adding_value = 1; } - - if (optlen == 0) + else if (optlen == 0) { as_bad (_("missing architectural extension")); return 0; } - gas_assert (adding_value != -1); - for (opt = aarch64_features; opt->name != NULL; opt++) if (strncmp (opt->name, str, optlen) == 0) { diff --git a/gas/testsuite/gas/aarch64/opt_order.l b/gas/testsuite/gas/aarch64/opt_order.l new file mode 100644 index 0000000000000000000000000000000000000000..94820513356d2d3c2a02c1f348e2c5423e43f1cd --- /dev/null +++ b/gas/testsuite/gas/aarch64/opt_order.l @@ -0,0 +1 @@ +#... diff --git a/gas/testsuite/gas/aarch64/opt_order.s b/gas/testsuite/gas/aarch64/opt_order.s new file mode 100644 index 0000000000000000000000000000000000000000..e0642b3a811ad7d944418f36e237e6fd87771051 --- /dev/null +++ b/gas/testsuite/gas/aarch64/opt_order.s @@ -0,0 +1 @@ +UDOT V0.2S, V0.8B, V0.8B diff --git a/gas/testsuite/gas/aarch64/opt_order_1.d b/gas/testsuite/gas/aarch64/opt_order_1.d new file mode 100644 index 0000000000000000000000000000000000000000..862f7be85f462bfc470a466e9652471d0d268652 --- /dev/null +++ b/gas/testsuite/gas/aarch64/opt_order_1.d @@ -0,0 +1,4 @@ +# source: opt_order.s +# as: -march=armv8.2-a+nodotprod+fp16+dotprod +# objdump: -dr +#... diff --git a/gas/testsuite/gas/aarch64/opt_order_2.d b/gas/testsuite/gas/aarch64/opt_order_2.d new file mode 100644 index 0000000000000000000000000000000000000000..77bd6c57ec9be2e24c3b673f4eccb2c0f7bfc16c --- /dev/null +++ b/gas/testsuite/gas/aarch64/opt_order_2.d @@ -0,0 +1,4 @@ +# source: opt_order.s +# as: -march=armv8.2-a+fp16+nodotprod+dotprod +# objdump: -dr +#... diff --git a/gas/testsuite/gas/aarch64/opt_order_3.d b/gas/testsuite/gas/aarch64/opt_order_3.d new file mode 100644 index 0000000000000000000000000000000000000000..5b22090331d11965097a35bad181693c75d51f3c --- /dev/null +++ b/gas/testsuite/gas/aarch64/opt_order_3.d @@ -0,0 +1,4 @@ +# source: opt_order.s +# as: -march=armv8.2-a+dotprod+fp16+dotprod +# objdump: -dr +#... diff --git a/gas/testsuite/gas/aarch64/opt_order_4.d b/gas/testsuite/gas/aarch64/opt_order_4.d new file mode 100644 index 0000000000000000000000000000000000000000..7ffe2a3011632fdcf25aa32eeb1bedbcc1f408ba --- /dev/null +++ b/gas/testsuite/gas/aarch64/opt_order_4.d @@ -0,0 +1,5 @@ +# source: opt_order.s +# as: -march=armv8.2-a+nodotprod+fp16+nodotprod +# objdump: -dr +#error_output: opt_order.l +#... diff --git a/gas/testsuite/gas/aarch64/opt_order_5.d b/gas/testsuite/gas/aarch64/opt_order_5.d new file mode 100644 index 0000000000000000000000000000000000000000..e7d057c77e7efa14caf55c96cba321e99c36ca21 --- /dev/null +++ b/gas/testsuite/gas/aarch64/opt_order_5.d @@ -0,0 +1,5 @@ +# source: opt_order.s +# as: -march=armv8.2-a+dotprod+fp16+nodotprod +# objdump: -dr +#error_output: opt_order.l +#... diff --git a/gas/testsuite/gas/aarch64/opt_order_6.d b/gas/testsuite/gas/aarch64/opt_order_6.d new file mode 100644 index 0000000000000000000000000000000000000000..b39247de3b3c7261a700b96be8cfbf6b781cbb6b --- /dev/null +++ b/gas/testsuite/gas/aarch64/opt_order_6.d @@ -0,0 +1,5 @@ +# source: opt_order.s +# as: -march=armv8.2-a+fp16+dotprod+nodotprod +# objdump: -dr +#error_output: opt_order.l +#...