Re: [x86 PATCH] PR rtl-optimization/101617: Use neg/sbb in ix86_expand_int_movcc.

2022-05-30 Thread Uros Bizjak via Gcc-patches
On Mon, May 30, 2022 at 7:50 PM Roger Sayle wrote: > > > This patch resolves PR rtl-optimization/101617 where we should generate > the exact same code for (X ? -1 : 1) as we do for ((X ? -1 : 0) | 1). > The cause of the current difference on x86_64 is actually in > ix86_expand_int_movcc that doesn

[x86 PATCH] PR rtl-optimization/101617: Use neg/sbb in ix86_expand_int_movcc.

2022-05-30 Thread Roger Sayle
This patch resolves PR rtl-optimization/101617 where we should generate the exact same code for (X ? -1 : 1) as we do for ((X ? -1 : 0) | 1). The cause of the current difference on x86_64 is actually in ix86_expand_int_movcc that doesn't know that negl;sbbl can be used to create a -1/0 result depe