RISC-V: Interpreter now continues when branch condition is not met.
Closes RV-245
What
Branch instructions now continue executing a block when the branch condition is not met, rather than resetting.
Why
Previously, we were exiting the block we were in and jumping to the next instruction (starting a new block) for either outcome of a branch instruction. This meant conducting an unnecessary reset when branch conditions were not met. Now the interpreter will just continue executing the next instruction, reducing overhead and behaviour matches expectation better.
How
Rather than having the branch instruction return the absolute address of the next instruction to execute, it now returns the ProgramCounterUpdate object itself, of either the Next type or Set type where appropriate.
Manually Testing
make -C src/riscv all
Benchmarking
master |
This MR | Improvement | |
|---|---|---|---|
| $MyMachine | 2.686 TPS | 3.156 TPS | 17.50% |
| Benchmark Machine | 2.034 TPS | 2.233 TPS | 9.78% |
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 Neelay Sant