delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/03/17/12:00:07

Date: Tue, 17 Mar 1998 18:57:34 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
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.SUN.3.91.980317185442.19045M-100000@is>
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.

Doesn't GCC inline `memcmp' under -On?

> !       while (n > 4) {
> !          if (*((int *) p1) != *((int *) p2)) {

I suggest making p1 and p2 aligned on 4-byte boundary (with single-byte 
comparisons) before going full throttle with 4-byte comparison.

- Raw text -


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