From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30591 invoked by alias); 31 Oct 2012 13:47:46 -0000 Received: (qmail 30124 invoked by uid 48); 31 Oct 2012 13:47:11 -0000 From: "olegendo at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/49263] SH Target: underutilized "TST #imm, R0" instruction Date: Wed, 31 Oct 2012 13:47:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: olegendo at gcc dot gnu.org X-Bugzilla-Status: REOPENED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: olegendo at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-10/txt/msg02960.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49263 --- Comment #20 from Oleg Endo 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