Search code examples
linuxarmcpuid

Is it possible to obtain (short) descriptions of features contained in /proc/cpuinfo?


Scenario:

$ cat /proc/cpuinfo | grep fp | sort -u
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma dcpop asimddp asimdfhm

Here we see the list of features.

Is it possible to obtain (short) descriptions of each of these features?

Example:

$ <some_command>
feature  short description
crc32    CRC32 instructions
aes      Advanced SIMD AES instructions
...

Solution

  • Using the idea in What do the flags in /proc/cpuinfo mean?. Unfortunately there's no source code available in Linux commenting the ARM64 feature names like in x86 so I had to use the version in golang's cpu package

    ARM64_FEATURES="$(wget -qO- https://github.com/golang/sys/raw/master/cpu/cpu.go \
        | awk '/ARM64/,/}/')"
    for feature in $(grep "^Features" /proc/cpuinfo | sort -u | cut -d":" -f2); do
        printf "${feature}\t"
        echo "$ARM64_FEATURES" | grep -i "Has${feature}\s" | sed 's#.* // ##'
    done | column -t -s $'\t'
    

    Please also check the above question for details, because as mentioned there, not all flags are printed to the Features line on ARM as each manufacturer may have their own extensions

    Sample output for your case

    fp        Floating-point instruction set (always available)
    asimd     Advanced SIMD (always available)
    evtstrm   Event stream support
    aes       AES hardware implementation
    pmull     Polynomial multiplication instruction set
    sha1      SHA1 hardware implementation
    sha2      SHA2 hardware implementation
    crc32     CRC32 hardware implementation
    atomics   Atomic memory operation instruction set
    fphp      Half precision floating-point instruction set
    asimdhp   Advanced SIMD half precision instruction set
    cpuid     CPUID identification scheme registers
    asimdrdm  Rounding double multiply add/subtract instruction set
    jscvt     Javascript conversion from floating-point to integer
    fcma      Floating-point multiplication and addition of complex numbers
    dcpop     Persistent memory support
    asimddp   Advanced SIMD double precision instruction set
    asimdfhm  Advanced SIMD multiplication FP16 to FP32