Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes two critical issues in Paranoid TSO mode: Many applications that work with FEX's default settings would fail to run since TSO emulation wasn't enabled for most instructions. Further complications arose due to indirect memory addressing not being implemented.
A negative (but expected) side effect of fixing these issues is that Paranoid TSO mode will now make emulation unusably slow (>90% performance impact). I'm not sure there are strong enough reasons to keep around the current PTSO approach, so I wrote a patch that implements backpatching-free TSO without requiring excessive signalling. It's not included here since it's a bit more tricky to maintain at the moment, but this current PR will get things back to a functional state at least.
As a small but related side change, I realized that memcpy/memset emit slightly more
nop
s than needed in either TSO mode.Implementation details
The ARM instructions emitted in PTSO mode don't support indirect memory addressing (unlike the instructions emitted with backpatching-based TSO emulation), so the indirect offsets are instead manually computed using
add
.