Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Relax verification to allow I8X16 to act as a default vector type #1236

Closed
wants to merge 1 commit into from

Commits on Nov 16, 2019

  1. Relax verification to allow I8X16 to act as a default vector type

    This change allows using I8X16 as a default type to represent Wasm's V128 type. Values of Wasm's V128 type can be used in any instruction of similar width (e.g. `i32x4.add`). Cranelift must build signatures for Wasm functions using V128 and, lacking a special type to do so, Cranelift uses I8X16 for V128. To avoid excessive bitcasting, however, we relax the verifier to allow I8X16 to type-check as the other 128-bit types. This implies that:
     - SIMD instructions must have explicit types (e.g. iadd.i32x4) to avoid type inference deciding a wrong type and emitting the wrong instruction
     - The verifier will be unable to catch unintended errors in sequences like: `v1 = iadd.i8x16 v0, v0; v2 = isub.i32x4 v1, v0` (presumably we want v0 and v1 to be I8X16 in fact and would want the verifier to tell us that we should not add them as I32X4s).
    abrown committed Nov 16, 2019
    Configuration menu
    Copy the full SHA
    d4c197e View commit details
    Browse the repository at this point in the history