Skip to content

Commit

Permalink
Annotate platform specific hardware intrinsics with the ConstExpected…
Browse files Browse the repository at this point in the history
… attribute (#80192)

* Annotate platform specific hardware intrinsics with the ConstExpected attribute

* Remove a 'c' that was accidentally inserted

* Fixing using directives
  • Loading branch information
tannergooding authored Jan 6, 2023
1 parent 7d91fd0 commit e0a6771
Show file tree
Hide file tree
Showing 25 changed files with 2,805 additions and 2,781 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.

#pragma warning disable IDE0060 // unused parameters
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;

namespace System.Runtime.Intrinsics.Arm
Expand Down Expand Up @@ -56,55 +57,55 @@ internal Arm64() { }
/// A32: VSDOT.S8 Dd, Dn, Dm[lane]
/// A64: SDOT Vd.2S, Vn.8B, Vm.4B[lane]
/// </summary>
public static Vector64<int> DotProductBySelectedQuadruplet(Vector64<int> addend, Vector64<sbyte> left, Vector64<sbyte> right, byte rightScaledIndex) { throw new PlatformNotSupportedException(); }
public static Vector64<int> DotProductBySelectedQuadruplet(Vector64<int> addend, Vector64<sbyte> left, Vector64<sbyte> right, [ConstantExpected(Max = (byte)(7))] byte rightScaledIndex) { throw new PlatformNotSupportedException(); }

/// <summary>
/// int32x2_t vdot_laneq_s32 (int32x2_t r, int8x8_t a, int8x16_t b, const int lane)
/// A32: VSDOT.S8 Dd, Dn, Dm[lane]
/// A64: SDOT Vd.2S, Vn.8B, Vm.4B[lane]
/// </summary>
public static Vector64<int> DotProductBySelectedQuadruplet(Vector64<int> addend, Vector64<sbyte> left, Vector128<sbyte> right, byte rightScaledIndex) { throw new PlatformNotSupportedException(); }
public static Vector64<int> DotProductBySelectedQuadruplet(Vector64<int> addend, Vector64<sbyte> left, Vector128<sbyte> right, [ConstantExpected(Max = (byte)(15))] byte rightScaledIndex) { throw new PlatformNotSupportedException(); }

/// <summary>
/// uint32x2_t vdot_lane_u32 (uint32x2_t r, uint8x8_t a, uint8x8_t b, const int lane)
/// A32: VUDOT.U8 Dd, Dn, Dm[lane]
/// A64: UDOT Vd.2S, Vn.8B, Vm.4B[lane]
/// </summary>
public static Vector64<uint> DotProductBySelectedQuadruplet(Vector64<uint> addend, Vector64<byte> left, Vector64<byte> right, byte rightScaledIndex) { throw new PlatformNotSupportedException(); }
public static Vector64<uint> DotProductBySelectedQuadruplet(Vector64<uint> addend, Vector64<byte> left, Vector64<byte> right, [ConstantExpected(Max = (byte)(7))] byte rightScaledIndex) { throw new PlatformNotSupportedException(); }

/// <summary>
/// uint32x2_t vdot_laneq_u32 (uint32x2_t r, uint8x8_t a, uint8x16_t b, const int lane)
/// A32: VUDOT.U8 Dd, Dn, Dm[lane]
/// A64: UDOT Vd.2S, Vn.8B, Vm.4B[lane]
/// </summary>
public static Vector64<uint> DotProductBySelectedQuadruplet(Vector64<uint> addend, Vector64<byte> left, Vector128<byte> right, byte rightScaledIndex) { throw new PlatformNotSupportedException(); }
public static Vector64<uint> DotProductBySelectedQuadruplet(Vector64<uint> addend, Vector64<byte> left, Vector128<byte> right, [ConstantExpected(Max = (byte)(15))] byte rightScaledIndex) { throw new PlatformNotSupportedException(); }

/// <summary>
/// int32x4_t vdotq_laneq_s32 (int32x4_t r, int8x16_t a, int8x16_t b, const int lane)
/// A32: VSDOT.S8 Qd, Qn, Dm[lane]
/// A64: SDOT Vd.4S, Vn.16B, Vm.4B[lane]
/// </summary>
public static Vector128<int> DotProductBySelectedQuadruplet(Vector128<int> addend, Vector128<sbyte> left, Vector128<sbyte> right, byte rightScaledIndex) { throw new PlatformNotSupportedException(); }
public static Vector128<int> DotProductBySelectedQuadruplet(Vector128<int> addend, Vector128<sbyte> left, Vector128<sbyte> right, [ConstantExpected(Max = (byte)(15))] byte rightScaledIndex) { throw new PlatformNotSupportedException(); }

/// <summary>
/// int32x4_t vdotq_lane_s32 (int32x4_t r, int8x16_t a, int8x8_t b, const int lane)
/// A32: VSDOT.S8 Qd, Qn, Dm[lane]
/// A64: SDOT Vd.4S, Vn.16B, Vm.4B[lane]
/// </summary>
public static Vector128<int> DotProductBySelectedQuadruplet(Vector128<int> addend, Vector128<sbyte> left, Vector64<sbyte> right, byte rightScaledIndex) { throw new PlatformNotSupportedException(); }
public static Vector128<int> DotProductBySelectedQuadruplet(Vector128<int> addend, Vector128<sbyte> left, Vector64<sbyte> right, [ConstantExpected(Max = (byte)(7))] byte rightScaledIndex) { throw new PlatformNotSupportedException(); }

/// <summary>
/// uint32x4_t vdotq_laneq_u32 (uint32x4_t r, uint8x16_t a, uint8x16_t b, const int lane)
/// A32: VUDOT.U8 Qd, Qn, Dm[lane]
/// A64: UDOT Vd.4S, Vn.16B, Vm.4B[lane]
/// </summary>
public static Vector128<uint> DotProductBySelectedQuadruplet(Vector128<uint> addend, Vector128<byte> left, Vector128<byte> right, byte rightScaledIndex) { throw new PlatformNotSupportedException(); }
public static Vector128<uint> DotProductBySelectedQuadruplet(Vector128<uint> addend, Vector128<byte> left, Vector128<byte> right, [ConstantExpected(Max = (byte)(15))] byte rightScaledIndex) { throw new PlatformNotSupportedException(); }

/// <summary>
/// uint32x4_t vdotq_lane_u32 (uint32x4_t r, uint8x16_t a, uint8x8_t b, const int lane)
/// A32: VUDOT.U8 Qd, Qn, Dm[lane]
/// A64: UDOT Vd.4S, Vn.16B, Vm.4B[lane]
/// </summary>
public static Vector128<uint> DotProductBySelectedQuadruplet(Vector128<uint> addend, Vector128<byte> left, Vector64<byte> right, byte rightScaledIndex) { throw new PlatformNotSupportedException(); }
public static Vector128<uint> DotProductBySelectedQuadruplet(Vector128<uint> addend, Vector128<byte> left, Vector64<byte> right, [ConstantExpected(Max = (byte)(7))] byte rightScaledIndex) { throw new PlatformNotSupportedException(); }
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;

namespace System.Runtime.Intrinsics.Arm
Expand Down Expand Up @@ -57,55 +58,55 @@ internal Arm64() { }
/// A32: VSDOT.S8 Dd, Dn, Dm[lane]
/// A64: SDOT Vd.2S, Vn.8B, Vm.4B[lane]
/// </summary>
public static Vector64<int> DotProductBySelectedQuadruplet(Vector64<int> addend, Vector64<sbyte> left, Vector64<sbyte> right, byte rightScaledIndex) => DotProductBySelectedQuadruplet(addend, left, right, rightScaledIndex);
public static Vector64<int> DotProductBySelectedQuadruplet(Vector64<int> addend, Vector64<sbyte> left, Vector64<sbyte> right, [ConstantExpected(Max = (byte)(7))] byte rightScaledIndex) => DotProductBySelectedQuadruplet(addend, left, right, rightScaledIndex);

/// <summary>
/// int32x2_t vdot_laneq_s32 (int32x2_t r, int8x8_t a, int8x16_t b, const int lane)
/// A32: VSDOT.S8 Dd, Dn, Dm[lane]
/// A64: SDOT Vd.2S, Vn.8B, Vm.4B[lane]
/// </summary>
public static Vector64<int> DotProductBySelectedQuadruplet(Vector64<int> addend, Vector64<sbyte> left, Vector128<sbyte> right, byte rightScaledIndex) => DotProductBySelectedQuadruplet(addend, left, right, rightScaledIndex);
public static Vector64<int> DotProductBySelectedQuadruplet(Vector64<int> addend, Vector64<sbyte> left, Vector128<sbyte> right, [ConstantExpected(Max = (byte)(15))] byte rightScaledIndex) => DotProductBySelectedQuadruplet(addend, left, right, rightScaledIndex);

/// <summary>
/// uint32x2_t vdot_lane_u32 (uint32x2_t r, uint8x8_t a, uint8x8_t b, const int lane)
/// A32: VUDOT.U8 Dd, Dn, Dm[lane]
/// A64: UDOT Vd.2S, Vn.8B, Vm.4B[lane]
/// </summary>
public static Vector64<uint> DotProductBySelectedQuadruplet(Vector64<uint> addend, Vector64<byte> left, Vector64<byte> right, byte rightScaledIndex) => DotProductBySelectedQuadruplet(addend, left, right, rightScaledIndex);
public static Vector64<uint> DotProductBySelectedQuadruplet(Vector64<uint> addend, Vector64<byte> left, Vector64<byte> right, [ConstantExpected(Max = (byte)(7))] byte rightScaledIndex) => DotProductBySelectedQuadruplet(addend, left, right, rightScaledIndex);

/// <summary>
/// uint32x2_t vdot_laneq_u32 (uint32x2_t r, uint8x8_t a, uint8x16_t b, const int lane)
/// A32: VUDOT.U8 Dd, Dn, Dm[lane]
/// A64: UDOT Vd.2S, Vn.8B, Vm.4B[lane]
/// </summary>
public static Vector64<uint> DotProductBySelectedQuadruplet(Vector64<uint> addend, Vector64<byte> left, Vector128<byte> right, byte rightScaledIndex) => DotProductBySelectedQuadruplet(addend, left, right, rightScaledIndex);
public static Vector64<uint> DotProductBySelectedQuadruplet(Vector64<uint> addend, Vector64<byte> left, Vector128<byte> right, [ConstantExpected(Max = (byte)(15))] byte rightScaledIndex) => DotProductBySelectedQuadruplet(addend, left, right, rightScaledIndex);

/// <summary>
/// int32x4_t vdotq_laneq_s32 (int32x4_t r, int8x16_t a, int8x16_t b, const int lane)
/// A32: VSDOT.S8 Qd, Qn, Dm[lane]
/// A64: SDOT Vd.4S, Vn.16B, Vm.4B[lane]
/// </summary>
public static Vector128<int> DotProductBySelectedQuadruplet(Vector128<int> addend, Vector128<sbyte> left, Vector128<sbyte> right, byte rightScaledIndex) => DotProductBySelectedQuadruplet(addend, left, right, rightScaledIndex);
public static Vector128<int> DotProductBySelectedQuadruplet(Vector128<int> addend, Vector128<sbyte> left, Vector128<sbyte> right, [ConstantExpected(Max = (byte)(15))] byte rightScaledIndex) => DotProductBySelectedQuadruplet(addend, left, right, rightScaledIndex);

/// <summary>
/// int32x4_t vdotq_lane_s32 (int32x4_t r, int8x16_t a, int8x8_t b, const int lane)
/// A32: VSDOT.S8 Qd, Qn, Dm[lane]
/// A64: SDOT Vd.4S, Vn.16B, Vm.4B[lane]
/// </summary>
public static Vector128<int> DotProductBySelectedQuadruplet(Vector128<int> addend, Vector128<sbyte> left, Vector64<sbyte> right, byte rightScaledIndex) => DotProductBySelectedQuadruplet(addend, left, right, rightScaledIndex);
public static Vector128<int> DotProductBySelectedQuadruplet(Vector128<int> addend, Vector128<sbyte> left, Vector64<sbyte> right, [ConstantExpected(Max = (byte)(7))] byte rightScaledIndex) => DotProductBySelectedQuadruplet(addend, left, right, rightScaledIndex);

/// <summary>
/// uint32x4_t vdotq_laneq_u32 (uint32x4_t r, uint8x16_t a, uint8x16_t b, const int lane)
/// A32: VUDOT.U8 Qd, Qn, Dm[lane]
/// A64: UDOT Vd.4S, Vn.16B, Vm.4B[lane]
/// </summary>
public static Vector128<uint> DotProductBySelectedQuadruplet(Vector128<uint> addend, Vector128<byte> left, Vector128<byte> right, byte rightScaledIndex) => DotProductBySelectedQuadruplet(addend, left, right, rightScaledIndex);
public static Vector128<uint> DotProductBySelectedQuadruplet(Vector128<uint> addend, Vector128<byte> left, Vector128<byte> right, [ConstantExpected(Max = (byte)(15))] byte rightScaledIndex) => DotProductBySelectedQuadruplet(addend, left, right, rightScaledIndex);

/// <summary>
/// uint32x4_t vdotq_lane_u32 (uint32x4_t r, uint8x16_t a, uint8x8_t b, const int lane)
/// A32: VUDOT.U8 Qd, Qn, Dm[lane]
/// A64: UDOT Vd.4S, Vn.16B, Vm.4B[lane]
/// </summary>
public static Vector128<uint> DotProductBySelectedQuadruplet(Vector128<uint> addend, Vector128<byte> left, Vector64<byte> right, byte rightScaledIndex) => DotProductBySelectedQuadruplet(addend, left, right, rightScaledIndex);
public static Vector128<uint> DotProductBySelectedQuadruplet(Vector128<uint> addend, Vector128<byte> left, Vector64<byte> right, [ConstantExpected(Max = (byte)(7))] byte rightScaledIndex) => DotProductBySelectedQuadruplet(addend, left, right, rightScaledIndex);
}
}
Loading

0 comments on commit e0a6771

Please sign in to comment.