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

--- Comment #1 from Oleg Endo <olegendo at gcc dot gnu.org> ---
Actually, this can be also used for xor or and-not etc combinations.  E.g. an
and-not sequence:
        mov     #-1,r12
        tst     r0,r0       T1
        negc    r12,r12     !T1
        tst     r1,r1       T0
        movt    r10
        and     r12,r10     r1 = T0 & !T1
        tst     r10,r10     T = !(T0 & !T1)
        bt      .L4315

could be done better as:
        tst     r0,r0           T1
        movt    r0
        tst     r1,r1           T0
        rotcl   r0              t0 = T1 T0
        cmp/eq  #1,r0           T = T0 & !T1
        bf      .L4315

Since the comparison combination is more complex (in terms of SH insns), it's
also beneficial to do it for 2 comparisons.

Reply via email to