[PATCH, rs6000] Add expansions for min/max vector reductions

Segher Boessenkool segher@kernel.crashing.org
Thu Sep 17 19:08:00 GMT 2015


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



More information about the Gcc-patches mailing list