Subject: Re: Runtime Altivec detection

From: Dan Malek <[email-masked]>
Date: Fri, 07 Mar 2003 12:24:15 -0500

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/