From nobody Thu Apr 18 18:42:58 2024 X-Original-To: dev-commits-src-main@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 4VL68z0B33z5HMZW; Thu, 18 Apr 2024 18:42:59 +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 4VL68y6f4Yz46SX; Thu, 18 Apr 2024 18:42:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713465778; 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=9li3NcZl8MAsDFkK5XUoiSiR961jaIEgwHgzOj1VJZs=; b=lpIIBetM+E0Av6Qm7Vs20SDKCOdmP7Jl6z46TaqeTJhI84sbFgOWX32wb4EnxcyM0H0ecK uCY3SWmiiFZgxIwiGOoBBrW9fif86IwOF9kt4onuo68iJWapTzOL9f8hoObHEESqpo+PAl fFQ789DkesiHMADq7IMLsjdExLxWrtpa6H1J2S08qCsT+51uimmcZ0fCKm5+Ogq6XmMwvV LGRO7erTEOR3FesIZan2BST49PgqqntpwZgdA80Ht3vMOetqRyfpFOqm9IXF7tz0DbMF// RnBT/r1EI5tVl1X2Cw7V5+Euth7P2Bmn3mCXwSNw5JswW2giKzEOEfu+TLRILw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713465778; a=rsa-sha256; cv=none; b=rxPzBKVHZYhx01ABIXpPhPiGqJxEYfnHRXgCOuUmK6KiD+TTVrfwXwj9kN52xl+PW0zYUL zjQpsGyJsnakcu92jKaEbyoso7vfJJ2+2kfgbtpjDkcCyRnAZcJBMnIJ7tFYg/K0ogMrpO mCzNDsGS/ZIVMh1OtqqlBAnQ0vSE4qRYlL2FvEEHdB83V6YJu/7j+kncNBZKg2hBW6iBE+ 4UHk9XJNUuy+2W5VZbNTVOC8A7tptxgVz+hxsp/hGzbjQdE2fr4z/TyI8VsUPzodxlU6S3 roAdlD6aXXoP4bOhOpcNqQ/nWr6g5uwCPl3Y47d+JlC5GrNV5IBbb91ZwjjfKg== 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=1713465778; 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=9li3NcZl8MAsDFkK5XUoiSiR961jaIEgwHgzOj1VJZs=; b=v7WeTiedhceyVzlvgcR+tIfwqLkilZ5XVA3qZG/+S8mKeE6VbduaEtT1uqTDYuVNxx2gyP GR6rYUL8jxqjRiuy2oz1AZ1ekvMOlblgeCyrUd9eq6lInOh9xVWakzDRhuSxL6Ob6hHmlw 0h0KGo6rRqdaClL5w++eOiOVp8CLqkV2eDjFyPy2AyAQKNxtnQMqEgyAYiLGdu2gO8p5TF WliVa9uJ4yUu0JCZVEVcw0Q1E6tPuKj++BOmW/HTG36XoIeqbX9tKQwDbA7FjC0e0lJazB 7Mhxu1a59fehgP7RDO8mUX37HESRY9HkBQsOExECsJC7g2CuCSoHK7HMOBWw1w== 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 4VL68y6DyYzLhB; Thu, 18 Apr 2024 18:42:58 +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 43IIgwPq067429; Thu, 18 Apr 2024 18:42:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43IIgwE7067426; Thu, 18 Apr 2024 18:42:58 GMT (envelope-from git) Date: Thu, 18 Apr 2024 18:42:58 GMT Message-Id: <202404181842.43IIgwE7067426@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 2fd73b7126d7 - main - share/mk/bsd.cpu.mk: add F16C feature for i386 and amd64 architectures List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 2fd73b7126d7d7e5701e001af929411ce7a0c5f1 Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=2fd73b7126d7d7e5701e001af929411ce7a0c5f1 commit 2fd73b7126d7d7e5701e001af929411ce7a0c5f1 Author: Dimitry Andric AuthorDate: 2024-04-18 17:46:57 +0000 Commit: Dimitry Andric 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" || \