Date: Tue, 17 Mar 1998 14:18:40 +0100 (MET) From: Hans-Bernhard Broeker To: Burton Radons cc: djgpp-workers AT delorie DOT com Subject: Re: libc replacement (memcmp) In-Reply-To: <350f6b73.34099775@mail.gec.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Tue, 17 Mar 1998, Burton Radons wrote: > memcmp used to compare using char-by-char, so I replaced it with > int-by-int -- quick optimizations, but it hadn't been done in three > years, so... bcmp follows this message. Two comments: 1) the patch is the wrong way round, and not a context diff. Not a big thing, but one that's easy to fix: always generate diffs to upload via: diff -c3 oldfile newfile > patchfile 2) I'm not sure, but I suspect it can be done even faster if you *align* the 32-bit compares. To do that, you'ld have to add another fixup loop that compares at most three bytes up to the next 4-byte boundary, before the main 32-bit compare loop. Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.