Skip to content

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