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

remove unnecessary & ~0x7 #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Validark
Copy link

@Validark Validark commented Jan 3, 2024

It is easy to prove we do not need & ~0x7 because the maximum value it can operate on is 00001000_00000111_00000110_00000101_00000100_00000011_00000010_00000001 >> 53. Since the byte under the most significant byte can be a 7 at most, the upper 3 bits of that second byte are always 0. Therefore we do not need to zero them out.

It is easy to prove we do not need `& ~0x7` because the maximum value it can operate on is `00001000_00000111_00000110_00000101_00000100_00000011_00000010_00000001 >> 53`. Since the byte under the most significant byte can be a 7 at most, the upper 3 bits of that second byte are always 0. Therefore we do not need to zero them out.
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.

1 participant