Skip to content

Commit

Permalink
Add DotProduct() and DotProductBySelectedScalar() APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
kunalspathak committed May 13, 2024
1 parent f3b4f4a commit be2b75f
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1160,6 +1160,60 @@ internal Arm64() { }
/// </summary>
public static unsafe Vector<double> Divide(Vector<double> left, Vector<double> right) { throw new PlatformNotSupportedException(); }


/// DotProduct : Dot product

/// <summary>
/// svint32_t svdot[_s32](svint32_t op1, svint8_t op2, svint8_t op3)
/// SDOT Ztied1.S, Zop2.B, Zop3.B
/// </summary>
public static unsafe Vector<int> DotProduct(Vector<int> addend, Vector<sbyte> left, Vector<sbyte> right) { throw new PlatformNotSupportedException(); }

/// <summary>
/// svint64_t svdot[_s64](svint64_t op1, svint16_t op2, svint16_t op3)
/// SDOT Ztied1.D, Zop2.H, Zop3.H
/// </summary>
public static unsafe Vector<long> DotProduct(Vector<long> addend, Vector<short> left, Vector<short> right) { throw new PlatformNotSupportedException(); }

/// <summary>
/// svuint32_t svdot[_u32](svuint32_t op1, svuint8_t op2, svuint8_t op3)
/// UDOT Ztied1.S, Zop2.B, Zop3.B
/// </summary>
public static unsafe Vector<uint> DotProduct(Vector<uint> addend, Vector<byte> left, Vector<byte> right) { throw new PlatformNotSupportedException(); }

/// <summary>
/// svuint64_t svdot[_u64](svuint64_t op1, svuint16_t op2, svuint16_t op3)
/// UDOT Ztied1.D, Zop2.H, Zop3.H
/// </summary>
public static unsafe Vector<ulong> DotProduct(Vector<ulong> addend, Vector<ushort> left, Vector<ushort> right) { throw new PlatformNotSupportedException(); }


/// DotProductBySelectedScalar : Dot product

/// <summary>
/// svint32_t svdot_lane[_s32](svint32_t op1, svint8_t op2, svint8_t op3, uint64_t imm_index)
/// SDOT Ztied1.S, Zop2.B, Zop3.B[imm_index]
/// </summary>
public static unsafe Vector<int> DotProductBySelectedScalar(Vector<int> addend, Vector<sbyte> left, Vector<sbyte> right, [ConstantExpected] byte rightIndex) { throw new PlatformNotSupportedException(); }

/// <summary>
/// svint64_t svdot_lane[_s64](svint64_t op1, svint16_t op2, svint16_t op3, uint64_t imm_index)
/// SDOT Ztied1.D, Zop2.H, Zop3.H[imm_index]
/// </summary>
public static unsafe Vector<long> DotProductBySelectedScalar(Vector<long> addend, Vector<short> left, Vector<short> right, [ConstantExpected] byte rightIndex) { throw new PlatformNotSupportedException(); }

/// <summary>
/// svuint32_t svdot_lane[_u32](svuint32_t op1, svuint8_t op2, svuint8_t op3, uint64_t imm_index)
/// UDOT Ztied1.S, Zop2.B, Zop3.B[imm_index]
/// </summary>
public static unsafe Vector<uint> DotProductBySelectedScalar(Vector<uint> addend, Vector<byte> left, Vector<byte> right, [ConstantExpected] byte rightIndex) { throw new PlatformNotSupportedException(); }

/// <summary>
/// svuint64_t svdot_lane[_u64](svuint64_t op1, svuint16_t op2, svuint16_t op3, uint64_t imm_index)
/// UDOT Ztied1.D, Zop2.H, Zop3.H[imm_index]
/// </summary>
public static unsafe Vector<ulong> DotProductBySelectedScalar(Vector<ulong> addend, Vector<ushort> left, Vector<ushort> right, [ConstantExpected] byte rightIndex) { throw new PlatformNotSupportedException(); }

/// FusedMultiplyAdd : Multiply-add, addend first

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1217,6 +1217,59 @@ internal Arm64() { }
/// </summary>
public static unsafe Vector<double> Divide(Vector<double> left, Vector<double> right) => Divide(left, right);

/// DotProduct : Dot product

/// <summary>
/// svint32_t svdot[_s32](svint32_t op1, svint8_t op2, svint8_t op3)
/// SDOT Ztied1.S, Zop2.B, Zop3.B
/// </summary>
public static unsafe Vector<int> DotProduct(Vector<int> addend, Vector<sbyte> left, Vector<sbyte> right) => DotProduct(addend, left, right);

/// <summary>
/// svint64_t svdot[_s64](svint64_t op1, svint16_t op2, svint16_t op3)
/// SDOT Ztied1.D, Zop2.H, Zop3.H
/// </summary>
public static unsafe Vector<long> DotProduct(Vector<long> addend, Vector<short> left, Vector<short> right) => DotProduct(addend, left, right);

/// <summary>
/// svuint32_t svdot[_u32](svuint32_t op1, svuint8_t op2, svuint8_t op3)
/// UDOT Ztied1.S, Zop2.B, Zop3.B
/// </summary>
public static unsafe Vector<uint> DotProduct(Vector<uint> addend, Vector<byte> left, Vector<byte> right) => DotProduct(addend, left, right);

/// <summary>
/// svuint64_t svdot[_u64](svuint64_t op1, svuint16_t op2, svuint16_t op3)
/// UDOT Ztied1.D, Zop2.H, Zop3.H
/// </summary>
public static unsafe Vector<ulong> DotProduct(Vector<ulong> addend, Vector<ushort> left, Vector<ushort> right) => DotProduct(addend, left, right);


