Re: [PATCH] match.pd: recognize a signed rotate

2020-03-24 Thread Richard Biener via Gcc-patches
On Tue, Mar 24, 2020 at 10:45 AM Stefan Schulze Frielinghaus wrote: > > On Mon, Mar 23, 2020 at 04:44:56PM +0100, Richard Biener wrote: > > On Mon, Mar 23, 2020 at 4:34 PM Jakub Jelinek wrote: > > > > > > On Mon, Mar 23, 2020 at 04:29:12PM +0100, Richard Biener wrote: > > > > I wonder if we can l

Re: [PATCH] match.pd: recognize a signed rotate

2020-03-24 Thread Stefan Schulze Frielinghaus via Gcc-patches
On Mon, Mar 23, 2020 at 04:44:56PM +0100, Richard Biener wrote: > On Mon, Mar 23, 2020 at 4:34 PM Jakub Jelinek wrote: > > > > On Mon, Mar 23, 2020 at 04:29:12PM +0100, Richard Biener wrote: > > > I wonder if we can leverage the bswap pass for rotate detection > > > (see find_bswap_or_nop which ma

Re: [PATCH] match.pd: recognize a signed rotate

2020-03-23 Thread Richard Biener via Gcc-patches
On Mon, Mar 23, 2020 at 4:34 PM Jakub Jelinek wrote: > > On Mon, Mar 23, 2020 at 04:29:12PM +0100, Richard Biener wrote: > > I wonder if we can leverage the bswap pass for rotate detection > > (see find_bswap_or_nop which matches the symbolic number > > against either 1:1 or byte-swapped variants,

Re: [PATCH] match.pd: recognize a signed rotate

2020-03-23 Thread Jakub Jelinek via Gcc-patches
On Mon, Mar 23, 2020 at 04:29:12PM +0100, Richard Biener wrote: > I wonder if we can leverage the bswap pass for rotate detection > (see find_bswap_or_nop which matches the symbolic number > against either 1:1 or byte-swapped variants, to be added would be > rotate and shift patterns). That pass c

Re: [PATCH] match.pd: recognize a signed rotate

2020-03-23 Thread Richard Biener via Gcc-patches
On Mon, Mar 23, 2020 at 2:23 PM Stefan Schulze Frielinghaus via Gcc-patches wrote: > > Hi all, > > A rotate of a signed integer is not recognized so far. > > int32_t f (int32_t x) > { > return (x << 5) | (int32_t)((uint32_t)x >> 27); > } > > The code above is unoptimized in contrast to a

[PATCH] match.pd: recognize a signed rotate

2020-03-23 Thread Stefan Schulze Frielinghaus via Gcc-patches
Hi all, A rotate of a signed integer is not recognized so far. int32_t f (int32_t x) { return (x << 5) | (int32_t)((uint32_t)x >> 27); } The code above is unoptimized in contrast to a version consisting only of unsigned integers. I'm wondering if this is intended or not. Since GCC ha