This is the mail archive of the gcc-patches@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]

Re: [SH] PR 54089 - Improve software dynamic shifts


Oleg Endo <oleg.endo@t-online.de> wrote:
> This patch does two things...
> 
> 1) The dynamic shift cost is set to be the same if HW dynamic shifts are
> available.  This improves code size for SH2A a little (-2 KByte on CSiBE
> for -m2a-single -O2).
> 
> 2) Improve code around library function calls for software dynamic
> shifts (logical right + left shifts only for now).
> For this I had to change the implementations of ashlsi3 and lshrsi3 in
> lib1funcs.S, but  the changes are backwards compatible with older
> binaries.  Due to the additional branch insn in the dyn shift functions
> they might be one or two cycles slower than the original, but this
> reduces the amount of clobbered regs and cuts 9.5 KByte in the CSiBE set
> (-m2 -ml -O2), which seems more beneficial to do on average.
> 
> Tested on rev. 190990 with
> make -k check RUNTESTFLAGS="--target_board=sh-sim
> \{-m2/-ml,-m2/-mb,-m2a/-mb,-m4/-ml,-m4/-mb,-m4a/-ml,-m4a/-mb}"
> 
> and no new failures except for this one on SH2:
> 
> FAIL: gcc.dg/pr28402.c scan-assembler-not __[a-z]*si3
> 
> The reason for this is that now the middle-end will expand DImode shifts
> as SImode shifts instead of a DImode shift library call, because it sees
> the new SImode dynamic library call shift patterns for SH2.  I will have
> a look at this issue later to see if it is beneficial to do special
> handling of DImode shifts on SH2.
> 
> OK to install?

OK.

Regards,
	kaz


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