Open
Description
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.