Re: [PATCH] match.pd: Add new bitwise arithmetic pattern [PR98304]

2022-07-09 Thread Jeff Law via Gcc-patches
On 7/7/2022 7:59 AM, Sam Feifer via Gcc-patches wrote: Hi! This patch is meant to solve a missed optimization in match.pd. It optimizes the following expression: n - (((n > 63) ? n : 63) & -64) where the constant being negated (in this case -64) is a power of 2 and the sum of the two consta

[PATCH] match.pd: Add new bitwise arithmetic pattern [PR98304]

2022-07-07 Thread Sam Feifer via Gcc-patches
Hi! This patch is meant to solve a missed optimization in match.pd. It optimizes the following expression: n - (((n > 63) ? n : 63) & -64) where the constant being negated (in this case -64) is a power of 2 and the sum of the two constants is -1. For the signed case, this gets optimized to (n <