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: [PATCH] Don't emit cmpstrsi and movstr* insns with -Os


On Sun, 7 Sep 2003, Richard Henderson wrote:
> On Sat, Sep 06, 2003 at 04:58:40PM -0600, Roger Sayle wrote:
> > Disabling cmpstrsi with -Os shouldn't be controversial, the only backend
> > .md file that defines a pattern for it is i386.md.  My belief is that
> > disabling movstr* should also be a space win on other platforms, most of
> > which don't have the CISC advantages of x86's variable instruction length
> > encoding, complex memory move instructions and unaligned memory accesses.
>
> Any chance you could get this tested on s390?  If you get
> similar results there, then this is ok.

At the risk of upsetting all of the embedded s390 developers out there :>,
I've just done some experimentation with a s390-ibm-linux cross-compiler.
Unfortunately, s390 isn't supported by newlib, so I'm unable to generate
CSiBE's object files myself.  Perhaps CSiBE should contain preprocessed
source files?

However, I have been able to try the following minimal benchmark:

void foo(char *dst, char *src, int len)
{
  memcpy(dst,src,len);
}

with mainline CVS versions of gcc, gas and gld (20030907), the cross
compiler to s390-ibm-linux-gnu produced the following object sizes
(as reported by binutils' size).

Options				Text	Data	Total
-c				64	52	116
-c -O2				56	32	88
-c -Os				56	32	88
-c -Os -fno-builtin-memcpy	36	44	80
-c -Os [with this patch]	36	44	80


Hence it looks like disabling movstr* when the user specifies -Os
is also a "size" win on IBM's s390, for this single test atleast.
Checking the -S output, the call to memcpy isn't being sibcalled,
which would bias/invalidate this particular test.


Ulrich, if you can, please could you evaluate my patch on your s390?
If you haven't tried it before, the CSiBE benchmark is remarkably
easy to use.  Very many thanks in advance.

I'm happy to wait for Ulrich (or some other kind volunteer?) to
provide the definitive CSiBE results.  Is this single data-point
conclusive enough?

Roger
--


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