Closed fwsGonzo closed 6 months ago
I've made an attempt here: https://github.com/fwsGonzo/libriscv/pull/114
Did not see any improvements so far.
Merged the PR but I will keep this open until the brutal test passes with bintr again.
The problem is well understood now. The binary translation shared objects cannot really be shared across forks, at least the way they are designed right now.
I fixed the problem by accessing counters relative to the CPU which is in a register, avoiding the need for state (even internal state) in the translations.
We should not need to store and reload the counters when entering bintr. Instead we can forward them, and then return them back again by double-returning the counters. It's not guaranteed to be faster than before, but in theory we can at least avoid one load/store, but most likely both counters. Passing PC may not be as useful.