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

Support for a scalable simd representation #118917

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from

Commits on Jul 24, 2024

  1. Prototype of scalable vectors

    The representation of the element type has been changed to be a slice
    rather than a zero length array. Two feature gates are now required in
    core_arch unsized fn params and unsized locals.
    
    This still leaves unsized return types being an issue. For this we are
    currently bypassing some of the `Sized` trait checking to pass when
    the type is scalable simd.
    
    This still leaves the copy issue. For that we have marked scalable
    simd types as trivally pure clone copy. We have still had to remove
    some trait checks for the copy trait with this though as they are
    still performed in certain situations.
    
    The implementation of `transmute` is also an issue for us. For this a
    new SIMD intrinsic has been created simd_reinterpret which performs a
    transmute on SIMD vectors. A few intrinsics need to be able to produce
    an LLVM `undef` this intrinsic will also produce that when given a
    zero sized input.
    JamieCunliffe committed Jul 24, 2024
    Configuration menu
    Copy the full SHA
    aee9788 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6624e8a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5869f9d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    0324ff4 View commit details
    Browse the repository at this point in the history
  5. Restrict the spilling of scalable types to the problematic ones.

    Rather than not spilling any scalable SIMD types for debug info, we
    only avoid spilling the ones that are going to cause a problem.
    Currently the only ones known to cause a problem are the internal
    svbool types for AArch64.
    JamieCunliffe committed Jul 24, 2024
    Configuration menu
    Copy the full SHA
    0a956db View commit details
    Browse the repository at this point in the history
  6. Scalable SIMD tests for disallowing scalable types in types.

    Tests to ensure that scalable SIMD types can't exist in
    struct, union, enum variants and compound types.
    
    This also changes the well formed checking of types to improve the
    error message when scalable SIMD types are included. The previous
    implementation would also allow a scalable SIMD type as the last
    element within a struct in some cases which we currently don't want to
    allow.
    JamieCunliffe committed Jul 24, 2024
    Configuration menu
    Copy the full SHA
    c4f8a92 View commit details
    Browse the repository at this point in the history
  7. Allow SVE types to be taken by reference.

    Ensures that an SVE type can have a reference taken to it. This
    currently emits a `dereferenceable` attribute for the ptr using the
    element size as the number of bytes. While not perfect this is correct
    as a vector will always have a least one primitive.
    JamieCunliffe committed Jul 24, 2024
    Configuration menu
    Copy the full SHA
    dace184 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    d5834cc View commit details
    Browse the repository at this point in the history
  9. Don't require the user to enable the unsized features.

    Rather than forcing the user to enable the unsized_fn_params and
    unsized_locals features, we condition those features tests with if the
    type is a scalable simd type.
    JamieCunliffe committed Jul 24, 2024
    Configuration menu
    Copy the full SHA
    e237c35 View commit details
    Browse the repository at this point in the history
  10. Fix up style review comments.

    Add some comments explaining some not so obvious things.
    Mark code as unreachable on architectures that don't currently have
    scalable vectors.
    Remove some unused (and incorrect) checks that were being performed.
    Refactor some code to improve it's readability.
    JamieCunliffe committed Jul 24, 2024
    Configuration menu
    Copy the full SHA
    e23a944 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    1adf6ca View commit details
    Browse the repository at this point in the history
  12. Disallow scalable vectors in async fn.

    Scalable vectors are unsized types so we can't hold them across an
    await point.
    
    Also clean up the tests to remove unsized features from tests as a
    user shouldn't have to enable them when using scalable vectors.
    JamieCunliffe committed Jul 24, 2024
    Configuration menu
    Copy the full SHA
    f18804e View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    63f9d37 View commit details
    Browse the repository at this point in the history