-
-
Notifications
You must be signed in to change notification settings - Fork 828
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
optimize ceil32 #2771
optimize ceil32 #2771
Conversation
down from 9 to 6 instructions (all G_low) also optimize out a couple instances of ceil32
Codecov Report
@@ Coverage Diff @@
## master #2771 +/- ##
==========================================
- Coverage 87.44% 87.41% -0.03%
==========================================
Files 93 93
Lines 9945 9949 +4
Branches 2471 2472 +1
==========================================
+ Hits 8696 8697 +1
- Misses 782 785 +3
Partials 467 467
Continue to review full report at Codecov.
|
@@ -876,7 +877,8 @@ def zero_pad(bytez_placeholder): | |||
# the actual value of X as a byte sequence, | |||
# followed by the *minimum* number of zero-bytes | |||
# such that len(enc(X)) is a multiple of 32. | |||
num_zero_bytes = ["sub", ["ceil32", "len"], "len"] | |||
# optimized form of ceil32(len) - len: | |||
num_zero_bytes = ["and", 31, ["sub", 0, "len"]] |
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.
So cool !!!!
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.
🚀
down from 9 to 6 instructions (all G_low)
also optimize out a couple instances of ceil32
What I did
steal a couple easy optimizations out of #2647
How I did it
note that
ceil32(x) == floor32(x + 31)
How to verify it
tests still pass
Commit message
Description for the changelog
Cute Animal Picture