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

[mono][interp] Add instrinsics for common Vector128 operations #81782

Merged
merged 9 commits into from
Feb 28, 2023

Commits on Feb 6, 2023

  1. Configuration menu
    Copy the full SHA
    c439344 View commit details
    Browse the repository at this point in the history

Commits on Feb 15, 2023

  1. Configuration menu
    Copy the full SHA
    d4eb2aa View commit details
    Browse the repository at this point in the history

Commits on Feb 21, 2023

  1. [mono][interp] Add intrinsics for most common V128 operations

    We add intrinsics for Vector128 intrinsics that are actively used within our bcl.
    
    We declare a set of simd method names, the same way we do it with jit, in `simd-methods.def`. In `transform-simd.c` we lookup method names in the list of supported intrinsics for `Vector128` and `Vector128<T>`. Once we find a supported instrinsic, we generate code for it, typically a `MINT_SIMD_INTRINS_*` opcode. In order to avoid adding too many new opcodes to the interpreter, simd intrinsics are grouped by signature. So all simd intrinsics that receive a single argument and return a value, will be called through `MINT_SIMD_INTRINS_P_P`. This instruction will receive an index to get the intrinsic implementation and calls it indirectly.
    
    Some of the intrinsics are implemented using the standard vector intrinsics, supported by gcc and clang. These do not fully expose the SIMD capabilities, so some intrinsics are implemented naively. This should still be faster than using nonvectorized approach from managed code. In the future we can add better implmentation, on platforms where we have low level support. This would both be faster and reduce code size.
    BrzVlad committed Feb 21, 2023
    Configuration menu
    Copy the full SHA
    7e4a385 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d42c15c View commit details
    Browse the repository at this point in the history
  3. [mono][interp] Disable simd intrinsics by default on wasm

    These intrinsics are not yet implemented on jiterpreter, making it slighty slower instead.
    BrzVlad committed Feb 21, 2023
    Configuration menu
    Copy the full SHA
    f69a049 View commit details
    Browse the repository at this point in the history
  4. [mono][interp] Replace v128_create with v128_ldc if possible

    v128_create receives as an argument every single element of the vector. This method is typically used with constants. For a Vector128<short> this means that creating a constant vector required 8 ldc.i4 and a v128_create. We can instead use a single instruction and embed the vector value in the code stream directly.
    BrzVlad committed Feb 21, 2023
    Configuration menu
    Copy the full SHA
    db74dd5 View commit details
    Browse the repository at this point in the history
  5. [mono][interp] Remove op_Division

    It is actually not used in bcl, it is not really vectorized on any platforms and the codegen for the interp implementation is massive and inefficient.
    BrzVlad committed Feb 21, 2023
    Configuration menu
    Copy the full SHA
    8ffac07 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    629cd94 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    719523d View commit details
    Browse the repository at this point in the history