From nobody Sun Apr 21 19:05:39 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VMyWl5Lbmz5HXkw; Sun, 21 Apr 2024 19:05:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VMyWl4YtSz4f5r; Sun, 21 Apr 2024 19:05:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713726339; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y+cT4OrmK/DMAgZdpY+g6U/rWM8qb+jJlf/sEtO1V4M=; b=cG0NsqAe7Rs2+evIAdBmzGfmdehP160p6gl3Xg6inOhD1MnDPmKqD+cKQYsegKZmbaihrR 1ZJCA96ZBWkWNHyObCgRTHbSYLoyttjpSRlvLz5RK1yeeFg/2EFq8LqlubTOSYT/kb9SOS zmCBlaQPAzHaxlQuCn3fFbPA16sfr7cbCja+vMFtYnPGiCePlI3suTZfBvCx0dG3yMRqYi JkgxdzIgh6KVxGIULA1L+6tiubX3lHlf4tPsZ2m7t6sbtyOqL71VBCU5OMBt1KgAE0ZZb/ ayCLsaLrhG+rJ7KQAUmYQO9xJlTDaWzrgqkwysCIOUQQncCqDQNYgPz9KdKvsA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713726339; a=rsa-sha256; cv=none; b=FRWJl4BOXRT0S4ACGgWOQutDUmJkkZ3vS4fNpYx1AdyTDNeK9E7t8l4S/ynBChP5a0WVG5 v4UdrPl9La0YAzbjRSOxJSpOD9gfa9y+ezrIwJRmqHuBJLuuLfjU6hOna4Oj8U2gQrTF4x 9d7ktJ1CFWw+RgIiFT8Ji7v4fOSz99sOBM1U4/S7q2exrH+aJh/ZHsT72y2X9Zq9M+3Yzs WtzDCxIc+q4BeG0XuU7tKFdmDrMaXGJ51TnVOKQscYQWTJSpXDjxGzlH1+8VtnPAa2ub7D WlXQI4BY1EcPKVho6lWvATCTlJiZiVP5Iv1iX1J5Dl4PTEpuccplrTuztLLX9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713726339; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y+cT4OrmK/DMAgZdpY+g6U/rWM8qb+jJlf/sEtO1V4M=; b=ud1fCJ0ngHeLENGzKhIf9GSUPlruhY9lYGFLNT95Ic/m2QQX6le/6IY/579elsmeMczdu4 ozMx/XLxhaJIkAX0MHsnRkj0wXCe7nFbvZDz8ZwVny9B2oN1sotahV4FizK78jLcZfJyLQ nwpCZ4VN3OWSM31m7pUHXwDbgoMNDroxDVJ0cgW6Pay5stJ8liM0WQMJRiV4d/RmXf3sJJ UoA4GehZEQBlBg1oiaE9OFHLNsNc2jWMsf/Q0yug5KJ3gmDVcevzxNAWgg6SpgXRQGH6Ck KZXdo+v2RQDYmBzuF+nOdddgajDslZmC5T/zwJUrnzVKVXi98CUSyUA3nKbI7g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VMyWl49HnzGtJ; Sun, 21 Apr 2024 19:05:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43LJ5dFf028891; Sun, 21 Apr 2024 19:05:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43LJ5dvk028888; Sun, 21 Apr 2024 19:05:39 GMT (envelope-from git) Date: Sun, 21 Apr 2024 19:05:39 GMT Message-Id: <202404211905.43LJ5dvk028888@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 2dff504999f5 - stable/14 - share/mk/bsd.cpu.mk: add F16C feature for i386 and amd64 architectures List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2dff504999f570d45e969f62a3911f5d8310ab21 Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=2dff504999f570d45e969f62a3911f5d8310ab21 commit 2dff504999f570d45e969f62a3911f5d8310ab21 Author: Dimitry Andric AuthorDate: 2024-04-18 17:46:57 +0000 Commit: Dimitry Andric CommitDate: 2024-04-21 18:44: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 (cherry picked from commit 2fd73b7126d7d7e5701e001af929411ce7a0c5f1) --- 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" || \