Skip to content
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

Inflate fast NEON optimization #345

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Apr 5, 2018

  1. Porting inflate using wider loads and stores

    In inflate_fast() the output pointer always has plenty of room to write. This
    means that so long as the target is capable, wide un-aligned loads and stores
    can be used to transfer several bytes at once. When the reference distance is
    too short simply unroll the data a little to increase the distance.
    
    For reference, please see:
    https://chromium.googlesource.com/chromium/src/+/78104f4d73e3bbb4155fa804d00ed66682180556
    ps: this is still missing the fix for inflate_back corner case.
    
    Change-Id: I5216424ab584e069b77ddf04000a313d5ca99839
    Adenilson Cavalcanti committed Apr 5, 2018
    Configuration menu
    Copy the full SHA
    390b271 View commit details
    Browse the repository at this point in the history
  2. Port Fix InflateBack corner case

    This handles the case where a zlib user could rely on InflateBack
    API to decompress content.
    
    The NEON optimization assumes that it can perform wide stores, sometimes
    overwriting data on the output pointer (but never overflowing the buffer
    end as it has enough room for the write).
    
    For infback there is no such guarantees (i.e. no extra wiggle room),
    which can result in illegal operations. This patch fixes the potential
    issue by falling back to the non-optimized code for such cases.
    
    Also it adds some comments about the entry assumptions in inflate and
    writes out a defined value at the write buffer to identify where
    the real data has ended (helpful while debugging).
    
    For reference, please see:
    https://chromium.googlesource.com/chromium/src/+/0bb11040792edc5b28fcb710fc4c01fedd98c97c
    
    Change-Id: Iffbda9eb5e08a661aa15c6e3d1c59b678cc23b2c
    Adenilson Cavalcanti committed Apr 5, 2018
    Configuration menu
    Copy the full SHA
    267e6f2 View commit details
    Browse the repository at this point in the history