This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] ARM: Add optimized ARMv7 strcmp implementation
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Will Newton <will dot newton at linaro dot org>
- Cc: <libc-alpha at sourceware dot org>, Richard Earnshaw <rearnsha at arm dot com>
- Date: Thu, 24 Apr 2014 14:42:18 +0000
- Subject: Re: [PATCH] ARM: Add optimized ARMv7 strcmp implementation
- Authentication-results: sourceware.org; auth=none
- References: <1398256338-24784-1-git-send-email-will dot newton at linaro dot org>
On Wed, 23 Apr 2014, Will Newton wrote:
> Add an optimized implementation of strcmp for ARMv7-A cores. This
> implementation is significantly faster than the current generic C
> implementation, particularly for strings of 16 bytes and longer.
Could you please describe the testing (at least the string/ tests should
have been run for both endiannesses) and be more specific about
"significantly faster" (benchmark results - on specific identified
hardware - using glibc's benchtests are desirable for such string function
tests, in addition to any other benchmarks you may have used if glibc's
benchtests aren't useful for the cases of interest)?
> +/* Build Options:
> + STRCMP_NO_PRECHECK: Don't run a quick pre-check of the first
> + byte in the string. If comparing completely random strings
> + the pre-check will save time, since there is a very high
> + probability of a mismatch in the first character: we save
> + significant overhead if this is the common case. However,
> + if strings are likely to be identical (eg because we're
> + verifying a hit in a hash table), then this check is largely
> + redundant. */
> +
> +#define STRCMP_NO_PRECHECK 0
In general I think it's clearer to have such macros in the positive sense,
i.e. STRCMP_PRECHECK (value 1) instead of STRCMP_NO_PRECHECK (value 0).
--
Joseph S. Myers
joseph@codesourcery.com