diff options
| author | Nathan Moinvaziri <nathan@nathanm.com> | 2026-01-31 16:57:24 -0800 |
|---|---|---|
| committer | Hans Kristian Rosbach <hk-github@circlestorm.org> | 2026-02-18 13:57:07 +0100 |
| commit | ee2dd805d6418dee2cce27d6bbef20f400fc934e (patch) | |
| tree | a197707a38a143169bf51e3a73dad97345fdab97 /trees.c | |
| parent | 2f6f0e84571d420edea04cbd5ffbf0a13934a535 (diff) | |
| download | Project-Tick-ee2dd805d6418dee2cce27d6bbef20f400fc934e.tar.gz Project-Tick-ee2dd805d6418dee2cce27d6bbef20f400fc934e.zip | |
Optimize symbol buffer access based on platform unaligned access
Diffstat (limited to 'trees.c')
| -rw-r--r-- | trees.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -730,9 +730,15 @@ static void compress_block(deflate_state *s, const ct_data *ltree, const ct_data dist = d_buf[sx]; lc = l_buf[sx++]; #else - dist = sym_buf[sx++] & 0xff; - dist += (unsigned)(sym_buf[sx++] & 0xff) << 8; - lc = sym_buf[sx++]; +# if OPTIMAL_CMP >= 32 + uint32_t val = Z_U32_FROM_LE(zng_memread_4(&sym_buf[sx])); + dist = val & 0xffff; + lc = (val >> 16) & 0xff; +# else + dist = sym_buf[sx] + ((unsigned)sym_buf[sx + 1] << 8); + lc = sym_buf[sx + 2]; +# endif + sx += 3; #endif if (dist == 0) { zng_emit_lit(s, ltree, lc); |
