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

wasm->CLIF translation: consistently bitcast V128 values that are blo… #2303

Merged

Commits on Oct 21, 2020

  1. wasm->CLIF translation: consistently bitcast V128 values that are blo…

    …ck formal parameters.
    
    In the current translation of wasm (128-bit) SIMD into CLIF, we work around differences in the
    type system models of wasm vs CLIF by inserting `bitcast` (a no-op cast) CLIF instructions before
    more or less every use of a SIMD value.  Unfortunately this was not being done consistently and
    even small examples with a single if-then-else diamond that produces a SIMD value, could cause a
    verification failure downstream.  In this case, the jump out of the "else" block needed a
    bitcast, but didn't have one.
    
    This patch wraps creation of CLIF jumps and conditional branches up into three functions,
    `canonicalise_then_jump` and `canonicalise_then_br{z,nz}`, and uses them consistently.  They
    first cast the relevant block formal parameters, then generate the relevant kind of branch/jump.
    Hence, provided they are also used consistently in future to generate branches/jumps in this
    file, we are protected against such failures.
    
    The patch also adds a large(ish) comment at the top explaining this in more detail.
    julian-seward1 committed Oct 21, 2020
    Configuration menu
    Copy the full SHA
    db93e13 View commit details
    Browse the repository at this point in the history