delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/03/17/08:21:08

Date: Tue, 17 Mar 1998 14:18:40 +0100 (MET)
From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
To: Burton Radons <loth AT gec DOT net>
cc: djgpp-workers AT delorie DOT com
Subject: Re: libc replacement (memcmp)
In-Reply-To: <350f6b73.34099775@mail.gec.net>
Message-ID: <Pine.LNX.3.93.980317141236.84E-100000@acp3bf>
MIME-Version: 1.0

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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019