Skip to content
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

Fix u32 assembly parsers for shift/rotate ops to allow b = 0 #92

Merged
merged 1 commit into from
Feb 2, 2022

Conversation

willyrgf
Copy link
Contributor

@willyrgf willyrgf commented Feb 2, 2022

As described in #76, fix the parsers parse_u32shl, parse_u32shr, parse_u32rotl, parse_u32rotr for shift/rotate ops to allow parameter value of 0 <= b <= 31, according to the assembly specs. Also, adjusted the tests to this parsers added in #75 to validate the new enforcing parameter bounds.

Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Looks good. A couple of minor comments in-line.

Also, I'd prefer to make a single commit for this (rather than 4).

processor/src/tests/u32_ops.rs Show resolved Hide resolved
processor/src/tests/u32_ops.rs Outdated Show resolved Hide resolved
@bobbinth
Copy link
Contributor

bobbinth commented Feb 2, 2022

Oh - and one other thing: could you make sure rustfmt checks pass? You can do this by running:

cargo fix --allow-staged --allow-dirty --all-targets && cargo fmt && cargo clippy

(that's for linux/macos, on windows the syntax might be slightly different)

@willyrgf willyrgf force-pushed the pr/shift-rotate-ops branch 3 times, most recently from 2f17f41 to 8a28195 Compare February 2, 2022 11:48
@willyrgf
Copy link
Contributor Author

willyrgf commented Feb 2, 2022

Thank you! Looks good. A couple of minor comments in-line.

Also, I'd prefer to make a single commit for this (rather than 4).

Yes, I usually use squash commits in the "PR", but I don't know if github have this feature.

Done.

@willyrgf
Copy link
Contributor Author

willyrgf commented Feb 2, 2022

Oh - and one other thing: could you make sure rustfmt checks pass? You can do this by running:

cargo fix --allow-staged --allow-dirty --all-targets && cargo fmt && cargo clippy

(that's for linux/macos, on windows the syntax might be slightly different)

That's passing now! Nice to know about that, already save it here.

according in the specs

fix: parse_u32shl and the test according the spec to allow value b = 0

fix: parse_u32shr and the test according the spec to allow value b = 0

fix: parse_u32rotl and the test according the spec to allow value b = 0

fix: parse_u32rotr and the tests according the spec to allow value b = 0

mend
Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants