We can examine /proc/cpuinfo
on Intel and ARM machines to learn cpu features, like AES and SHA. I need to do the same for PowerPC under both AIX and Linux.
Testing with Linux is shown below. The output is produced by GCC112 on the compile farm.
$ cat /proc/cpuinfo
processor : 0
cpu : POWER8E (raw), altivec supported
clock : 2061.000000MHz
revision : 2.1 (pvr 004b 0201)
...
processor : 159
cpu : POWER8E (raw), altivec supported
clock : 2061.000000MHz
revision : 2.1 (pvr 004b 0201)
timebase : 512000000
platform : PowerNV
model : 8247-22L
machine : PowerNV 8247-22L
firmware : OPAL v3
GCC112 is a Power 8 machine. I should be seeing flags like VMX, AES, SHA, PMULL, etc. VMX is roughly the PowerPC equivalent to Intel SSE and ARM NEON.
I've found some related discussions like /proc/cpuinfo on comp.os.linux.powerpc. I also found What do we check on a new system?, but it lacks useful details like cpu features. Finally, there's a related question at What do the flags in /proc/cpuinfo mean?, but it does not discuss PowerPC.
GCC appears to provide the information to C programs through its use of built-ins. For example, there's a vsx
test and a vcrypto
test. The problem is, I'm working from a Bash script and not a C program.
I also don't know what to use for AIX. AIX is available at GCC119 on the compile farm.
How do I get the PowerPC cpu features on AIX and Linux?
lscpu
on Linux, andlscfg -v
on AIX. – meuh Sep 09 '17 at 18:16