Skip to content

[API Proposal]: Arm64 SVE: Add LoadAndReplicateToVector for SVE #116006

Open
@a74nh

Description

@a74nh

Currently there is no obvious way to load a scalar and duplicate it across a vector in SVE. The closest we current have is something similar to:

Vector<uint> vec = Sve.DuplicateSelectedScalarToVector(Sve.LoadVectorNonFaulting(Sve.CreateTrueMaskUInt32(), input), 0);

This is not ideal as it has to load a full vector.

API suggestion:

/// T: float, double, sbyte, short, int, long, byte, ushort, uint, ulong
public static unsafe Vector<T> DuplicateSelectedScalarToVector(Vector<T> mask, T* address); // ld1rb ld1rd ld1rh ld1rsb ld1rsh ld1rsw ld1rw

SVE does not have variants for float, double, long. I assume we can just use the unsigned versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions