Re: [PATCH] Improve simplify_rotate (PR middle-end/62263, PR middle-end/82498)

2017-10-14 Thread Richard Biener
On October 13, 2017 9:36:48 PM GMT+02:00, Jakub Jelinek wrote: >Hi! > >The forwprop rotate pattern recognizer is able to detect various >patterns, but for the case where we want to support all rotate >counts without UB, it requires >Y &= B - 1; >R = (X << Y) | (X >> ((-Y) & (B

[PATCH] Improve simplify_rotate (PR middle-end/62263, PR middle-end/82498)

2017-10-13 Thread Jakub Jelinek
Hi! The forwprop rotate pattern recognizer is able to detect various patterns, but for the case where we want to support all rotate counts without UB, it requires Y &= B - 1; R = (X << Y) | (X >> ((-Y) & (B - 1))); where R = (X << (Y & (B - 1))) | (X >> ((-Y) & (B - 1))); is another reasonable