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

[BasicCABI] Pass compiler-rt 128-bit return values in memory #223

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

Commits on Mar 19, 2024

  1. [BasicCABI] Pass compiler-rt 128-bit return values in memory

    Currently our LLVM Wasm backend returns 128-bit values as two `i64`s in
    case multivalue is enabled:
    https://github.com/llvm/llvm-project/blob/a5f576e5961ecc099bd7ccf8565da090edc84b0d/llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp#L697-L700
    
    But given that neither emscripten nor wasm-sdk seem to provide a
    multivalue version of compiler-rt, it looks this has not been working so
    far and the reason we haven't heard complaints was likely that no one
    was using compiler-rt with multivalue enabled.
    
    Maintaining and providing two different versions of compiler-rt is a
    cumbersome thing for toolchains, and emscripten already has to provide
    multiple versions of many libraries (e.g. threaded vs. non-threaded,
    debug vs. release, exception-enabled vs. disabled, ...).
    
    Also enabling the multivalue return on several compiler-rt functions
    that have a 128-bit return value wouldn't affect performance in a
    meaningful way, given that there are not many of them.
    
    I had a chance to chat with several people who contribute here offline
    this morning, and it looked we agreed that there is not much benefit to
    enabling multivalue return in compiler-rt functions. One thing I'm not
    sure is whether we decided to disable 128-bit multivalue returns for
    only compiler-rt functions or for all user functions. This PR currently
    says we do that only for compiler-rt; please let me know if you think we
    should do otherwise.
    aheejin committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    2695827 View commit details
    Browse the repository at this point in the history