/// DotProductBySelectedScalar : Dot product

/// <summary>
/// svint32_t svdot_lane[_s32](svint32_t op1, svint8_t op2, svint8_t op3, uint64_t imm_index)
/// SDOT Ztied1.S, Zop2.B, Zop3.B[imm_index]
/// </summary>
public static unsafe Vector<int> DotProductBySelectedScalar(Vector<int> addend, Vector<sbyte> left, Vector<sbyte> right, [ConstantExpected] byte rightIndex) => DotProductBySelectedScalar(addend, left, right, rightIndex);

/// <summary>
/// svint64_t svdot_lane[_s64](svint64_t op1, svint16_t op2, svint16_t op3, uint64_t imm_index)
/// SDOT Ztied1.D, Zop2.H, Zop3.H[imm_index]
/// </summary>
public static unsafe Vector<long> DotProductBySelectedScalar(Vector<long> addend, Vector<short> left, Vector<short> right, [ConstantExpected] byte rightIndex) => DotProductBySelectedScalar(addend, left, right, rightIndex);

/// <summary>
/// svuint32_t svdot_lane[_u32](svuint32_t op1, svuint8_t op2, svuint8_t op3, uint64_t imm_index)
/// UDOT Ztied1.S, Zop2.B, Zop3.B[imm_index]
/// </summary>
public static unsafe Vector<uint> DotProductBySelectedScalar(Vector<uint> addend, Vector<byte> left, Vector<byte> right, [ConstantExpected] byte rightIndex) => DotProductBySelectedScalar(addend, left, right, rightIndex);

/// <summary>
/// svuint64_t svdot_lane[_u64](svuint64_t op1, svuint16_t op2, svuint16_t op3, uint64_t imm_index)
/// UDOT Ztied1.D, Zop2.H, Zop3.H[imm_index]
/// </summary>
public static unsafe Vector<ulong> DotProductBySelectedScalar(Vector<ulong> addend, Vector<ushort> left, Vector<ushort> right, [ConstantExpected] byte rightIndex) => DotProductBySelectedScalar(addend, left, right, rightIndex);

/// FusedMultiplyAdd : Multiply-add, addend first

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4322,9 +4322,20 @@ internal Arm64() { }
public static System.Numerics.Vector<byte> CreateWhileLessThanOrEqualMask8Bit(long left, long right) { throw null; }
public static System.Numerics.Vector<byte> CreateWhileLessThanOrEqualMask8Bit(uint left, uint right) { throw null; }
public static System.Numerics.Vector<byte> CreateWhileLessThanOrEqualMask8Bit(ulong left, ulong right) { throw null; }

public static System.Numerics.Vector<float> Divide(System.Numerics.Vector<float> left, System.Numerics.Vector<float> right) { throw null; }
public static System.Numerics.Vector<double> Divide(System.Numerics.Vector<double> left, System.Numerics.Vector<double> right) { throw null; }

public static System.Numerics.Vector<int> DotProduct(System.Numerics.Vector<int> addend, System.Numerics.Vector<sbyte> left, System.Numerics.Vector<sbyte> right) { throw null; }
public static System.Numerics.Vector<long> DotProduct(System.Numerics.Vector<long> addend, System.Numerics.Vector<short> left, System.Numerics.Vector<short> right) { throw null; }
public static System.Numerics.Vector<uint> DotProduct(System.Numerics.Vector<uint> addend, System.Numerics.Vector<byte> left, System.Numerics.Vector<byte> right) { throw null; }
public static System.Numerics.Vector<ulong> DotProduct(System.Numerics.Vector<ulong> addend, System.Numerics.Vector<ushort> left, System.Numerics.Vector<ushort> right) { throw null; }

public static System.Numerics.Vector<int> DotProductBySelectedScalar(System.Numerics.Vector<int> addend, System.Numerics.Vector<sbyte> left, System.Numerics.Vector<sbyte> right, [ConstantExpected] byte rightIndex) { throw null; }
public static System.Numerics.Vector<long> DotProductBySelectedScalar(System.Numerics.Vector<long> addend, System.Numerics.Vector<short> left, System.Numerics.Vector<short> right, [ConstantExpected] byte rightIndex) { throw null; }
public static System.Numerics.Vector<uint> DotProductBySelectedScalar(System.Numerics.Vector<uint> addend, System.Numerics.Vector<byte> left, System.Numerics.Vector<byte> right, [ConstantExpected] byte rightIndex) { throw null; }
public static System.Numerics.Vector<ulong> DotProductBySelectedScalar(System.Numerics.Vector<ulong> addend, System.Numerics.Vector<ushort> left, System.Numerics.Vector<ushort> right, [ConstantExpected] byte rightIndex) { throw null; }

public static System.Numerics.Vector<double> FusedMultiplyAdd(System.Numerics.Vector<double> addend, System.Numerics.Vector<double> left, System.Numerics.Vector<double> right) { throw null; }
public static System.Numerics.Vector<float> FusedMultiplyAdd(System.Numerics.Vector<float> addend, System.Numerics.Vector<float> left, System.Numerics.Vector<float> right) { throw null; }
public static System.Numerics.Vector<double> FusedMultiplyAddBySelectedScalar(System.Numerics.Vector<double> addend, System.Numerics.Vector<double> left, System.Numerics.Vector<double> right, [ConstantExpected] byte rightIndex) { throw null; }
Expand Down

0 comments on commit be2b75f

Please sign in to comment.