[go: up one dir, main page]

RISC-V: Incorporate macro structs into re-usable struct

Closes RV-171

Review Advisory

src/riscv/lib/src/machine_state/csregisters/values.rs has almost entirely changed. I recommend reviewing the resulting file instead of the diff in the Changes tab.

What

Use a single configurable struct to contain CSR values.

Why

Resolves a small performance regression from !14177 (merged).

How

Replace the various CSR value structs (layout, placed, allocated, bound) into a single CSRValueF that can be parameterised appropriately. Methods to transform or select fields of this struct make other code locations simpler.

Manually Testing

make -C src/riscv all

Benchmarking

master This MR Improvement
M3 MBP 0.365 TPS 0.365 TPS 0%
Benchmark Machine 0.136 TPS 0.138 TPS 1.5%

Tasks for the Author

  • Link all Linear issues related to this MR using magic words (e.g. part of, relates to, closes).
  • Eliminate dead code and other spurious artefacts introduced in your changes.
  • Document new public functions, methods and types.
  • Make sure the documentation for updated functions, methods, and types is correct.
  • Add tests for bugs that have been fixed.
  • Put in reasonable effort to ensure that CI will pass.
  • Benchmark performance and populate the table above if needed.
  • Write commit messages to reflect the changes they're about.
  • Self-review your changes to ensure they are high-quality.
  • Complete all of the above before assigning this MR to reviewers.
Edited by Ole Krüger

Merge request reports

Loading