This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/49263] SH Target: underutilized "TST #imm, R0" instruction


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49263

--- Comment #20 from Oleg Endo <olegendo at gcc dot gnu.org> 2012-10-31 13:47:07 UTC ---
(In reply to comment #19)
> Another thing I've noticed...
> Cases such as:
> 
>         mov.l   r0,@r2        ! LS
>         mov     r13,r0        ! MT
>         and     #7,r0         ! EX
>         tst     r0,r0         ! MT
>         bt/s    .L8           ! BR
>         mov.l   r0,@(16,r1)
> 
> where the result of the and op is re-used would be slightly better as:
> 
>         mov.l   r0,@r2       ! LS
>         mov     r13,r0       ! MT
>         tst     #7,r0        ! MT
>         and     #7,r0        ! EX
>         bt/s    .L8          ! BR
>         mov.l   r0,@(16,r1)
> 
> because it reduces dependency on the result of the and op and thus has a higher
> chance to be executed in parallel.

Other similar cases where hoisting the tst insn would make sense:
        mov.b   @(13,r2),r0
        extu.b  r0,r0
        tst     #1,r0
        bt      .L53

        mov.b   @(13,r1),r0
        extu.b  r0,r0
        tst     r0,r0
        bt/s    .L37


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]