From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150042.outbound.protection.outlook.com [40.107.15.42]) by sourceware.org (Postfix) with ESMTPS id 049AF3851C22 for ; Fri, 7 Aug 2020 07:52:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 049AF3851C22 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Kyrylo.Tkachov@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=ZjbisRBzUTDFxanH1qGWBGgBsldTqsf+4GmfQ/8jVhQ=; b=iuGyJnyaLYD/JXu49U2jurSOLY+CPPb7UwIkbboglfquw8PxZGrqIYQSfKFayvE1O+S7VlR7aXqDIPi1xpr0eZT3CBysJztWiS//lfLgNoBNXIZp82++8bJvjhEc4sfbCRSD+5BSg2q9HMBjwmvir7Q7TIcY+JhJAdNljt7v9n4= Received: from MR2P264CA0023.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:1::35) by DB6PR08MB2758.eurprd08.prod.outlook.com (2603:10a6:6:1c::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.16; Fri, 7 Aug 2020 07:52:30 +0000 Received: from VE1EUR03FT054.eop-EUR03.prod.protection.outlook.com (2603:10a6:500:1:cafe::5d) by MR2P264CA0023.outlook.office365.com (2603:10a6:500:1::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.16 via Frontend Transport; Fri, 7 Aug 2020 07:52:30 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; gcc.gnu.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;gcc.gnu.org; dmarc=bestguesspass 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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT054.mail.protection.outlook.com (10.152.19.64) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.16 via Frontend Transport; Fri, 7 Aug 2020 07:52:29 +0000 Received: ("Tessian outbound e8cdb8c6f386:v64"); Fri, 07 Aug 2020 07:52:29 +0000 X-CR-MTA-TID: 64aa7808 Received: from dbc03fd78d76.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id C0B95852-EA21-4C8E-8705-B4C75A0D048E.1; Fri, 07 Aug 2020 07:52:24 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id dbc03fd78d76.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 07 Aug 2020 07:52:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aE1UQ6ckKI3m3sIztAAJsK9mHVhc/pVL8Ng26ERvajjmk4So/Lnp4se2iIEdObbZrN8aNB9iGma9rML9tG+xqKWVA3H0Q8uyeToBtIMSgk4NS/Jyc4zkSI6MGUbx5I8Fwl5UOTCP95b1NoIbjDhp9JuKQuPYPZo++TFu1nz8SKdnaMZxNbxNSFieDcBs9mjDvtwrsUS9Rxe4hI6sX6HKD58zcmYUM6OHwqWp+jWUcejW7MNYegPNECzDwVCmM96f10nNqANH9OoZ21iwY4DyaB3EGdijwDZ+G99FmuXLzWd2/5FXfDC2NQW0NhdjT7UidQyccVVsi9YqYh8TNhNuQg== 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-SenderADCheck; bh=ZjbisRBzUTDFxanH1qGWBGgBsldTqsf+4GmfQ/8jVhQ=; b=JOrDf1Ob34VdKk5CRubdCBUzCURDooHEng05T4Ne1DlDAjPh/0WHoDXqAtSxfKmfjfCKWNXmuFgeMuEP/glt6enqhF+zsNReZZCsHftG25mw8nhDoIR00AfZE3JIPSgEm7ILXCfVp4r5Od+FECb2VO+mQ6/D1r1T4TBVCfJ4gxOwGZjj0peha2tl7qq/3IRYONIlBE73LqlU8mFyog6HjJ3qSBHvQLgjEFpcr5TUcMPuPPLlKRFZRHOsJXaBH0WjeJw2/Q1b/baXM+3VnOcvGmSNktdjznbDttw/gVr1AnXCSN9URR3A3lrfFnNaXPQePyGHfyL0Qev38NPZrEZlBA== 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 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=ZjbisRBzUTDFxanH1qGWBGgBsldTqsf+4GmfQ/8jVhQ=; b=iuGyJnyaLYD/JXu49U2jurSOLY+CPPb7UwIkbboglfquw8PxZGrqIYQSfKFayvE1O+S7VlR7aXqDIPi1xpr0eZT3CBysJztWiS//lfLgNoBNXIZp82++8bJvjhEc4sfbCRSD+5BSg2q9HMBjwmvir7Q7TIcY+JhJAdNljt7v9n4= Received: from DB7PR08MB3002.eurprd08.prod.outlook.com (2603:10a6:5:20::25) by DB8PR08MB4108.eurprd08.prod.outlook.com (2603:10a6:10:b1::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.19; Fri, 7 Aug 2020 07:52:22 +0000 Received: from DB7PR08MB3002.eurprd08.prod.outlook.com ([fe80::5cd5:a4c8:f166:acf]) by DB7PR08MB3002.eurprd08.prod.outlook.com ([fe80::5cd5:a4c8:f166:acf%7]) with mapi id 15.20.3261.018; Fri, 7 Aug 2020 07:52:22 +0000 From: Kyrylo Tkachov To: Omar Tahir , "nickc@redhat.com" , Ramana Radhakrishnan , Richard Earnshaw , "gcc-patches@gcc.gnu.org" Subject: RE: [PATCH 3/5][Arm] New pattern for CSINC instructions Thread-Topic: [PATCH 3/5][Arm] New pattern for CSINC instructions Thread-Index: AdZqef4iUtYNV/e8SbuTpFz2jlc5DABbA3DQAACvDrAAKa94MA== Date: Fri, 7 Aug 2020 07:52:22 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 5211f3e1-a7e0-4c5a-9d53-f37614a98033.0 x-checkrecipientchecked: true Authentication-Results-Original: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; x-originating-ip: [80.5.218.175] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 8a3b4591-722a-4076-80c0-08d83aa6d5e3 x-ms-traffictypediagnostic: DB8PR08MB4108:|DB6PR08MB2758: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:8882;OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 3I2e5Lp4tYlfufOntu62xE2Z+59gKibZvfXaeC+9m+PN8TIJ2rSfS3i0YFOhDbUh2e5DnDGrjAs8zwAJIMmSAFTNml+bUq57Eic0deFcE9j0JqpmDhv64yyCwHCaU0EfY1LRtf1eXQ6ZsqPvzQCkL8YiXQYZDk7QBC4dyiDa1MpdeEuDilxk6lIKWGgwRPnxjYBWVe96uqofSz5+/soLicepDuM3AeJ3kRWvXpE5s+PgCmDFnHxX+/rsIsEBLR5tUbO2navRLZfNG4RNwQsMbTWlGgUqqxyw2ML1EtL+8QCZje3cHPikztllFD23hZbUEjap8NfuaPl9Mh9KwXuxOg== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB7PR08MB3002.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(346002)(396003)(366004)(376002)(39860400002)(136003)(2906002)(83380400001)(5660300002)(186003)(26005)(86362001)(6506007)(66446008)(55016002)(478600001)(52536014)(53546011)(9686003)(66556008)(66476007)(8936002)(33656002)(316002)(76116006)(110136005)(8676002)(71200400001)(7696005)(64756008)(66946007); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: DV1v4Kj++J66ZDwveJn/HPNjgQGsiEEYvx71ea8X99gWTLMQB8k0vglUdawhHEhuT2rMHAa5SmjDj934jtpcuhOM1dDE8A8hejVuRYwAIZw2g3YYpRS14kvgop7sMUxs+HYxK0R7ZOus0bEkHpkBJM63DMbh9i1r077Y97ET0nW9dl2lmZ1hbAQ0ymRHNcT/LSpuaszPSDUtqfT4oj7KfWCh3ODj/h23hZu/orQjXrJz1Vy/lnJ8sRj1p1HDC0fGk/zFKY5r5BCHYzeT5ARp/LN6FBzZYjeja3m8H1I6aPBRSCapVSEbb/7gatjHWI5+QeXelyFw9MrMrlY7+FCTvkTvHExakCegJ7+JDunHolq1ZYhjW86JHRZhMD1ojllBrWaj69e13A1p0gLIT+3aEcHJvVu4Z9HjR2VM+yGatjL4qSBk5eVe0+q96GR8cY7R4VD9/vi63FoE+v9HIha0t9xIUb4YaJxad6B39XT6IGJZaXNOCrtaU75xp35Eur/v5Ufwx6G2EqyyBua3Aw+Iw9o9jKROWUwAo4O0MzyRp4jtOqGyNM9rAP5ojSWLyLCpFoQ+zyds7RbvPuCzLQpg13V3sN6ZJVZNG/uX/hzUl8UaZw7EAWSO6vlepPO9Y5MUeNNx3KE1Dag4V9kh6wvpUQ== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB4108 Original-Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT054.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 75cb00f5-3a25-4bd7-81f3-08d83aa6d19f X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +IWXVSnK3h8fgSSL6Lx3YUoBnYlr2YH3XXboZdzWwvz9TDE+sdf/H1vNGVswRiDFotch3M+AJsT0815MPkl2OGNJvOlbyMTvwqMmaCCD2gtO6VhsQqdDpKNeTmd0LsmnZqeUVjVSEQWalmIBseguIgmqhoRfON+SKkKpr7Lahs1ajiyjIjxACBZejwJvyrDW9WsTMY24DpRD1NMa5bELJOeG3TkFldXpdCDhs8DHDbZYXe1e1CGt35qnrBQET4CYTU6XZ2VO/QRFlqiwtXUcLUTiCuvLiSKN1JAq4yegs5+7I8uarmpv9NJdEHWvmlIVzRxj+9mhoqqPcdNspayCm9ijQFzo9JLBcUi4z+LZeIQEGp2znOrMd1DBuS2whxFEkHuyUrap6ejrm5Q+/6IvGQ== 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; SFTY:; SFS:(4636009)(376002)(346002)(136003)(396003)(39860400002)(46966005)(26005)(7696005)(33656002)(6506007)(53546011)(8676002)(186003)(5660300002)(8936002)(2906002)(52536014)(336012)(70206006)(70586007)(83380400001)(55016002)(9686003)(82310400002)(81166007)(36906005)(47076004)(316002)(82740400003)(110136005)(478600001)(86362001)(356005); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2020 07:52:29.8824 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8a3b4591-722a-4076-80c0-08d83aa6d5e3 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: VE1EUR03FT054.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR08MB2758 X-Spam-Status: No, score=-15.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Aug 2020 07:52:34 -0000 > -----Original Message----- > From: Omar Tahir > Sent: 06 August 2020 13:02 > To: Kyrylo Tkachov ; nickc@redhat.com; > Ramana Radhakrishnan ; Richard > Earnshaw ; gcc-patches@gcc.gnu.org > Subject: RE: [PATCH 3/5][Arm] New pattern for CSINC instructions >=20 > > Hi Omar, > > > > diff --git a/gcc/config/arm/thumb2.md b/gcc/config/arm/thumb2.md > > index 0b00aef7ef7..79cf684e5cb 100644 > > --- a/gcc/config/arm/thumb2.md > > +++ b/gcc/config/arm/thumb2.md > > @@ -743,6 +743,9 @@ > > if (GET_CODE (operands[4]) =3D=3D LT && operands[3] =3D=3D const0_= rtx) > > return \"%i5\\t%0, %1, %2, lsr #31\"; > > > > + if (GET_CODE (operands[5]) =3D=3D PLUS && TARGET_COND_ARITH) > > + return \"cinc\\t%0, %1, %d4\"; > > + > > output_asm_insn (\"cmp\\t%2, %3\", operands); > > > > > > Hmmm, this looks wrong. The pattern needs to perform the comparison > (setting the CC reg) as well as do the conditional increment. > > Emitting a cinc without a cmp won't set the CC flags. > > Also, cinc increments only by 1, whereas the "arm_rhs_operand" predicat= e > accepts a wider variety of immediates, so just checking for GET_CODE > (operands[5]) =3D=3D PLUS isn't enough. > > > > Thanks, > > Kyrill > > >=20 > My bad, the following line >=20 > output_asm_insn (\"cmp\\t%2, %3\", operands); >=20 > should be before my change rather than after, that will generate the cmp > needed. >=20 > As for the predicate accepting other immediates, I don't think that's an = issue. > From what I understand, the pattern represents >=20 > r0 =3D f5 (f4 (r2, r3), r1) >=20 > where f5 is a shiftable operator and f4 is a comparison operator. For > simplicity let's just assume f4 is =3D=3D. Then we have >=20 > r0 =3D f5 (r1, r2 =3D=3D r3) >=20 > If f5 is PLUS then we get >=20 > r0 =3D r1 + (r2 =3D=3D r3) >=20 > which is >=20 > r0 =3D (r2 =3D=3D r3) ? r1 + 1 : r1 >=20 > i.e. cmp r2, r3 \\ cinc r0, r1, eq. Since all comparisons return either z= ero > (comparison failed) or 1 (comparison passed) a cinc should always work as > long as the shiftable operator is PLUS. > Operand 3 being an "arm_rhs_operand" shouldn't matter since it's just bei= ng > compared to operand 2 and returning a 0 or 1. Ah, thanks for explaining, it's been a while since I messed with these patt= erns... Ok with the cmp fixed (as long as bootstrap and testing shows no problems) >=20 > Thanks, > Omar