RE: [PATCH] middle-end: Recognize idioms for bswap32 and bswap64 in match.pd.

2020-08-22 Thread Marc Glisse
On Sat, 15 Aug 2020, Roger Sayle wrote: Here's version #2 of the patch to recognize bswap32 and bswap64 incorporating your suggestions and feedback. The test cases now confirm the transformation is applied when int is 32 bits and long is 64 bits, and should pass otherwise; the patterns now re

RE: [PATCH] middle-end: Recognize idioms for bswap32 and bswap64 in match.pd.

2020-08-17 Thread Roger Sayle
g/fold-bswap-4.c: New test. Thanks in advance, Roger -- -Original Message- From: Jakub Jelinek Sent: 15 August 2020 14:26 To: Roger Sayle Cc: 'GCC Patches' ; 'Marc Glisse' Subject: Re: [PATCH] middle-end: Recognize idioms for bswap32 and bswap64 in match.pd.

Re: [PATCH] middle-end: Recognize idioms for bswap32 and bswap64 in match.pd.

2020-08-15 Thread Jakub Jelinek via Gcc-patches
On Sat, Aug 15, 2020 at 11:09:17AM +0100, Roger Sayle wrote: > +/* Recognize ((T)bswap32(x)<<32)|bswap32(x>>32) as bswap64(x). */ > +(simplify > + (bit_ior:c Any reason for supporting bit_ior only? Don't plus:c or bit_xor:c work the same (i.e. use (for op (bit_ior bit_xor plus) ...)? J

RE: [PATCH] middle-end: Recognize idioms for bswap32 and bswap64 in match.pd.

2020-08-15 Thread Roger Sayle
check" with no new failures. Ok for mainline? Thanks in advance, Roger -- -Original Message- From: Marc Glisse Sent: 12 August 2020 10:43 To: Roger Sayle Cc: 'GCC Patches' Subject: Re: [PATCH] middle-end: Recognize idioms for bswap32 and bswap64 in match.pd. On Wed, 12 Au

Re: [PATCH] middle-end: Recognize idioms for bswap32 and bswap64 in match.pd.

2020-08-12 Thread Marc Glisse
On Wed, 12 Aug 2020, Roger Sayle wrote: This patch is inspired by a small code fragment in comment #3 of bugzilla PR rtl-optimization/94804. That snippet appears almost unrelated to the topic of the PR, but recognizing __builtin_bswap64 from two __builtin_bswap32 calls, seems like a clever/usef