]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Micro-optimization for in pointer calculation for inflate_fast REFILL
authorNathan Moinvaziri <nathan@nathanm.com>
Sat, 6 Dec 2025 03:59:06 +0000 (19:59 -0800)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Mon, 8 Dec 2025 11:58:00 +0000 (12:58 +0100)
trifectatechfoundation/zlib-rs#320

Co-authored-by: Brian Pane <brianp@brianp.net>
inffast_tpl.h

index 4f0ca982733a00ab61df0de3b0c85e13fc882fa9..63d9de04f2709243ae13de92add307023ee8b44c 100644 (file)
@@ -141,8 +141,7 @@ void Z_INTERNAL INFLATE_FAST(PREFIX3(stream) *strm, uint32_t start) {
 
 #define REFILL() do { \
         hold |= load_64_bits(in, bits); \
-        in += 7; \
-        in -= ((bits >> 3) & 7); \
+        in += (63 ^ bits) >> 3; \
         bits |= 56; \
     } while (0)