On Fri, Apr 27, 2012 at 12:00 PM, Paulo J. Matos <pa...@matos-sorge.com> wrote: > On 27/04/12 09:21, Richard Guenther wrote: >>> >>> >>> This differs from what GCC47 does and seems to work better. >>> I would like help on how to best handle this situation under GCC47. >> >> >> Not provide movmem which looks like open-coded and not in any way >> "optimized"? >> > > Thanks Richard, however I don't understand your comment. > GCC46 outputs for this problem: > $t25: > enterl #H'0002 > st AL,@H'fff9 > st AH,@H'fff8 > ld X,@$XAP_AH > ld X,@(0,X) > ld AL,#H'0010 > ld AH,@H'fff9 > bc2 > ld AL,@H'fff8 > leavel #H'0002 > > and GCC47, once movmemqi and setmemqi are disabled: > $t25: > enterl #H'0005 > st AH,@(H'0001,Y) > ld X,@$XAP_AH > ld X,@(0,X) > ld AH,#H'0010 > st AH,@(0,Y) > ld AH,@$XAP_UXL > bsr $memcpy > ld AL,@(H'0001,Y) > leavel #H'0005 > > > It feels to me that GCC46 version is better: > * no branch to subroutine memcpy; > * less stack usage (argument to enterl); > > So, using our block copy (bc2) instruction is an optimisation, don't you > think?
Yes, it inlines it. You may want to look at s390 which I believe has a similar block-copy operation. Richard. > -- > PMatos >