[Bug target/65317] [SH] Shifts used instead of and with const_int

olegendo at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jun 17 16:31:00 GMT 2015


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

--- Comment #1 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to Oleg Endo from comment #0)
> It seems that it's better to allow any constant for the *andsi_compact
> pattern and split out the constant load if it doesn't fit into K08.  An and
> with constant 0x80000000 could be treated as a special case to emit the
> shorter sequence:
>         shll     r4
>         movt     r0
>         rts
>         rotr     r0

On SH4A the following sequence is better, because imm8 constant loads are in
the MT group:

         shll     r4
         mov      #0,r0
         rts
         rotcr    r0



More information about the Gcc-bugs mailing list