Skip to content

Commit 6373209

Browse files
authoredJun 26, 2024
Add support for Sve.VectorTableLookup() (#103989)
* Add support for Sve.VectorTableLookup() * Incorporate review comments * Fix instruction format in comments
1 parent 2705fa4 commit 6373209

File tree

5 files changed

+149
-0
lines changed

5 files changed

+149
-0
lines changed
 

‎src/coreclr/jit/hwintrinsiclistarm64sve.h

+1
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ HARDWARE_INTRINSIC(Sve, TransposeEven,
213213
HARDWARE_INTRINSIC(Sve, TransposeOdd, -1, 2, true, {INS_sve_trn2, INS_sve_trn2, INS_sve_trn2, INS_sve_trn2, INS_sve_trn2, INS_sve_trn2, INS_sve_trn2, INS_sve_trn2, INS_sve_trn2, INS_sve_trn2}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_SpecialCodeGen)
214214
HARDWARE_INTRINSIC(Sve, UnzipEven, -1, 2, true, {INS_sve_uzp1, INS_sve_uzp1, INS_sve_uzp1, INS_sve_uzp1, INS_sve_uzp1, INS_sve_uzp1, INS_sve_uzp1, INS_sve_uzp1, INS_sve_uzp1, INS_sve_uzp1}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_SpecialCodeGen)
215215
HARDWARE_INTRINSIC(Sve, UnzipOdd, -1, 2, true, {INS_sve_uzp2, INS_sve_uzp2, INS_sve_uzp2, INS_sve_uzp2, INS_sve_uzp2, INS_sve_uzp2, INS_sve_uzp2, INS_sve_uzp2, INS_sve_uzp2, INS_sve_uzp2}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_SpecialCodeGen)
216+
HARDWARE_INTRINSIC(Sve, VectorTableLookup, -1, 2, true, {INS_sve_tbl, INS_sve_tbl, INS_sve_tbl, INS_sve_tbl, INS_sve_tbl, INS_sve_tbl, INS_sve_tbl, INS_sve_tbl, INS_sve_tbl, INS_sve_tbl}, HW_Category_SIMD, HW_Flag_Scalable)
216217
HARDWARE_INTRINSIC(Sve, Xor, -1, -1, false, {INS_sve_eor, INS_sve_eor, INS_sve_eor, INS_sve_eor, INS_sve_eor, INS_sve_eor, INS_sve_eor, INS_sve_eor, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_OptionalEmbeddedMaskedOperation|HW_Flag_HasRMWSemantics|HW_Flag_LowMaskedOperation)
217218
HARDWARE_INTRINSIC(Sve, XorAcross, -1, -1, false, {INS_sve_eorv, INS_sve_eorv, INS_sve_eorv, INS_sve_eorv, INS_sve_eorv, INS_sve_eorv, INS_sve_eorv, INS_sve_eorv, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation)
218219
HARDWARE_INTRINSIC(Sve, ZeroExtend16, -1, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_uxth, INS_invalid, INS_sve_uxth, 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

+63
Original file line numberDiff line numberDiff line change
@@ -6624,6 +6624,69 @@ internal Arm64() { }
66246624
public static unsafe Vector<ulong> UnzipOdd(Vector<ulong> left, Vector<ulong> right) { throw new PlatformNotSupportedException(); }
66256625

66266626

6627+
/// Table lookup in single-vector table
6628+
6629+
/// <summary>
6630+
/// svuint8_t svtbl[_u8](svuint8_t data, svuint8_t indices)
6631+
/// TBL Zresult.B, {Zdata.B}, Zindices.B
6632+
/// </summary>
6633+
public static unsafe Vector<byte> VectorTableLookup(Vector<byte> data, Vector<byte> indices) { throw new PlatformNotSupportedException(); }
6634+
6635+
/// <summary>
6636+
/// svfloat64_t svtbl[_f64](svfloat64_t data, svuint64_t indices)
6637+
/// TBL Zresult.D, {Zdata.D}, Zindices.D
6638+
/// </summary>
6639+
public static unsafe Vector<double> VectorTableLookup(Vector<double> data, Vector<ulong> indices) { throw new PlatformNotSupportedException(); }
6640+
6641+
/// <summary>
6642+
/// svint16_t svtbl[_s16](svint16_t data, svuint16_t indices)
6643+
/// TBL Zresult.H, {Zdata.H}, Zindices.H
6644+
/// </summary>
6645+
public static unsafe Vector<short> VectorTableLookup(Vector<short> data, Vector<ushort> indices) { throw new PlatformNotSupportedException(); }
6646+
6647+
/// <summary>
6648+
/// svint32_t svtbl[_s32](svint32_t data, svuint32_t indices)
6649+
/// TBL Zresult.S, {Zdata.S}, Zindices.S
6650+
/// </summary>
6651+
public static unsafe Vector<int> VectorTableLookup(Vector<int> data, Vector<uint> indices) { throw new PlatformNotSupportedException(); }
6652+
6653+
/// <summary>
6654+
/// svint64_t svtbl[_s64](svint64_t data, svuint64_t indices)
6655+
/// TBL Zresult.D, {Zdata.D}, Zindices.D
6656+
/// </summary>
6657+
public static unsafe Vector<long> VectorTableLookup(Vector<long> data, Vector<ulong> indices) { throw new PlatformNotSupportedException(); }
6658+
6659+
/// <summary>
6660+
/// svint8_t svtbl[_s8](svint8_t data, svuint8_t indices)
6661+
/// TBL Zresult.B, {Zdata.B}, Zindices.B
6662+
/// </summary>
6663+
public static unsafe Vector<sbyte> VectorTableLookup(Vector<sbyte> data, Vector<byte> indices) { throw new PlatformNotSupportedException(); }
6664+
6665+
/// <summary>
6666+
/// svfloat32_t svtbl[_f32](svfloat32_t data, svuint32_t indices)
6667+
/// TBL Zresult.S, {Zdata.S}, Zindices.S
6668+
/// </summary>
6669+
public static unsafe Vector<float> VectorTableLookup(Vector<float> data, Vector<uint> indices) { throw new PlatformNotSupportedException(); }
6670+
6671+
/// <summary>
6672+
/// svuint16_t svtbl[_u16](svuint16_t data, svuint16_t indices)
6673+
/// TBL Zresult.H, {Zdata.H}, Zindices.H
6674+
/// </summary>
6675+
public static unsafe Vector<ushort> VectorTableLookup(Vector<ushort> data, Vector<ushort> indices) { throw new PlatformNotSupportedException(); }
6676+
6677+
/// <summary>
6678+
/// svuint32_t svtbl[_u32](svuint32_t data, svuint32_t indices)
6679+
/// TBL Zresult.S, {Zdata.S}, Zindices.S
6680+
/// </summary>
6681+
public static unsafe Vector<uint> VectorTableLookup(Vector<uint> data, Vector<uint> indices) { throw new PlatformNotSupportedException(); }
6682+
6683+
/// <summary>
6684+
/// svuint64_t svtbl[_u64](svuint64_t data, svuint64_t indices)
6685+
/// TBL Zresult.D, {Zdata.D}, Zindices.D
6686+
/// </summary>
6687+
public static unsafe Vector<ulong> VectorTableLookup(Vector<ulong> data, Vector<ulong> indices) { throw new PlatformNotSupportedException(); }
6688+
6689+
66276690
/// Xor : Bitwise exclusive OR
66286691

66296692
/// <summary>

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

+63
Original file line numberDiff line numberDiff line change
@@ -6694,6 +6694,69 @@ internal Arm64() { }
66946694
public static unsafe Vector<ulong> UnzipOdd(Vector<ulong> left, Vector<ulong> right) => UnzipOdd(left, right);
66956695

66966696

6697+
/// Table lookup in single-vector table
6698+
6699+
/// <summary>
6700+
/// svuint8_t svtbl[_u8](svuint8_t data, svuint8_t indices)
6701+
/// TBL Zresult.B, {Zdata.B}, Zindices.B
6702+
/// </summary>
6703+
public static unsafe Vector<byte> VectorTableLookup(Vector<byte> data, Vector<byte> indices) => VectorTableLookup(data, indices);
6704+
6705+
/// <summary>
6706+
/// svfloat64_t svtbl[_f64](svfloat64_t data, svuint64_t indices)
6707+
/// TBL Zresult.D, {Zdata.D}, Zindices.D
6708+
/// </summary>
6709+
public static unsafe Vector<double> VectorTableLookup(Vector<double> data, Vector<ulong> indices) => VectorTableLookup(data, indices);
6710+
6711+
/// <summary>
6712+
/// svint16_t svtbl[_s16](svint16_t data, svuint16_t indices)
6713+
/// TBL Zresult.H, {Zdata.H}, Zindices.H
6714+
/// </summary>
6715+
public static unsafe Vector<short> VectorTableLookup(Vector<short> data, Vector<ushort> indices) => VectorTableLookup(data, indices);
6716+
6717+
/// <summary>
6718+
/// svint32_t svtbl[_s32](svint32_t data, svuint32_t indices)
6719+
/// TBL Zresult.S, {Zdata.S}, Zindices.S
6720+
/// </summary>
6721+
public static unsafe Vector<int> VectorTableLookup(Vector<int> data, Vector<uint> indices) => VectorTableLookup(data, indices);
6722+
6723+
/// <summary>
6724+
/// svint64_t svtbl[_s64](svint64_t data, svuint64_t indices)
6725+
/// TBL Zresult.D, {Zdata.D}, Zindices.D
6726+
/// </summary>
6727+
public static unsafe Vector<long> VectorTableLookup(Vector<long> data, Vector<ulong> indices) => VectorTableLookup(data, indices);
6728+
6729+
/// <summary>
6730+
/// svint8_t svtbl[_s8](svint8_t data, svuint8_t indices)
6731+
/// TBL Zresult.B, {Zdata.B}, Zindices.B
6732+
/// </summary>
6733+
public static unsafe Vector<sbyte> VectorTableLookup(Vector<sbyte> data, Vector<byte> indices) => VectorTableLookup(data, indices);
6734+
6735+
/// <summary>
6736+
/// svfloat32_t svtbl[_f32](svfloat32_t data, svuint32_t indices)
6737+
/// TBL Zresult.S, {Zdata.S}, Zindices.S
6738+
/// </summary>
6739+
public static unsafe Vector<float> VectorTableLookup(Vector<float> data, Vector<uint> indices) => VectorTableLookup(data, indices);
6740+
6741+
/// <summary>
6742+
/// svuint16_t svtbl[_u16](svuint16_t data, svuint16_t indices)
6743+
/// TBL Zresult.H, {Zdata.H}, Zindices.H
6744+
/// </summary>
6745+
public static unsafe Vector<ushort> VectorTableLookup(Vector<ushort> data, Vector<ushort> indices) => VectorTableLookup(data, indices);
6746+
6747+
/// <summary>
6748+
/// svuint32_t svtbl[_u32](svuint32_t data, svuint32_t indices)
6749+
/// TBL Zresult.S, {Zdata.S}, Zindices.S
6750+
/// </summary>
6751+
public static unsafe Vector<uint> VectorTableLookup(Vector<uint> data, Vector<uint> indices) => VectorTableLookup(data, indices);
6752+
6753+
/// <summary>
6754+
/// svuint64_t svtbl[_u64](svuint64_t data, svuint64_t indices)
6755+
/// TBL Zresult.D, {Zdata.D}, Zindices.D
6756+
/// </summary>
6757+
public static unsafe Vector<ulong> VectorTableLookup(Vector<ulong> data, Vector<ulong> indices) => VectorTableLookup(data, indices);
6758+
6759+
66976760
/// Xor : Bitwise exclusive OR
66986761

66996762
/// <summary>

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

+11
Original file line numberDiff line numberDiff line change
@@ -5167,6 +5167,17 @@ internal Arm64() { }
51675167
public static System.Numerics.Vector<uint> UnzipOdd(System.Numerics.Vector<uint> left, System.Numerics.Vector<uint> right) { throw null; }
51685168
public static System.Numerics.Vector<ulong> UnzipOdd(System.Numerics.Vector<ulong> left, System.Numerics.Vector<ulong> right) { throw null; }
51695169

5170+
public static System.Numerics.Vector<byte> VectorTableLookup(System.Numerics.Vector<byte> data, System.Numerics.Vector<byte> indices) { throw null; }
5171+
public static System.Numerics.Vector<double> VectorTableLookup(System.Numerics.Vector<double> data, System.Numerics.Vector<ulong> indices) { throw null; }
5172+
public static System.Numerics.Vector<short> VectorTableLookup(System.Numerics.Vector<short> data, System.Numerics.Vector<ushort> indices) { throw null; }
5173+
public static System.Numerics.Vector<int> VectorTableLookup(System.Numerics.Vector<int> data, System.Numerics.Vector<uint> indices) { throw null; }
5174+
public static System.Numerics.Vector<long> VectorTableLookup(System.Numerics.Vector<long> data, System.Numerics.Vector<ulong> indices) { throw null; }
5175+
public static System.Numerics.Vector<sbyte> VectorTableLookup(System.Numerics.Vector<sbyte> data, System.Numerics.Vector<byte> indices) { throw null; }
5176+
public static System.Numerics.Vector<float> VectorTableLookup(System.Numerics.Vector<float> data, System.Numerics.Vector<uint> indices) { throw null; }
5177+
public static System.Numerics.Vector<ushort> VectorTableLookup(System.Numerics.Vector<ushort> data, System.Numerics.Vector<ushort> indices) { throw null; }
5178+
public static System.Numerics.Vector<uint> VectorTableLookup(System.Numerics.Vector<uint> data, System.Numerics.Vector<uint> indices) { throw null; }
5179+
public static System.Numerics.Vector<ulong> VectorTableLookup(System.Numerics.Vector<ulong> data, System.Numerics.Vector<ulong> indices) { throw null; }
5180+
51705181
public static System.Numerics.Vector<byte> Xor(System.Numerics.Vector<byte> left, System.Numerics.Vector<byte> right) { throw null; }
51715182
public static System.Numerics.Vector<short> Xor(System.Numerics.Vector<short> left, System.Numerics.Vector<short> right) { throw null; }
51725183
public static System.Numerics.Vector<int> Xor(System.Numerics.Vector<int> left, System.Numerics.Vector<int> right) { throw null; }

0 commit comments

Comments
 (0)