[PATCH] powerpc: New feature - HWCAP/HWCAP2 bits in the TCB
Steven Munroe
munroesj@linux.vnet.ibm.com
Tue Jun 9 19:18:00 GMT 2015
On Tue, 2015-06-09 at 11:33 -0700, Roland McGrath wrote:
> > I believe the idea is to provide a fast way to emulate a functionality
> > similar to __builtin_cpu_supports for powerpc. For x86, this builtin
> > will create 'cpuid' instruction, but since powerpc lacks a similar one
> > it should rely on hardware capability information provided by kernel.
>
> On x86 using cpuid is quite slow as instruction-level overheads go.
> It's certainly nowhere near as fast as doing a direct load from memory.
> So this analogue does not suggest anything like justification for the
> kind of microoptimization being discussed.
In the X86 implementation the cpuid is cached by __builtin_cpu_init(). I
suspect the result is saved in static or TLS.
That said the x86/x86_64 ISA and micro arch are different from POWER
with different tradeoffs.
It would inappropriate to impose these assumptions on other platforms
Our proposal is appropriate for the reality of POWER and using the
HWCAP.
More information about the Libc-alpha
mailing list