I read on https://docs.microsoft.com/en-us/dotnet/api/system.numerics.vector-1?view=netcore-3.0 that Vector and Vector multiplications do not map to intrinsics. Experimentation confirmed that.
However, they could simply map to (v)pmulld (when available) and (v)pmullw.
Current workaround:
static Vector<uint> Multiply(Vector<uint> a, Vector<uint> b)
{
return Vector.AsVectorUInt32(Vector.AsVectorInt32(a) * Vector.AsVectorInt32(b));
}
static Vector<ushort> Multiply(Vector<ushort> a, Vector<ushort> b)
{
return Vector.AsVectorUInt16(Vector.AsVectorInt16(a) * Vector.AsVectorInt16(b));
}
byte, sbyte, long and ulong could potentially be supported with multi-operation sequences, which is at least better than calling some scalar fallback, especially for the 8bit cases.
I read on https://docs.microsoft.com/en-us/dotnet/api/system.numerics.vector-1?view=netcore-3.0 that Vector and Vector multiplications do not map to intrinsics. Experimentation confirmed that.
However, they could simply map to
(v)pmulld(when available) and(v)pmullw.Current workaround:
byte, sbyte, long and ulong could potentially be supported with multi-operation sequences, which is at least better than calling some scalar fallback, especially for the 8bit cases.