Repository navigation
add jp, jnp, jo, jno #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, note that none of the operations that affect parity currently set this flag, so these instructions won't do the right thing 😬
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking into it!
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parity is really annoying because in principle all the arithmetic operations compute it, and then it's almost never actually needed.
Originally what I did in retrowin32 was a hack where if the decoder saw a jp/jnp, it would panic if the previous instruction wasn't some specific thing, so then when it hit the jnp it could retroactively compute parity. (In both links I'm talking about the deleted code)
In my ideal world in theseus we could statically analyze the code enough that we would know when we actually need parity computation or not, similar to this hack but principled and covering all the cases. But I think until we hit that world, just computing parity always (like the added code in the above diff) is probably fine, and I can think of the static analysis thing as an optimization. (Lately I've been working on the static analysis bit of things, which is why I haven't committed to Theseus in a bit!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that Theseus is currently setting this flag at least in some cases? But I might be missing something. My game is using these instructions and seems to be working fully (which is amazing 🤩) so that would point towards that as well, but I'm not to familiar with the code base to say anything for sure yet 😅
https://github.com/search?q=repo%3Aevmar%2Ftheseus+flags.set%28Flags%3A%3APF&type=code
My agent did find another issue when looking into this, which I believe was already fixed later in my branch as well, sending a follow up PR for that now: #21