Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Apr 2024 18:42:58 GMT
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 2fd73b7126d7 - main - share/mk/bsd.cpu.mk: add F16C feature for i386 and amd64 architectures
Message-ID:  <202404181842.43IIgwE7067426@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by dim:

URL: https://cgit.FreeBSD.org/src/commit/?id=2fd73b7126d7d7e5701e001af929411ce7a0c5f1

commit 2fd73b7126d7d7e5701e001af929411ce7a0c5f1
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-04-18 17:46:57 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-04-18 18:42:21 +0000

    share/mk/bsd.cpu.mk: add F16C feature for i386 and amd64 architectures
    
    As discussed in bug 278417, some ports require the F16C instruction set
    to compile, but there is no way yet to detect whether the currently
    chosen CPUTYPE supports this feature.
    
    Add the feature to the MACHINE_CPU variable, for each processor that
    supports it. The list of processors was extracted from clang 18's -dM
    output, filtered on the __F16C__ define.
    
    PR:             278417
    Reviewed by:    brooks, emaste
    MFC after:      3 days
    Differential Revision: https://reviews.freebsd.org/D44848
---
 share/mk/bsd.cpu.mk | 42 ++++++++++++++++++++++++------------------
 1 file changed, 24 insertions(+), 18 deletions(-)

diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk
index 3fee105e901d..730e4b4aa152 100644
--- a/share/mk/bsd.cpu.mk
+++ b/share/mk/bsd.cpu.mk
@@ -149,17 +149,18 @@ _CPUCFLAGS = -mcpu=${CPUTYPE}
 ########## i386
 . if ${MACHINE_CPUARCH} == "i386"
 .  if ${CPUTYPE} == "znver4"
-MACHINE_CPU = avx512 avx2 avx sse42 sse41 ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586
+MACHINE_CPU = avx512 avx2 avx sse42 sse41 ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586 f16c
 .  elif ${CPUTYPE} == "znver3" || ${CPUTYPE} == "znver2" || \
     ${CPUTYPE} == "znver1"
-MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586
+MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586 f16c
 .  elif ${CPUTYPE} == "bdver4"
-MACHINE_CPU = xop avx2 avx sse42 sse41 ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586
-.  elif ${CPUTYPE} == "bdver3" || ${CPUTYPE} == "bdver2" || \
-    ${CPUTYPE} == "bdver1"
+MACHINE_CPU = xop avx2 avx sse42 sse41 ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586 f16c
+.  elif ${CPUTYPE} == "bdver3" || ${CPUTYPE} == "bdver2"
+MACHINE_CPU = xop avx sse42 sse41 ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586 f16c
+.  elif ${CPUTYPE} == "bdver1"
 MACHINE_CPU = xop avx sse42 sse41 ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586
 .  elif ${CPUTYPE} == "btver2"
-MACHINE_CPU = avx sse42 sse41 ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586
+MACHINE_CPU = avx sse42 sse41 ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586 f16c
 .  elif ${CPUTYPE} == "btver1"
 MACHINE_CPU = ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586
 .  elif ${CPUTYPE} == "amdfam10"
@@ -186,12 +187,14 @@ MACHINE_CPU = k5 i586
     ${CPUTYPE} == "cannonlake" || ${CPUTYPE} == "knm" || \
     ${CPUTYPE} == "skylake-avx512" || ${CPUTYPE} == "knl" || \
     ${CPUTYPE} == "x86-64-v4"
-MACHINE_CPU = avx512 avx2 avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586
+MACHINE_CPU = avx512 avx2 avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 f16c
 .  elif ${CPUTYPE} == "alderlake" || ${CPUTYPE} == "skylake" || \
     ${CPUTYPE} == "broadwell" || ${CPUTYPE} == "haswell" || \
     ${CPUTYPE} == "x86-64-v3"
-MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586
-.  elif ${CPUTYPE} == "ivybridge" || ${CPUTYPE} == "sandybridge"
+MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 f16c
+.  elif ${CPUTYPE} == "ivybridge"
+MACHINE_CPU = avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 f16c
+.  elif ${CPUTYPE} == "sandybridge"
 MACHINE_CPU = avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586
 .  elif ${CPUTYPE} == "tremont" || ${CPUTYPE} == "goldmont-plus" || \
     ${CPUTYPE} == "goldmont" || ${CPUTYPE} == "westmere" || \
@@ -232,17 +235,18 @@ MACHINE_CPU += i486
 ########## amd64
 . elif ${MACHINE_CPUARCH} == "amd64"
 .  if ${CPUTYPE} == "znver4"
-MACHINE_CPU = avx512 avx2 avx sse42 sse41 ssse3 sse4a sse3
+MACHINE_CPU = avx512 avx2 avx sse42 sse41 ssse3 sse4a sse3 f16c
 .  elif ${CPUTYPE} == "znver3" || ${CPUTYPE} == "znver2" || \
     ${CPUTYPE} == "znver1"
-MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse4a sse3
+MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse4a sse3 f16c
 .  elif ${CPUTYPE} == "bdver4"
-MACHINE_CPU = xop avx2 avx sse42 sse41 ssse3 sse4a sse3
-.  elif ${CPUTYPE} == "bdver3" || ${CPUTYPE} == "bdver2" || \
-    ${CPUTYPE} == "bdver1"
+MACHINE_CPU = xop avx2 avx sse42 sse41 ssse3 sse4a sse3 f16c
+.  elif ${CPUTYPE} == "bdver3" || ${CPUTYPE} == "bdver2"
+MACHINE_CPU = xop avx sse42 sse41 ssse3 sse4a sse3 f16c
+.  elif ${CPUTYPE} == "bdver1"
 MACHINE_CPU = xop avx sse42 sse41 ssse3 sse4a sse3
 .  elif ${CPUTYPE} == "btver2"
-MACHINE_CPU = avx sse42 sse41 ssse3 sse4a sse3
+MACHINE_CPU = avx sse42 sse41 ssse3 sse4a sse3 f16c
 .  elif ${CPUTYPE} == "btver1"
 MACHINE_CPU = ssse3 sse4a sse3
 .  elif ${CPUTYPE} == "amdfam10"
@@ -259,12 +263,14 @@ MACHINE_CPU = k8 3dnow
     ${CPUTYPE} == "cannonlake" || ${CPUTYPE} == "knm" || \
     ${CPUTYPE} == "skylake-avx512" || ${CPUTYPE} == "knl" || \
     ${CPUTYPE} == "x86-64-v4"
-MACHINE_CPU = avx512 avx2 avx sse42 sse41 ssse3 sse3
+MACHINE_CPU = avx512 avx2 avx sse42 sse41 ssse3 sse3 f16c
 .  elif ${CPUTYPE} == "alderlake" || ${CPUTYPE} == "skylake" || \
     ${CPUTYPE} == "broadwell" || ${CPUTYPE} == "haswell" || \
     ${CPUTYPE} == "x86-64-v3"
-MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse3
-.  elif ${CPUTYPE} == "ivybridge" || ${CPUTYPE} == "sandybridge"
+MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse3 f16c
+.  elif ${CPUTYPE} == "ivybridge"
+MACHINE_CPU = avx sse42 sse41 ssse3 sse3 f16c
+.  elif ${CPUTYPE} == "sandybridge"
 MACHINE_CPU = avx sse42 sse41 ssse3 sse3
 .  elif ${CPUTYPE} == "tremont" || ${CPUTYPE} == "goldmont-plus" || \
     ${CPUTYPE} == "goldmont" || ${CPUTYPE} == "westmere" || \



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202404181842.43IIgwE7067426>