Repository navigation
Closed
Labels
api-approvedAPI was approved in API review, it can be implementedarch-arm64area-System.Runtime.Intrinsics
Milestone
Description
namespace System.Runtime.Intrinsics.Arm
{
public static class AdvSimd
{
// LDP
public static unsafe (Vector64<byte>, Vector64<byte>) LoadPairVector64(byte* address);
public static unsafe (Vector64<sbyte>, Vector64<sbyte>) LoadPairVector64(sbyte* address);
public static unsafe (Vector64<short>, Vector64<short>) LoadPairVector64(short* address);
public static unsafe (Vector64<ushort>, Vector64<ushort>) LoadPairVector64(ushort* address);
public static unsafe (Vector64<int>, Vector64<int>) LoadPairVector64(int* address);
public static unsafe (Vector64<uint>, Vector64<uint>) LoadPairVector64(uint* address);
public static unsafe (Vector64<float>, Vector64<float>) LoadPairVector64(float* address);
public static unsafe (Vector128<byte>, Vector128<byte>) LoadPairVector128(byte* address);
public static unsafe (Vector128<sbyte>, Vector128<sbyte>) LoadPairVector128(sbyte* address);
public static unsafe (Vector128<short>, Vector128<short>) LoadPairVector128(short* address);
public static unsafe (Vector128<ushort>, Vector128<ushort>) LoadPairVector128(ushort* address);
public static unsafe (Vector128<int>, Vector128<int>) LoadPairVector128(int* address);
public static unsafe (Vector128<uint>, Vector128<uint>) LoadPairVector128(uint* address);
public static unsafe (Vector128<long>, Vector128<long>) LoadPairVector128(long* address);
public static unsafe (Vector128<ulong>, Vector128<ulong>) LoadPairVector128(ulong* address);
public static unsafe (Vector128<float>, Vector128<float>) LoadPairVector128(float* address);
public static unsafe (Vector64<int>, Vector64<int>) LoadPairScalarVector64(int* address);
public static unsafe (Vector64<uint>, Vector64<uint>) LoadPairScalarVector64(uint* address);
public static unsafe (Vector64<long>, Vector64<long>) LoadPairScalarVector64(long* address);
public static unsafe (Vector64<ulong>, Vector64<ulong>) LoadPairScalarVector64(ulong* address);
public static unsafe (Vector64<float>, Vector64<float>) LoadPairScalarVector64(float* address);
public static unsafe (Vector64<double>, Vector64<double>) LoadPairScalarVector64(double* address);
// LDNP
public static unsafe (Vector64<byte>, Vector64<byte>) LoadPairVector64NonTemporal(byte* address);
public static unsafe (Vector64<sbyte>, Vector64<sbyte>) LoadPairVector64NonTemporal(sbyte* address);
public static unsafe (Vector64<short>, Vector64<short>) LoadPairVector64NonTemporal(short* address);
public static unsafe (Vector64<ushort>, Vector64<ushort>) LoadPairVector64NonTemporal(ushort* address);
public static unsafe (Vector64<int>, Vector64<int>) LoadPairVector64NonTemporal(int* address);
public static unsafe (Vector64<uint>, Vector64<uint>) LoadPairVector64NonTemporal(uint* address);
public static unsafe (Vector64<float>, Vector64<float>) LoadPairVector64NonTemporal(float* address);
public static unsafe (Vector128<byte>, Vector128<byte>) LoadPairVector128NonTemporal(byte* address);
public static unsafe (Vector128<sbyte>, Vector128<sbyte>) LoadPairVector128NonTemporal(sbyte* address);
public static unsafe (Vector128<short>, Vector128<short>) LoadPairVector128NonTemporal(short* address);
public static unsafe (Vector128<ushort>, Vector128<ushort>) LoadPairVector128NonTemporal(ushort* address);
public static unsafe (Vector128<int>, Vector128<int>) LoadPairVector128NonTemporal(int* address);
public static unsafe (Vector128<uint>, Vector128<uint>) LoadPairVector128NonTemporal(uint* address);
public static unsafe (Vector128<long>, Vector128<long>) LoadPairVector128NonTemporal(long* address);
public static unsafe (Vector128<ulong>, Vector128<ulong>) LoadPairVector128NonTemporal(ulong* address);
public static unsafe (Vector128<float>, Vector128<float>) LoadPairVector128NonTemporal(float* address);
public static unsafe (Vector64<int>, Vector64<int>) LoadPairScalarVector64NonTemporal(int* address);
public static unsafe (Vector64<uint>, Vector64<uint>) LoadPairScalarVector64NonTemporal(uint* address);
public static unsafe (Vector64<long>, Vector64<long>) LoadPairScalarVector64NonTemporal(long* address);
public static unsafe (Vector64<ulong>, Vector64<ulong>) LoadPairScalarVector64NonTemporal(ulong* address);
public static unsafe (Vector64<float>, Vector64<float>) LoadPairScalarVector64NonTemporal(float* address);
public static unsafe (Vector64<double>, Vector64<double>) LoadPairScalarVector64NonTemporal(double* address);
// SQXTN
public static Vector64<sbyte> ExtractNarrowingSaturateLower(Vector128<short> value);
public static Vector64<short> ExtractNarrowingSaturateLower(Vector128<int> value);
public static Vector64<int> ExtractNarrowingSaturateLower(Vector128<long> value);
public static Vector128<sbyte> ExtractNarrowingSaturateUpper(Vector64<short> lower, Vector128<short> value);
public static Vector128<short> ExtractNarrowingSaturateUpper(Vector64<int> lower, Vector128<int> value);
public static Vector128<int> ExtractNarrowingSaturateUpper(Vector64<long> lower, Vector128<long> value);
// SQXTUN
public static Vector64<byte> ExtractNarrowingSaturateLower(Vector128<ushort> value);
public static Vector64<ushort> ExtractNarrowingSaturateLower(Vector128<uint> value);
public static Vector64<uint> ExtractNarrowingSaturateLower(Vector128<ulong> value);
public static Vector128<byte> ExtractNarrowingSaturateUpper(Vector64<ushort> lower, Vector128<ushort> value);
public static Vector128<ushort> ExtractNarrowingSaturateUpper(Vector64<uint> lower, Vector128<uint> value);
public static Vector128<uint> ExtractNarrowingSaturateUpper(Vector64<ulong> lower, Vector128<ulong> value);
// UQXTN
public static Vector64<byte> ExtractNarrowingSaturateUnsignedLower(Vector128<short> value);
public static Vector64<ushort> ExtractNarrowingSaturateUnsignedLower(Vector128<int> value);
public static Vector64<uint> ExtractNarrowingSaturateUnsignedLower(Vector128<long> value);
public static Vector128<byte> ExtractNarrowingSaturateUnsignedUpper(Vector64<short> lower, Vector128<short> value);
public static Vector128<ushort> ExtractNarrowingSaturateUnsignedUpper(Vector64<int> lower, Vector128<int> value);
public static Vector128<uint> ExtractNarrowingSaturateUnsignedUpper(Vector64<long> lower, Vector128<long> value);
// REV16
public static Vector64<ushort> ReverseElementBytes(Vector64<ushort> value);
public static Vector64<short> ReverseElementBytes(Vector64<short> value);
public static Vector128<ushort> ReverseElementBytes(Vector128<ushort> value);
public static Vector128<short> ReverseElementBytes(Vector128<short> value);
// REV32
public static Vector64<uint> ReverseElementBytes(Vector64<uint> value);
public static Vector64<int> ReverseElementBytes(Vector64<int> value);
public static Vector64<float> ReverseElementBytes(Vector64<float> value);
public static Vector128<uint> ReverseElementBytes(Vector128<uint> value);
public static Vector128<int> ReverseElementBytes(Vector128<int> value);
// Also versions that swap the "halfwords" (each 16-bit portion)
// REV64
public static Vector128<ulong> ReverseElementBytes(Vector64<ulong> value);
public static Vector128<long> ReverseElementBytes(Vector64<long> value);
public static Vector128<ulong> ReverseElementBytes(Vector128<ulong> value);
public static Vector128<long> ReverseElementBytes(Vector128<long> value);
// Also versions that swap the "doublewords" (each 32-bit portion)
// Also versions that swap the "halfwords" (each 16-bit portion)
}
}Metadata
Metadata
Assignees
Labels
api-approvedAPI was approved in API review, it can be implementedarch-arm64area-System.Runtime.Intrinsics
Activity
tannergooding commentedon May 26, 2020
CC. @CarolEidt, @echesakovMSFT
echesakov commentedon Jun 24, 2020
ExtractNarrowingSaturateUnsignedLower and ExtractNarrowingSaturateUnsignedUpper are needed for the "intrinsification" work that @carlossanlop is doing, so I will implement this next.
echesakov commentedon Jun 25, 2020
ExtractNarrowingSaturateUnsignedLower and ExtractNarrowingSaturateUnsignedUpper should correspond to sqxtun and sqxtun2
terrajobst commentedon Jun 25, 2020
Video
label:blocking
juliusfriedman commentedon Jun 26, 2020
Please correct me if I am wrong but for the first 50 or so methods there is little change for them to fail unless the address is invalid (and they take a pointer), thus I would highly suggest perhaps a
Spanand orIntPtroverload as well as proposedunsafevariants here.tannergooding commentedon Jun 26, 2020
Such APIs are out of scope for .NET 5 and would require a separate API proposal.
However, none of the other intrinsics have such overloads and they would likely not be as performant or have as clear semantics and so I would not be in favor of taking them through API review.
echesakov commentedon Jul 14, 2020
During the last JIT team meeting there were concerns raised that LoadPairVector64 and LoadPairVector128 are the only intrinsics returning a tuple and we don't know yet if they could expose previously not seen issues.
I am going to open a separate issue to track the work of implementing LoadPairVector64 and LoadPairVector128. Depending on the extent of changes their implementation requires we might consider moving these intrinsics to 6.0. Then, work could be consolidated with a work of implementing intrinsics for LD1-LD4,ST1-ST4 operating on multiple registers and thoroughly tested thereafter.
cc @dotnet/jit-contrib
echesakov commentedon Jul 14, 2020
Opened #39243 for LoadPairVector64 and LoadPairVector128