From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 45009 invoked by alias); 26 Nov 2015 13:00:53 -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 44150 invoked by uid 89); 26 Nov 2015 13:00:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: gate.crashing.org Received: from gate.crashing.org (HELO gate.crashing.org) (63.228.1.57) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 26 Nov 2015 13:00:51 +0000 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id tAQD0fYK023025; Thu, 26 Nov 2015 07:00:41 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id tAQD0efq023022; Thu, 26 Nov 2015 07:00:40 -0600 Date: Thu, 26 Nov 2015 13:02:00 -0000 From: Segher Boessenkool To: Kyrill Tkachov Cc: GCC Patches Subject: Re: [PATCH][combine] PR rtl-optimization/68381: Only restrict pure simplification in mult-extend subst case, allow other substitutions Message-ID: <20151126130040.GA22668@gate.crashing.org> References: <564DA3D1.10905@arm.com> <20151119105739.GA32343@gate.crashing.org> <564DD0ED.9010604@arm.com> <20151119144102.GB32343@gate.crashing.org> <564DE415.1090600@arm.com> <564DE8B6.9040902@arm.com> <20151124001553.GA9049@gate.crashing.org> <5656D5FA.90805@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5656D5FA.90805@arm.com> User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg03227.txt.bz2 On Thu, Nov 26, 2015 at 09:50:50AM +0000, Kyrill Tkachov wrote: > As I mentioned on IRC, this patch improves codegen on aarch64 as well. > I've re-checked SPEC2006 and it seems to improve codegen around > multiply-extend-accumulate > instructions. For example the sequence: > mov w4, 64 > mov x1, 24 > smaddl x1, w9, w4, x1 // multiply-sign-extend-accumulate > add x1, x3, x1 > > becomes something like this: > mov w3, 64 > smaddl x1, w9, w3, x0 > add x1, x1, 24 // constant 24 propagated into the add So combine isn't smart enough to combine those last three into those last two. Yeah that makes sense. > Another was transforming the muliply-extend into something cheaper: > mov x0, 40 > mov w22, 32 > umaddl x22, w21, w22, x0 // multiply-zero-extend-accumulate > > changed becomes: > ubfiz x22, x21, 5, 32 // ASHIFT+extend > add x22, x22, 40 > > which should be always beneficial. But it only applies given some other preconditions. right? Either case, make sense that one is also too complicated for combine. > From what I can see we don't lose any of the multiply-extend-accumulate > opportunities that we gained from the original combine patch. > > So can we take this patch in as well? See the patch mail... Segher