From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 80115 invoked by alias); 17 Sep 2015 18:56:08 -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 80104 invoked by uid 89); 17 Sep 2015 18:56:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD 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, 17 Sep 2015 18:56:06 +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 t8HIX7BX014362; Thu, 17 Sep 2015 13:38:31 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id t8HGHvVS006938; Thu, 17 Sep 2015 11:17:57 -0500 Date: Thu, 17 Sep 2015 19:08:00 -0000 From: Segher Boessenkool To: Bill Schmidt Cc: Richard Biener , Alan Lawrence , "gcc-patches@gcc.gnu.org" , "dje.gcc@gmail.com" , Alan Hayward , "ramana.gcc@googlemail.com" Subject: Re: [PATCH, rs6000] Add expansions for min/max vector reductions Message-ID: <20150917161752.GD2613@gate.crashing.org> References: <1442413689.2896.45.camel@gnopaine> <55F98AD2.4080408@arm.com> <1442419857.10907.0.camel@gnopaine> <55F9A0D8.3020900@arm.com> <1442499522.10907.25.camel@gnopaine> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1442499522.10907.25.camel@gnopaine> User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg01327.txt.bz2 On Thu, Sep 17, 2015 at 09:18:42AM -0500, Bill Schmidt wrote: > On Thu, 2015-09-17 at 09:39 +0200, Richard Biener wrote: > > So just to clarify - you need to reduce the vector with max to a scalar > > but want the (same) result in all vector elements? > > Yes. Alan Hayward's cond-reduction patch is set up to perform a > reduction to scalar, followed by a scalar broadcast to get the value > into all positions. It happens that our most efficient expansion to > reduce to scalar will naturally produce the value in all positions. It also is many insns after expand, so relying on combine to combine all that plus the following splat (as Richard suggests below) is not really going to work. If there also are targets where the _scal version is cheaper, maybe we should keep both, and have expand expand to whatever the target supports? Segher