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 bit handling in archive_compressor_xz_init_stream #1990
base: master
Are you sure you want to change the base?
Conversation
ce5bea2
to
89b3756
Compare
1538e86
to
5f0178f
Compare
@evelikov Done! |
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.
Even without the optimisation bits, the commit does a good job and fixing the respective types.
The spec has a lot of "undefined" mentions when dealing with signed ints, shifts and alike.
Thanks o/
ee5d726
to
32549e3
Compare
@AtariDreams the extra changes that got squashed a few minutes ago do not belong to this MR. |
My bad |
@@ -209,7 +209,7 @@ peek_at_header(struct archive_read_filter *filter, int *pbits, | |||
} | |||
|
|||
/* Optional header CRC */ | |||
if ((header_flags & 2)) { | |||
if (header_flags & 2) { |
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.
The extra parentheses are needed here. That's used by several C compilers to indicate that you're doing a boolean check.
As @evelikov mentioned, we'd appreciate any measurements that would show the performance improvement here. Generally, we prefer to not have different code paths for different platforms unless it's necessary or provides significant performance gains. Having lots of |
Add intrin.h for _BitScanReverse. This makes the operations being done much clearer and also faster as well.
Add intrin.h for _BitScanReverse. This makes the operations being done much clearer and also faster as well.