Re: [RFC-PATCH] x86: really use __builtin_memcmp on x86_32

Andi Kleen
2008-11-10T08:21:38Z

Harvey Harrison <harvey.harrison@gmail.com> writes:

> Impact: prevent generic code from overriding __builtin_memcmp
>
> lib/string.c was using a generic implementation of memcmp
> because __HAVE_ARCH_MEMCMP was not defined and it was then doing
> #undef memcmp and defining a generic version.

gcc sometimes decides to not inline memcmp, so an out of line
version is always needed even when __builtin_memcmp is used.

While in theory x86 could supply an optimized version,
memcmp is relatively rarely used (and in many cases inlined),
so adding an assembler version for x86 is likely not worth
it.

-Andi

--
ak@linux.intel.com