https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106602

--- Comment #6 from Vineet Gupta <vineetg at rivosinc dot com> ---
(In reply to Andrew Pinski from comment #4)
> (In reply to Vineet Gupta from comment #3)
> > Interestingly, if one builds for -march=rv64gc_zbs  # single bit extension
> > 
> > then the optimal code seq for bitmanip is generated, while no zbs
> > instructions are used.
> > 
> > foo2:
> >     slli    a5,a0,32
> >     srli    a0,a5,26
> >     ret
> 
> Most likely because
> li    a5,1
>       slli    a5,a5,38
> Could be done using one instruction.
> 
> And then combine could do its thing. But with multiple instructions, it
> becomes harder to do.
> I have not looked into rtl dumps but this is just knowing what combine can
> do and such.

Looks like our updates collided, indeed that 1 << 38 is the issue here.

Reply via email to