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: OndÅej BÃlka <neleai at seznam dot cz>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 27 Aug 2015 14:10:47 +0200
- 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>
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.