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

bc7enc: Optimize "find approximate selector" branch chains #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Sep 24, 2024

  1. bc7enc: Optimize "find approximate selector" branch chains

    Several BC7 code paths have branch chains which sequentially
    compare a value against an array of thresholds. These chains
    are long enough that compilers have trouble converting them to
    branchless operations.
    
    In all of these code paths, the value produced by the branch chain
    is a direct dependency of of the subsequent code. This often results
    in a pipeline stall, because the branches can't be easily predicted.
    
    To improve this, convert each branch chain to a branchless loop.
    Compiler optimizations will inline and unroll the loop, significantly
    improving the codgen in these code paths and making room for further
    compiler optimizations (such as auto-vectorization).
    abbriggs committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    1d28e49 View commit details
    Browse the repository at this point in the history