This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/49263] SH Target: underutilized "TST #imm, R0" instruction
- From: "olegendo at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 31 Oct 2012 13:47:07 +0000
- Subject: [Bug target/49263] SH Target: underutilized "TST #imm, R0" instruction
- Auto-submitted: auto-generated
- References: <bug-49263-4@http.gcc.gnu.org/bugzilla/>
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