This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Detect and select i586/i686 implementation at run-time
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: OndÅej BÃlka <neleai at seznam dot cz>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 27 Aug 2015 05:35:16 -0700
- Subject: Re: [PATCH] Detect and select i586/i686 implementation at run-time
- Authentication-results: sourceware.org; auth=none
- References: <20150826155705 dot GA26329 at intel dot com> <20150827121047 dot GB14077 at domone>
On Thu, Aug 27, 2015 at 5:10 AM, OndÅej BÃlka <neleai@seznam.cz> wrote:
> On Wed, Aug 26, 2015 at 08:57:05AM -0700, H.J. Lu wrote:
>> We detect i586 and i686 features at run-time by checking CX8 and CMOV
>> CPUID features bits. We can use these information to select the best
>> implementation in ix86 multiarch. HAS_I586/HAS_I686 is true if i586/i686
>> instructions are available on the processor.
>>
>> Due to the reordering and the other nifty extensions in i686, it is not
>> really good to use heavily i586 optimized code on an i686. It's better
>> to use i486 or i386 code if it isn't an i586. USE_I586/USE_I686 is true
>> if i586/i686 implementation should be used for the processor. USE_I586
>> is true only if i686 instructions aren't available. If i686 instructions
>> are available, we always choose i686, i486 or i386 implementation, in
>> that order, and we never choose i586 implementation for i686-class
>> processors.
>>
> Here I couldn't test if its improvement so I won't help with that.
>
> However as it covers historic extensions a better alternative would be
> use corresponding mmx to sse2 variant. Question here is again how much
> we support these.
The i486, i586, i686 version of multi-arch functions won't be used
on processors with SSE. The preferred version will be used on
older processors. It is an improvement for processors with SSE
as well as older processors.
--
H.J.