Re: [16/n] PR85694: Add detection of averaging operations

2018-07-02 Thread Richard Biener
On Fri, Jun 29, 2018 at 11:21 AM Richard Sandiford wrote: > > This patch adds detection of average instructions: > >a = (((wide) b + (wide) c) >> 1); >--> a = (wide) .AVG_FLOOR (b, c); > >a = (((wide) b + (wide) c + 1) >> 1); >--> a = (wide) .AVG_CEIL (b, c); > > in cases w

[16/n] PR85694: Add detection of averaging operations

2018-06-29 Thread Richard Sandiford
This patch adds detection of average instructions: a = (((wide) b + (wide) c) >> 1); --> a = (wide) .AVG_FLOOR (b, c); a = (((wide) b + (wide) c + 1) >> 1); --> a = (wide) .AVG_CEIL (b, c); in cases where users of "a" need only the low half of the result, making the cast to (