Repository navigation
Closed
Labels
api-approvedAPI was approved in API review, it can be implementedarch-arm64area-System.Runtime.Intrinsicsarm-sveWork related to arm64 SVE/SVE2 support
Milestone
Description
The following was approved for SVE AES in #94423
namespace System.Runtime.Intrinsics.Arm;
/// VectorT Summary
public abstract class SveAes : AdvSimd /// Feature: FEAT_SVE_AES
{
public static unsafe Vector<byte> InverseMixColumns(Vector<byte> value); // AESIMC
public static unsafe Vector<byte> MixColumns(Vector<byte> value); // AESMC
public static unsafe Vector<byte> Decrypt(Vector<byte> left, Vector<byte> right); // AESD
public static unsafe Vector<byte> Encrypt(Vector<byte> left, Vector<byte> right); // AESE
public static unsafe Vector<ulong> PolynomialMultiplyWideningEven(Vector<ulong> left, Vector<ulong> right); // PMULLB
public static unsafe Vector<ulong> PolynomialMultiplyWideningOdd(Vector<ulong> left, Vector<ulong> right); // PMULLT
}
/// total method signatures: 6There are three issues with these APIs
1:
The APIs do no need to be marked unsafe
2:
The names of the Decrypt/Encrypt arguments should be changed to match the existing Advsimd AES APIs:
public static Vector<byte> Decrypt(Vector<byte> value, Vector<byte> roundKey); // AESD
public static Vector<byte> Encrypt(Vector<byte> value, Vector<byte> roundKey); // AESE3:
The argument types for the Polynomial functions are wrong. The forms of the instructions are:
PMULLB Zresult.H, Zop1.B, Zop2.B
PMULLB Zresult.D, Zop1.S, Zop2.S
PMULLT Zresult.H, Zop1.B, Zop2.B
PMULLT Zresult.D, Zop1.S, Zop2.S
Therefore the APIs should be:
public static Vector<ushort> PolynomialMultiplyWideningEven(Vector<byte> left, Vector<byte> right)
public static Vector<ulong> PolynomialMultiplyWideningEven(Vector<uint> left, Vector<uint> right)
public static Vector<ushort> PolynomialMultiplyWideningOdd(Vector<byte> left, Vector<byte> right)
public static Vector<ulong> PolynomialMultiplyWideningOdd(Vector<uint> left, Vector<uint> right)These changes have been made in the implementation in #130859
The final suggested API is:
namespace System.Runtime.Intrinsics.Arm;
/// VectorT Summary
public abstract class SveAes : AdvSimd /// Feature: FEAT_SVE_AES
{
public static Vector<byte> InverseMixColumns(Vector<byte> value); // AESIMC
public static Vector<byte> MixColumns(Vector<byte> value); // AESMC
public static Vector<byte> Decrypt(Vector<byte> value, Vector<byte> roundKey); // AESD
public static Vector<byte> Encrypt(Vector<byte> value, Vector<byte> roundKey); // AESE
public static Vector<ushort> PolynomialMultiplyWideningEven(Vector<byte> left, Vector<byte> right); // PMULLB
public static Vector<ulong> PolynomialMultiplyWideningEven(Vector<uint> left, Vector<uint> right); // PMULLB
public static Vector<ushort> PolynomialMultiplyWideningOdd(Vector<byte> left, Vector<byte> right); // PMULLT
public static Vector<ulong> PolynomialMultiplyWideningOdd(Vector<uint> left, Vector<uint> right); // PMULLT
}
/// total method signatures: 8Metadata
Metadata
Assignees
Labels
api-approvedAPI was approved in API review, it can be implementedarch-arm64area-System.Runtime.Intrinsicsarm-sveWork related to arm64 SVE/SVE2 support
Activity
dotnet-policy-service commentedon Jul 22, 2026
Tagging subscribers to this area: @dotnet/area-system-runtime-intrinsics
See info in area-owners.md if you want to be subscribed.
bartonjs commentedon Aug 11, 2026
Video
Looks good as proposed.
tannergooding commentedon Aug 11, 2026
@a74nh this is already implemented and so was just signing-off on the consistency improvements and can be closed, right?
a74nh commentedon Aug 12, 2026
I should have removed the ready-to-review tag last week.
From the reviews on #130859, the following needs to change:
PolynomialMultiplyWidenings are technically part ofFEAT_SVE_PMULL128so need moving to aSvePmull128.Vector<ulong>is correct forPolynomialMultiplyWidening- the byte/uint versions are the SVE2 variations.I'd recommend we discuss in #130859