From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26008 invoked by alias); 11 Dec 2011 00:24:39 -0000 Received: (qmail 25996 invoked by uid 22791); 11 Dec 2011 00:24:37 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 11 Dec 2011 00:24:23 +0000 From: "oleg.endo@t-online.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/50751] SH Target: Displacement addressing does not work for QImode and HImode Date: Sun, 11 Dec 2011 01:00: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: oleg.endo@t-online.de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Attachment #25932 is obsolete 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: 2011-12/txt/msg01134.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50751 Oleg Endo changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #25932|0 |1 is obsolete| | --- Comment #18 from Oleg Endo 2011-12-11 00:24:17 UTC --- Created attachment 26046 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26046 Proposed patch to add QImode displacement addressing This version of the patch was tested against rev 182090 and did not introduce new failures. It allows the generation of QImode displacement addressing move insns, but only if the addresses can be fixed before reload. If reload needs to load/store e.g. pseudos on the stack where displacement addressing would be required the generated code is not as good unfortunately. One good example for this kind of scenario is the gcc.dg/compat/struct-by-value-11 test from the testsuite, which shows that there is still some room for improvement. Still, on the CSiBE I could observe a code size decrease of -1.2% avg, where mpeg2dec goes down to -5.65% and libmpeg2/motion_comp down to -20% (-m4 -ml taken as example). Due to SH2A's 4 byte QImode displacement insn the benefit on SH2A code is not that big (-0.2% avg). There are probably smarter ways of doing what the patch does. I have also tried out implementing it with predicates and constraints, few load/store insns and lots of alternatives in the insns. However, reload would refuse to select the displacement addressing due to pressure on R0 in many cases. Would something like the attached patch be acceptable (after some cleanups)? If so, I'd also start adding HImode displacement addressing support.