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

Refactor to improve code size, fix GCC 12 #802

Draft
wants to merge 11 commits into
base: dev
Choose a base branch
from

Commits on Feb 23, 2023

  1. Modernize XXH32/XXH64

     - Fix the state structs to use unsigned char, update names
     - Extract the algorithm steps into inline subroutines
     - Fix a theoretical integer overflow bug
     - Reroll XXH64 on 32-bit (it is going to run like crap anyway)
    easyaspi314 committed Feb 23, 2023
    Configuration menu
    Copy the full SHA
    0a9db72 View commit details
    Browse the repository at this point in the history
  2. Kill XXH_OLD_NAMES

    It's been long enough
    easyaspi314 committed Feb 23, 2023
    Configuration menu
    Copy the full SHA
    810498e View commit details
    Browse the repository at this point in the history
  3. 32-bit size optimizations

     - Add `XXH_32BIT_OPT` which is enabled for targets without 64-bit arithmetic
     - Add a 64-bit only inline hint, apply it to the functions that need them
       - TODO benchmark them more
     - Tail call XXH3_64bits_update instead of inlining XXH3_update
     - Reroll midrange on 32-bit (ARM is the only one that doesn't choke on the 128-bit
       multiplies)
     - Extract the copy-pasted midrange finalization code in XXH128
    easyaspi314 committed Feb 23, 2023
    Configuration menu
    Copy the full SHA
    183d69e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    18e28a9 View commit details
    Browse the repository at this point in the history
  5. Refactor and simplify XXH3_update

    XXH3_consumeStripes can now process multiple blocks, greatly simplifying
    the logic and making it resemble XXH32 and XXH64.
    
    This also reduces code size by a solid amount.
    easyaspi314 committed Feb 23, 2023
    Configuration menu
    Copy the full SHA
    cc4c915 View commit details
    Browse the repository at this point in the history
  6. Add XXH_INLINE, force inline some things on sizeopt

     - XXH_SIZE_OPT now, instead of disabling inline hints, turns off
       *most* inline hints
        - Things like acc512 and utilities remain force inline
     - XXH_FORCE_INLINE now always force inlines for functions that need it.
    easyaspi314 committed Feb 23, 2023
    Configuration menu
    Copy the full SHA
    9b82f8b View commit details
    Browse the repository at this point in the history
  7. Force GCC 12 -O2/-Og to -O3 to fix -Og bug

    Not the best solution, but not force inlining the accumulate functions
    is more of a problem than forcing GCC to -O3.
    easyaspi314 committed Feb 23, 2023
    Configuration menu
    Copy the full SHA
    05a972c View commit details
    Browse the repository at this point in the history
  8. Add unused attribute

    easyaspi314 committed Feb 23, 2023
    Configuration menu
    Copy the full SHA
    e3776e2 View commit details
    Browse the repository at this point in the history
  9. Better 32-bit check

    TIL C90 doesn't have SIZE_MAX.
    easyaspi314 committed Feb 23, 2023
    Configuration menu
    Copy the full SHA
    3778858 View commit details
    Browse the repository at this point in the history
  10. Fix -Wstrict-overflow

    easyaspi314 committed Feb 23, 2023
    Configuration menu
    Copy the full SHA
    c590089 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    98be0b9 View commit details
    Browse the repository at this point in the history