-
Notifications
You must be signed in to change notification settings - Fork 87
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
WDCM and WQCM: reset $of and $err #844
Conversation
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.
It would be nice to add a test case for it
Yes, I'm just not sure how, I could not find where we test the opcodes in the source |
4 Tests added, one for each possible combination of operand size and register to be checked). |
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.
Good test structure. I had some small suggestions, and the changelog needs fixing, but other than that seems good to go.
*of = 0; | ||
*err = 0; |
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.
If I remove these lines, tests still passes
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.
Can confirm, but I don't have any idea why.
I have checked, and log does not reset the registers, so the only option is that the registers are reset already somewhere while executing the wideint compare instruction. Will check more in depth
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.
It's because code generated by make_u128
and make_u256
used in the tests reset $err
and $of
as they use movi
internally.
You should first create all values, and only after that call the opcodes that access flags.
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 wish I looked at this comment three hours ago :)
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.
fixed tests in 18b6008 and verified that they fail before applying the changes to the wideint cmp alu operation
6ba6181
to
025dad3
Compare
[Link to related issue(s) here, if any]
Closes #791
[Short description of the changes.]
The specification requires that WDCM and WDQCM reset the $of and $err registers, but this was not the case.
Questions:
Checklist
Before requesting review
After merging, notify other teams
[Add or remove entries as needed]