diff options
author | Alexander Kanavin <alex.kanavin@gmail.com> | 2022-12-30 19:38:40 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-12-31 17:08:29 +0000 |
commit | f2bb46285046f53fbfd20ae8cac00786092ce19d (patch) | |
tree | d6285c125c929a2f1970b2cf76216704e24e5306 /meta/conf/machine/include | |
parent | ae4311f25fe8ff739af015c8ac2342a62ca7dcdd (diff) | |
download | poky-f2bb46285046f53fbfd20ae8cac00786092ce19d.tar.gz |
conf/machine/include: add x86-64-v3 tunes (AVX, AVX2, BMI1, BMI2, F16C, FMA, LZCNT, MOVBE, XSAVE)
Qemu 7.2 finally allows us to move beyond building for original Core 2/Core i7 era hardware,
and this patch adds support for the newer generations. But first, a bit of
background:
Recently toolchains gained support for specifying x86-64 'levels' of
instruction set support; v3 corresponds to 2013-era Haswell CPUs
(and later), with AVX, AVX2 and a few other instructions that
were introduced in that generation. I believe this is preferrable
to picking a specific CPU model as the baseline.
Here's Phoronix's feature article that explains the feature and the available levels:
"Both LLVM Clang 12 and GCC 11 are ready to go in offering the new x86-64-v2, x86-64-v3, and x86-64-v4 targets.
These x86_64 micro-architecture feature levels have been about coming up with a few "classes" of Intel/AMD CPU processor support rather than continuing to rely on just the x86_64 baseline or targeting a
specific CPU family for optimizations. These new levels make it easier to raise the base requirements around Linux x86-64 whether it be for a Linux distribution or a particular software application where
the developer/ISV may be wanting to compile with greater instruction set extensions enabled in catering to more recent Intel/AMD CPUs."
https://www.phoronix.com/news/GCC-11-x86-64-Feature-Levels
Here's gcc docs for it:
https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html
And here's the formal specification (click on the pdf link):
https://gitlab.com/x86-psABIs/x86-64-ABI
The actual tune file was created by copying corei7 tunes and doing
search/replace on them. Qemu options were dropped as unnecessary.
32 bit tune was dropped as well, as there is no 32 bit only CPU
that also supports these new instructions; all of the v3 capable
chips are 64 bit.
(From OE-Core rev: ac041f90e71dba83b7144c91f929de88aaeae519)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/conf/machine/include')
-rw-r--r-- | meta/conf/machine/include/x86/tune-x86-64-v3.inc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/meta/conf/machine/include/x86/tune-x86-64-v3.inc b/meta/conf/machine/include/x86/tune-x86-64-v3.inc new file mode 100644 index 0000000000..267c12ff50 --- /dev/null +++ b/meta/conf/machine/include/x86/tune-x86-64-v3.inc | |||
@@ -0,0 +1,29 @@ | |||
1 | # Settings for the GCC(1) cpu-type "x86-64-v3": | ||
2 | # | ||
3 | # CPUs with AVX, AVX2, BMI1, BMI2, F16C, FMA, LZCNT, MOVBE, XSAVE. | ||
4 | # (but not AVX512). | ||
5 | # See https://www.phoronix.com/news/GCC-11-x86-64-Feature-Levels for details. | ||
6 | # | ||
7 | # This tune is recommended for Intel Haswell/AMD Excavator CPUs (and later). | ||
8 | # | ||
9 | DEFAULTTUNE ?= "x86-64-v3" | ||
10 | |||
11 | # Include the previous tune to pull in PACKAGE_EXTRA_ARCHS | ||
12 | require conf/machine/include/x86/tune-corei7.inc | ||
13 | |||
14 | # Extra tune features | ||
15 | TUNEVALID[x86-64-v3] = "Enable x86-64-v3 specific processor optimizations" | ||
16 | TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'x86-64-v3', ' -march=x86-64-v3', '', d)}" | ||
17 | |||
18 | # Extra tune selections | ||
19 | AVAILTUNES += "x86-64-v3" | ||
20 | TUNE_FEATURES:tune-x86-64-v3 = "${TUNE_FEATURES:tune-x86-64} x86-64-v3" | ||
21 | BASE_LIB:tune-x86-64-v3 = "lib64" | ||
22 | TUNE_PKGARCH:tune-x86-64-v3 = "x86-64-v3" | ||
23 | PACKAGE_EXTRA_ARCHS:tune-x86-64-v3 = "${PACKAGE_EXTRA_ARCHS:tune-corei7-64} x86-64-v3" | ||
24 | |||
25 | AVAILTUNES += "x86-64-v3-x32" | ||
26 | TUNE_FEATURES:tune-x86-64-v3-x32 = "${TUNE_FEATURES:tune-x86-64-x32} x86-64-v3" | ||
27 | BASE_LIB:tune-x86-64-v3-x32 = "libx32" | ||
28 | TUNE_PKGARCH:tune-x86-64-v3-x32 = "x86-64-v3-x32" | ||
29 | PACKAGE_EXTRA_ARCHS:tune-x86-64-v3-x32 = "${PACKAGE_EXTRA_ARCHS:tune-corei7-64-x32} x86-64-v3-x32" | ||