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

            Bug ID: 67637
           Summary: [SH] Optimize {shll,shlr} {bf/bt} sequences
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: olegendo at gcc dot gnu.org
  Target Milestone: ---
            Target: sh*-*-*

There are some cases, where shll or shlr insns are used to conditionally branch
on the MSB or LSB of a reg.

The shll case has been mentioned in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59533#c7

In the CSiBE set, lpgparse shows the shlr variant:

.L1573:
        neg     r1,r1
        shld    r1,r4
        mov     r4,r1
        shlr    r1
        bf      .L2333

On SH2A the bld insn can be used in this case.  On non-SH2A it might be better
(at least for lpgparse) to use a tst #1,r0, because r0 is unused at that time.

Reply via email to