-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
Cost:SWork that requires one engineer up to 1 weekWork that requires one engineer up to 1 weekarea-System.Numericshelp wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributorstenet-performancePerformance related issuePerformance related issue
Milestone
Description
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.
Metadata
Metadata
Assignees
Labels
Cost:SWork that requires one engineer up to 1 weekWork that requires one engineer up to 1 weekarea-System.Numericshelp wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributorstenet-performancePerformance related issuePerformance related issue