From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2044.outbound.protection.outlook.com [40.107.22.44]) by sourceware.org (Postfix) with ESMTPS id 269733857342 for ; Fri, 22 Sep 2023 08:08:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 269733857342 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=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=P1yAxQ73wP6BeAjCkCP9stXZzQTQWjKu6gBwrMGCXpE=; b=ixZuPTcXJSiD7akIgy8fVxq7qReZHwr7w/cSpdf1DlLLtjVWm2rb+TnygEXSBcbNiFz+8wX+TXm7bse/Tl7bhKnazy+ME7F8AN1zPaDGtJ9LAX5g0hOYtx87tkdgwQl3+Wc1ie6oLSV/UcO0hptaR1CWB0fUGeDYpQgWtNlRlQo= Received: from DUZPR01CA0206.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b6::21) by DU0PR08MB9797.eurprd08.prod.outlook.com (2603:10a6:10:446::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.23; Fri, 22 Sep 2023 08:08:28 +0000 Received: from DBAEUR03FT034.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:4b6:cafe::eb) by DUZPR01CA0206.outlook.office365.com (2603:10a6:10:4b6::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.31 via Frontend Transport; Fri, 22 Sep 2023 08:08:28 +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 DBAEUR03FT034.mail.protection.outlook.com (100.127.142.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.12 via Frontend Transport; Fri, 22 Sep 2023 08:08:27 +0000 Received: ("Tessian outbound 1eb4e931b055:v175"); Fri, 22 Sep 2023 08:08:27 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: a0386dfe59cb5088 X-CR-MTA-TID: 64aa7808 Received: from bdd8affd637f.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id C19171D0-08F4-4FA8-8FBF-C0D4675AF07A.1; Fri, 22 Sep 2023 08:07:40 +0000 Received: from EUR03-DBA-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id bdd8affd637f.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 22 Sep 2023 08:07:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DDL04NMdq1sKh7Pqr5QyywSl793+Tezg+y88XbyREmDmYgApSG0fWtO0pW49i3XG4RN9ElKJW2ql0NmUAeWbwiy5lUtpYwve3qLcbMp3TKdgeiyL4xvIpmAI+KbKk2T2Tpd7h7PLnpCNH7r2JlNLD6SBlKV4Dgf/XyUEot7UVYBnLPVBAJ+NNulH09SYPz99HYe6hWic+nIDYS20U85IqS2zpESymKmeogkl/GYW+6rtw0hMTFjhalRSV6HfxubaCkhctdXQ32jpLyNhYzN71hwqYHU3KuWUeNszR9CqGQnYJpAOkn5SxwYyFLDvpwGEsAGGoM6/xdODhZwZLWlSMw== 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=P1yAxQ73wP6BeAjCkCP9stXZzQTQWjKu6gBwrMGCXpE=; b=NutDAxD0fsU91qB/H2fbvtQn+XAQgdsVBCZiPmJ6JfObKR0jsbXwaSZTVbk/DEg4SycdnBKnl1xHTEAFR1n0uoeKRbth6c+Y2SEJ9lPfb4y6lkOTIlNcoLwbIm2kIpBLWOxxObA6tPJQb5PD2XCO486NEQ7Nxjq4Em3W0/UjMJIu4P/tcVyyOY0Jo6l7/tWhkAsWViDe30IAlzRck02MZOyVFn9p31uMo7ywzvkOC09rOsJpzBxl5BamEB67A56Q9vilV1wJOTgjmgDADPGpzCIOiLCm1rWT3QAYILC7SJGwLzIahYcnQCjEcvt5pYc2iKinBuSTgLTciQXrQxicwA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=gcc.gnu.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 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=P1yAxQ73wP6BeAjCkCP9stXZzQTQWjKu6gBwrMGCXpE=; b=ixZuPTcXJSiD7akIgy8fVxq7qReZHwr7w/cSpdf1DlLLtjVWm2rb+TnygEXSBcbNiFz+8wX+TXm7bse/Tl7bhKnazy+ME7F8AN1zPaDGtJ9LAX5g0hOYtx87tkdgwQl3+Wc1ie6oLSV/UcO0hptaR1CWB0fUGeDYpQgWtNlRlQo= Received: from DUZPR01CA0173.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b3::27) by AM8PR08MB6323.eurprd08.prod.outlook.com (2603:10a6:20b:354::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.20; Fri, 22 Sep 2023 08:07:38 +0000 Received: from DBAEUR03FT044.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:4b3:cafe::d8) by DUZPR01CA0173.outlook.office365.com (2603:10a6:10:4b3::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.32 via Frontend Transport; Fri, 22 Sep 2023 08:07:38 +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 DBAEUR03FT044.mail.protection.outlook.com (100.127.142.189) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.12 via Frontend Transport; Fri, 22 Sep 2023 08:07:38 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) 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.27; Fri, 22 Sep 2023 08:07:37 +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.27; Fri, 22 Sep 2023 08:07:37 +0000 Received: from e124257.nice.arm.com (10.34.101.64) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Fri, 22 Sep 2023 08:07:36 +0000 From: Andrea Corallo To: CC: , , Subject: [PATCH 1/3] recog: Improve parser for pattern new compact syntax Date: Fri, 22 Sep 2023 10:07:01 +0200 Message-ID: <20230922080703.93612-1-andrea.corallo@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DBAEUR03FT044:EE_|AM8PR08MB6323:EE_|DBAEUR03FT034:EE_|DU0PR08MB9797:EE_ X-MS-Office365-Filtering-Correlation-Id: 64e00787-e8f4-41f2-c5ee-08dbbb431a26 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: aaJpjt5sy7PXp7BXRXQzApQHJ5MPkOjxMHikL9G+G6gVbX7l0EWfs3yqjjnj77gjxLZOy/zkFQJ64he6NYnI7q0s3vq13h/Vv/eEA7+U7pjwsIlCervXyXvcO280cvl0Jo93ftF7v8FUegMzfoLAACVnJhoYGlr2bXVivxSOGkdcNy/1rFyROOZ/PJ2V3Q1NpjvVchEVTREBq+5wWA3/jnOHjHgfuf0NXfekpJWTN2dAcnngJxr+R8cUhE1vIabZCKFKtCf7BtnaNtdIrdi4apGSVkXn3caRokh3ULq5XROsWwWLClMFg8IfriKW4x5Oxkh30fQb729EBAqHj3M4Qc7X1qGtAvQRtxg01gQvIZdUC68gaLncavfVxZ11fDUv97uCLds5wn1U+A1d/jXpKtmbBY0+i8czC+phGwB8O8StQllEojBnWkhbr+UzeXwsXLGld/Mq9GfqGBMIhgN+2VoAB36L58fvunh++vxDeuOhX2cqQgVBheXjZEnnG0psZeeRo4Vklcqp0h28BCzKGz6b9z9wkC3rnWdXVNf2TYQlfyZQvFESvReQgMQ4jA4+5/pPVCT/rZkW5TYy1nZ/qgzhzqr5lmrUaD4YMsjyrTo63Q19gZbl1l3eFb5AJi6ayL0mHKZz72vXzVa4kD0PgNLpdpbU6w5vBuuAftUhGzwiDE0sBUteJjhddOric5mzqRPh23cfDGgaw0+x/LLVtrru6I/teALyQ08b/LtGGesJhqYOzOfHeadL2xgyyAkrrfjxqBXVa18uiHycnNLsw1vg70wg3NlpIkBPrgbFnTvNGoyzm9NhzVCasL9SC1oK 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)(396003)(136003)(376002)(346002)(39860400002)(451199024)(230921699003)(82310400011)(1800799009)(186009)(36840700001)(46966006)(40470700004)(2616005)(336012)(26005)(44832011)(8936002)(40480700001)(36756003)(1076003)(5660300002)(426003)(8676002)(41300700001)(40460700003)(4326008)(356005)(82740400003)(81166007)(86362001)(2906002)(316002)(83380400001)(47076005)(36860700001)(6666004)(478600001)(7696005)(54906003)(70206006)(70586007)(6916009)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB6323 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT034.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 5dd3f5d1-8179-4279-c8b7-08dbbb42fcad X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cGpzyoTROPBz2ALgEg3WE2pMAEanJiKUdultl7c9m0zLJrWu4uWa7pLalNjr3WZUDWGGfm5d2WBXV4dFZCVBS3rv38JWBa0xOWc0bvI4C+HI+6lK+bHbwR7PUp1wiC7FEI/28PL2kpPEFoZtCVJLo796G8aWSHz+w6NBZC4C8seN69TEF7oyxDB2hUmnbOFowPMJL1phybPugttSa/lFRKoqVWzPzrNVvM6ocSlossJjsisDSMrlLKzdYx8MrDkhcMx+0QQ32VjHWFWNYOb1MdD1oztNYoYJuBMbyaLbRrFYXRlSezR4tps47oRE7a0ZD1RM4xeJuTY8K50w0GY9wfKsuSIt3kNWrJTG6RJzv3+yxyDS2QaoeHEkAGpdc6GPDT9tpaUwUoldZVIuguFkXnocmzNeLzUBmXsO56xlC0wLDwzL6Si9UeDKY3KhgWEchwMP690Tu8oc6rWLygNG0Z6iax5ObI9xFQ9isHlG9thekFVo60zC7GFMQCRjXRl0etIdXW2YRVvuN3RrqD3MXiS5DcaY43NMt6BFeH1uGmkpj5iaNtWKDKn8+TEZcqCEanDCpASXkfshBXaYfFmsQRgh5/uyPsvWCX3H/r+RIdLzKq1RWj0vVuHOPtAng+ZOqC9n1nJQR+N9IR4DEl2HWMBT76lsYPgcM6qIMBitqggow9lzpPvvntpvKMf6k+WX2mfU2IECMoK1OoZ2WVcTWlOAjogYrqpiQ0PJf/IWRZxx8FmPH5/Z2kCfVZRcFsgZtts+dRk4VRscq7TkwclhNA== 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)(346002)(136003)(396003)(39860400002)(376002)(82310400011)(1800799009)(186009)(451199024)(230921699003)(46966006)(40470700004)(36840700001)(6666004)(82740400003)(7696005)(40480700001)(86362001)(40460700003)(81166007)(2616005)(1076003)(26005)(36756003)(336012)(426003)(83380400001)(44832011)(316002)(70206006)(54906003)(70586007)(6916009)(2906002)(47076005)(36860700001)(8936002)(8676002)(4326008)(41300700001)(478600001)(5660300002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Sep 2023 08:08:27.9008 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 64e00787-e8f4-41f2-c5ee-08dbbb431a26 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: DBAEUR03FT034.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB9797 X-Spam-Status: No, score=-11.7 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,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: From: Richard Sandiford Hi all, this is to add support to the new compact pattern syntax for the case where the constraints do appear unsorted like: (define_insn "*si3_insn_uxtw" [(set (match_operand:DI 0 "register_operand") (zero_extend:DI (SHIFT_no_rotate:SI (match_operand:SI 1 "register_operand") (match_operand:QI 2 "aarch64_reg_or_shift_imm_si"))))] "" {@ [cons: =0, 2, 1] [ r, Uss, r] \\t%w0, %w1, %2 [ r, r, r] \\t%w0, %w1, %w2 } [(set_attr "type" "bfx,shift_reg")] ) Best Regards Andrea gcc/Changelog 2023-09-20 Richard Sandiford * gensupport.cc (convert_syntax): Updated to support unordered constraints in compact syntax. --- gcc/gensupport.cc | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/gcc/gensupport.cc b/gcc/gensupport.cc index f7164b3214d..7e125e3d8db 100644 --- a/gcc/gensupport.cc +++ b/gcc/gensupport.cc @@ -896,19 +896,6 @@ convert_syntax (rtx x, file_location loc) parse_section_layout (loc, &templ, "cons:", tconvec, true); - /* Check for any duplicate cons entries and sort based on i. */ - for (auto e : tconvec) - { - unsigned idx = e.idx; - if (idx >= convec.size ()) - convec.resize (idx + 1); - - if (convec[idx].idx >= 0) - fatal_at (loc, "duplicate cons number found: %d", idx); - convec[idx] = e; - } - tconvec.clear (); - if (*templ != ']') { if (*templ == ';') @@ -951,13 +938,13 @@ convert_syntax (rtx x, file_location loc) new_templ += '\n'; new_templ.append (buffer); /* Parse the constraint list, then the attribute list. */ - if (convec.size () > 0) - parse_section (&templ, convec.size (), alt_no, convec, loc, + if (tconvec.size () > 0) + parse_section (&templ, tconvec.size (), alt_no, tconvec, loc, "constraint"); if (attrvec.size () > 0) { - if (convec.size () > 0 && !expect_char (&templ, ';')) + if (tconvec.size () > 0 && !expect_char (&templ, ';')) fatal_at (loc, "expected `;' to separate constraints " "and attributes in alternative %d", alt_no); @@ -1027,6 +1014,19 @@ convert_syntax (rtx x, file_location loc) ++alt_no; } + /* Check for any duplicate cons entries and sort based on i. */ + for (auto e : tconvec) + { + unsigned idx = e.idx; + if (idx >= convec.size ()) + convec.resize (idx + 1); + + if (convec[idx].idx >= 0) + fatal_at (loc, "duplicate cons number found: %d", idx); + convec[idx] = e; + } + tconvec.clear (); + /* Write the constraints and attributes into their proper places. */ if (convec.size () > 0) add_constraints (x, loc, convec); -- 2.25.1