Skip to content

Commit 7fe3451

Browse files
Add support for Sve.ReverseBits() (#103806)
1 parent 18bc115 commit 7fe3451

File tree

6 files changed

+157
-0
lines changed

6 files changed

+157
-0
lines changed

src/coreclr/jit/hwintrinsiclistarm64sve.h

+1
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ HARDWARE_INTRINSIC(Sve, PrefetchBytes,
168168
HARDWARE_INTRINSIC(Sve, PrefetchInt16, -1, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_sve_prfh, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_MemoryLoad, HW_Flag_Scalable|HW_Flag_SpecialCodeGen|HW_Flag_ExplicitMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_BaseTypeFromFirstArg|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand)
169169
HARDWARE_INTRINSIC(Sve, PrefetchInt32, -1, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_prfw, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_MemoryLoad, HW_Flag_Scalable|HW_Flag_SpecialCodeGen|HW_Flag_ExplicitMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_BaseTypeFromFirstArg|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand)
170170
HARDWARE_INTRINSIC(Sve, PrefetchInt64, -1, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_prfd, INS_invalid, INS_invalid}, HW_Category_MemoryLoad, HW_Flag_Scalable|HW_Flag_SpecialCodeGen|HW_Flag_ExplicitMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_BaseTypeFromFirstArg|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand)
171+
HARDWARE_INTRINSIC(Sve, ReverseBits, -1, -1, false, {INS_sve_rbit, INS_sve_rbit, INS_sve_rbit, INS_sve_rbit, INS_sve_rbit, INS_sve_rbit, INS_sve_rbit, INS_sve_rbit, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation)
171172
HARDWARE_INTRINSIC(Sve, ReverseElement, -1, 1, true, {INS_sve_rev, INS_sve_rev, INS_sve_rev, INS_sve_rev, INS_sve_rev, INS_sve_rev, INS_sve_rev, INS_sve_rev, INS_sve_rev, INS_sve_rev}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_SpecialCodeGen)
172173
HARDWARE_INTRINSIC(Sve, ReverseElement16, -1, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_revh, INS_sve_revh, INS_sve_revh, INS_sve_revh, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation)
173174
HARDWARE_INTRINSIC(Sve, ReverseElement32, -1, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_revw, INS_sve_revw, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation)

src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.PlatformNotSupported.cs

+51
Original file line numberDiff line numberDiff line change
@@ -4445,6 +4445,57 @@ internal Arm64() { }
44454445
public static unsafe void PrefetchInt64(Vector<ulong> mask, void* address, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); }
44464446

44474447

4448+
/// Reverse bits
4449+
4450+
/// <summary>
4451+
/// svuint8_t svrbit[_u8]_m(svuint8_t inactive, svbool_t pg, svuint8_t op)
4452+
/// RBIT Ztied.B, Pg/M, Zop.B
4453+
/// </summary>
4454+
public static unsafe Vector<byte> ReverseBits(Vector<byte> value) { throw new PlatformNotSupportedException(); }
4455+
4456+
/// <summary>
4457+
/// svint16_t svrbit[_s16]_m(svint16_t inactive, svbool_t pg, svint16_t op)
4458+
/// RBIT Ztied.H, Pg/M, Zop.H
4459+
/// </summary>
4460+
public static unsafe Vector<short> ReverseBits(Vector<short> value) { throw new PlatformNotSupportedException(); }
4461+
4462+
/// <summary>
4463+
/// svint32_t svrbit[_s32]_m(svint32_t inactive, svbool_t pg, svint32_t op)
4464+
/// RBIT Ztied.S, Pg/M, Zop.S
4465+
/// </summary>
4466+
public static unsafe Vector<int> ReverseBits(Vector<int> value) { throw new PlatformNotSupportedException(); }
4467+
4468+
/// <summary>
4469+
/// svint64_t svrbit[_s64]_m(svint64_t inactive, svbool_t pg, svint64_t op)
4470+
/// RBIT Ztied.D, Pg/M, Zop.D
4471+
/// </summary>
4472+
public static unsafe Vector<long> ReverseBits(Vector<long> value) { throw new PlatformNotSupportedException(); }
4473+
4474+
/// <summary>
4475+
/// svint8_t svrbit[_s8]_m(svint8_t inactive, svbool_t pg, svint8_t op)
4476+
/// RBIT Ztied.B, Pg/M, Zop.B
4477+
/// </summary>
4478+
public static unsafe Vector<sbyte> ReverseBits(Vector<sbyte> value) { throw new PlatformNotSupportedException(); }
4479+
4480+
/// <summary>
4481+
/// svuint16_t svrbit[_u16]_m(svuint16_t inactive, svbool_t pg, svuint16_t op)
4482+
/// RBIT Ztied.H, Pg/M, Zop.H
4483+
/// </summary>
4484+
public static unsafe Vector<ushort> ReverseBits(Vector<ushort> value) { throw new PlatformNotSupportedException(); }
4485+
4486+
/// <summary>
4487+
/// svuint32_t svrbit[_u32]_m(svuint32_t inactive, svbool_t pg, svuint32_t op)
4488+
/// RBIT Ztied.S, Pg/M, Zop.S
4489+
/// </summary>
4490+
public static unsafe Vector<uint> ReverseBits(Vector<uint> value) { throw new PlatformNotSupportedException(); }
4491+
4492+
/// <summary>
4493+
/// svuint64_t svrbit[_u64]_m(svuint64_t inactive, svbool_t pg, svuint64_t op)
4494+
/// RBIT Ztied.D, Pg/M, Zop.D
4495+
/// </summary>
4496+
public static unsafe Vector<ulong> ReverseBits(Vector<ulong> value) { throw new PlatformNotSupportedException(); }
4497+
4498+
44484499
/// Reverse all elements
44494500

44504501
/// <summary>

src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.cs

+51
Original file line numberDiff line numberDiff line change
@@ -4499,6 +4499,57 @@ internal Arm64() { }
44994499
/// </summary>
45004500
public static unsafe void PrefetchInt64(Vector<ulong> mask, void* address, [ConstantExpected] SvePrefetchType prefetchType) => PrefetchInt64(mask, address, prefetchType);
45014501

4502+
/// Reverse bits
4503+
4504+
/// <summary>
4505+
/// svuint8_t svrbit[_u8]_x(svbool_t pg, svuint8_t op)
4506+
/// RBIT Ztied.B, Pg/M, Ztied.B
4507+
/// </summary>
4508+
public static unsafe Vector<byte> ReverseBits(Vector<byte> value) => ReverseBits(value);
4509+
4510+
/// <summary>
4511+
/// svint16_t svrbit[_s16]_m(svint16_t inactive, svbool_t pg, svint16_t op)
4512+
/// RBIT Ztied.H, Pg/M, Zop.H
4513+
/// </summary>
4514+
public static unsafe Vector<short> ReverseBits(Vector<short> value) => ReverseBits(value);
4515+
4516+
/// <summary>
4517+
/// svint32_t svrbit[_s32]_m(svint32_t inactive, svbool_t pg, svint32_t op)
4518+
/// RBIT Ztied.S, Pg/M, Zop.S
4519+
/// </summary>
4520+
public static unsafe Vector<int> ReverseBits(Vector<int> value) => ReverseBits(value);
4521+
4522+
/// <summary>
4523+
/// svint64_t svrbit[_s64]_m(svint64_t inactive, svbool_t pg, svint64_t op)
4524+
/// RBIT Ztied.D, Pg/M, Zop.D
4525+
/// </summary>
4526+
public static unsafe Vector<long> ReverseBits(Vector<long> value) => ReverseBits(value);
4527+
4528+
/// <summary>
4529+
/// svint8_t svrbit[_s8]_m(svint8_t inactive, svbool_t pg, svint8_t op)
4530+
/// RBIT Ztied.B, Pg/M, Zop.B
4531+
/// </summary>
4532+
public static unsafe Vector<sbyte> ReverseBits(Vector<sbyte> value) => ReverseBits(value);
4533+
4534+
/// <summary>
4535+
/// svuint16_t svrbit[_u16]_m(svuint16_t inactive, svbool_t pg, svuint16_t op)
4536+
/// RBIT Ztied.H, Pg/M, Zop.H
4537+
/// </summary>
4538+
public static unsafe Vector<ushort> ReverseBits(Vector<ushort> value) => ReverseBits(value);
4539+
4540+
/// <summary>
4541+
/// svuint32_t svrbit[_u32]_m(svuint32_t inactive, svbool_t pg, svuint32_t op)
4542+
/// RBIT Ztied.S, Pg/M, Zop.S
4543+
/// </summary>
4544+
public static unsafe Vector<uint> ReverseBits(Vector<uint> value) => ReverseBits(value);
4545+
4546+
/// <summary>
4547+
/// svuint64_t svrbit[_u64]_m(svuint64_t inactive, svbool_t pg, svuint64_t op)
4548+
/// RBIT Ztied.D, Pg/M, Zop.D
4549+
/// </summary>
4550+
public static unsafe Vector<ulong> ReverseBits(Vector<ulong> value) => ReverseBits(value);
4551+
4552+
45024553
/// Reverse all elements
45034554

45044555
/// <summary>

src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs

+9
Original file line numberDiff line numberDiff line change
@@ -4826,6 +4826,15 @@ internal Arm64() { }
48264826
public static unsafe void PrefetchInt32(System.Numerics.Vector<uint> mask, void* address, [ConstantExpected] SvePrefetchType prefetchType) { throw null; }
48274827
public static unsafe void PrefetchInt64(System.Numerics.Vector<ulong> mask, void* address, [ConstantExpected] SvePrefetchType prefetchType) { throw null; }
48284828

4829+
public static System.Numerics.Vector<byte> ReverseBits(System.Numerics.Vector<byte> value) { throw null; }
4830+
public static System.Numerics.Vector<short> ReverseBits(System.Numerics.Vector<short> value) { throw null; }
4831+
public static System.Numerics.Vector<int> ReverseBits(System.Numerics.Vector<int> value) { throw null; }
4832+
public static System.Numerics.Vector<long> ReverseBits(System.Numerics.Vector<long> value) { throw null; }
4833+
public static System.Numerics.Vector<sbyte> ReverseBits(System.Numerics.Vector<sbyte> value) { throw null; }
4834+
public static System.Numerics.Vector<ushort> ReverseBits(System.Numerics.Vector<ushort> value) { throw null; }
4835+
public static System.Numerics.Vector<uint> ReverseBits(System.Numerics.Vector<uint> value) { throw null; }
4836+
public static System.Numerics.Vector<ulong> ReverseBits(System.Numerics.Vector<ulong> value) { throw null; }
4837+
48294838
public static System.Numerics.Vector<byte> ReverseElement(System.Numerics.Vector<byte> value) { throw null; }
48304839
public static System.Numerics.Vector<double> ReverseElement(System.Numerics.Vector<double> value) { throw null; }
48314840
public static System.Numerics.Vector<short> ReverseElement(System.Numerics.Vector<short> value) { throw null; }

0 commit comments

Comments
 (0)