Introduce extension implied rules
Status from this message: Applied to riscv-to-apply.next
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest6 patches 3 repliesApplied
- v26 patches 8 repliesSuperseded
- v1 posting 2/26 patches 5 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 posting 1/2 | 6 patches | 2 replies | Superseded |
Changes in v3 from the cover letter
- Replace the enabled bitmask of type 'uint64_t' with a dynamic bitmask to support more than 64 harts.
- Ensure that implied rules and hash tables are initialized/created only once.
- Rename variables to align nomenclature with existing variables:
- In RISCVCPUImpliedExtsRule structure:
- 'implied_misas' -> 'implied_misa_exts'
- 'implied_exts' -> 'implied_multi_exts'
- 'misa_implied_rules' -> 'misa_ext_implied_rules'
- 'ext_implied_rules' -> 'multi_ext_implied_rules'
- 'riscv_misa_implied_rules' -> 'riscv_misa_ext_implied_rules'
- 'riscv_ext_implied_rules -> 'riscv_multi_ext_implied_rules'
Patches in v3 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | target/riscv: Introduce extension implied rules definitiontarget/ target/ | +31 | 1 reply | |
| 2/6 | target/riscv: Introduce extension implied rule helperstarget/ | +121 | 1 reply | |
| 3/6 | target/riscv: Add MISA extension implied rulestarget/ | +49 | 0 replies | |
| 4/6 | target/riscv: Add multi extension implied rulestarget/ | +340 | 0 replies | |
| 5/6 | target/riscv: Add Zc extension implied ruletarget/ | +34 | 0 replies | |
| 6/6 | target/riscv: Remove extension auto-update check statementstarget/ | +0 | 0 replies |
Reviews trailers per patch
All 6 patches have a Reviewed-by or Acked-by.
| Patch | Jerry Zhang Jian | Max Chou | Daniel Henrique Barboza | Alistair Francis |
|---|---|---|---|---|
| 1/6 | R-b | T-b | R-b | R-b |
| 2/6 | R-b | T-b | R-b | R-b |
| 3/6 | R-b | T-b | R-b | R-b |
| 4/6 | R-b | T-b | R-b | A-b |
| 5/6 | R-b | T-b | R-b | |
| 6/6 | R-b | T-b | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.
Cover letter [PATCH v3 0/6] Introduce extension implied rules
From: Frank Chang <[email protected]>
Currently, the implied extensions are enabled and checked in riscv_cpu_validate_set_extensions(). However, the order of enabling the implied extensions must follow a strict sequence, which is error-prone.
This patchset introduce extension implied rule helpers to enable the implied extensions. This also eliminates the old-fashioned ordering requirement. For example, Zvksg implies Zvks, Zvks implies Zvksed, etc., removing the need to check the implied rules of Zvksg before Zvks.
The idea [1] and the implied rules [2] are referenced from LLVM.
[1] https://github.com/llvm/llvm-project/blob/main/llvm/lib/TargetParser/RISCVISAInfo.cpp#L875
[2] https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/RISCV/RISCVFeatures.td
Changelog:
v3:
- Replace the enabled bitmask of type 'uint64_t' with a dynamic bitmask to support more than 64 harts.
- Ensure that implied rules and hash tables are initialized/created only once.
- Rename variables to align nomenclature with existing variables:
- In RISCVCPUImpliedExtsRule structure:
- 'implied_misas' -> 'implied_misa_exts'
- 'implied_exts' -> 'implied_multi_exts'
- 'misa_implied_rules' -> 'misa_ext_implied_rules'
- 'ext_implied_rules' -> 'multi_ext_implied_rules'
- 'riscv_misa_implied_rules' -> 'riscv_misa_ext_implied_rules'
- 'riscv_ext_implied_rules -> 'riscv_multi_ext_implied_rules'
v2:
- Remove enabled bitmask from user-mode QEMU as there's no good way (e.g. mhartid) to distinguish the SMP cores in user-mode QEMU.
- Use qatomic API to access the enabled bitmask to prevent the potential enabled bit from being cleared by another hart.
Frank Chang (6):
target/riscv: Introduce extension implied rules definition target/riscv: Introduce extension implied rule helpers target/riscv: Add MISA extension implied rules target/riscv: Add multi extension implied rules target/riscv: Add Zc extension implied rule target/riscv: Remove extension auto-update check statements
target/riscv/cpu.c | 396 +++++++++++++++++++++++++++++++++++++ target/riscv/cpu.h | 23 +++ target/riscv/tcg/tcg-cpu.c | 274 ++++++++++++++----------- 3 files changed, 574 insertions(+), 119 deletions(-)
--
2.43.2