riscv: add new ISA extensions and profile support
cover riscv: add new ISA extensions and profile support
# Overview
Support for the RISC-V architecture and a basic set of extensions has been available in oe-core for a long time now, and as of late 2025, QEMU defaults to the RVA23S64 profile when booting qemuriscv64 images. However, at the userspace level, we currently support only the standard "riscv64gc" profile (behind a generic "riscv64" identifier), which is common across the wider open-source ecosystem, but lacks many of the features which are starting to become necessary for more advanced experimentation and testing on RISC-V platforms. This series aims to remedy that by introducing several distinct changes across a few files. I've broken it up on a per-profile basis for easier review, but the final version could probably feature some squashed commits. It could also go the route of breaking tunings up more in the style of those in conf/machine/include/arm/, but I'll leave them as-is for now to avoid even more rework that needs reviewing.
A list of changes, by group:
1. Basic clarification changes and extra tunings:
a. tune-riscv: be explicit about riscv64gc default
b. tune-riscv.inc: add 'riscv64gcv' tune
2. Adding official RVA20 profile extensions, and supporting the explicit choice of 'rva20u64' as a tuning option for builds:
a. arch-riscv.inc: add missing RVA20 extensions
b. meta/lib/oe/tune.py: support profile strings, add rva20u64 c. tune-riscv.inc: add rva20u64 to AVAILTUNES
3. Adding RVA22 profile support:
a. arch-riscv.inc: add rva22u64 extensions
b. meta/lib/oe/tune.py: add rva22u64 profile
c. tune-riscv.inc: add rva22u64 to AVAILTUNES
4. Adding RVA23 profile support:
a. arch-riscv.inc: add rva23u64 extensions
b. meta/lib/oe/tune.py: add rva23u64 profile
c. tune-riscv.inc: add rva23u64 to AVAILTUNES
5. Quality-of-life fixups after 1-4:
a. meta/lib/oe/tune.py: add riscv_pkgarch()
b. arch-riscv.inc: rename TUNE_RISCV_PKGARCH -> TUNE_RISCV_PKGARCH_EXACT
in assignments
c. tune-riscv.inc: append zifencei extension to profiles
These changes are also in my contrib branch[1]. The main sources of truth used were gcc's '-march' options list[2], the official RISC-V International documentation[3], and the RISC-V ISA Explorer[4], with the gcc specifics as the preferred source. When comparing against gcc's output, commands like the following were run:
|tgamblin@megalith ~/workspace/ypbuilds/poky-qemuriscv64/layers/openembedded-core (master)$ riscv64-linux-gnu-gcc -march=rva23u64 -mabi=lp64d -Q --help=target | grep rv64 | -march= rv64imafdcbv_zic64b_zicbom_zicbop_zicboz_ziccamoa_ziccif_zicclsm_ziccrse_zicntr_zicond_zicsr_zihintntl_zihintpause_zihpm_zimop_zmmul_za64rs_zaamo_zalrsc_zawrs_zfa_zfhmin_zca_zcb_zcd_zcmop_zba_zbb_zbs_zkt_zvbb_zve32f_zve32x_zve64d_zve64f_zve64x_zvfhmin_z
However, as is visible above, the extension list became so long for the RVA23 case that it was truncated, and so a more verbose output from the following was checked instead:
|riscv64-linux-gnu-gcc -march=rva23u64 -mabi=lp64d -v -xc /dev/null -c -o /dev/null
For now, the default tuning remains riscv64gc (with the naming rework in 1a), despite the presence of the other profiles. It is critical to note that not all combinations of the RISC-V extensions may be valid or useful to use for projects, and whenever possible a ratified profile's corresponding tune (e.g. "RVA22" -> "rva22u64") should be extended rather than picking and choosing each feature. There are also several extensions which are depended on by others (e.g. 'zkt' is needed by 'b'), and other known examples which aren't strictly part of the official profiles but must be included for the Yocto/OE case, such as 'zifencei' being necessary to build the Linux Kernel (which already had been addressed before, but this series handles slightly differently). This series makes no attempts to add extensions which are not part of these profiles - those could be added in future series, but these changes are significant enough for now. It might be worth adding some more documentation about how all of this works - I'd be happy to hear what people think about that too.
One significant change to the way profile strings are processed with these patches shows up in sstate/build path naming, and is part of the reason for patch 5a and 5b above - before, a build directory might have a path in it like:
|build/tmp/work/riscv64imafdc_zicsr_zifencei-poky-linux/
This was fine when the extension list was short (for riscv64gc), but with the full RVA profiles, the paths started to get so long that bitbake would produce this error:
|ERROR: Unable to reduce sstate name to less than 255 chararacters
To solve this problem, meta/lib/oe/tune.py now supports a very short list of profile names, and includes a new function riscv_pkgarch() designed to compare selected extensions against known profiles and determine if once has implicitly been selected. As an example, if you set the following in local.conf:
|TUNE_FEATURES = "${@oe.tune.riscv_isa_to_tune('riscv64gc')} ziccamoa ziccif zicclsm ziccrse zicntr zicsr zmmul za128rs zaamo zalrsc zca zcd"
and then run 'bitbake -e opensbi', you will see:
|PACKAGE_EXTRA_ARCHS="rva20u64_zifencei"
With all of this combined, subdirectories in tmp/work/ look like:
|tgamblin@megalith ~/workspace/ypbuilds/poky-qemuriscv64 $ ls build/tmp/work |all-poky-linux riscv64imafdcv_zicsr_zifencei-poky-linux rva20u64_zcmop_zifencei_zihintpause_zimop_zvbb-poky-linux rva22u64_zifencei-poky-linux x86_64-linux |qemuriscv64-poky-linux riscv64imafdc_zicsr_zifencei-poky-linux rva20u64_zifencei-poky-linux rva23u64_zifencei-poky-linux
Note that the 'rva20u64_zcmop_zifencei_zihintpause_zimop_zvbb-poky-linux' configuration is a custom one I set in local.conf only for testing purposes. Custom tunings still run the ris(c|k) of exceeding the naming length, which we may need some extra logic to handle (or, again, find a way to make it behave more like arm) if we want to enable freely customizing build tunings. This is an area where I'm hoping there will be some suggestions, as the way to do this in local.conf seems fairly ugly (but maybe that's a good thing?):
|DEFAULTTUNE = "rva20u64"
|TUNE_FEATURES = "${@oe.tune.riscv_isa_to_tune('rva20u64')} zihintpause zvbb zimop zcmop zifencei"
A consequence of doing this is that a lot of other variables related to the tuning features get "polluted":
|tgamblin@megalith ~/workspace/ypbuilds/poky-qemuriscv64 $ bitbake -e opensbi | grep PACKAGE_EXTRA_ARCHS
|# "all any noarch ${PACKAGE_EXTRA_ARCHS} ${MACHINE_ARCH}"
|# "all any noarch ${PACKAGE_EXTRA_ARCHS} ${MACHINE_ARCH}"
|# $PACKAGE_EXTRA_ARCHS [11 operations]
|# [_defaultval] "${PACKAGE_EXTRA_ARCHS:tune-${DEFAULTTUNE}}"
|# "${PACKAGE_EXTRA_ARCHS:tune-${DEFAULTTUNE}}"
|PACKAGE_EXTRA_ARCHS="rva20u64_zcmop_zifencei_zihintpause_zimop_zvbb"
|# $PACKAGE_EXTRA_ARCHS:tune-riscv32gc
|PACKAGE_EXTRA_ARCHS:tune-riscv32gc="rva20u64_zcmop_zifencei_zihintpause_zimop_zvbb"
|# $PACKAGE_EXTRA_ARCHS:tune-riscv32nf
|PACKAGE_EXTRA_ARCHS:tune-riscv32nf="rva20u64_zcmop_zifencei_zihintpause_zimop_zvbb"
|# $PACKAGE_EXTRA_ARCHS:tune-riscv64gc
|PACKAGE_EXTRA_ARCHS:tune-riscv64gc="rva20u64_zcmop_zifencei_zihintpause_zimop_zvbb"# Testing
Testing different profiles' validity against the compiler involved setting (for example) DEFAULTTUNE = "rva23u64" and then running 'bitbake opensbi' (which also results in a kernel rebuild) as a quick smoke test. I've also opted to do full image builds to make sure that the new profiles fully boot and run without any obvious errors. Because I've been playing with coreutils on qemuriscv64 a lot lately, here are example results with each profile (plus riscv64gc and riscv64gcv, for completeness) enabled on a build and test of core-image-ptest-coreutils. Note that when the vector extension is enabled (riscv64gcv, rva23u64), the test duration is significantly higher:
riscv64gc:
|============================================================================ |Testsuite summary for GNU coreutils 9.11 |============================================================================ |# TOTAL: 733 |# PASS: 561 |# SKIP: 172 |# XFAIL: 0 |# FAIL: 0 |# XPASS: 0 |# ERROR: 0 |============================================================================ |make[1]: Leaving directory '/usr/lib/coreutils/ptest' |DURATION: 671 |END: /usr/lib/coreutils/ptest |2026-09-15T15:45 |STOP: ptest-runner |TOTAL: 1 FAIL: 0 |root@qemuriscv64:~#
riscv64gcv:
|============================================================================ |Testsuite summary for GNU coreutils 9.11 |============================================================================ |# TOTAL: 733 |# PASS: 561 |# SKIP: 172 |# XFAIL: 0 |# FAIL: 0 |# XPASS: 0 |# ERROR: 0 |============================================================================ |make[1]: Leaving directory '/usr/lib/coreutils/ptest' |DURATION: 940 |END: /usr/lib/coreutils/ptest |2026-09-15T16:39 |STOP: ptest-runner |TOTAL: 1 FAIL: 0 |root@qemuriscv64:~#
rva20u64:
|============================================================================ |Testsuite summary for GNU coreutils 9.11 |============================================================================ |# TOTAL: 733 |# PASS: 561 |# SKIP: 172 |# XFAIL: 0 |# FAIL: 0 |# XPASS: 0 |# ERROR: 0 |============================================================================ |make[1]: Leaving directory '/usr/lib/coreutils/ptest' |DURATION: 660 |END: /usr/lib/coreutils/ptest |2026-09-15T15:02 |STOP: ptest-runner |TOTAL: 1 FAIL: 0 |root@qemuriscv64:~#
rva22u64:
|============================================================================ |Testsuite summary for GNU coreutils 9.11 |============================================================================ |# TOTAL: 733 |# PASS: 561 |# SKIP: 172 |# XFAIL: 0 |# FAIL: 0 |# XPASS: 0 |# ERROR: 0 |============================================================================ |make[1]: Leaving directory '/usr/lib/coreutils/ptest' |DURATION: 615 |END: /usr/lib/coreutils/ptest |2026-09-15T13:48 |STOP: ptest-runner |TOTAL: 1 FAIL: 0 |root@qemuriscv64:~#
rva23u64:
|============================================================================ |Testsuite summary for GNU coreutils 9.11 |============================================================================ |# TOTAL: 733 |# PASS: 561 |# SKIP: 172 |# XFAIL: 0 |# FAIL: 0 |# XPASS: 0 |# ERROR: 0 |============================================================================ |make[1]: Leaving directory '/usr/lib/coreutils/ptest' |DURATION: 966 |END: /usr/lib/coreutils/ptest |2026-09-15T12:18 |STOP: ptest-runner |TOTAL: 1 FAIL: 0 |root@qemuriscv64:~#
[1]: https://git.openembedded.org/openembedded-core-contrib/log/?h=tgamblin/riscv64-tuning-rework
[2]: https://gcc.gnu.org/onlinedocs/gcc/RISC-V-Options.html
[3]: https://docs.riscv.org/reference/home/index.html
[4]: https://riscv.github.io/riscv-isa-explorer/
Trevor Gamblin (14):
tune-riscv: be explicit about riscv64gc default tune-riscv.inc: add 'riscv64gcv' tune
arch-riscv.inc: add missing RVA20 extensions meta/lib/oe/tune.py: support profile strings, add rva20u64 tune-riscv.inc: add rva20u64 to AVAILTUNES
arch-riscv.inc: add rva22u64 extensions meta/lib/oe/tune.py: add rva22u64 profile
tune-riscv.inc: add rva22u64 to AVAILTUNES
arch-riscv.inc: add rva23u64 extensions meta/lib/oe/tune.py: add rva23u64 profile
tune-riscv.inc: add rva23u64 to AVAILTUNES meta/lib/oe/tune.py: add riscv_pkgarch()
arch-riscv.inc: rename TUNE_RISCV_PKGARCH -> TUNE_RISCV_PKGARCH_EXACT
in assignments
tune-riscv.inc: append zifencei extension to profiles
.../conf/machine/include/riscv/arch-riscv.inc | 198 ++++++++++++++++-- .../conf/machine/include/riscv/tune-riscv.inc | 24 ++- meta/lib/oe/tune.py | 42 +++- 3 files changed, 240 insertions(+), 24 deletions(-)
Signature · 1 line
2.55.0
RFC PATCH 1/14 tune-riscv: be explicit about riscv64gc default
The string 'riscv64' is a generic descriptor for the 64-bit RISC-V ISA, and can mean different things under different contexts. In the case of tune-riscv.inc, it has served as an alias for the 'riscv64gc' profile which packages are typically built against, resulting in the following output (from a typical bitbake preamble):
|TUNE_FEATURES = "rv 64 i m a f d c zicsr zifencei"
Modify tune-riscv.inc to avoid overloading the 'riscv64' string in this way, instead setting DEFAULTTUNE to 'riscv64gc', and changing other occurrences to match. TUNE_FEATURES remains the same under this adjustment, but the .inc file is clearer which profile is being targeted.
--- meta/conf/machine/include/riscv/tune-riscv.inc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
meta/conf/machine/include/riscv/tune-riscv.inc +5 -5
@@ -1,15 +1,15 @@ require conf/machine/include/riscv/arch-riscv.inc -DEFAULTTUNE ?= "riscv64" +DEFAULTTUNE ?= "riscv64gc" -AVAILTUNES += "riscv64 riscv32 riscv64nc riscv64nf riscv32nf" +AVAILTUNES += "riscv64gc riscv32gc riscv64nc riscv64nf riscv32nf" # Default -TUNE_FEATURES:tune-riscv64 := "${@oe.tune.riscv_isa_to_tune("rv64gc")}" -PACKAGE_EXTRA_ARCHS:tune-riscv64 = "${TUNE_RISCV_PKGARCH}" +TUNE_FEATURES:tune-riscv64gc := "${@oe.tune.riscv_isa_to_tune("rv64gc")}" +PACKAGE_EXTRA_ARCHS:tune-riscv64gc = "${TUNE_RISCV_PKGARCH}" TUNE_FEATURES:tune-riscv32 := "${@oe.tune.riscv_isa_to_tune("rv32gc")}" -PACKAGE_EXTRA_ARCHS:tune-riscv32 = "${TUNE_RISCV_PKGARCH}" +PACKAGE_EXTRA_ARCHS:tune-riscv32gc = "${TUNE_RISCV_PKGARCH}" # No float TUNE_FEATURES:tune-riscv64nf := "${@oe.tune.riscv_isa_to_tune("rv64imac_zicsr_zifencei")}"
Signature · 1 line
2.55.0
Re: [OE-core][RFC PATCH 01/14] tune-riscv: be explicit about riscv64gc default
Quoted 31 lines · Trevor Gamblin
The string 'riscv64' is a generic descriptor for the 64-bit RISC-V ISA, and can mean different things under different contexts. In the case of tune-riscv.inc, it has served as an alias for the 'riscv64gc' profile which packages are typically built against, resulting in the following output (from a typical bitbake preamble):
|TUNE_FEATURES = "rv 64 i m a f d c zicsr zifencei"
Modify tune-riscv.inc to avoid overloading the 'riscv64' string in this way, instead setting DEFAULTTUNE to 'riscv64gc', and changing other occurrences to match.
TUNE_FEATURESremains the same under this adjustment, but the .inc file is clearer which profile is being targeted.Signed-off-by Trevor Gamblin <[email protected]>--- meta/conf/machine/include/riscv/tune-riscv.inc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)meta/conf/machine/include/riscv/tune-riscv.inc +1
-2@@ -1,15 +1,15 @@ require conf/machine/include/riscv/arch-riscv.inc -DEFAULTTUNE ?= "riscv64" +DEFAULTTUNE ?= "riscv64gc" -AVAILTUNES += "riscv64 riscv32 riscv64nc riscv64nf riscv32nf"
meta/conf/machine/include/riscv/tune-riscv.inc line 12
Quoted 10 lines
meta/conf/machine/include/riscv/tune-riscv.inc +3
-2+AVAILTUNES += "riscv64gc riscv32gc riscv64nc riscv64nf riscv32nf" # Default -TUNE_FEATURES:tune-riscv64 := "${@oe.tune.riscv_isa_to_tune("rv64gc")}" -PACKAGE_EXTRA_ARCHS:tune-riscv64 = "${TUNE_RISCV_PKGARCH}" +TUNE_FEATURES:tune-riscv64gc := "${@oe.tune.riscv_isa_to_tune("rv64gc")}" +PACKAGE_EXTRA_ARCHS:tune-riscv64gc = "${TUNE_RISCV_PKGARCH}" TUNE_FEATURES:tune-riscv32 := "${@oe.tune.riscv_isa_to_tune("rv32gc")}"
AVAILTUNES (riscv32 → riscv32gc) and PACKAGE_EXTRA_ARCHS:tune-riscv32 → :tune-riscv32gc, are renamed but not TUNE_FEATURES:tune-riscv32.
Quoted 10 lines
meta/conf/machine/include/riscv/tune-riscv.inc +1
-1-PACKAGE_EXTRA_ARCHS:tune-riscv32 = "${TUNE_RISCV_PKGARCH}" +PACKAGE_EXTRA_ARCHS:tune-riscv32gc = "${TUNE_RISCV_PKGARCH}" # No floatTUNE_FEATURES:tune-riscv64nf :=
"${@oe.tune.riscv_isa_to_tune("rv64imac_zicsr_zifencei")}" --
2.55.0
RFC PATCH 2/14 tune-riscv.inc: add 'riscv64gcv' tune
In reply to Trevor GamblinAdd a new RISC-V tune option which adds the 'v' (vector) extension, compared to the default.
--- meta/conf/machine/include/riscv/tune-riscv.inc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
meta/conf/machine/include/riscv/tune-riscv.inc +4 -1
@@ -2,12 +2,15 @@ require conf/machine/include/riscv/arch-riscv.inc DEFAULTTUNE ?= "riscv64gc" -AVAILTUNES += "riscv64gc riscv32gc riscv64nc riscv64nf riscv32nf" +AVAILTUNES += "riscv64gcv riscv64gc riscv32gc riscv64nc riscv64nf riscv32nf" # Default TUNE_FEATURES:tune-riscv64gc := "${@oe.tune.riscv_isa_to_tune("rv64gc")}" PACKAGE_EXTRA_ARCHS:tune-riscv64gc = "${TUNE_RISCV_PKGARCH}" +TUNE_FEATURES:tune-riscv64gcv := "${@oe.tune.riscv_isa_to_tune("rv64gcv")}" +PACKAGE_EXTRA_ARCHS:tune-riscv64gcv = "${TUNE_RISCV_PKGARCH}" + TUNE_FEATURES:tune-riscv32 := "${@oe.tune.riscv_isa_to_tune("rv32gc")}" PACKAGE_EXTRA_ARCHS:tune-riscv32gc = "${TUNE_RISCV_PKGARCH}"
Signature · 1 line
2.55.0
Re: [OE-core][RFC PATCH 02/14] tune-riscv.inc: add 'riscv64gcv' tune
Quoted 29 lines · Trevor Gamblin
Add a new RISC-V tune option which adds the 'v' (vector) extension, compared to the default.
Signed-off-by Trevor Gamblin <[email protected]>--- meta/conf/machine/include/riscv/tune-riscv.inc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)meta/conf/machine/include/riscv/tune-riscv.inc +1
-1@@ -2,12 +2,15 @@ require conf/machine/include/riscv/arch-riscv.inc DEFAULTTUNE ?= "riscv64gc" -AVAILTUNES += "riscv64gc riscv32gc riscv64nc riscv64nf riscv32nf" +AVAILTUNES += "riscv64gcv riscv64gc riscv32gc riscv64nc riscv64nfriscv32nf"
# Default
TUNE_FEATURES:tune-riscv64gc := "${@oe.tune.riscv_isa_to_tune("rv64gc")}" PACKAGE_EXTRA_ARCHS:tune-riscv64gc = "${TUNE_RISCV_PKGARCH}"+TUNE_FEATURES:tune-riscv64gcv :=
"${@oe.tune.riscv_isa_to_tune("rv64gcv")}"
meta/conf/machine/include/riscv/tune-riscv.inc require conf/machine/include/riscv/arch-riscv.inc · line 15
Quoted 4 lines
meta/conf/machine/include/riscv/tune-riscv.inc +2
-0+PACKAGE_EXTRA_ARCHS:tune-riscv64gcv = "${TUNE_RISCV_PKGARCH}" + TUNE_FEATURES:tune-riscv32 := "${@oe.tune.riscv_isa_to_tune("rv32gc")}" PACKAGE_EXTRA_ARCHS:tune-riscv32gc = "${TUNE_RISCV_PKGARCH}"
So riscv32gc has no TUNE_FEATURES and riscv32 has no PACKAGE_EXTRA_ARCHS. Nothing later in the series fixes it AFAICT. And meta/conf/machine/qemuriscv32.conf:5 still says DEFAULTTUNE ?= "riscv32", so qemuriscv32 ends up with an empty PACKAGE_EXTRA_ARCHS after this patch.
Quoted 4 lines
--
2.55.0
Re: [OE-core][RFC PATCH 02/14] tune-riscv.inc: add 'riscv64gcv' tune
No compatibility aliases for riscv64/riscv32. Out-of-tree fallout is silent-and-weird rather than a clean error:
- meta-riscv/conf/machine/baremetal-riscv64.conf: DEFAULTTUNE = "riscv64" → empty TUNE_FEATURES
- meta-sifive/conf/machine/include/riscv/tune-sifive.inc:
TUNE_FEATURES:tune-sifive-5-series = "${TUNE_FEATURES:tune-riscv64} sifive-5-series" → collapses to just sifive-5-series and there might be more layers.
Either keep riscv64/riscv32 in AVAILTUNES as aliases for a release (TUNE_FEATURES:tune-riscv64 := "${TUNE_FEATURES:tune-riscv64gc}") or land coordinated BSP patches plus a release note.
Quoted 48 lines · Khem Raj
Quoted 29 lines · Trevor Gamblin
Add a new RISC-V tune option which adds the 'v' (vector) extension, compared to the default.
Signed-off-by Trevor Gamblin <[email protected]>--- meta/conf/machine/include/riscv/tune-riscv.inc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)meta/conf/machine/include/riscv/tune-riscv.inc +1
-1@@ -2,12 +2,15 @@ require conf/machine/include/riscv/arch-riscv.inc DEFAULTTUNE ?= "riscv64gc" -AVAILTUNES += "riscv64gc riscv32gc riscv64nc riscv64nf riscv32nf" +AVAILTUNES += "riscv64gcv riscv64gc riscv32gc riscv64nc riscv64nfriscv32nf"
# Default
TUNE_FEATURES:tune-riscv64gc := "${@oe.tune.riscv_isa_to_tune("rv64gc")}" PACKAGE_EXTRA_ARCHS:tune-riscv64gc = "${TUNE_RISCV_PKGARCH}"+TUNE_FEATURES:tune-riscv64gcv :=
"${@oe.tune.riscv_isa_to_tune("rv64gcv")}"meta/conf/machine/include/riscv/tune-riscv.inc require conf/machine/include/riscv/arch-riscv.inc · line 15
Quoted 4 lines
meta/conf/machine/include/riscv/tune-riscv.inc +2
-0+PACKAGE_EXTRA_ARCHS:tune-riscv64gcv = "${TUNE_RISCV_PKGARCH}" + TUNE_FEATURES:tune-riscv32 := "${@oe.tune.riscv_isa_to_tune("rv32gc")}" PACKAGE_EXTRA_ARCHS:tune-riscv32gc = "${TUNE_RISCV_PKGARCH}"So riscv32gc has no
TUNE_FEATURESand riscv32 has noPACKAGE_EXTRA_ARCHS. Nothing later in the series fixes it AFAICT. Andmeta/conf/machine/qemuriscv32.conf:5still says DEFAULTTUNE ?= "riscv32", so qemuriscv32 ends up with an emptyPACKAGE_EXTRA_ARCHSafter this patch.Quoted 4 lines
--
2.55.0
RFC PATCH 3/14 arch-riscv.inc: add missing RVA20 extensions
In reply to Trevor GamblinThere are currently many RISC-V ISA extensions missing from the arch-riscv.inc file, even some which are required by core 'riscv64gc' extensions. For example:
|tgamblin@megalith ~/workspace/ypbuilds/poky-qemuriscv64/layers/openembedded-core (master)$ riscv64-linux-gnu-gcc -march=rv64imafdc_zicsr_zifencei -mabi=lp64d -Q --help=target | grep rv64 | -march= rv64imafdc_zicsr_zifencei_zmmul_zaamo_zalrsc_zca_zcd
versus:
|TUNE_FEATURES = "rv 64 i m a f d c zicsr zifencei"
which is missing zmmul, zaamo, zalrsc, zca, and zcd. There are even more absent when comparing against the official RVA20 spec - passing '-march=rva20u64' to gcc and checking the ISA extension string shows:
|tgamblin@alchemist ~ $ riscv64-linux-gnu-gcc -march=rva20u64 -mabi=lp64d -Q --help=target | grep rv64 | -march= rv64imafdc_ziccamoa_ziccif_zicclsm_ziccrse_zicntr_zicsr_zmmul_za128rs_zaamo_zalrsc_zca_zcd
Add the following extensions to arch-riscv.inc, along with their conditional inclusions required:
- za128rs
- zaamo (required by 'a')
- zalrsc (required by 'a')
- zca (required by 'c')
- zcd
- ziccamoa
- ziccif
- zicclsm
- ziccrse
- zicntr
- zmmul (required by 'm')
We also need to change the extension ordering in the file, so that they appear in the same order as the compiler expects.
--- .../conf/machine/include/riscv/arch-riscv.inc | 46 ++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-)
meta/conf/machine/include/riscv/arch-riscv.inc +45 -1
@@ -86,14 +86,58 @@ TUNEVALID[zicbom] = "Cache-block management extension" TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicbom", "_zicbom", "", d)}" TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicbom", "_zicbom", "", d)}" +TUNEVALID[ziccamoa] = "PMA guarantees for A-extension atomics extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "ziccamoa", "_ziccamoa", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "ziccamoa", "_ziccamoa", "", d)}" + +TUNEVALID[ziccif] = "Patching instructions at run time extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "ziccif", "_ziccif", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "ziccif", "_ziccif", "", d)}" + +TUNEVALID[zicclsm] = "Software that assumes misaligned access works extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zicclsm", "_zicclsm", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zicclsm", "_zicclsm", "", d)}" + +TUNEVALID[ziccrse] = "Guarantees LR/SC forward progress extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "ziccrse", "_ziccrse", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "ziccrse", "_ziccrse", "", d)}" + +TUNEVALID[zicntr] = "Cycle and instruction counting for profiling extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zicntr", "_zicntr", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zicntr", "_zicntr", "", d)}" + TUNEVALID[zicsr] = "Control and status register access extension" TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicsr f d", "_zicsr", "", d)}" TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicsr f d", "_zicsr", "", d)}" -TUNEVALID[zifencei] = "Instruction-fetch fence extension" +TUNEVALID[zifencei] = "Instruction-fetch fence extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zifencei", "_zifencei", "", d)}" TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zifencei", "_zifencei", "", d)}" +TUNEVALID[zmmul] = "Cheaper M subset (mul only) extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "m zmmul", "_zmmul", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "m zmmul", "_zmmul", "", d)}" + +TUNEVALID[za128rs] = "Reservation set granularity (128-byte) extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "za128rs", "_za128rs", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "za128rs", "_za128rs", "", d)}" + +TUNEVALID[zaamo] = "Atomic read-modify-write memory operations extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "a zaamo", "_zaamo", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "a zaamo", "_zaamo", "", d)}" + +TUNEVALID[zalrsc] = "Extended LR/SC semantics extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "a zalrsc", "_zalrsc", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "a zalrsc", "_zalrsc", "", d)}" + +TUNEVALID[zca] = "Compressed base integer ops extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "c zca", "_zca", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "c zca", "_zca", "", d)}" + +TUNEVALID[zcd] = "16-bit encodings for 64-bit FP extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zcd", "_zcd", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zcd", "_zcd", "", d)}" + TUNEVALID[zba] = "Address bit manipulation extension" TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zba", "_zba", "", d)}" TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zba", "_zba", "", d)}"
Signature · 1 line
2.55.0
Re: [OE-core][RFC PATCH 03/14] arch-riscv.inc: add missing RVA20 extensions
Quoted 105 lines · Trevor Gamblin
There are currently many RISC-V ISA extensions missing from the arch-riscv.inc file, even some which are required by core 'riscv64gc' extensions. For example:
|tgamblin@megalith ~/workspace/ypbuilds/poky-qemuriscv64/layers/openembedded-core (master)$ riscv64-linux-gnu-gcc -march=rv64imafdc_zicsr_zifencei -mabi=lp64d -Q --help=target | grep rv64
| -march=
rv64imafdc_zicsr_zifencei_zmmul_zaamo_zalrsc_zca_zcdversus:
|TUNE_FEATURES = "rv 64 i m a f d c zicsr zifencei"
which is missing zmmul, zaamo, zalrsc, zca, and zcd. There are even more absent when comparing against the official RVA20 spec - passing '-march=rva20u64' to gcc and checking the ISA extension string shows:
|tgamblin@alchemist ~ $ riscv64-linux-gnu-gcc -march=rva20u64 -mabi=lp64d -Q --help=target | grep rv64
| -march=rv64imafdc_ziccamoa_ziccif_zicclsm_ziccrse_zicntr_zicsr_zmmul_za128rs_zaamo_zalrsc_zca_zcdAdd the following extensions to arch-riscv.inc, along with their conditional inclusions required:
- za128rs
- zaamo (required by 'a')
- zalrsc (required by 'a')
- zca (required by 'c')
- zcd
- ziccamoa
- ziccif
- zicclsm
- ziccrse
- zicntr
- zmmul (required by 'm')We also need to change the extension ordering in the file, so that they appear in the same order as the compiler expects.
Signed-off-by Trevor Gamblin <[email protected]>--- .../conf/machine/include/riscv/arch-riscv.inc | 46 ++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-)meta/conf/machine/include/riscv/arch-riscv.inc +0
-0@@ -86,14 +86,58 @@ TUNEVALID[zicbom] = "Cache-block management extension" TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicbom","
_zicbom", "", d)}"
TUNE_RISCV_PKGARCH.= "${@bb.utils.contains_any("TUNE_FEATURES",
"zicbom", "_zicbom", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +2
-0+TUNEVALID[ziccamoa] = "PMA guarantees for A-extension atomics extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "ziccamoa","
_ziccamoa", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "ziccamoa", "_ziccamoa", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +3
-0+ +TUNEVALID[ziccif] = "Patching instructions at run time extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "ziccif","
_ziccif", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "ziccif", "_ziccif", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +2
-0+ +TUNEVALID[zicclsm] = "Software that assumes misaligned access worksextension."
+TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zicclsm", "_zicclsm", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zicclsm", "_zicclsm", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +3
-0+ +TUNEVALID[ziccrse] = "Guarantees LR/SC forward progress extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "ziccrse","
_ziccrse", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "ziccrse", "_ziccrse", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +2
-0+ +TUNEVALID[zicntr] = "Cycle and instruction counting for profilingextension."
+TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zicntr", "_zicntr", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zicntr", "_zicntr", "", d)}"
+
TUNEVALID[zicsr] = "Control and status register access extension"TUNE_RISCV_MARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "zicsr f
d", "_zicsr", "", d)}"
TUNE_RISCV_PKGARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "zicsr f
d", "_zicsr", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +1
-1-TUNEVALID[zifencei] = "Instruction-fetch fence extension" +TUNEVALID[zifencei] = "Instruction-fetch fence extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zifencei","
_zifencei", "", d)}"
TUNE_RISCV_PKGARCH.= "${@bb.utils.contains("TUNE_FEATURES", "zifencei",
"_zifencei", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +2
-0+TUNEVALID[zmmul] = "Cheaper M subset (mul only) extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "m zmmul",
Quoted 4 lines
"
_zmmul", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "m zmmul", "_zmmul", "", d)}"
It uses contains (AND) where it means "implied by" (OR). bb.utils.contains("TUNE_FEATURES", "m zmmul", ...)
fires only when both m and zmmul are present. Net effect: the commit message's premise — riscv64gc is missing zmmul/zaamo/zalrsc/zca/zcd relative to gcc — is not fixed, riscv64gc still yields -march=rv64imafdc_zicsr_zifencei
while gcc expands rv64gc to ..._zmmul_zaamo_zalrsc_zca_zcd. Either switch to contains_any
(and own the default-tune -march/pkgarch churn) or reword the commit message because as-is the lines are dead for every non-profile tune.
zcd has the same issue (gcc implies it from c+d).
Quoted 40 lines
meta/conf/machine/include/riscv/arch-riscv.inc +3
-0+ +TUNEVALID[za128rs] = "Reservation set granularity (128-byte) extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "za128rs","
_za128rs", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "za128rs", "_za128rs", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +3
-0+ +TUNEVALID[zaamo] = "Atomic read-modify-write memory operations extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "a zaamo","
_zaamo", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "a zaamo", "_zaamo", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +3
-0+ +TUNEVALID[zalrsc] = "Extended LR/SC semantics extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "a zalrsc","
_zalrsc", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "a zalrsc", "_zalrsc", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +3
-0+ +TUNEVALID[zca] = "Compressed base integer ops extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "c zca","
_zca", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "c zca", "_zca", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +3
-0+ +TUNEVALID[zcd] = "16-bit encodings for 64-bit FP extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zcd", "_zcd","", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zcd", "_zcd", "", d)}"
+
TUNEVALID[zba] = "Address bit manipulation extension"TUNE_RISCV_MARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "b zba",
"_zba", "", d)}"
TUNE_RISCV_PKGARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "b zba",
"_zba", "", d)}"
--
2.55.0
RFC PATCH 4/14 meta/lib/oe/tune.py: support profile strings, add rva20u64
In reply to Trevor Gamblin--- meta/lib/oe/tune.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
meta/lib/oe/tune.py +10 -1
@@ -4,16 +4,25 @@ # SPDX-License-Identifier: GPL-2.0-only # +# RISC-V profile name -> equivalent ISA string. These are determined from compiler output, like: +# tgamblin@alchemist ~ $ riscv64-linux-gnu-gcc -march=rva20u64 -mabi=lp64d -Q --help=target | grep rv64 +# -march=rv64imafdc_ziccamoa_ziccif_zicclsm_ziccrse_zicntr_zicsr_zmmul_za128rs_zaamo_zalrsc_zca_zcd +RISCV_PROFILES = { + 'rva20u64': 'rv64imafdc_ziccamoa_ziccif_zicclsm_ziccrse_zicntr_zicsr_zmmul_za128rs_zaamo_zalrsc_zca_zcd', +} + # riscv_isa_to_tune(isa) # # Automatically translate a RISC-V ISA string to TUNE_FEATURES # # Abbreviations, such as rv32g -> rv32imaffd_zicsr_zifencei are supported. # -# Profiles, such as rva22u64, are NOT supported, you must use ISA strings. +# Profiles are supported for the names listed in RISCV_PROFILES. Otherwise, you +# must use ISA strings. # def riscv_isa_to_tune(isa): _isa = isa.lower() + _isa = RISCV_PROFILES.get(_isa, _isa) feature = [] iter = 0
Signature · 1 line
2.55.0
Patchtest results for [OE-core][RFC PATCH 04/14] meta/lib/oe/tune.py: support profile strings, add rva20u64
Thank you for your submission. Patchtest identified one or more issues with the patch. Please see the log below for more information:
---
Testing patch /home/patchtest/share/mboxes/RFC-04-14-meta-lib-oe-tune.py-support-profile-strings-add-rva20u64.patch
FAIL: test commit message presence: Please include a commit message on your patch explaining the change (test_mbox.TestMbox.test_commit_message_presence)
PASS: pretest pylint (test_python_pylint.PyLint.pretest_pylint)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test auh changelog truncation notice (test_mbox.TestMbox.test_auh_changelog_truncation_notice)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test max line length (test_metadata.TestMetadata.test_max_line_length)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test pylint (test_python_pylint.PyLint.test_pylint)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)
SKIP: pretest src uri left files: No modified recipes, skipping pretest (test_metadata.TestMetadata.pretest_src_uri_left_files)
SKIP: test CVE check ignore: No modified recipes or older target branch, skipping test (test_metadata.TestMetadata.test_cve_check_ignore)
SKIP: test CVE tag format: No new source patches introduced (test_patch.TestPatch.test_cve_tag_format)
SKIP: test Signed-off-by presence: No new source patches introduced (test_patch.TestPatch.test_signed_off_by_presence)
SKIP: test Upstream-Status presence: No new source patches introduced (test_patch.TestPatch.test_upstream_status_presence_format)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test lic files chksum modified not mentioned: No modified recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence)
SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
SKIP: test src uri left files: No modified recipes, skipping test (test_metadata.TestMetadata.test_src_uri_left_files)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)
---
Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this email with an explanation of why the patch should be accepted. If you believe these results are due to an error in patchtest, please submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category under 'Yocto Project Subprojects'). For more information on specific failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank you!
RFC PATCH 5/14 tune-riscv.inc: add rva20u64 to AVAILTUNES
In reply to Trevor Gamblinriscv64gc remains the default for now.
--- meta/conf/machine/include/riscv/tune-riscv.inc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
meta/conf/machine/include/riscv/tune-riscv.inc +4 -1
@@ -2,7 +2,10 @@ require conf/machine/include/riscv/arch-riscv.inc DEFAULTTUNE ?= "riscv64gc" -AVAILTUNES += "riscv64gcv riscv64gc riscv32gc riscv64nc riscv64nf riscv32nf" +AVAILTUNES += "rva20u64 riscv64gcv riscv64gc riscv32gc riscv64nc riscv64nf riscv32nf" + +TUNE_FEATURES:tune-rva20u64 := "${@oe.tune.riscv_isa_to_tune("rva20u64")}" +PACKAGE_EXTRA_ARCHS:tune-rva20u64 = "${TUNE_RISCV_PKGARCH}" # Default TUNE_FEATURES:tune-riscv64gc := "${@oe.tune.riscv_isa_to_tune("rv64gc")}"
Signature · 1 line
2.55.0
RFC PATCH 6/14 arch-riscv.inc: add rva22u64 extensions
In reply to Trevor Gamblingcc reports the following extension string for '-march=rva22u64':
|tgamblin@megalith ~/workspace/ypbuilds/poky-qemuriscv64/layers/openembedded-core (master)$ riscv64-linux-gnu-gcc -march=rva22u64 -mabi=lp64d -Q --help=target | grep rv64 | -march= rv64imafdcb_zic64b_zicbom_zicbop_zicboz_ziccamoa_ziccif_zicclsm_ziccrse_zicntr_zicsr_zihintpause_zmmul_za64rs_zaamo_zalrsc_zfhmin_zca_zcd_zba_zbb_zbs_zkt
Add the following extensions needed to complete the profile:
- za64rs
- zfhmin
- zic64b
- zicbop
- zicboz
- zihintpause
- zkt
--- .../conf/machine/include/riscv/arch-riscv.inc | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+)
meta/conf/machine/include/riscv/arch-riscv.inc +28 -0
@@ -82,10 +82,22 @@ TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "v", "v", "", d)}" TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "v", "v", "", d)}" # Now the special Z extensions +TUNEVALID[zic64b] = "Cache block size is 64 bytes extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zic64b", "_zic64b", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zic64b", "_zic64b", "", d)}" + TUNEVALID[zicbom] = "Cache-block management extension" TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicbom", "_zicbom", "", d)}" TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicbom", "_zicbom", "", d)}" +TUNEVALID[zicbop] = "Cache-block prefetching extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicbop", "_zicbop", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicbop", "_zicbop", "", d)}" + +TUNEVALID[zicboz] = "Cache-block zeroing extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicboz", "_zicboz", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicboz", "_zicboz", "", d)}" + TUNEVALID[ziccamoa] = "PMA guarantees for A-extension atomics extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "ziccamoa", "_ziccamoa", "", d)}" TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "ziccamoa", "_ziccamoa", "", d)}"
@@ -114,10 +126,18 @@ TUNEVALID[zifencei] = "Instruction-fetch fence extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zifencei", "_zifencei", "", d)}" TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zifencei", "_zifencei", "", d)}" +TUNEVALID[zihintpause] = "Pause hint extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zihintpause", "_zihintpause", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zihintpause", "_zihintpause", "", d)}" + TUNEVALID[zmmul] = "Cheaper M subset (mul only) extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "m zmmul", "_zmmul", "", d)}" TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "m zmmul", "_zmmul", "", d)}" +TUNEVALID[za64rs] = "Reservation set size of at most 64 bytes extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "za64rs", "_za64rs", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "za64rs", "_za64rs", "", d)}" + TUNEVALID[za128rs] = "Reservation set granularity (128-byte) extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "za128rs", "_za128rs", "", d)}" TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "za128rs", "_za128rs", "", d)}"
@@ -130,6 +150,10 @@ TUNEVALID[zalrsc] = "Extended LR/SC semantics extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "a zalrsc", "_zalrsc", "", d)}" TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "a zalrsc", "_zalrsc", "", d)}" +TUNEVALID[zfhmin] = "Minimal half-precision floating point extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zfhmin", "_zfhmin", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zfhmin", "_zfhmin", "", d)}" + TUNEVALID[zca] = "Compressed base integer ops extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "c zca", "_zca", "", d)}" TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "c zca", "_zca", "", d)}"
@@ -154,6 +178,10 @@ TUNEVALID[zbs] = "Single-bit manipulation extension" TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zbs", "_zbs", "", d)}" TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zbs", "_zbs", "", d)}" +TUNEVALID[zkt] = "Data-independent execution latency extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zkt", "_zkt", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zkt", "_zkt", "", d)}" + # Construct TUNE_CCARGS # This should result in a CCARG similar to: # -march=rv32imac -mabi=ilp32
Signature · 1 line
2.55.0
Re: [OE-core][RFC PATCH 06/14] arch-riscv.inc: add rva22u64 extensions
Quoted 120 lines · Trevor Gamblin
gcc reports the following extension string for '-march=rva22u64':
|tgamblin@megalith
~/workspace/ypbuilds/poky-qemuriscv64/layers/openembedded-core (master)$
riscv64-linux-gnu-gcc -march=rva22u64 -mabi=lp64d -Q --help=target | grep
rv64
| -march=
rv64imafdcb_zic64b_zicbom_zicbop_zicboz_ziccamoa_ziccif_zicclsm_ziccrse_zicntr_zicsr_zihintpause_zmmul_za64rs_zaamo_zalrsc_zfhmin_zca_zcd_zba_zbb_zbs_zktAdd the following extensions needed to complete the profile:
- za64rs
- zfhmin
- zic64b
- zicbop
- zicboz
- zihintpause
- zktSigned-off-by Trevor Gamblin <[email protected]>--- .../conf/machine/include/riscv/arch-riscv.inc | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+)meta/conf/machine/include/riscv/arch-riscv.inc +0
-0@@ -82,10 +82,22 @@ TUNE_RISCV_MARCH .="${@bb.utils.contains("TUNE_FEATURES", "v", "v", "", d)}"
TUNE_RISCV_PKGARCH.= "${@bb.utils.contains("TUNE_FEATURES", "v", "v",
"", d)}"# Now the special Z extensions
meta/conf/machine/include/riscv/arch-riscv.inc +2
-0+TUNEVALID[zic64b] = "Cache block size is 64 bytes extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zic64b","
_zic64b", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zic64b", "_zic64b", "", d)}"
+
TUNEVALID[zicbom] = "Cache-block management extension"TUNE_RISCV_MARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "zicbom",
"_zicbom", "", d)}"
TUNE_RISCV_PKGARCH.= "${@bb.utils.contains_any("TUNE_FEATURES",
"zicbom", "_zicbom", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +2
-0+TUNEVALID[zicbop] = "Cache-block prefetching extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicbop","
_zicbop", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicbop", "_zicbop", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +3
-0+ +TUNEVALID[zicboz] = "Cache-block zeroing extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicboz","
_zicboz", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicboz", "_zicboz", "", d)}"
+
TUNEVALID[ziccamoa] = "PMA guarantees for A-extension atomics extension."TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "ziccamoa",
"_ziccamoa", "", d)}"
TUNE_RISCV_PKGARCH.= "${@bb.utils.contains("TUNE_FEATURES", "ziccamoa",
"_ziccamoa", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +0
-0@@ -114,10 +126,18 @@ TUNEVALID[zifencei] = "Instruction-fetch fenceextension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "zifencei",
"_zifencei", "", d)}"
TUNE_RISCV_PKGARCH.= "${@bb.utils.contains("TUNE_FEATURES", "zifencei",
"_zifencei", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +2
-0+TUNEVALID[zihintpause] = "Pause hint extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zihintpause","
_zihintpause", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zihintpause", "_zihintpause", "", d)}"
+
TUNEVALID[zmmul] = "Cheaper M subset (mul only) extension."TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "m zmmul",
"_zmmul", "", d)}"
TUNE_RISCV_PKGARCH.= "${@bb.utils.contains("TUNE_FEATURES", "m zmmul",
"_zmmul", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +2
-0+TUNEVALID[za64rs] = "Reservation set size of at most 64 bytes extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "za64rs","
_za64rs", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "za64rs", "_za64rs", "", d)}"
+
TUNEVALID[za128rs] = "Reservation set granularity (128-byte) extension."TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "za128rs",
"_za128rs", "", d)}"
TUNE_RISCV_PKGARCH.= "${@bb.utils.contains("TUNE_FEATURES", "za128rs",
"_za128rs", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +0
-0@@ -130,6 +150,10 @@ TUNEVALID[zalrsc] = "Extended LR/SC semanticsextension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "a zalrsc",
"_zalrsc", "", d)}"
TUNE_RISCV_PKGARCH.= "${@bb.utils.contains("TUNE_FEATURES", "a zalrsc",
"_zalrsc", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +2
-0+TUNEVALID[zfhmin] = "Minimal half-precision floating point extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zfhmin","
_zfhmin", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zfhmin", "_zfhmin", "", d)}"
+
TUNEVALID[zca] = "Compressed base integer ops extension."TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "c zca",
"_zca", "", d)}"
TUNE_RISCV_PKGARCH.= "${@bb.utils.contains("TUNE_FEATURES", "c zca",
"_zca", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +0
-0@@ -154,6 +178,10 @@ TUNEVALID[zbs] = "Single-bit manipulation extension" TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zbs","
_zbs", "", d)}"
TUNE_RISCV_PKGARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "b zbs",
"_zbs", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +2
-0+TUNEVALID[zkt] = "Data-independent execution latency extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zkt",
Quoted 4 lines
"
_zkt", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zkt", "_zkt", "", d)}"
wrongly implies zkt from b, Zkt is mandated by the RVA22/23 profiles, not by B
(the cover letter's "'zkt' is needed by 'b'" is incorrect). This silently injects _zkt into -march and the
package arch of any b-enabled non-profile tune.
Quoted 8 lines
+
# ConstructTUNE_CCARGS
# This should result in a CCARG similar to:
# -march=rv32imac -mabi=ilp32
--
2.55.0
RFC PATCH 7/14 meta/lib/oe/tune.py: add rva22u64 profile
In reply to Trevor Gamblin--- meta/lib/oe/tune.py | 1 + 1 file changed, 1 insertion(+)
meta/lib/oe/tune.py +1 -0
@@ -9,6 +9,7 @@ # -march=rv64imafdc_ziccamoa_ziccif_zicclsm_ziccrse_zicntr_zicsr_zmmul_za128rs_zaamo_zalrsc_zca_zcd RISCV_PROFILES = { 'rva20u64': 'rv64imafdc_ziccamoa_ziccif_zicclsm_ziccrse_zicntr_zicsr_zmmul_za128rs_zaamo_zalrsc_zca_zcd', + 'rva22u64': 'rv64imafdcb_zic64b_zicbom_zicbop_zicboz_ziccamoa_ziccif_zicclsm_ziccrse_zicntr_zicsr_zihintpause_zmmul_za64rs_zaamo_zalrsc_zfhmin_zca_zcd_zba_zbb_zbs_zkt', } # riscv_isa_to_tune(isa)
Signature · 1 line
2.55.0
Patchtest results for [OE-core][RFC PATCH 07/14] meta/lib/oe/tune.py: add rva22u64 profile
Thank you for your submission. Patchtest identified one or more issues with the patch. Please see the log below for more information:
---
Testing patch /home/patchtest/share/mboxes/RFC-07-14-meta-lib-oe-tune.py-add-rva22u64-profile.patch
FAIL: test commit message presence: Please include a commit message on your patch explaining the change (test_mbox.TestMbox.test_commit_message_presence)
PASS: pretest pylint (test_python_pylint.PyLint.pretest_pylint)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test auh changelog truncation notice (test_mbox.TestMbox.test_auh_changelog_truncation_notice)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test max line length (test_metadata.TestMetadata.test_max_line_length)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test pylint (test_python_pylint.PyLint.test_pylint)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)
SKIP: pretest src uri left files: Patch cannot be merged (test_metadata.TestMetadata.pretest_src_uri_left_files)
SKIP: test CVE check ignore: No modified recipes or older target branch, skipping test (test_metadata.TestMetadata.test_cve_check_ignore)
SKIP: test CVE tag format: No new source patches introduced (test_patch.TestPatch.test_cve_tag_format)
SKIP: test Signed-off-by presence: No new source patches introduced (test_patch.TestPatch.test_signed_off_by_presence)
SKIP: test Upstream-Status presence: No new source patches introduced (test_patch.TestPatch.test_upstream_status_presence_format)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test lic files chksum modified not mentioned: No modified recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence)
SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
SKIP: test src uri left files: Patch cannot be merged (test_metadata.TestMetadata.test_src_uri_left_files)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)
---
Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this email with an explanation of why the patch should be accepted. If you believe these results are due to an error in patchtest, please submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category under 'Yocto Project Subprojects'). For more information on specific failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank you!
RFC PATCH 8/14 tune-riscv.inc: add rva22u64 to AVAILTUNES
In reply to Trevor Gamblin--- meta/conf/machine/include/riscv/tune-riscv.inc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
meta/conf/machine/include/riscv/tune-riscv.inc +4 -1
@@ -2,11 +2,14 @@ require conf/machine/include/riscv/arch-riscv.inc DEFAULTTUNE ?= "riscv64gc" -AVAILTUNES += "rva20u64 riscv64gcv riscv64gc riscv32gc riscv64nc riscv64nf riscv32nf" +AVAILTUNES += "rva22u64 rva20u64 riscv64gcv riscv64gc riscv32gc riscv64nc riscv64nf riscv32nf" TUNE_FEATURES:tune-rva20u64 := "${@oe.tune.riscv_isa_to_tune("rva20u64")}" PACKAGE_EXTRA_ARCHS:tune-rva20u64 = "${TUNE_RISCV_PKGARCH}" +TUNE_FEATURES:tune-rva22u64 := "${@oe.tune.riscv_isa_to_tune("rva22u64")}" +PACKAGE_EXTRA_ARCHS:tune-rva22u64 = "${TUNE_RISCV_PKGARCH}" + # Default TUNE_FEATURES:tune-riscv64gc := "${@oe.tune.riscv_isa_to_tune("rv64gc")}" PACKAGE_EXTRA_ARCHS:tune-riscv64gc = "${TUNE_RISCV_PKGARCH}"
Signature · 1 line
2.55.0
Patchtest results for [OE-core][RFC PATCH 08/14] tune-riscv.inc: add rva22u64 to AVAILTUNES
Thank you for your submission. Patchtest identified one or more issues with the patch. Please see the log below for more information:
---
Testing patch /home/patchtest/share/mboxes/RFC-08-14-tune-riscv.inc-add-rva22u64-to-AVAILTUNES.patch
FAIL: test commit message presence: Please include a commit message on your patch explaining the change (test_mbox.TestMbox.test_commit_message_presence)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test auh changelog truncation notice (test_mbox.TestMbox.test_auh_changelog_truncation_notice)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test max line length (test_metadata.TestMetadata.test_max_line_length)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)
SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: pretest src uri left files: Patch cannot be merged (test_metadata.TestMetadata.pretest_src_uri_left_files)
SKIP: test CVE check ignore: No modified recipes or older target branch, skipping test (test_metadata.TestMetadata.test_cve_check_ignore)
SKIP: test CVE tag format: No new source patches introduced (test_patch.TestPatch.test_cve_tag_format)
SKIP: test Signed-off-by presence: No new source patches introduced (test_patch.TestPatch.test_signed_off_by_presence)
SKIP: test Upstream-Status presence: No new source patches introduced (test_patch.TestPatch.test_upstream_status_presence_format)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test lic files chksum modified not mentioned: No modified recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence)
SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
SKIP: test src uri left files: Patch cannot be merged (test_metadata.TestMetadata.test_src_uri_left_files)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)
---
Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this email with an explanation of why the patch should be accepted. If you believe these results are due to an error in patchtest, please submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category under 'Yocto Project Subprojects'). For more information on specific failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank you!
RFC PATCH 9/14 arch-riscv.inc: add rva23u64 extensions
In reply to Trevor Gamblingcc reports the following extension string for '-march=rva32u64':
|tgamblin@megalith ~/workspace/ypbuilds/poky-qemuriscv64/layers/openembedded-core (master)$ riscv64-linux-gnu-gcc -march=rva23u64 -mabi=lp64d -Q --help=target | grep rv64 | -march= rv64imafdcbv_zic64b_zicbom_zicbop_zicboz_ziccamoa_ziccif_zicclsm_ziccrse_zicntr_zicond_zicsr_zihintntl_zihintpause_zihpm_zimop_zmmul_za64rs_zaamo_zalrsc_zawrs_zfa_zfhmin_zca_zcb_zcd_zcmop_zba_zbb_zbs_zkt_zvbb_zve32f_zve32x_zve64d_zve64f_zve64x_zvfhmin_z
Add the following extensions to complete the profile:
- zawrs
- zcb
- zcmop
- zfa
- zicond
- zihintntl
- zihpm
- zimop
- zvbb
- zve32f
- zve32x
- zve64d
- zve64f
- zve64x
--- .../conf/machine/include/riscv/arch-riscv.inc | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+)
meta/conf/machine/include/riscv/arch-riscv.inc +84 -0
@@ -118,6 +118,10 @@ TUNEVALID[zicntr] = "Cycle and instruction counting for profiling extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zicntr", "_zicntr", "", d)}" TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zicntr", "_zicntr", "", d)}" +TUNEVALID[zicond] = "Conditional zeroing operations extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zicond", "_zicond", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zicond", "_zicond", "", d)}" + TUNEVALID[zicsr] = "Control and status register access extension" TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicsr f d", "_zicsr", "", d)}" TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicsr f d", "_zicsr", "", d)}"
@@ -126,10 +130,22 @@ TUNEVALID[zifencei] = "Instruction-fetch fence extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zifencei", "_zifencei", "", d)}" TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zifencei", "_zifencei", "", d)}" +TUNEVALID[zihintntl] = "Non-temporal locality hints extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zihintntl", "_zihintntl", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zihintntl", "_zihintntl", "", d)}" + TUNEVALID[zihintpause] = "Pause hint extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zihintpause", "_zihintpause", "", d)}" TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zihintpause", "_zihintpause", "", d)}" +TUNEVALID[zihpm] = "Hardware performance counters extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zihpm", "_zihpm", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zihpm", "_zihpm", "", d)}" + +TUNEVALID[zimop] = "Hardware performance counters extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zimop", "_zimop", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zimop", "_zimop", "", d)}" + TUNEVALID[zmmul] = "Cheaper M subset (mul only) extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "m zmmul", "_zmmul", "", d)}" TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "m zmmul", "_zmmul", "", d)}"
@@ -150,6 +166,14 @@ TUNEVALID[zalrsc] = "Extended LR/SC semantics extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "a zalrsc", "_zalrsc", "", d)}" TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "a zalrsc", "_zalrsc", "", d)}" +TUNEVALID[zawrs] = "Wait-on-reservation-set instructions extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zawrs", "_zawrs", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zawrs", "_zawrs", "", d)}" + +TUNEVALID[zfa] = "Additional floating point instructions extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zfa", "_zfa", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zfa", "_zfa", "", d)}" + TUNEVALID[zfhmin] = "Minimal half-precision floating point extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zfhmin", "_zfhmin", "", d)}" TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zfhmin", "_zfhmin", "", d)}"
@@ -158,10 +182,18 @@ TUNEVALID[zca] = "Compressed base integer ops extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "c zca", "_zca", "", d)}" TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "c zca", "_zca", "", d)}" +TUNEVALID[zcb] = "Extra compressed integer ops extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zcb", "_zcb", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zcb", "_zcb", "", d)}" + TUNEVALID[zcd] = "16-bit encodings for 64-bit FP extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zcd", "_zcd", "", d)}" TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zcd", "_zcd", "", d)}" +TUNEVALID[zcmop] = "Compressed may-be-ops extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zcmop", "_zcmop", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zcmop", "_zcmop", "", d)}" + TUNEVALID[zba] = "Address bit manipulation extension" TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zba", "_zba", "", d)}" TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zba", "_zba", "", d)}"
@@ -182,6 +214,58 @@ TUNEVALID[zkt] = "Data-independent execution latency extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zkt", "_zkt", "", d)}" TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zkt", "_zkt", "", d)}" +TUNEVALID[zvbb] = "Vector basic bit-manipulation extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvbb", "_zvbb", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvbb", "_zvbb", "", d)}" + +TUNEVALID[zve32f] = "Embedded vector computation (32-bit integer, 32-bit FP) extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve32f", "_zve32f", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve32f", "_zve32f", "", d)}" + +TUNEVALID[zve32x] = "Embedded vector computation (32-bit integer) extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve32x", "_zve32x", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve32x", "_zve32x", "", d)}" + +TUNEVALID[zve64d] = "Embedded vector computation (64-bit integer, 64-bit FP) extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve64d", "_zve64d", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve64d", "_zve64d", "", d)}" + +TUNEVALID[zve64f] = "Embedded vector computation (64-bit integer, 32-bit FP) extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve64f", "_zve64f", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve64f", "_zve64f", "", d)}" + +TUNEVALID[zve64x] = "Embedded vector computation (64-bit integer) extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve64x", "_zve64x", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve64x", "_zve64x", "", d)}" + +TUNEVALID[zvfhmin] = "Vector half-precision minimal extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvfhmin", "_zvfhmin", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvfhmin", "_zvfhmin", "", d)}" + +TUNEVALID[zvkb] = "Vector cryptography bit-manipulation extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvkb", "_zvkb", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvkb", "_zvkb", "", d)}" + +TUNEVALID[zvkt] = "Vector data independent execution latency extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvkt", "_zvkt", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvkt", "_zvkt", "", d)}" + +TUNEVALID[zvl128b] = "Minimum vector length standard extensions (128-bit)." +TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvl128b", "_zvl128b", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvl128b", "_zvl128b", "", d)}" + +TUNEVALID[zvl32b] = "Minimum vector length standard extensions (32-bit)." +TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvl32b", "_zvl32b", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvl32b", "_zvl32b", "", d)}" + +TUNEVALID[zvl64b] = "Minimum vector length standard extensions (64-bit)." +TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvl64b", "_zvl64b", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvl64b", "_zvl64b", "", d)}" + +TUNEVALID[supm] = "User-mode pointer masking extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "supm", "_supm", "", d)}" +TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "supm", "_supm", "", d)}" + # Construct TUNE_CCARGS # This should result in a CCARG similar to: # -march=rv32imac -mabi=ilp32
Signature · 1 line
2.55.0
Re: [OE-core][RFC PATCH 09/14] arch-riscv.inc: add rva23u64 extensions
Quoted 11 lines · Trevor Gamblin
gcc reports the following extension string for '-march=rva32u64':
|tgamblin@megalith
~/workspace/ypbuilds/poky-qemuriscv64/layers/openembedded-core (master)$
riscv64-linux-gnu-gcc -march=rva23u64 -mabi=lp64d -Q --help=target | grep
rv64
| -march=
rv64imafdcbv_zic64b_zicbom_zicbop_zicboz_ziccamoa_ziccif_zicclsm_ziccrse_zicntr_zicond_zicsr_zihintntl_zihintpause_zihpm_zimop_zmmul_za64rs_zaamo_zalrsc_zawrs_zfa_zfhmin_zca_zcb_zcd_zcmop_zba_zbb_zbs_zkt_zvbb_zve32f_zve32x_zve64d_zve64f_zve64x_zvfhmin_zAdd the following extensions to complete the profile:
Quoted 15 lines
- zawrs
- zcb
- zcmop
- zfa
- zicond
- zihintntl
- zihpm
- zimop
- zvbb
- zve32f
- zve32x
- zve64d
- zve64f
- zve64x
commit message: says -march=rva32u64 (typo), and its bullet list omits zvfhmin zvkb zvkt zvl32b zvl64b zvl128b supm
which the patch does add.
Quoted 54 lines
Signed-off-by Trevor Gamblin <[email protected]>--- .../conf/machine/include/riscv/arch-riscv.inc | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+)meta/conf/machine/include/riscv/arch-riscv.inc +0
-0@@ -118,6 +118,10 @@ TUNEVALID[zicntr] = "Cycle and instruction countingfor profiling extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "zicntr",
"_zicntr", "", d)}"
TUNE_RISCV_PKGARCH.= "${@bb.utils.contains("TUNE_FEATURES", "zicntr",
"_zicntr", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +2
-0+TUNEVALID[zicond] = "Conditional zeroing operations extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zicond","
_zicond", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zicond", "_zicond", "", d)}"
+
TUNEVALID[zicsr] = "Control and status register access extension"TUNE_RISCV_MARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "zicsr f
d", "_zicsr", "", d)}"
TUNE_RISCV_PKGARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "zicsr f
d", "_zicsr", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +0
-0@@ -126,10 +130,22 @@ TUNEVALID[zifencei] = "Instruction-fetch fenceextension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "zifencei",
"_zifencei", "", d)}"
TUNE_RISCV_PKGARCH.= "${@bb.utils.contains("TUNE_FEATURES", "zifencei",
"_zifencei", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +2
-0+TUNEVALID[zihintntl] = "Non-temporal locality hints extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zihintntl","
_zihintntl", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zihintntl", "_zihintntl", "", d)}"
+
TUNEVALID[zihintpause] = "Pause hint extension."TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "zihintpause",
"_zihintpause", "", d)}"
TUNE_RISCV_PKGARCH.= "${@bb.utils.contains("TUNE_FEATURES",
"zihintpause", "_zihintpause", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +2
-0+TUNEVALID[zihpm] = "Hardware performance counters extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zihpm","
_zihpm", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zihpm", "_zihpm", "", d)}"
meta/conf/machine/include/riscv/arch-riscv.inc
Quoted 2 lines
meta/conf/machine/include/riscv/arch-riscv.inc +2
-0+ +TUNEVALID[zimop] = "Hardware performance counters extension."
copy/paste from zihpm. Should be May-Be-Operations.
Quoted 162 lines
+TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zimop", "
_zimop", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zimop", "_zimop", "", d)}"
+
TUNEVALID[zmmul] = "Cheaper M subset (mul only) extension."TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "m zmmul",
"_zmmul", "", d)}"
TUNE_RISCV_PKGARCH.= "${@bb.utils.contains("TUNE_FEATURES", "m zmmul",
"_zmmul", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +0
-0@@ -150,6 +166,14 @@ TUNEVALID[zalrsc] = "Extended LR/SC semanticsextension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "a zalrsc",
"_zalrsc", "", d)}"
TUNE_RISCV_PKGARCH.= "${@bb.utils.contains("TUNE_FEATURES", "a zalrsc",
"_zalrsc", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +2
-0+TUNEVALID[zawrs] = "Wait-on-reservation-set instructions extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zawrs","
_zawrs", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zawrs", "_zawrs", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +3
-0+ +TUNEVALID[zfa] = "Additional floating point instructions extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zfa", "_zfa","", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zfa", "_zfa", "", d)}"
+
TUNEVALID[zfhmin] = "Minimal half-precision floating point extension."TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "zfhmin",
"_zfhmin", "", d)}"
TUNE_RISCV_PKGARCH.= "${@bb.utils.contains("TUNE_FEATURES", "zfhmin",
"_zfhmin", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +0
-0@@ -158,10 +182,18 @@ TUNEVALID[zca] = "Compressed base integer opsextension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "c zca",
"_zca", "", d)}"
TUNE_RISCV_PKGARCH.= "${@bb.utils.contains("TUNE_FEATURES", "c zca",
"_zca", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +2
-0+TUNEVALID[zcb] = "Extra compressed integer ops extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zcb", "_zcb","", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zcb", "_zcb", "", d)}"
+
TUNEVALID[zcd] = "16-bit encodings for 64-bit FP extension."TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "zcd", "_zcd",
"", d)}"
TUNE_RISCV_PKGARCH.= "${@bb.utils.contains("TUNE_FEATURES", "zcd",
"_zcd", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +2
-0+TUNEVALID[zcmop] = "Compressed may-be-ops extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zcmop","
_zcmop", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zcmop", "_zcmop", "", d)}"
+
TUNEVALID[zba] = "Address bit manipulation extension"TUNE_RISCV_MARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "b zba",
"_zba", "", d)}"
TUNE_RISCV_PKGARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "b zba",
"_zba", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +0
-0@@ -182,6 +214,58 @@ TUNEVALID[zkt] = "Data-independent execution latencyextension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "b zkt",
"_zkt", "", d)}"
TUNE_RISCV_PKGARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "b zkt",
"_zkt", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +2
-0+TUNEVALID[zvbb] = "Vector basic bit-manipulation extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvbb","
_zvbb", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvbb", "_zvbb", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +2
-0+ +TUNEVALID[zve32f] = "Embedded vector computation (32-bit integer, 32-bitFP) extension."
+TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve32f", "_zve32f", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve32f", "_zve32f", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +2
-0+ +TUNEVALID[zve32x] = "Embedded vector computation (32-bit integer)extension."
+TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve32x", "_zve32x", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve32x", "_zve32x", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +2
-0+ +TUNEVALID[zve64d] = "Embedded vector computation (64-bit integer, 64-bitFP) extension."
+TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve64d", "_zve64d", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve64d", "_zve64d", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +2
-0+ +TUNEVALID[zve64f] = "Embedded vector computation (64-bit integer, 32-bitFP) extension."
+TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve64f", "_zve64f", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve64f", "_zve64f", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +2
-0+ +TUNEVALID[zve64x] = "Embedded vector computation (64-bit integer)extension."
+TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve64x", "_zve64x", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve64x", "_zve64x", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +3
-0+ +TUNEVALID[zvfhmin] = "Vector half-precision minimal extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvfhmin","
_zvfhmin", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvfhmin", "_zvfhmin", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +3
-0+ +TUNEVALID[zvkb] = "Vector cryptography bit-manipulation extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvkb","
_zvkb", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvkb", "_zvkb", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +3
-0+ +TUNEVALID[zvkt] = "Vector data independent execution latency extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvkt","
_zvkt", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvkt", "_zvkt", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +2
-0+ +TUNEVALID[zvl128b] = "Minimum vector length standard extensions(128-bit)."
+TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvl128b", "_zvl128b", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvl128b", "_zvl128b", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +3
-0+ +TUNEVALID[zvl32b] = "Minimum vector length standard extensions (32-bit)." +TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvl32b","
_zvl32b", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvl32b", "_zvl32b", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +3
-0+ +TUNEVALID[zvl64b] = "Minimum vector length standard extensions (64-bit)." +TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvl64b","
_zvl64b", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvl64b", "_zvl64b", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +3
-0+ +TUNEVALID[supm] = "User-mode pointer masking extension." +TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "supm","
_supm", "", d)}"
+TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "supm", "_supm", "", d)}"
+
# ConstructTUNE_CCARGS
# This should result in a CCARG similar to:
# -march=rv32imac -mabi=ilp32
--
2.55.0
RFC PATCH 10/14 meta/lib/oe/tune.py: add rva23u64 profile
In reply to Trevor Gamblin--- meta/lib/oe/tune.py | 1 + 1 file changed, 1 insertion(+)
meta/lib/oe/tune.py +1 -0
@@ -10,6 +10,7 @@ RISCV_PROFILES = { 'rva20u64': 'rv64imafdc_ziccamoa_ziccif_zicclsm_ziccrse_zicntr_zicsr_zmmul_za128rs_zaamo_zalrsc_zca_zcd', 'rva22u64': 'rv64imafdcb_zic64b_zicbom_zicbop_zicboz_ziccamoa_ziccif_zicclsm_ziccrse_zicntr_zicsr_zihintpause_zmmul_za64rs_zaamo_zalrsc_zfhmin_zca_zcd_zba_zbb_zbs_zkt', + 'rva23u64': 'rv64imafdcbv_zic64b_zicbom_zicbop_zicboz_ziccamoa_ziccif_zicclsm_ziccrse_zicntr_zicond_zicsr_zihintntl_zihintpause_zihpm_zimop_zmmul_za64rs_zaamo_zalrsc_zawrs_zfa_zfhmin_zca_zcb_zcd_zcmop_zba_zbb_zbs_zkt_zvbb_zve32f_zve32x_zve64d_zve64f_zve64x_zvfhmin_zvkb_zvkt_zvl128b_zvl32b_zvl64b_supm', } # riscv_isa_to_tune(isa)
Signature · 1 line
2.55.0
Patchtest results for [OE-core][RFC PATCH 10/14] meta/lib/oe/tune.py: add rva23u64 profile
Thank you for your submission. Patchtest identified one or more issues with the patch. Please see the log below for more information:
---
Testing patch /home/patchtest/share/mboxes/RFC-10-14-meta-lib-oe-tune.py-add-rva23u64-profile.patch
FAIL: test commit message presence: Please include a commit message on your patch explaining the change (test_mbox.TestMbox.test_commit_message_presence)
FAIL: test max line length: Patch line too long (current length 307, maximum is 200) (test_metadata.TestMetadata.test_max_line_length)
PASS: pretest pylint (test_python_pylint.PyLint.pretest_pylint)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test auh changelog truncation notice (test_mbox.TestMbox.test_auh_changelog_truncation_notice)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test pylint (test_python_pylint.PyLint.test_pylint)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)
SKIP: pretest src uri left files: Patch cannot be merged (test_metadata.TestMetadata.pretest_src_uri_left_files)
SKIP: test CVE check ignore: No modified recipes or older target branch, skipping test (test_metadata.TestMetadata.test_cve_check_ignore)
SKIP: test CVE tag format: No new source patches introduced (test_patch.TestPatch.test_cve_tag_format)
SKIP: test Signed-off-by presence: No new source patches introduced (test_patch.TestPatch.test_signed_off_by_presence)
SKIP: test Upstream-Status presence: No new source patches introduced (test_patch.TestPatch.test_upstream_status_presence_format)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test lic files chksum modified not mentioned: No modified recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence)
SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
SKIP: test src uri left files: Patch cannot be merged (test_metadata.TestMetadata.test_src_uri_left_files)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)
---
Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this email with an explanation of why the patch should be accepted. If you believe these results are due to an error in patchtest, please submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category under 'Yocto Project Subprojects'). For more information on specific failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank you!
RFC PATCH 11/14 tune-riscv.inc: add rva23u64 to AVAILTUNES
In reply to Trevor Gamblin--- meta/conf/machine/include/riscv/tune-riscv.inc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
meta/conf/machine/include/riscv/tune-riscv.inc +4 -1
@@ -2,7 +2,7 @@ require conf/machine/include/riscv/arch-riscv.inc DEFAULTTUNE ?= "riscv64gc" -AVAILTUNES += "rva22u64 rva20u64 riscv64gcv riscv64gc riscv32gc riscv64nc riscv64nf riscv32nf" +AVAILTUNES += "rva23u64 rva22u64 rva20u64 riscv64gcv riscv64gc riscv32gc riscv64nc riscv64nf riscv32nf" TUNE_FEATURES:tune-rva20u64 := "${@oe.tune.riscv_isa_to_tune("rva20u64")}" PACKAGE_EXTRA_ARCHS:tune-rva20u64 = "${TUNE_RISCV_PKGARCH}"
@@ -10,6 +10,9 @@ PACKAGE_EXTRA_ARCHS:tune-rva20u64 = "${TUNE_RISCV_PKGARCH}" TUNE_FEATURES:tune-rva22u64 := "${@oe.tune.riscv_isa_to_tune("rva22u64")}" PACKAGE_EXTRA_ARCHS:tune-rva22u64 = "${TUNE_RISCV_PKGARCH}" +TUNE_FEATURES:tune-rva23u64 := "${@oe.tune.riscv_isa_to_tune("rva23u64")}" +PACKAGE_EXTRA_ARCHS:tune-rva23u64 = "${TUNE_RISCV_PKGARCH}" + # Default TUNE_FEATURES:tune-riscv64gc := "${@oe.tune.riscv_isa_to_tune("rv64gc")}" PACKAGE_EXTRA_ARCHS:tune-riscv64gc = "${TUNE_RISCV_PKGARCH}"
Signature · 1 line
2.55.0
Patchtest results for [OE-core][RFC PATCH 11/14] tune-riscv.inc: add rva23u64 to AVAILTUNES
Thank you for your submission. Patchtest identified one or more issues with the patch. Please see the log below for more information:
---
Testing patch /home/patchtest/share/mboxes/RFC-11-14-tune-riscv.inc-add-rva23u64-to-AVAILTUNES.patch
FAIL: test commit message presence: Please include a commit message on your patch explaining the change (test_mbox.TestMbox.test_commit_message_presence)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test auh changelog truncation notice (test_mbox.TestMbox.test_auh_changelog_truncation_notice)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test max line length (test_metadata.TestMetadata.test_max_line_length)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)
SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: pretest src uri left files: Patch cannot be merged (test_metadata.TestMetadata.pretest_src_uri_left_files)
SKIP: test CVE check ignore: No modified recipes or older target branch, skipping test (test_metadata.TestMetadata.test_cve_check_ignore)
SKIP: test CVE tag format: No new source patches introduced (test_patch.TestPatch.test_cve_tag_format)
SKIP: test Signed-off-by presence: No new source patches introduced (test_patch.TestPatch.test_signed_off_by_presence)
SKIP: test Upstream-Status presence: No new source patches introduced (test_patch.TestPatch.test_upstream_status_presence_format)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test lic files chksum modified not mentioned: No modified recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence)
SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
SKIP: test src uri left files: Patch cannot be merged (test_metadata.TestMetadata.test_src_uri_left_files)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)
---
Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this email with an explanation of why the patch should be accepted. If you believe these results are due to an error in patchtest, please submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category under 'Yocto Project Subprojects'). For more information on specific failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank you!
RFC PATCH 12/14 meta/lib/oe/tune.py: add riscv_pkgarch()
In reply to Trevor GamblinCreate a new function to help match RISC-V ISA extension combinations against recognized profile strings (e.g. 'rva22u64'), so that we can use simpler patterns for naming things like sstate/build paths.
--- meta/lib/oe/tune.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
meta/lib/oe/tune.py +29 -0
@@ -90,3 +90,32 @@ def riscv_isa_to_tune(isa): # Eliminate duplicates, but preserve the order feature = list(dict.fromkeys(feature)) return ' '.join(feature) + +# riscv_pkgarch(features, exact_pkgarch) +# +# Prefer a RISCV_PROFILES name (plus any extensions enabled on top of it) as the +# package arch fragment, since otherwise the full ISA extension list will exceed +# what the sstate class can handle. When several profiles match, the one with +# the most extensions is preferred, as it is the more specific/clearer match. +# If there's no clear profile matching the extension list, then fall back to +# exact_pkgarch. +def riscv_pkgarch(features, exact_pkgarch): + if not features: + return exact_pkgarch + + current = set(features.split()) + + best_match = None + best_features = None + for name in RISCV_PROFILES: + profile_features = set(riscv_isa_to_tune(name).split()) + if profile_features.issubset(current): + if best_features is None or len(profile_features) > len(best_features): + best_match = name + best_features = profile_features + + if best_match is None: + return exact_pkgarch + + extra = sorted(current - best_features) + return '_'.join([best_match] + extra)
Signature · 1 line
2.55.0
RFC PATCH 13/14 arch-riscv.inc: rename TUNE_RISCV_PKGARCH -> TUNE_RISCV_PKGARCH_EXACT in assignments
In reply to Trevor GamblinChange the naming convention we use when determining TUNE_RISCV_PKGARCH, so that we have the option of relying on a known RISC-V profile name (e.g. 'rva22u64') as a baseline, rather than always specifying the full ISA extension set. An example from 'bitbake -e opensbi' with 'DEFAULTTUNE = "rva22u64" in conf/local.conf:
|TUNE_RISCV_PKGARCH="rva22u64" |# $TUNE_RISCV_PKGARCH_EXACT [48 operations] |TUNE_RISCV_PKGARCH_EXACT="riscv64imafdc_zic64b_zicbom_zicbop_zicboz_ziccamoa_ziccif_zicclsm_ziccrse_zicntr_zicsr_zihintpause_zmmul_za64rs_zaamo_zalrsc_zfhmin_zca_zcd_zba_zbb_zbs_zkt"
--- .../conf/machine/include/riscv/arch-riscv.inc | 118 +++++++++--------- 1 file changed, 62 insertions(+), 56 deletions(-)
meta/conf/machine/include/riscv/arch-riscv.inc +62 -56
@@ -32,7 +32,7 @@ TUNE_RISCV_ABI .= "${@bb.utils.contains("TUNE_FEATURES", "64", "lp64", "", d)}" # The package arch starts with the canonical arch, but adds some extensions to make # package compatibility clear -TUNE_RISCV_PKGARCH = "${TUNE_RISCV_ARCH}" +TUNE_RISCV_PKGARCH_EXACT = "${TUNE_RISCV_ARCH}" # i, e, or g are defined by gcc, but 'g' refers to 'i' + extensions 'MAFD Zicsr Zifencei' # So 'g' will not be defined here as it is an abbreviation of the expanded version
@@ -40,231 +40,237 @@ TUNEVALID[e] = "Reduced register base integer extension" TUNECONFLICTS[e] = "i" TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "e", "e", "", d)}" TUNE_RISCV_ABI .= "${@bb.utils.contains("TUNE_FEATURES", "e", "e", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "e", "e", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "e", "e", "", d)}" TUNEVALID[i] = "Base integer extension" TUNECONFLICTS[i] = "e" TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "i", "i", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "i", "i", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "i", "i", "", d)}" # Extensions TUNEVALID[m] = "Integer multiplication and division extension" TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "m", "m", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "m", "m", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "m", "m", "", d)}" TUNEVALID[a] = "Atomic extension" TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "a", "a", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "a", "a", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "a", "a", "", d)}" TUNEVALID[f] = "Single-precision floating-point extension" TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "f d", "f", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "f d", "f", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "f d", "f", "", d)}" TUNEVALID[d] = "Double-precision floating-point extension" TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "d", "d", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "d", "d", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "d", "d", "", d)}" # Only f OR d, but just one TUNE_RISCV_ABI .= "${@bb.utils.contains("TUNE_FEATURES", "d", "d", bb.utils.contains("TUNE_FEATURES", "f", "f", "", d), d)}" TUNEVALID[c] = "Compressed extension" TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "c", "c", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "c", "c", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "c", "c", "", d)}" TUNEVALID[b] = "Bit Manipulation extension" # Handled below via zba, zbb, zbs # This matches current Linux kernel behavior #TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "b", "b", "", d)}" -#TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "b", "b", "", d)}" +#TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "b", "b", "", d)}" TUNEVALID[v] = "Vector operations extension" TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "v", "v", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "v", "v", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "v", "v", "", d)}" # Now the special Z extensions TUNEVALID[zic64b] = "Cache block size is 64 bytes extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zic64b", "_zic64b", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zic64b", "_zic64b", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zic64b", "_zic64b", "", d)}" TUNEVALID[zicbom] = "Cache-block management extension" TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicbom", "_zicbom", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicbom", "_zicbom", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicbom", "_zicbom", "", d)}" TUNEVALID[zicbop] = "Cache-block prefetching extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicbop", "_zicbop", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicbop", "_zicbop", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicbop", "_zicbop", "", d)}" TUNEVALID[zicboz] = "Cache-block zeroing extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicboz", "_zicboz", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicboz", "_zicboz", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicboz", "_zicboz", "", d)}" TUNEVALID[ziccamoa] = "PMA guarantees for A-extension atomics extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "ziccamoa", "_ziccamoa", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "ziccamoa", "_ziccamoa", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "ziccamoa", "_ziccamoa", "", d)}" TUNEVALID[ziccif] = "Patching instructions at run time extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "ziccif", "_ziccif", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "ziccif", "_ziccif", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "ziccif", "_ziccif", "", d)}" TUNEVALID[zicclsm] = "Software that assumes misaligned access works extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zicclsm", "_zicclsm", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zicclsm", "_zicclsm", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "zicclsm", "_zicclsm", "", d)}" TUNEVALID[ziccrse] = "Guarantees LR/SC forward progress extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "ziccrse", "_ziccrse", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "ziccrse", "_ziccrse", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "ziccrse", "_ziccrse", "", d)}" TUNEVALID[zicntr] = "Cycle and instruction counting for profiling extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zicntr", "_zicntr", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zicntr", "_zicntr", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "zicntr", "_zicntr", "", d)}" TUNEVALID[zicond] = "Conditional zeroing operations extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zicond", "_zicond", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zicond", "_zicond", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "zicond", "_zicond", "", d)}" TUNEVALID[zicsr] = "Control and status register access extension" TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicsr f d", "_zicsr", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicsr f d", "_zicsr", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicsr f d", "_zicsr", "", d)}" TUNEVALID[zifencei] = "Instruction-fetch fence extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zifencei", "_zifencei", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zifencei", "_zifencei", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "zifencei", "_zifencei", "", d)}" TUNEVALID[zihintntl] = "Non-temporal locality hints extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zihintntl", "_zihintntl", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zihintntl", "_zihintntl", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "zihintntl", "_zihintntl", "", d)}" TUNEVALID[zihintpause] = "Pause hint extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zihintpause", "_zihintpause", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zihintpause", "_zihintpause", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "zihintpause", "_zihintpause", "", d)}" TUNEVALID[zihpm] = "Hardware performance counters extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zihpm", "_zihpm", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zihpm", "_zihpm", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "zihpm", "_zihpm", "", d)}" TUNEVALID[zimop] = "Hardware performance counters extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zimop", "_zimop", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zimop", "_zimop", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "zimop", "_zimop", "", d)}" TUNEVALID[zmmul] = "Cheaper M subset (mul only) extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "m zmmul", "_zmmul", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "m zmmul", "_zmmul", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "m zmmul", "_zmmul", "", d)}" TUNEVALID[za64rs] = "Reservation set size of at most 64 bytes extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "za64rs", "_za64rs", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "za64rs", "_za64rs", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "za64rs", "_za64rs", "", d)}" TUNEVALID[za128rs] = "Reservation set granularity (128-byte) extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "za128rs", "_za128rs", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "za128rs", "_za128rs", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "za128rs", "_za128rs", "", d)}" TUNEVALID[zaamo] = "Atomic read-modify-write memory operations extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "a zaamo", "_zaamo", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "a zaamo", "_zaamo", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "a zaamo", "_zaamo", "", d)}" TUNEVALID[zalrsc] = "Extended LR/SC semantics extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "a zalrsc", "_zalrsc", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "a zalrsc", "_zalrsc", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "a zalrsc", "_zalrsc", "", d)}" TUNEVALID[zawrs] = "Wait-on-reservation-set instructions extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zawrs", "_zawrs", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zawrs", "_zawrs", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "zawrs", "_zawrs", "", d)}" TUNEVALID[zfa] = "Additional floating point instructions extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zfa", "_zfa", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zfa", "_zfa", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "zfa", "_zfa", "", d)}" TUNEVALID[zfhmin] = "Minimal half-precision floating point extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zfhmin", "_zfhmin", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zfhmin", "_zfhmin", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "zfhmin", "_zfhmin", "", d)}" TUNEVALID[zca] = "Compressed base integer ops extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "c zca", "_zca", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "c zca", "_zca", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "c zca", "_zca", "", d)}" TUNEVALID[zcb] = "Extra compressed integer ops extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zcb", "_zcb", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zcb", "_zcb", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "zcb", "_zcb", "", d)}" TUNEVALID[zcd] = "16-bit encodings for 64-bit FP extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zcd", "_zcd", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zcd", "_zcd", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "zcd", "_zcd", "", d)}" TUNEVALID[zcmop] = "Compressed may-be-ops extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zcmop", "_zcmop", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zcmop", "_zcmop", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "zcmop", "_zcmop", "", d)}" TUNEVALID[zba] = "Address bit manipulation extension" TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zba", "_zba", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zba", "_zba", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zba", "_zba", "", d)}" TUNEVALID[zbb] = "Basic bit manipulation extension" TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zbb", "_zbb", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zbb", "_zbb", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zbb", "_zbb", "", d)}" TUNEVALID[zbc] = "Carry-less multiplication extension" TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zbc", "_zbc", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zbc", "_zbc", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zbc", "_zbc", "", d)}" TUNEVALID[zbs] = "Single-bit manipulation extension" TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zbs", "_zbs", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zbs", "_zbs", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zbs", "_zbs", "", d)}" TUNEVALID[zkt] = "Data-independent execution latency extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zkt", "_zkt", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zkt", "_zkt", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zkt", "_zkt", "", d)}" TUNEVALID[zvbb] = "Vector basic bit-manipulation extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvbb", "_zvbb", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvbb", "_zvbb", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvbb", "_zvbb", "", d)}" TUNEVALID[zve32f] = "Embedded vector computation (32-bit integer, 32-bit FP) extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve32f", "_zve32f", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve32f", "_zve32f", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve32f", "_zve32f", "", d)}" TUNEVALID[zve32x] = "Embedded vector computation (32-bit integer) extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve32x", "_zve32x", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve32x", "_zve32x", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve32x", "_zve32x", "", d)}" TUNEVALID[zve64d] = "Embedded vector computation (64-bit integer, 64-bit FP) extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve64d", "_zve64d", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve64d", "_zve64d", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve64d", "_zve64d", "", d)}" TUNEVALID[zve64f] = "Embedded vector computation (64-bit integer, 32-bit FP) extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve64f", "_zve64f", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve64f", "_zve64f", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve64f", "_zve64f", "", d)}" TUNEVALID[zve64x] = "Embedded vector computation (64-bit integer) extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve64x", "_zve64x", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve64x", "_zve64x", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve64x", "_zve64x", "", d)}" TUNEVALID[zvfhmin] = "Vector half-precision minimal extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvfhmin", "_zvfhmin", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvfhmin", "_zvfhmin", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvfhmin", "_zvfhmin", "", d)}" TUNEVALID[zvkb] = "Vector cryptography bit-manipulation extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvkb", "_zvkb", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvkb", "_zvkb", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvkb", "_zvkb", "", d)}" TUNEVALID[zvkt] = "Vector data independent execution latency extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvkt", "_zvkt", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvkt", "_zvkt", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvkt", "_zvkt", "", d)}" TUNEVALID[zvl128b] = "Minimum vector length standard extensions (128-bit)." TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvl128b", "_zvl128b", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvl128b", "_zvl128b", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvl128b", "_zvl128b", "", d)}" TUNEVALID[zvl32b] = "Minimum vector length standard extensions (32-bit)." TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvl32b", "_zvl32b", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvl32b", "_zvl32b", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvl32b", "_zvl32b", "", d)}" TUNEVALID[zvl64b] = "Minimum vector length standard extensions (64-bit)." TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvl64b", "_zvl64b", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvl64b", "_zvl64b", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvl64b", "_zvl64b", "", d)}" TUNEVALID[supm] = "User-mode pointer masking extension." TUNE_RISCV_MARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "supm", "_supm", "", d)}" -TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "supm", "_supm", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "supm", "_supm", "", d)}" + +# Prefer a known RVA profile name (e.g. "rva22u64"), plus any extensions on +# top of the profile (e.g. "rva22u64_zvbb"), over the fully expanded exact +# extension list, when TUNE_FEATURES clearly matches a profile. Falls back +# to TUNE_RISCV_PKGARCH_EXACT for combinations that don't match a profile. +TUNE_RISCV_PKGARCH = "${@oe.tune.riscv_pkgarch(d.getVar('TUNE_FEATURES'), d.getVar('TUNE_RISCV_PKGARCH_EXACT'))}" # Construct TUNE_CCARGS # This should result in a CCARG similar to:
Signature · 1 line
2.55.0
Re: [OE-core][RFC PATCH 13/14] arch-riscv.inc: rename TUNE_RISCV_PKGARCH -> TUNE_RISCV_PKGARCH_EXACT in assignments
Quoted 257 lines · Trevor Gamblin
Change the naming convention we use when determining
TUNE_RISCV_PKGARCH, so that we have the option of relying on a known RISC-V profile name (e.g. 'rva22u64') as a baseline, rather than always specifying the full ISA extension set. An example from 'bitbake -e opensbi' with 'DEFAULTTUNE = "rva22u64" inconf/local.conf:|TUNE_RISCV_PKGARCH="rva22u64"
|# $TUNE_RISCV_PKGARCH_EXACT [48 operations]|TUNE_RISCV_PKGARCH_EXACT="riscv64imafdc_zic64b_zicbom_zicbop_zicboz_ziccamoa_ziccif_zicclsm_ziccrse_zicntr_zicsr_zihintpause_zmmul_za64rs_zaamo_zalrsc_zfhmin_zca_zcd_zba_zbb_zbs_zkt"
Signed-off-by Trevor Gamblin <[email protected]>--- .../conf/machine/include/riscv/arch-riscv.inc | 118 +++++++++--------- 1 file changed, 62 insertions(+), 56 deletions(-)meta/conf/machine/include/riscv/arch-riscv.inc +0
-0@@ -32,7 +32,7 @@ TUNE_RISCV_ABI .= "${@bb.utils.contains("TUNE_FEATURES","64", "lp64", "", d)}"
# The package arch starts with the canonical arch, but adds some
extensions to make# package compatibility clearmeta/conf/machine/include/riscv/arch-riscv.inc +1
-1-TUNE_RISCV_PKGARCH = "${TUNE_RISCV_ARCH}" +TUNE_RISCV_PKGARCH_EXACT = "${TUNE_RISCV_ARCH}" # i, e, or g are defined by gcc, but 'g' refers to 'i' + extensions 'MAFDZicsr Zifencei'
# So 'g' will not be defined here as it is an abbreviation of the
expanded versionmeta/conf/machine/include/riscv/arch-riscv.inc +0
-0@@ -40,231 +40,237 @@ TUNEVALID[e] = "Reduced register base integerextension"
TUNECONFLICTS[e] = "i"
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "e", "e", "",
d)}"
TUNE_RISCV_ABI.= "${@bb.utils.contains("TUNE_FEATURES", "e", "e", "",
d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "e", "e", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "e", "e", "", d)}"TUNEVALID[i] = "Base integer extension"
TUNECONFLICTS[i] = "e"
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "i", "i", "",
d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "i", "i", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "i", "i", "", d)}"# Extensions
TUNEVALID[m] = "Integer multiplication and division extension"TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "m", "m", "",
d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "m", "m", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "m", "m", "", d)}"TUNEVALID[a] = "Atomic extension"
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "a", "a", "",
d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "a", "a", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "a", "a", "", d)}"TUNEVALID[f] = "Single-precision floating-point extension"
TUNE_RISCV_MARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "f d",
"f", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "f d", "f", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "f d", "f", "", d)}"TUNEVALID[d] = "Double-precision floating-point extension"
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "d", "d", "",
d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "d", "d", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "d", "d", "", d)}"# Only f OR d, but just one
TUNE_RISCV_ABI.= "${@bb.utils.contains("TUNE_FEATURES", "d", "d",bb.utils.contains("TUNE_FEATURES", "f", "f", "", d), d)}"TUNEVALID[c] = "Compressed extension"
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "c", "c", "",
d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "c", "c", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "c", "c", "", d)}"TUNEVALID[b] = "Bit Manipulation extension"
# Handled below via zba, zbb, zbs
# This matches current Linux kernel behavior #TUNE_RISCV_MARCH .= "${@bb.utils.contains("TUNE_FEATURES", "b", "b", "",
d)}"
-#TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "b", "b", "", d)}"
+#TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "b", "b", "", d)}"TUNEVALID[v] = "Vector operations extension"
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "v", "v", "",
d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "v", "v", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "v", "v", "", d)}"# Now the special Z extensions
TUNEVALID[zic64b] = "Cache block size is 64 bytes extension."TUNE_RISCV_MARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "zic64b",
"_zic64b", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zic64b", "_zic64b", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zic64b", "_zic64b", "", d)}"TUNEVALID[zicbom] = "Cache-block management extension"
TUNE_RISCV_MARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "zicbom",
"_zicbom", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicbom", "_zicbom", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicbom", "_zicbom", "", d)}"TUNEVALID[zicbop] = "Cache-block prefetching extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "zicbop",
"_zicbop", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicbop", "_zicbop", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicbop", "_zicbop", "", d)}"TUNEVALID[zicboz] = "Cache-block zeroing extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "zicboz",
"_zicboz", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicboz", "_zicboz", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicboz", "_zicboz", "", d)}"TUNEVALID[ziccamoa] = "PMA guarantees for A-extension atomics extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "ziccamoa",
"_ziccamoa", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "ziccamoa", "_ziccamoa", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "ziccamoa", "_ziccamoa", "", d)}"TUNEVALID[ziccif] = "Patching instructions at run time extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "ziccif",
"_ziccif", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "ziccif", "_ziccif", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "ziccif", "_ziccif", "", d)}"TUNEVALID[zicclsm] = "Software that assumes misaligned access works
extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "zicclsm",
"_zicclsm", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zicclsm", "_zicclsm", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "zicclsm", "_zicclsm", "", d)}"TUNEVALID[ziccrse] = "Guarantees LR/SC forward progress extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "ziccrse",
"_ziccrse", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "ziccrse", "_ziccrse", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "ziccrse", "_ziccrse", "", d)}"TUNEVALID[zicntr] = "Cycle and instruction counting for profiling
extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "zicntr",
"_zicntr", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zicntr", "_zicntr", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "zicntr", "_zicntr", "", d)}"TUNEVALID[zicond] = "Conditional zeroing operations extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "zicond",
"_zicond", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zicond", "_zicond", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "zicond", "_zicond", "", d)}"TUNEVALID[zicsr] = "Control and status register access extension"
TUNE_RISCV_MARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "zicsr f
d", "_zicsr", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicsr f d", "_zicsr", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zicsr f d", "_zicsr", "", d)}"TUNEVALID[zifencei] = "Instruction-fetch fence extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "zifencei",
"_zifencei", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zifencei", "_zifencei", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "zifencei", "_zifencei", "", d)}"TUNEVALID[zihintntl] = "Non-temporal locality hints extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "zihintntl",
"_zihintntl", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zihintntl", "_zihintntl", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "zihintntl", "_zihintntl", "", d)}"TUNEVALID[zihintpause] = "Pause hint extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "zihintpause",
"_zihintpause", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zihintpause", "_zihintpause", "", d)}" +TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "zihintpause", "_zihintpause", "", d)}"TUNEVALID[zihpm] = "Hardware performance counters extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "zihpm",
"_zihpm", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zihpm", "_zihpm", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "zihpm", "_zihpm", "", d)}"TUNEVALID[zimop] = "Hardware performance counters extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "zimop",
"_zimop", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zimop", "_zimop", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "zimop", "_zimop", "", d)}"TUNEVALID[zmmul] = "Cheaper M subset (mul only) extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "m zmmul",
"_zmmul", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "m zmmul", "_zmmul", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "m zmmul", "_zmmul", "", d)}"
Quoted 8 lines
TUNEVALID[za64rs] = "Reservation set size of at most 64 bytes extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "za64rs",
"_za64rs", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "za64rs", "_za64rs", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "za64rs", "_za64rs", "", d)}"
za64rs is placed before za128rs see below, but canonical order within the Za group is alphabetical (za128rs then za64rs).
Quoted 245 lines
TUNEVALID[za128rs] = "Reservation set granularity (128-byte) extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "za128rs",
"_za128rs", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "za128rs", "_za128rs", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "za128rs", "_za128rs", "", d)}"TUNEVALID[zaamo] = "Atomic read-modify-write memory operations extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "a zaamo",
"_zaamo", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "a zaamo", "_zaamo", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "a zaamo", "_zaamo", "", d)}"TUNEVALID[zalrsc] = "Extended LR/SC semantics extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "a zalrsc",
"_zalrsc", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "a zalrsc", "_zalrsc", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "a zalrsc", "_zalrsc", "", d)}"TUNEVALID[zawrs] = "Wait-on-reservation-set instructions extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "zawrs",
"_zawrs", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zawrs", "_zawrs", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "zawrs", "_zawrs", "", d)}"TUNEVALID[zfa] = "Additional floating point instructions extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "zfa", "_zfa",
"", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zfa", "_zfa", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "zfa", "_zfa", "", d)}"TUNEVALID[zfhmin] = "Minimal half-precision floating point extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "zfhmin",
"_zfhmin", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zfhmin", "_zfhmin", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "zfhmin", "_zfhmin", "", d)}"TUNEVALID[zca] = "Compressed base integer ops extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "c zca",
"_zca", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "c zca", "_zca", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "c zca", "_zca", "", d)}"TUNEVALID[zcb] = "Extra compressed integer ops extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "zcb", "_zcb",
"", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zcb", "_zcb", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "zcb", "_zcb", "", d)}"TUNEVALID[zcd] = "16-bit encodings for 64-bit FP extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "zcd", "_zcd",
"", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zcd", "_zcd", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "zcd", "_zcd", "", d)}"TUNEVALID[zcmop] = "Compressed may-be-ops extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains("TUNE_FEATURES", "zcmop",
"_zcmop", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "zcmop", "_zcmop", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains("TUNE_FEATURES", "zcmop", "_zcmop", "", d)}"TUNEVALID[zba] = "Address bit manipulation extension"
TUNE_RISCV_MARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "b zba",
"_zba", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zba", "_zba", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zba", "_zba", "", d)}"TUNEVALID[zbb] = "Basic bit manipulation extension"
TUNE_RISCV_MARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "b zbb",
"_zbb", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zbb", "_zbb", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zbb", "_zbb", "", d)}"TUNEVALID[zbc] = "Carry-less multiplication extension"
TUNE_RISCV_MARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "zbc",
"_zbc", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zbc", "_zbc", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zbc", "_zbc", "", d)}"TUNEVALID[zbs] = "Single-bit manipulation extension"
TUNE_RISCV_MARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "b zbs",
"_zbs", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zbs", "_zbs", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zbs", "_zbs", "", d)}"TUNEVALID[zkt] = "Data-independent execution latency extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "b zkt",
"_zkt", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zkt", "_zkt", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "b zkt", "_zkt", "", d)}"TUNEVALID[zvbb] = "Vector basic bit-manipulation extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "zvbb",
"_zvbb", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvbb", "_zvbb", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvbb", "_zvbb", "", d)}"TUNEVALID[zve32f] = "Embedded vector computation (32-bit integer, 32-bit
FP) extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "zve32f",
"_zve32f", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve32f", "_zve32f", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve32f", "_zve32f", "", d)}"TUNEVALID[zve32x] = "Embedded vector computation (32-bit integer)
extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "zve32x",
"_zve32x", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve32x", "_zve32x", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve32x", "_zve32x", "", d)}"TUNEVALID[zve64d] = "Embedded vector computation (64-bit integer, 64-bit
FP) extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "zve64d",
"_zve64d", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve64d", "_zve64d", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve64d", "_zve64d", "", d)}"TUNEVALID[zve64f] = "Embedded vector computation (64-bit integer, 32-bit
FP) extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "zve64f",
"_zve64f", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve64f", "_zve64f", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve64f", "_zve64f", "", d)}"TUNEVALID[zve64x] = "Embedded vector computation (64-bit integer)
extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "zve64x",
"_zve64x", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve64x", "_zve64x", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zve64x", "_zve64x", "", d)}"TUNEVALID[zvfhmin] = "Vector half-precision minimal extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "zvfhmin",
"_zvfhmin", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvfhmin", "_zvfhmin", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvfhmin", "_zvfhmin", "", d)}"TUNEVALID[zvkb] = "Vector cryptography bit-manipulation extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "zvkb",
"_zvkb", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvkb", "_zvkb", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvkb", "_zvkb", "", d)}"TUNEVALID[zvkt] = "Vector data independent execution latency extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "zvkt",
"_zvkt", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvkt", "_zvkt", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvkt", "_zvkt", "", d)}"TUNEVALID[zvl128b] = "Minimum vector length standard extensions
(128-bit)."
TUNE_RISCV_MARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "zvl128b",
"_zvl128b", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvl128b", "_zvl128b", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvl128b", "_zvl128b", "", d)}"TUNEVALID[zvl32b] = "Minimum vector length standard extensions (32-bit)."
TUNE_RISCV_MARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "zvl32b",
"_zvl32b", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvl32b", "_zvl32b", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvl32b", "_zvl32b", "", d)}"TUNEVALID[zvl64b] = "Minimum vector length standard extensions (64-bit)."
TUNE_RISCV_MARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "zvl64b",
"_zvl64b", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvl64b", "_zvl64b", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "zvl64b", "_zvl64b", "", d)}"TUNEVALID[supm] = "User-mode pointer masking extension."
TUNE_RISCV_MARCH.= "${@bb.utils.contains_any("TUNE_FEATURES", "supm",
"_supm", "", d)}"
-TUNE_RISCV_PKGARCH .= "${@bb.utils.contains_any("TUNE_FEATURES", "supm", "_supm", "", d)}"
+TUNE_RISCV_PKGARCH_EXACT .= "${@bb.utils.contains_any("TUNE_FEATURES", "supm", "_supm", "", d)}"meta/conf/machine/include/riscv/arch-riscv.inc +2
-0+ +# Prefer a known RVA profile name (e.g. "rva22u64"), plus any extensionson
meta/conf/machine/include/riscv/arch-riscv.inc +4
-0+# top of the profile (e.g. "rva22u64_zvbb"), over the fully expanded exact +# extension list, when TUNE_FEATURES clearly matches a profile. Falls back +# to TUNE_RISCV_PKGARCH_EXACT for combinations that don't match a profile. +TUNE_RISCV_PKGARCH = "${@oe.tune.riscv_pkgarch(d.getVar('TUNE_FEATURES'),
d.getVar('TUNE_RISCV_PKGARCH_EXACT'))}"# Construct
TUNE_CCARGS
# This should result in a CCARG similar to:
--
2.55.0
RFC PATCH 14/14 tune-riscv.inc: append zifencei extension to profiles
In reply to Trevor GamblinOnly riscv64gc enables this by default, but we need it for the Linux Kernel. Append it to the official profile strings.
--- meta/conf/machine/include/riscv/tune-riscv.inc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
meta/conf/machine/include/riscv/tune-riscv.inc +5 -3
@@ -4,13 +4,15 @@ DEFAULTTUNE ?= "riscv64gc" AVAILTUNES += "rva23u64 rva22u64 rva20u64 riscv64gcv riscv64gc riscv32gc riscv64nc riscv64nf riscv32nf" -TUNE_FEATURES:tune-rva20u64 := "${@oe.tune.riscv_isa_to_tune("rva20u64")}" +# zifencei isn't part of these profiles per gcc's -march expansion, but the +# Linux kernel requires it, so add it on top of the profile's extensions. +TUNE_FEATURES:tune-rva20u64 := "${@oe.tune.riscv_isa_to_tune("rva20u64")} zifencei" PACKAGE_EXTRA_ARCHS:tune-rva20u64 = "${TUNE_RISCV_PKGARCH}" -TUNE_FEATURES:tune-rva22u64 := "${@oe.tune.riscv_isa_to_tune("rva22u64")}" +TUNE_FEATURES:tune-rva22u64 := "${@oe.tune.riscv_isa_to_tune("rva22u64")} zifencei" PACKAGE_EXTRA_ARCHS:tune-rva22u64 = "${TUNE_RISCV_PKGARCH}" -TUNE_FEATURES:tune-rva23u64 := "${@oe.tune.riscv_isa_to_tune("rva23u64")}" +TUNE_FEATURES:tune-rva23u64 := "${@oe.tune.riscv_isa_to_tune("rva23u64")} zifencei" PACKAGE_EXTRA_ARCHS:tune-rva23u64 = "${TUNE_RISCV_PKGARCH}" # Default
Signature · 1 line
2.55.0
Re: [OE-core][RFC PATCH 14/14] tune-riscv.inc: append zifencei extension to profiles
Quoted 33 lines · Trevor Gamblin
Only riscv64gc enables this by default, but we need it for the Linux Kernel. Append it to the official profile strings.
Signed-off-by Trevor Gamblin <[email protected]>--- meta/conf/machine/include/riscv/tune-riscv.inc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)meta/conf/machine/include/riscv/tune-riscv.inc +0
-0@@ -4,13 +4,15 @@ DEFAULTTUNE ?= "riscv64gc" AVAILTUNES += "rva23u64 rva22u64 rva20u64 riscv64gcv riscv64gc riscv32gcriscv64nc riscv64nf riscv32nf"
meta/conf/machine/include/riscv/tune-riscv.inc +1
-1-TUNE_FEATURES:tune-rva20u64 := "${@oe.tune.riscv_isa_to_tune("rva20u64")}" +# zifencei isn't part of these profiles per gcc's -march expansion, butthe
meta/conf/machine/include/riscv/tune-riscv.inc +2
-0+# Linux kernel requires it, so add it on top of the profile's extensions. +TUNE_FEATURES:tune-rva20u64 := "${@oe.tune.riscv_isa_to_tune("rva20u64")}zifencei"
PACKAGE_EXTRA_ARCHS:tune-rva20u64 = "${TUNE_RISCV_PKGARCH}"meta/conf/machine/include/riscv/tune-riscv.inc +1
-1-TUNE_FEATURES:tune-rva22u64 := "${@oe.tune.riscv_isa_to_tune("rva22u64")}" +TUNE_FEATURES:tune-rva22u64 := "${@oe.tune.riscv_isa_to_tune("rva22u64")}zifencei"
PACKAGE_EXTRA_ARCHS:tune-rva22u64 = "${TUNE_RISCV_PKGARCH}"meta/conf/machine/include/riscv/tune-riscv.inc +1
-1-TUNE_FEATURES:tune-rva23u64 := "${@oe.tune.riscv_isa_to_tune("rva23u64")}" +TUNE_FEATURES:tune-rva23u64 := "${@oe.tune.riscv_isa_to_tune("rva23u64")}
Quoted 4 lines
zifencei"
PACKAGE_EXTRA_ARCHS:tune-rva23u64 = "${TUNE_RISCV_PKGARCH}"
Fold this into patch 0005 so bisecting is not broken in future least someone lands in between 0005 patch
and 0013, since The rva* tunes have no zifencei until this patch.
Quoted 5 lines
# Default
--
2.55.0
I think pkgarch needs to sort out shortening. riscv_pkgarch() only helps when TUNE_FEATURES is an exact superset of a known profile. SSTATE_PKGARCH is never truncated so this can be trouble, perhaps generate_sstatefn should be able to shorten pkgarch,
clang developer in me below cringes :)
A profile name used as package arch is an ABI claim with a compiler-derived definition.RISCV_PROFILES is "whatever gcc printed". If a future gcc adds an extension to
its rva23u64 expansion and someone refreshes the table, feeds full of rva23u64
packages silently change meaning — and the table is gcc's view while TOOLCHAIN may be clang. so maybe add a comment saying - "do not regenerate from
the compiler; changing it changes package-arch semantics" and then cite the RVA spec version
rather than a gcc invocation.
PACKAGE_EXTRA_ARCHS isn't modelling compatibility. e.g. rva20u64 binaries run on rva22/rva23 hardware, but each profile is an isolated arch with zero package sharing.
Quoted 349 lines · Trevor Gamblin
# Overview
Support for the RISC-V architecture and a basic set of extensions has been available in oe-core for a long time now, and as of late 2025, QEMU defaults to
the RVA23S64 profile when booting qemuriscv64 images. However, at the userspace
level, we currently support only the standard "riscv64gc" profile (behind a generic "riscv64" identifier), which is common across the wider open-source ecosystem, but lacks many of the features which are starting to become necessary
for more advanced experimentation and testing on RISC-V platforms. This series
aims to remedy that by introducing several distinct changes across a few files.
I've broken it up on a per-profile basis for easier review, but the final version could probably feature some squashed commits. It could also go the route
of breaking tunings up more in the style of those in conf/machine/include/arm/,
but I'll leave them as-is for now to avoid even more rework that needs reviewing.A list of changes, by group:
1. Basic clarification changes and extra tunings:
a. tune-riscv: be explicit about riscv64gc default
b. tune-riscv.inc: add 'riscv64gcv' tune
2. Adding official RVA20 profile extensions, and supporting the explicit choice
of 'rva20u64' as a tuning option for builds:
a. arch-riscv.inc: add missing RVA20 extensions
b.meta/lib/oe/tune.py: support profile strings, add rva20u64 c. tune-riscv.inc: add rva20u64 to AVAILTUNES
3. Adding RVA22 profile support:
a. arch-riscv.inc: add rva22u64 extensions
b.meta/lib/oe/tune.py: add rva22u64 profile
c. tune-riscv.inc: add rva22u64 to AVAILTUNES
4. Adding RVA23 profile support:
a. arch-riscv.inc: add rva23u64 extensions
b.meta/lib/oe/tune.py: add rva23u64 profile
c. tune-riscv.inc: add rva23u64 to AVAILTUNES
5. Quality-of-life fixups after 1-4:
a.meta/lib/oe/tune.py: addriscv_pkgarch()
b. arch-riscv.inc: renameTUNE_RISCV_PKGARCH->TUNE_RISCV_PKGARCH_EXACT
in assignments
c. tune-riscv.inc: append zifencei extension to profilesThese changes are also in my contrib branch[1]. The main sources of truth used
were gcc's '-march' options list[2], the official RISC-V International documentation[3], and the RISC-V ISA Explorer[4], with the gcc specifics as the
preferred source. When comparing against gcc's output, commands like the following were run:|tgamblin@megalith
~/workspace/ypbuilds/poky-qemuriscv64/layers/openembedded-core (master)$
riscv64-linux-gnu-gcc -march=rva23u64 -mabi=lp64d -Q --help=target | grep
rv64
| -march=
rv64imafdcbv_zic64b_zicbom_zicbop_zicboz_ziccamoa_ziccif_zicclsm_ziccrse_zicntr_zicond_zicsr_zihintntl_zihintpause_zihpm_zimop_zmmul_za64rs_zaamo_zalrsc_zawrs_zfa_zfhmin_zca_zcb_zcd_zcmop_zba_zbb_zbs_zkt_zvbb_zve32f_zve32x_zve64d_zve64f_zve64x_zvfhmin_zHowever, as is visible above, the extension list became so long for the RVA23
case that it was truncated, and so a more verbose output from the following was
checked instead:|riscv64-linux-gnu-gcc -march=rva23u64 -mabi=lp64d -v -xc
/dev/null-c -o/dev/nullFor now, the default tuning remains riscv64gc (with the naming rework in 1a),
despite the presence of the other profiles. It is critical to note that not all
combinations of the RISC-V extensions may be valid or useful to use for projects, and whenever possible a ratified profile's corresponding tune (e.g.
"RVA22" -> "rva22u64") should be extended rather than picking and choosing each
feature. There are also several extensions which are depended on by others (e.g.
'zkt' is needed by 'b'), and other known examples which aren't strictly part
of the official profiles but must be included for the Yocto/OE case, such as
'zifencei' being necessary to build the Linux Kernel (which already had been
addressed before, but this series handles slightly differently). This series
makes no attempts to add extensions which are not part of these profiles - those
could be added in future series, but these changes are significant enough for
now. It might be worth adding some more documentation about how all of this works - I'd be happy to hear what people think about that too.One significant change to the way profile strings are processed with these patches shows up in sstate/build path naming, and is part of the reason
for patch 5a and 5b above - before, a build directory might have a path in it
like:|build/tmp/work/riscv64imafdc_zicsr_zifencei-poky-linux/
This was fine when the extension list was short (for riscv64gc), but with the
full RVA profiles, the paths started to get so long that bitbake would produce
this error:|ERROR: Unable to reduce sstate name to less than 255 chararacters
To solve this problem,
meta/lib/oe/tune.pynow supports a very short list of
profile names, and includes a new functionriscv_pkgarch()designed to compare
selected extensions against known profiles and determine if once has implicitly
been selected. As an example, if you set the following in local.conf:|TUNE_FEATURES = "${@oe.tune.riscv_isa_to_tune('riscv64gc')} ziccamoa ziccif zicclsm ziccrse zicntr zicsr zmmul za128rs zaamo zalrsc zca zcd"
and then run 'bitbake -e opensbi', you will see:
|PACKAGE_EXTRA_ARCHS="rva20u64_zifencei"
With all of this combined, subdirectories in tmp/work/ look like:
|tgamblin@megalith ~/workspace/ypbuilds/poky-qemuriscv64 $ ls build/tmp/work
|all-poky-linux riscv64imafdcv_zicsr_zifencei-poky-linux
rva20u64_zcmop_zifencei_zihintpause_zimop_zvbb-poky-linux rva22u64_zifencei-poky-linux x86_64-linux |qemuriscv64-poky-linux riscv64imafdc_zicsr_zifencei-poky-linux
rva20u64_zifencei-poky-linux rva23u64_zifencei-poky-linuxNote that the 'rva20u64_zcmop_zifencei_zihintpause_zimop_zvbb-poky-linux' configuration is a custom one I set in local.conf only for testing purposes.
Custom tunings still run the ris(c|k) of exceeding the naming length, which we
may need some extra logic to handle (or, again, find a way to make it behave
more like arm) if we want to enable freely customizing build tunings. This is an
area where I'm hoping there will be some suggestions, as the way to do this in
local.conf seems fairly ugly (but maybe that's a good thing?):|DEFAULTTUNE = "rva20u64"
|TUNE_FEATURES = "${@oe.tune.riscv_isa_to_tune('rva20u64')} zihintpause zvbb zimop zcmop zifencei"A consequence of doing this is that a lot of other variables related to the tuning features get "polluted":
|tgamblin@megalith ~/workspace/ypbuilds/poky-qemuriscv64 $ bitbake -e opensbi | grep
PACKAGE_EXTRA_ARCHS|# "all any noarch ${PACKAGE_EXTRA_ARCHS} ${MACHINE_ARCH}" |# "all any noarch ${PACKAGE_EXTRA_ARCHS} ${MACHINE_ARCH}" |# $PACKAGE_EXTRA_ARCHS [11 operations] |# [_defaultval] "${PACKAGE_EXTRA_ARCHS:tune-${DEFAULTTUNE}}" |# "${PACKAGE_EXTRA_ARCHS:tune-${DEFAULTTUNE}}" |PACKAGE_EXTRA_ARCHS="rva20u64_zcmop_zifencei_zihintpause_zimop_zvbb" |# $PACKAGE_EXTRA_ARCHS:tune-riscv32gc|PACKAGE_EXTRA_ARCHS:tune-riscv32gc="rva20u64_zcmop_zifencei_zihintpause_zimop_zvbb" |# $PACKAGE_EXTRA_ARCHS:tune-riscv32nf
|PACKAGE_EXTRA_ARCHS:tune-riscv32nf="rva20u64_zcmop_zifencei_zihintpause_zimop_zvbb" |# $PACKAGE_EXTRA_ARCHS:tune-riscv64gc
|PACKAGE_EXTRA_ARCHS:tune-riscv64gc="rva20u64_zcmop_zifencei_zihintpause_zimop_zvbb"
# Testing
Testing different profiles' validity against the compiler involved setting (for
example) DEFAULTTUNE = "rva23u64" and then running 'bitbake opensbi' (which also
results in a kernel rebuild) as a quick smoke test. I've also opted to do full
image builds to make sure that the new profiles fully boot and run without any
obvious errors. Because I've been playing with coreutils on qemuriscv64 a lot
lately, here are example results with each profile (plus riscv64gc and riscv64gcv, for completeness) enabled on a build and test of core-image-ptest-coreutils. Note that when the vector extension is enabled (riscv64gcv, rva23u64), the test duration is significantly higher:riscv64gc:
|============================================================================ |Testsuite summary for GNU coreutils 9.11
|============================================================================ |# TOTAL: 733 |# PASS: 561 |# SKIP: 172 |# XFAIL: 0 |# FAIL: 0 |# XPASS: 0 |# ERROR: 0|============================================================================ |make[1]: Leaving directory '/usr/lib/coreutils/ptest' |DURATION: 671 |END: /usr/lib/coreutils/ptest |2026-09-15T15:45 |STOP: ptest-runner |TOTAL: 1 FAIL: 0 |root@qemuriscv64:~#riscv64gcv:
|============================================================================ |Testsuite summary for GNU coreutils 9.11
|============================================================================ |# TOTAL: 733 |# PASS: 561 |# SKIP: 172 |# XFAIL: 0 |# FAIL: 0 |# XPASS: 0 |# ERROR: 0|============================================================================ |make[1]: Leaving directory '/usr/lib/coreutils/ptest' |DURATION: 940 |END: /usr/lib/coreutils/ptest |2026-09-15T16:39 |STOP: ptest-runner |TOTAL: 1 FAIL: 0 |root@qemuriscv64:~#rva20u64:
|============================================================================ |Testsuite summary for GNU coreutils 9.11
|============================================================================ |# TOTAL: 733 |# PASS: 561 |# SKIP: 172 |# XFAIL: 0 |# FAIL: 0 |# XPASS: 0 |# ERROR: 0|============================================================================ |make[1]: Leaving directory '/usr/lib/coreutils/ptest' |DURATION: 660 |END: /usr/lib/coreutils/ptest |2026-09-15T15:02 |STOP: ptest-runner |TOTAL: 1 FAIL: 0 |root@qemuriscv64:~#rva22u64:
|============================================================================ |Testsuite summary for GNU coreutils 9.11
|============================================================================ |# TOTAL: 733 |# PASS: 561 |# SKIP: 172 |# XFAIL: 0 |# FAIL: 0 |# XPASS: 0 |# ERROR: 0|============================================================================ |make[1]: Leaving directory '/usr/lib/coreutils/ptest' |DURATION: 615 |END: /usr/lib/coreutils/ptest |2026-09-15T13:48 |STOP: ptest-runner |TOTAL: 1 FAIL: 0 |root@qemuriscv64:~#rva23u64:
|============================================================================ |Testsuite summary for GNU coreutils 9.11
|============================================================================ |# TOTAL: 733 |# PASS: 561 |# SKIP: 172 |# XFAIL: 0 |# FAIL: 0 |# XPASS: 0 |# ERROR: 0|============================================================================ |make[1]: Leaving directory '/usr/lib/coreutils/ptest' |DURATION: 966 |END: /usr/lib/coreutils/ptest |2026-09-15T12:18 |STOP: ptest-runner |TOTAL: 1 FAIL: 0 |root@qemuriscv64:~#[1]:
https://git.openembedded.org/openembedded-core-contrib/log/?h=tgamblin/riscv64-tuning-rework
[2]: https://gcc.gnu.org/onlinedocs/gcc/RISC-V-Options.html
[3]: https://docs.riscv.org/reference/home/index.html
[4]: https://riscv.github.io/riscv-isa-explorer/Trevor Gamblin (14):
tune-riscv: be explicit about riscv64gc default tune-riscv.inc: add 'riscv64gcv' tune
arch-riscv.inc: add missing RVA20 extensionsmeta/lib/oe/tune.py: support profile strings, add rva20u64 tune-riscv.inc: add rva20u64 to AVAILTUNES
arch-riscv.inc: add rva22u64 extensionsmeta/lib/oe/tune.py: add rva22u64 profile
tune-riscv.inc: add rva22u64 to AVAILTUNES
arch-riscv.inc: add rva23u64 extensionsmeta/lib/oe/tune.py: add rva23u64 profile
tune-riscv.inc: add rva23u64 to AVAILTUNESmeta/lib/oe/tune.py: addriscv_pkgarch()
arch-riscv.inc: renameTUNE_RISCV_PKGARCH->TUNE_RISCV_PKGARCH_EXACT
in assignments
tune-riscv.inc: append zifencei extension to profiles.../conf/machine/include/riscv/arch-riscv.inc | 198 ++++++++++++++++-- .../conf/machine/include/riscv/tune-riscv.inc | 24 ++- meta/lib/oe/tune.py | 42 +++- 3 files changed, 240 insertions(+), 24 deletions(-)--
2.55.0