On PowerPC/POWER, there is no consistent way for a userspace program to detect processor features like SIMD instruction sets.
The architecture defines a model specific register PVR which contains the processor identifier. However the mfspr
instruction used to read it is priveledged. Linux and NetBSD will trap and emulate PVR reads for userspace.
On OpenBSD and OS X, sysctl(3)
calls allow access to this information.
However AIX neither allows userspace access to PVR, nor has a sysctl
API. So, how does one detect the existence/absence of a processor feature when running on AIX?
In Power sytems, SIMD facility is included in VMX and VSX instruction sets.
systemcfg
may help:Actually
systemcfg.h
defined a list of macros to test system functionality: