From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10687 invoked by alias); 21 Dec 2016 15:05:13 -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 10602 invoked by uid 89); 21 Dec 2016 15:05:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=orn, itt, HContent-Language:en-GB X-HELO: EUR01-HE1-obe.outbound.protection.outlook.com Received: from mail-he1eur01on0061.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) (104.47.0.61) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 21 Dec 2016 15:05:02 +0000 Received: from VI1PR0802MB2621.eurprd08.prod.outlook.com (10.175.20.147) by VI1PR0802MB2400.eurprd08.prod.outlook.com (10.175.25.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.789.14; Wed, 21 Dec 2016 15:04:58 +0000 Received: from VI1PR0802MB2621.eurprd08.prod.outlook.com ([10.175.20.147]) by VI1PR0802MB2621.eurprd08.prod.outlook.com ([10.175.20.147]) with mapi id 15.01.0789.018; Wed, 21 Dec 2016 15:04:58 +0000 From: Wilco Dijkstra To: Bernd Edlinger , "gcc-patches@gcc.gnu.org" CC: Ramana Radhakrishnan , Richard Earnshaw , Kyrill Tkachov , nd Subject: Re: [PATCH, ARM] Further improve stack usage in sha512, part 2 (PR 77308) Date: Wed, 21 Dec 2016 15:20:00 -0000 Message-ID: References: , In-Reply-To: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Wilco.Dijkstra@arm.com; x-ms-office365-filtering-correlation-id: 210ba4b2-0e6d-4269-58c5-08d429b2bad5 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:VI1PR0802MB2400; x-microsoft-exchange-diagnostics: 1;VI1PR0802MB2400;7:y7ZVtVQ6l0a1UiG6KKIac7+UR74oiFsge+WbhTDZUP6G0SewkzIY/BifDFqI/Iaat6ts/smgHv853VcMFKm7CBqR1tz/CYfiNHHXu71/5kKxINGrljqpzVZbYObIPmBs90OPMya9n/q6U7UaYpwRBbWe2/ixludaSDEI0bH0LB7jdAL2NarAJHuIfeONCWdGt7c7AVS64BhD65f0C8SQPtNdj/Ql/wtxVTkYJwvSI1oCiF7vqueUuxM+HfCpdUjVKpFAkIxQ+dtiIX84AKTBOkcvkB0dNtGiXS7Dx0H8/O4docM5gtkgRD0Q1/pO9fRTbsLUlQbrCDfN/rpVIydzzkHMwuOvPX1bPVxvG9tLLfadA/jT1h/w2HIuqL74ulNPWwbP01YBI7xfztTkD0wQjcXaGyse0shcN6s0LOUTq6Fp7xwIQpcsr8XIlIpgw80Xl8GXFT6HoRbPtYmT3HR+aQ== nodisclaimer: True x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(6072148);SRVR:VI1PR0802MB2400;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0802MB2400; x-forefront-prvs: 01630974C0 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(7916002)(39840400002)(39450400003)(39860400002)(39850400002)(39410400002)(199003)(189002)(24454002)(86362001)(101416001)(5660300001)(106116001)(33656002)(6116002)(7696004)(76576001)(2900100001)(4326007)(189998001)(3846002)(97736004)(102836003)(106356001)(66066001)(50986999)(2906002)(122556002)(5001770100001)(54356999)(76176999)(77096006)(6436002)(6506006)(229853002)(7736002)(74316002)(305945005)(2501003)(25786008)(3280700002)(8936002)(105586002)(68736007)(8676002)(92566002)(81166006)(3660700001)(2950100002)(9686002)(81156014)(38730400001);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0802MB2400;H:VI1PR0802MB2621.eurprd08.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX: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="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Dec 2016 15:04:57.6269 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0802MB2400 X-SW-Source: 2016-12/txt/msg01786.txt.bz2 Bernd Edlinger wrote: On 12/20/16 16:09, Wilco Dijkstra wrote: > > As a result of your patches a few patterns are unused now. All the Thum= b-2 iordi_notdi* > > patterns cannot be used anymore. Also I think arm_cmpdi_zero never gets= used - a DI >> mode compare with zero is always split into ORR during expand. > > I did not change anything for -mthumb -mfpu=3Dneon for instance. > Do you think that iordi_notdi* is never used also for that > configuration? With -mfpu=3Dvfp or -msoft-float, these patterns cannot be used as logical = operations are expanded before combine. Interestingly with -mfpu=3Dneon ARM= uses the orndi3_neon patterns (which are inefficient for ARM and probably = should be disabled) but Thumb-2 uses the iordi_notdi patterns... So removin= g these reduces the number of patterns while we will still generate orn for= Thumb-2. > And if the arm_cmpdi_zero is never expanded, isn't it already > unused before my patch? It appears to be, so we don't need to fix it now. However when improving th= e expansion of comparisons it does trigger. For example x =3D=3D 3 expands = currently into 3 instructions: cmp r1, #0 itt eq cmpeq r0, #3 Tweaking arm_select_cc_mode uses arm_cmpdi_zero, and when expanded early we= generate this: eor r0, r0, #3 orrs r0, r0, r1 Using sub rather than eor would be even better of course. Wilco =20=20=20=20