Re: [ARC PATCH] Convert (signed<<31)>>31 to -(signed&1) without barrel shifter.

2023-10-30 Thread Claudiu Zissulescu Ianculescu
Hi Roger, Do you want to say bmsk_s instead of msk_s here: +/* { dg-final { scan-assembler "msk_s\\s+r0,r0,0" } } */ Anyhow, the patch looks good. Proceed with your commit. Thank you, Claudiu On Mon, Oct 30, 2023 at 5:05 AM Jeff Law wrote: > > > > On 10/28/23 10:47, Roger Sayle wrote: > > > >

Re: [ARC PATCH] Convert (signed<<31)>>31 to -(signed&1) without barrel shifter.

2023-10-29 Thread Jeff Law
On 10/28/23 10:47, Roger Sayle wrote: This patch optimizes PR middle-end/101955 for the ARC backend. On ARC CPUs with a barrel shifter, using two shifts is (probably) optimal as: asl_s r0,r0,31 asr_s r0,r0,31 but without a barrel shifter, GCC -O2 -mcpu=em currently

[ARC PATCH] Convert (signed<<31)>>31 to -(signed&1) without barrel shifter.

2023-10-28 Thread Roger Sayle
This patch optimizes PR middle-end/101955 for the ARC backend. On ARC CPUs with a barrel shifter, using two shifts is (probably) optimal as: asl_s r0,r0,31 asr_s r0,r0,31 but without a barrel shifter, GCC -O2 -mcpu=em currently generates: and r2,r0,1