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

Merge I128/Ixx and U128/Uxx variants #323

Merged
merged 5 commits into from
Jan 4, 2021
Merged

Conversation

Sh3Rm4n
Copy link
Contributor

@Sh3Rm4n Sh3Rm4n commented Dec 20, 2020

Closes #314

Also lift 32 bit range for bitfields introduced in #13
Could be split into another PR, if concerns are raised.

@Sh3Rm4n Sh3Rm4n changed the title Merge I128/Ixx and U28/Uxx variants Merge I128/Ixx and U128/Uxx variants Dec 20, 2020
@Sh3Rm4n Sh3Rm4n force-pushed the u128i128 branch 2 times, most recently from 017784b to 330cd0a Compare December 20, 2020 23:38
@jonas-schievink
Copy link
Contributor

Looks reasonable, thanks!

I think we should add a QEMU test for the larger bitfield range.

Range is exclusive. To match the MSB 32 for `range.end` has to be
allowed.
#[clippy(warn::or_fun_call)]
@Sh3Rm4n
Copy link
Contributor Author

Sh3Rm4n commented Dec 21, 2020

I've added a qemu test and as it showed, some more places had to be changed to support 128 bitfields.

I've also added ascii hint support for bitfields :)

@japaric japaric self-assigned this Jan 4, 2021
@@ -1608,6 +1621,31 @@ mod tests {
);
}

#[test]
fn bitfields_u128() {
Copy link
Member

Choose a reason for hiding this comment

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

I was a bit surprised about this test because expected that {0=119..124:b} is encoded as 2 bytes instead of as 16 bytes. After checking locally, this test also works if I remove the last 14 bytes. It would be nice to make decode_and_expect check that the input data was fully consumed to ensure we are not passing extra bytes that will be ignored.

Copy link
Member

@japaric japaric left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. This looks good!

@japaric
Copy link
Member

japaric commented Jan 4, 2021

bors r+

bors bot added a commit that referenced this pull request Jan 4, 2021
323: Merge I128/Ixx and U128/Uxx variants r=japaric a=Sh3Rm4n

Closes #314 

Also lift 32 bit range for bitfields introduced in #13
Could be split into another PR, if concerns are raised.

Co-authored-by: Fabian Viöl <f.vioel@googlemail.com>
@bors
Copy link
Contributor

bors bot commented Jan 4, 2021

Build failed:

@japaric
Copy link
Member

japaric commented Jan 4, 2021

CI should be fixed now
bors retry

@bors
Copy link
Contributor

bors bot commented Jan 4, 2021

Build succeeded:

@bors bors bot merged commit 41a5937 into knurling-rs:main Jan 4, 2021
@Sh3Rm4n Sh3Rm4n deleted the u128i128 branch January 4, 2021 19:07
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.

Merge I128/Ixx and U28/Uxx variants
3 participants