svn commit: r520468 - in head/sysutils: . cpuid2cpuflags
Jan Beich
jbeich at FreeBSD.org
Fri Dec 20 11:12:07 UTC 2019
(Sorry, I need to proofread more)
Jan Beich <jbeich at FreeBSD.org> writes:
> Neither supports non-x86 architectures[1] on FreeBSD. Even on x86 both
> are incomplete compared to "cc -march=native -v" e.g., cpuid2cpuflags
> lacks avx512bf16 while hs-cputype doesn't support avx512 at all.
>
> [1] Here're various ways to detect CPU features:
>
> aarch64:
> - READ_SPECIALREG(id_aa64isar0)
Typo: READ_SPECIALREG(id_aa64isar0_el1)
> - elf_aux_info: AT_HWCAP (on FreeBSD 13+)
>
> armv6 and armv7:
> - sysctl(KERN_PROC_AUXV): AT_HWCAP + AT_HWCAP2
> - elf_aux_info: AT_HWCAP + AT_HWCAP2 (on FreeBSD 12+)
>
> powerpc and powerpc64:
> - sysctlbyname: kern.cpu_features + kern.cpu_features2
Typo: kern. -> hw.
There's also hw.altivec as useful as hw.instruction_sse ;)
> - elf_aux_info: AT_HWCAP + AT_HWCAP2 (on FreeBSD 12+)
>
> riscv64:
> - elf_aux_info: AT_HWCAP (on FreeBSD 13+)
In the ports tree there're many examples checking a particular feature
(e.g., AES, NEON, ALTIVEC) but none try to list everything supported.
More information about the svn-ports-head
mailing list