http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50751
Oleg Endo <oleg.e...@t-online.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #25932|0 |1 is obsolete| | --- Comment #18 from Oleg Endo <oleg.e...@t-online.de> 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.