Runtime Altivec detection

Dan Malek dan at embeddededge.com
Sat Mar 8 04:24:15 EST 2003


Nathan Ingersoll wrote:

> I've recently been working on some Altivec optimizations for a library,
> and was looking for a relatively clean way to perform runtime detection.

For some time now the Linux kernel has provided support for emulating
the 'mfspr rd, PVR' instruction in user space.  Do this once, get the
PVR and determine the processor type.

You can also just read /proc/cpuinfo and search for the 'cpu :' line.
It will indicate the processor type and if altivec is supported.

There are probably other ways as well....


	-- Dan


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc-dev mailing list