From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24639 invoked by alias); 8 Aug 2017 19:59:01 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 24627 invoked by uid 89); 8 Aug 2017 19:59:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: EUR01-DB5-obe.outbound.protection.outlook.com Received: from mail-db5eur01on0082.outbound.protection.outlook.com (HELO EUR01-DB5-obe.outbound.protection.outlook.com) (104.47.2.82) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 08 Aug 2017 19:58:58 +0000 Received: from HE1PR0802MB2377.eurprd08.prod.outlook.com (10.172.129.19) by HE1PR0802MB2380.eurprd08.prod.outlook.com (10.172.129.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1304.22; Tue, 8 Aug 2017 19:58:54 +0000 Received: from HE1PR0802MB2377.eurprd08.prod.outlook.com ([fe80::488f:54de:6ff0:fdec]) by HE1PR0802MB2377.eurprd08.prod.outlook.com ([fe80::488f:54de:6ff0:fdec%18]) with mapi id 15.01.1304.027; Tue, 8 Aug 2017 19:58:54 +0000 From: Michael Collison To: Richard Kenner CC: "gcc-patches@gcc.gnu.org" , nd , "pinskia@gmail.com" Subject: RE: [PATCH] [Aarch64] Optimize subtract in shift counts Date: Tue, 08 Aug 2017 19:59:00 -0000 Message-ID: References: <20170807210159.86DD633CA8@vlsi1.gnat.com> <20170808015616.1386833CA8@vlsi1.gnat.com> <20170808121311.5B7D033CAD@vlsi1.gnat.com> <20170808195158.352B333ED7@vlsi1.gnat.com> In-Reply-To: <20170808195158.352B333ED7@vlsi1.gnat.com> authentication-results: spf=none (sender IP is ) smtp.mailfrom=Michael.Collison@arm.com; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;HE1PR0802MB2380;6:ZgorNfe0uUXRoyGWoWNbNoLaGVfA4PhUiLDlb9+WfHx9rhMmefcQvWSMczQQiN78G5mWQKGaN3By98SdDlgz7lYfpV9v2C3RCBxzwhKW8aQTzpFQRfiGA0iT9J8cCuLbx0p4RbVvCfWiIYKP220T9ekrtg3Lp/yeR/cAOXFVXkTJTYcXqhvNsIMtDna2VgkKw2KxQxRcX7NZvFtiMwe7dnOEyqbMkoy+JQYVbuxF7h+dgQAHs/z/Ie7cDi28ycAkJu1EC3ytqI0ICCbYhET8snagTfPILn4aMGwdE87Edaui7y1oJgXC1o5JGCXOygjoSSKegUbIQfwQkrp+K7ILsg==;5:Nmi0JBk1niBoQQIz5+lZayX3u8AJl//C5t3aBB8yufJQYYxb6xA+wUpRzIVWVF2o64jtTA3UOkfQoDyhdXHtfVsuOfhbPt1lquSP+au+NvHsHFztPN8Xbu9EitEQBo5Wr9LlZkLjbbGdFS8yA+k0yg==;24:APnlQR72ofh2WvlAHXtntbLTRjKk61f+Hvn95jZtn0cj4ng3T6dofggaZmjg4e1UjHI/WB+yFIdrjmCzlSE3LvladI2Trh+XTkN5TRr/T8g=;7:D6G0hiR5i+WAi5FEj8AsBh2AQXzUMoeqJfMQxpcbh5PjXb7yYHeu1t7Yde19wGrWeAjgMBfb/+eJ/ekCldIJEHncsHdBuGk1w5jLCqahfYN2qe33pRItKSOYrsVQo65lijEH0Ab7hvC9YfSbFrPOCaOiSqnh9N3ydixbFL0hWlzZR4yYQVdIHZhOXJtH8cRAoHlgMnv7IRDPLU8Mi30kEpUdWS7U7rKoSfbDyDv17PI= x-ms-office365-filtering-correlation-id: dfa1cc8e-b667-4cad-bd3e-08d4de97e5a9 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(48565401081)(2017052603031)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:HE1PR0802MB2380; x-ms-traffictypediagnostic: HE1PR0802MB2380: nodisclaimer: True x-exchange-antispam-report-test: UriScan:(180628864354917)(22074186197030)(183786458502308); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(100000703101)(100105400095)(6055026)(6041248)(20161123562025)(20161123555025)(20161123560025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:HE1PR0802MB2380;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:HE1PR0802MB2380; x-forefront-prvs: 03932714EB x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(39410400002)(39850400002)(39860400002)(39400400002)(39450400003)(39840400002)(13464003)(377454003)(189002)(199003)(53546010)(97736004)(6506006)(189998001)(2900100001)(81166006)(8936002)(8676002)(81156014)(3660700001)(14454004)(5660300001)(966005)(3280700002)(74316002)(478600001)(7696004)(86362001)(72206003)(54356999)(2906002)(76176999)(102836003)(68736007)(6116002)(3846002)(106356001)(66066001)(4326008)(99286003)(50986999)(7736002)(105586002)(25786009)(101416001)(33656002)(6436002)(93886004)(55016002)(9686003)(6306002)(2171002)(53936002)(54906002)(6246003)(39060400002)(305945005)(5250100002)(229853002)(38730400002)(2950100002)(6916009)(110136004);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR0802MB2380;H:HE1PR0802MB2377.eurprd08.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Aug 2017 19:58:53.9210 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0802MB2380 X-SW-Source: 2017-08/txt/msg00622.txt.bz2 Because for integer shift instructions the shift count is truncated. We ens= ure that we only use integer shift instructions by emitting a shift with a = mask. This only matches integer shift instructions in the md file. -----Original Message----- From: Richard Kenner [mailto:kenner@vlsi1.ultra.nyu.edu]=20 Sent: Tuesday, August 8, 2017 12:52 PM To: Michael Collison Cc: gcc-patches@gcc.gnu.org; nd ; pinskia@gmail.com Subject: RE: [PATCH] [Aarch64] Optimize subtract in shift counts > This case is covered by Wilco's previous reply: >=20 > https://gcc.gnu.org/ml/gcc-patches/2017-08/msg00575.html Which I don't understand: > No it's perfectly safe - it becomes an integer-only shift after the=20 > split since it keeps the masking as part of the pattern. Let say we have your first example: long f1(long x, int i) { return x >> (64 - i); } If "i" is -2, this should be a shift of 66 (which is indeed, technically un= defined), but becomes a shift of 62. What am I missing?