On Thu, May 15, 2025 at 10:04 AM liuhongt wrote:
>
> 1) Optimize (a >> 1) + (b >> 1) + ((a | b) & 1) to .AVG_CEIL (a, b)
> 2) Optimize (a | b) - ((a ^ b) >> 1) to .AVG_CEIL (a, b)
>
> Prof is at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118994#c6
>
> Bootstrapped and regtested on x86_64-pc-linu
1) Optimize (a >> 1) + (b >> 1) + ((a | b) & 1) to .AVG_CEIL (a, b)
2) Optimize (a | b) - ((a ^ b) >> 1) to .AVG_CEIL (a, b)
Prof is at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118994#c6
Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}.
Ok for trunk?
gcc/ChangeLog:
PR middle