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

cranelift: Optimize __multi3-style multiplications #8653

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on May 19, 2024

  1. cranelift: Optimize __multi3-style multiplications

    LLVM's `__multi3` function works by splitting a wide multiplication into
    several narrower ones. This optimization recognizes the algebraic
    identities involved and merges them back into the original wide
    multiply.
    
    This is not yet done but illustrates how part of the optimization can
    work, at least.
    
    Currently, the lower half of the result is optimized into a single
    `imul` instruction, but most of the intermediate values that are
    optimized away there are still used in computing the upper half, so
    elaboration brings them back later.
    
    Fixes bytecodealliance#4077
    jameysharp committed May 19, 2024
    Configuration menu
    Copy the full SHA
    2713ce9 View commit details
    Browse the repository at this point in the history