Subject: port-i386/8452: memchr micro-optimization for i386
To: None <gnats-bugs@gnats.netbsd.org>
From: None <byrnes@curl.com>
List: netbsd-bugs
Date: 09/20/1999 11:05:51
>Number: 8452
>Category: port-i386
>Synopsis: memchr micro-optimization for i386
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: port-i386-maintainer (NetBSD/i386 Portmaster)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Sep 20 11:05:00 1999
>Last-Modified:
>Originator: Robert Byrnes
>Organization:
Curl Corporation
>Release: NetBSD-1.4.1
>Environment:
>Description:
In lib/libc/arch/i386/string/memchr.S
and sys/lib/libkern/arch/i386/memchr.S,
the instructions ...
testl %ecx,%ecx /* test for len == 0 */
jz L1
can be replaced with ...
jecxz L1 /* test for len == 0 */
The only difference is the side effect of setting the condition codes,
but those aren't used, as far as I can tell.
>How-To-Repeat:
>Fix:
Use jecxz.
>Audit-Trail:
>Unformatted: