Re: [PATCH] phiopt: Optimize x < 0 ? ~y : y to (x >> 31) ^ y [PR96928]

2021-01-05 Thread Richard Biener
On Tue, 5 Jan 2021, Jakub Jelinek wrote: > Hi! > > As requested in the PR, the one's complement abs can be done more > efficiently without cmov or branching. > > Had to change the ifcvt-onecmpl-abs-1.c testcase, we no longer optimize > it in ifcvt, on x86_64 with -m32 we generate in the end the

[PATCH] phiopt: Optimize x < 0 ? ~y : y to (x >> 31) ^ y [PR96928]

2021-01-05 Thread Jakub Jelinek via Gcc-patches
Hi! As requested in the PR, the one's complement abs can be done more efficiently without cmov or branching. Had to change the ifcvt-onecmpl-abs-1.c testcase, we no longer optimize it in ifcvt, on x86_64 with -m32 we generate in the end the exact same code, but with -m64: movl%edi,