Subject: Re: CVS commit: src/lib/libc/arch/i386/string
To: None <david@l8s.co.uk>
From: Perry E. Metzger <perry@piermont.com>
List: current-users
Date: 02/04/2005 15:06:21
David Laight <david@l8s.co.uk> writes:
> On Fri, Feb 04, 2005 at 09:20:30AM -0500, Perry E. Metzger wrote:
>> 
>> Note that for many calls, mem* is now being inlined by gcc using its
>> built in code (unless you do -fno-builtin etc.)
>
> Yes, last time I looked it generated the 'rep movsl', 'reb movsb'
> sequence - which is definitely sub-optimal.
>
> For short fixed size copies I've also seen sequences of 'lods; stos'.
> I've not investigated the execution times of those instructions, but
> the could easily be worse than using many simpler instructions.

Well, if that is true, then we should fix gcc to produce better
code, which will benefit all the users of gcc.

In either case, being able to inline short things like zeroing
structures is probably a win over having to call a function -- there
is a lot of overhead in a function call, and replacing it with a
couple of instructions in line is nice.

Perry