From owner-svn-ports-all@freebsd.org Fri Dec 20 11:12:07 2019 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BAB711D680D; Fri, 20 Dec 2019 11:12:07 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47fR0R4Ysmz3MFq; Fri, 20 Dec 2019 11:12:07 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1354) id 94A8510BDB; Fri, 20 Dec 2019 11:12:07 +0000 (UTC) From: Jan Beich To: Alexey Dokuchaev Cc: svn-ports-head@freebsd.org, svn-ports-all@freebsd.org, Gleb Popov , ports-committers@freebsd.org Subject: Re: svn commit: r520468 - in head/sysutils: . cpuid2cpuflags References: <201912200518.xBK5IHPq022253@repo.freebsd.org> <20191220084532.GA30042@FreeBSD.org> Date: Fri, 20 Dec 2019 12:11:57 +0100 In-Reply-To: (Jan Beich's message of "Fri, 20 Dec 2019 11:45:48 +0100") Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 11:12:07 -0000 (Sorry, I need to proofread more) Jan Beich 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.