From dc9f6d015b5ae0454bd20110dd31955bc6215531 Mon Sep 17 00:00:00 2001 From: Swapnil Gaikwad Date: Tue, 25 Jun 2024 17:48:55 +0100 Subject: [PATCH 1/3] Add support for Sve.VectorTableLookup() --- src/coreclr/jit/hwintrinsiclistarm64sve.h | 1 + .../Arm/Sve.PlatformNotSupported.cs | 63 +++++++++++++++++++ .../src/System/Runtime/Intrinsics/Arm/Sve.cs | 63 +++++++++++++++++++ .../ref/System.Runtime.Intrinsics.cs | 11 ++++ .../GenerateHWIntrinsicTests_Arm.cs | 11 ++++ 5 files changed, 149 insertions(+) diff --git a/src/coreclr/jit/hwintrinsiclistarm64sve.h b/src/coreclr/jit/hwintrinsiclistarm64sve.h index 14eaa7b82ae89..45fd7e57bbe73 100644 --- a/src/coreclr/jit/hwintrinsiclistarm64sve.h +++ b/src/coreclr/jit/hwintrinsiclistarm64sve.h @@ -213,6 +213,7 @@ HARDWARE_INTRINSIC(Sve, TransposeEven, 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) 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) 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) +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|HW_Flag_BaseTypeFromSecondArg) 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) 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) 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) diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.PlatformNotSupported.cs index ee7848a4a5eb1..6c009e31d1e94 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.PlatformNotSupported.cs @@ -6624,6 +6624,69 @@ internal Arm64() { } public static unsafe Vector UnzipOdd(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + /// Table lookup in single-vector table + + /// + /// svuint8_t svtbl[_u8](svuint8_t data, svuint8_t indices) + /// TBL Zresult.B, Zdata.B, Zindices.B + /// + public static unsafe Vector VectorTableLookup(Vector data, Vector indices) { throw new PlatformNotSupportedException(); } + + /// + /// svfloat64_t svtbl[_f64](svfloat64_t data, svuint64_t indices) + /// TBL Zresult.D, Zdata.D, Zindices.D + /// + public static unsafe Vector VectorTableLookup(Vector data, Vector indices) { throw new PlatformNotSupportedException(); } + + /// + /// svint16_t svtbl[_s16](svint16_t data, svuint16_t indices) + /// TBL Zresult.H, Zdata.H, Zindices.H + /// + public static unsafe Vector VectorTableLookup(Vector data, Vector indices) { throw new PlatformNotSupportedException(); } + + /// + /// svint32_t svtbl[_s32](svint32_t data, svuint32_t indices) + /// TBL Zresult.S, Zdata.S, Zindices.S + /// + public static unsafe Vector VectorTableLookup(Vector data, Vector indices) { throw new PlatformNotSupportedException(); } + + /// + /// svint64_t svtbl[_s64](svint64_t data, svuint64_t indices) + /// TBL Zresult.D, Zdata.D, Zindices.D + /// + public static unsafe Vector VectorTableLookup(Vector data, Vector indices) { throw new PlatformNotSupportedException(); } + + /// + /// svint8_t svtbl[_s8](svint8_t data, svuint8_t indices) + /// TBL Zresult.B, Zdata.B, Zindices.B + /// + public static unsafe Vector VectorTableLookup(Vector data, Vector indices) { throw new PlatformNotSupportedException(); } + + /// + /// svfloat32_t svtbl[_f32](svfloat32_t data, svuint32_t indices) + /// TBL Zresult.S, Zdata.S, Zindices.S + /// + public static unsafe Vector VectorTableLookup(Vector data, Vector indices) { throw new PlatformNotSupportedException(); } + + /// + /// svuint16_t svtbl[_u16](svuint16_t data, svuint16_t indices) + /// TBL Zresult.H, Zdata.H, Zindices.H + /// + public static unsafe Vector VectorTableLookup(Vector data, Vector indices) { throw new PlatformNotSupportedException(); } + + /// + /// svuint32_t svtbl[_u32](svuint32_t data, svuint32_t indices) + /// TBL Zresult.S, Zdata.S, Zindices.S + /// + public static unsafe Vector VectorTableLookup(Vector data, Vector indices) { throw new PlatformNotSupportedException(); } + + /// + /// svuint64_t svtbl[_u64](svuint64_t data, svuint64_t indices) + /// TBL Zresult.D, Zdata.D, Zindices.D + /// + public static unsafe Vector VectorTableLookup(Vector data, Vector indices) { throw new PlatformNotSupportedException(); } + + /// Xor : Bitwise exclusive OR /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.cs index 7bf2ff6b84e9b..ea74cf934b105 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.cs @@ -6694,6 +6694,69 @@ internal Arm64() { } public static unsafe Vector UnzipOdd(Vector left, Vector right) => UnzipOdd(left, right); + /// Table lookup in single-vector table + + /// + /// svuint8_t svtbl[_u8](svuint8_t data, svuint8_t indices) + /// TBL Zresult.B, Zdata.B, Zindices.B + /// + public static unsafe Vector VectorTableLookup(Vector data, Vector indices) => VectorTableLookup(data, indices); + + /// + /// svfloat64_t svtbl[_f64](svfloat64_t data, svuint64_t indices) + /// TBL Zresult.D, Zdata.D, Zindices.D + /// + public static unsafe Vector VectorTableLookup(Vector data, Vector indices) => VectorTableLookup(data, indices); + + /// + /// svint16_t svtbl[_s16](svint16_t data, svuint16_t indices) + /// TBL Zresult.H, Zdata.H, Zindices.H + /// + public static unsafe Vector VectorTableLookup(Vector data, Vector indices) => VectorTableLookup(data, indices); + + /// + /// svint32_t svtbl[_s32](svint32_t data, svuint32_t indices) + /// TBL Zresult.S, Zdata.S, Zindices.S + /// + public static unsafe Vector VectorTableLookup(Vector data, Vector indices) => VectorTableLookup(data, indices); + + /// + /// svint64_t svtbl[_s64](svint64_t data, svuint64_t indices) + /// TBL Zresult.D, Zdata.D, Zindices.D + /// + public static unsafe Vector VectorTableLookup(Vector data, Vector indices) => VectorTableLookup(data, indices); + + /// + /// svint8_t svtbl[_s8](svint8_t data, svuint8_t indices) + /// TBL Zresult.B, Zdata.B, Zindices.B + /// + public static unsafe Vector VectorTableLookup(Vector data, Vector indices) => VectorTableLookup(data, indices); + + /// + /// svfloat32_t svtbl[_f32](svfloat32_t data, svuint32_t indices) + /// TBL Zresult.S, Zdata.S, Zindices.S + /// + public static unsafe Vector VectorTableLookup(Vector data, Vector indices) => VectorTableLookup(data, indices); + + /// + /// svuint16_t svtbl[_u16](svuint16_t data, svuint16_t indices) + /// TBL Zresult.H, Zdata.H, Zindices.H + /// + public static unsafe Vector VectorTableLookup(Vector data, Vector indices) => VectorTableLookup(data, indices); + + /// + /// svuint32_t svtbl[_u32](svuint32_t data, svuint32_t indices) + /// TBL Zresult.S, Zdata.S, Zindices.S + /// + public static unsafe Vector VectorTableLookup(Vector data, Vector indices) => VectorTableLookup(data, indices); + + /// + /// svuint64_t svtbl[_u64](svuint64_t data, svuint64_t indices) + /// TBL Zresult.D, Zdata.D, Zindices.D + /// + public static unsafe Vector VectorTableLookup(Vector data, Vector indices) => VectorTableLookup(data, indices); + + /// Xor : Bitwise exclusive OR /// diff --git a/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs b/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs index acc21ef80b49a..f8cbe2f635671 100644 --- a/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs +++ b/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs @@ -5167,6 +5167,17 @@ internal Arm64() { } public static System.Numerics.Vector UnzipOdd(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } public static System.Numerics.Vector UnzipOdd(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector VectorTableLookup(System.Numerics.Vector data, System.Numerics.Vector indices) { throw null; } + public static System.Numerics.Vector VectorTableLookup(System.Numerics.Vector data, System.Numerics.Vector indices) { throw null; } + public static System.Numerics.Vector VectorTableLookup(System.Numerics.Vector data, System.Numerics.Vector indices) { throw null; } + public static System.Numerics.Vector VectorTableLookup(System.Numerics.Vector data, System.Numerics.Vector indices) { throw null; } + public static System.Numerics.Vector VectorTableLookup(System.Numerics.Vector data, System.Numerics.Vector indices) { throw null; } + public static System.Numerics.Vector VectorTableLookup(System.Numerics.Vector data, System.Numerics.Vector indices) { throw null; } + public static System.Numerics.Vector VectorTableLookup(System.Numerics.Vector data, System.Numerics.Vector indices) { throw null; } + public static System.Numerics.Vector VectorTableLookup(System.Numerics.Vector data, System.Numerics.Vector indices) { throw null; } + public static System.Numerics.Vector VectorTableLookup(System.Numerics.Vector data, System.Numerics.Vector indices) { throw null; } + public static System.Numerics.Vector VectorTableLookup(System.Numerics.Vector data, System.Numerics.Vector indices) { throw null; } + public static System.Numerics.Vector Xor(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } public static System.Numerics.Vector Xor(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } public static System.Numerics.Vector Xor(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } diff --git a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs index 88a5d1b75f648..6c64f6844930a 100644 --- a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs +++ b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs @@ -3827,6 +3827,17 @@ ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveUnzipOdd_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[index] != left[i + 1] || result[index + half] != right[i + 1]"}), ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveUnzipOdd_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "UnzipOdd", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateEntry"] = "result[index] != left[i + 1] || result[index + half] != right[i + 1]"}), + ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "Sve_VectorTableLookup_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "VectorTableLookup", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "(UInt32) (TestLibrary.Generator.GetUInt32() % (UInt32)(Op2ElementCount * 2))", ["ValidateEntry"] = "(right[i] < (UInt32) RetElementCount) ? (result[i] != left[right[i]]) : (result[i] != 0)"}), + ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "Sve_VectorTableLookup_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "VectorTableLookup", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "(UInt64) (TestLibrary.Generator.GetUInt64() % (UInt64)(Op2ElementCount * 2))", ["ValidateEntry"] = "(right[i] < (UInt64) RetElementCount) ? (result[i] != left[right[i]]) : (result[i] != 0)"}), + ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "Sve_VectorTableLookup_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "VectorTableLookup", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "(Byte) (TestLibrary.Generator.GetByte() % (Byte) (Op2ElementCount * 2))", ["ValidateEntry"] = "(right[i] < (Byte) RetElementCount) ? (result[i] != left[right[i]]) : (result[i] != 0)"}), + ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "Sve_VectorTableLookup_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "VectorTableLookup", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "(UInt16) (TestLibrary.Generator.GetUInt16() % (UInt16)(Op2ElementCount * 2))", ["ValidateEntry"] = "(right[i] < (UInt16) RetElementCount) ? (result[i] != left[right[i]]) : (result[i] != 0)"}), + ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "Sve_VectorTableLookup_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "VectorTableLookup", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "(UInt32) (TestLibrary.Generator.GetUInt32() % (UInt32)(Op2ElementCount * 2))", ["ValidateEntry"] = "(right[i] < (UInt32) RetElementCount) ? (result[i] != left[right[i]]) : (result[i] != 0)"}), + ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "Sve_VectorTableLookup_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "VectorTableLookup", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "(UInt64) (TestLibrary.Generator.GetUInt64() % (UInt64)(Op2ElementCount * 2))", ["ValidateEntry"] = "(right[i] < (UInt64) RetElementCount) ? (result[i] != left[right[i]]) : (result[i] != 0)"}), + ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "Sve_VectorTableLookup_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "VectorTableLookup", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "(Byte) (TestLibrary.Generator.GetByte() % (Byte) (Op2ElementCount * 2))", ["ValidateEntry"] = "(right[i] < (Byte) RetElementCount) ? (result[i] != left[right[i]]) : (result[i] != 0)"}), + ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "Sve_VectorTableLookup_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "VectorTableLookup", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "(UInt16) (TestLibrary.Generator.GetUInt16() % (UInt16)(Op2ElementCount * 2))", ["ValidateEntry"] = "(right[i] < (UInt16) RetElementCount) ? (result[i] != left[right[i]]) : (result[i] != 0)"}), + ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "Sve_VectorTableLookup_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "VectorTableLookup", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "(UInt32) (TestLibrary.Generator.GetUInt32() % (UInt32)(Op2ElementCount * 2))", ["ValidateEntry"] = "(right[i] < (UInt32) RetElementCount) ? (result[i] != left[right[i]]) : (result[i] != 0)"}), + ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "Sve_VectorTableLookup_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "VectorTableLookup", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "(UInt64) (TestLibrary.Generator.GetUInt64() % (UInt64)(Op2ElementCount * 2))", ["ValidateEntry"] = "(right[i] < (UInt64) RetElementCount) ? (result[i] != left[right[i]]) : (result[i] != 0)"}), + ("SveSimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sve_ZeroExtend16_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ZeroExtend16", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "result[i] != Helpers.SignExtend(firstOp[i], 16, true)", ["GetIterResult"] = "Helpers.SignExtend(leftOp[i], 16, true)"}), ("SveSimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sve_ZeroExtend16_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ZeroExtend16", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "(TestLibrary.Generator.GetUInt64() & 0x3FFFFFFFFFFFFFFF)", ["ValidateIterResult"] = "result[i] != Helpers.SignExtend(firstOp[i], 16, true)", ["GetIterResult"] = "Helpers.SignExtend(leftOp[i], 16, true)"}), ("SveSimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sve_ZeroExtend32_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ZeroExtend32", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "(TestLibrary.Generator.GetUInt64() & 0x3FFFFFFFFFFFFFFF)", ["ValidateIterResult"] = "result[i] != Helpers.SignExtend(firstOp[i], 32, true)", ["GetIterResult"] = "Helpers.SignExtend(leftOp[i], 32, true)"}), From e417600a606b1216b30ab46738c9b8f7734f5089 Mon Sep 17 00:00:00 2001 From: Swapnil Gaikwad Date: Wed, 26 Jun 2024 11:29:23 +0100 Subject: [PATCH 2/3] Incorporate review comments --- src/coreclr/jit/hwintrinsiclistarm64sve.h | 2 +- .../src/System/Runtime/Intrinsics/Arm/Sve.cs | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/coreclr/jit/hwintrinsiclistarm64sve.h b/src/coreclr/jit/hwintrinsiclistarm64sve.h index 45fd7e57bbe73..e7af2383674f7 100644 --- a/src/coreclr/jit/hwintrinsiclistarm64sve.h +++ b/src/coreclr/jit/hwintrinsiclistarm64sve.h @@ -213,7 +213,7 @@ HARDWARE_INTRINSIC(Sve, TransposeEven, 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) 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) 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) -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|HW_Flag_BaseTypeFromSecondArg) +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) 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) 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) 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) diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.cs index ea74cf934b105..8f712b8ca8bbd 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.cs @@ -6698,61 +6698,61 @@ internal Arm64() { } /// /// svuint8_t svtbl[_u8](svuint8_t data, svuint8_t indices) - /// TBL Zresult.B, Zdata.B, Zindices.B + /// TBL Zresult.B, {Zdata.B}, Zindices.B /// public static unsafe Vector VectorTableLookup(Vector data, Vector indices) => VectorTableLookup(data, indices); /// /// svfloat64_t svtbl[_f64](svfloat64_t data, svuint64_t indices) - /// TBL Zresult.D, Zdata.D, Zindices.D + /// TBL Zresult.D, {Zdata.D}, Zindices.D /// public static unsafe Vector VectorTableLookup(Vector data, Vector indices) => VectorTableLookup(data, indices); /// /// svint16_t svtbl[_s16](svint16_t data, svuint16_t indices) - /// TBL Zresult.H, Zdata.H, Zindices.H + /// TBL Zresult.H, {Zdata.H}, Zindices.H /// public static unsafe Vector VectorTableLookup(Vector data, Vector indices) => VectorTableLookup(data, indices); /// /// svint32_t svtbl[_s32](svint32_t data, svuint32_t indices) - /// TBL Zresult.S, Zdata.S, Zindices.S + /// TBL Zresult.S, {Zdata.S}, Zindices.S /// public static unsafe Vector VectorTableLookup(Vector data, Vector indices) => VectorTableLookup(data, indices); /// /// svint64_t svtbl[_s64](svint64_t data, svuint64_t indices) - /// TBL Zresult.D, Zdata.D, Zindices.D + /// TBL Zresult.D, {Zdata.D}, Zindices.D /// public static unsafe Vector VectorTableLookup(Vector data, Vector indices) => VectorTableLookup(data, indices); /// /// svint8_t svtbl[_s8](svint8_t data, svuint8_t indices) - /// TBL Zresult.B, Zdata.B, Zindices.B + /// TBL Zresult.B, {Zdata.B}, Zindices.B /// public static unsafe Vector VectorTableLookup(Vector data, Vector indices) => VectorTableLookup(data, indices); /// /// svfloat32_t svtbl[_f32](svfloat32_t data, svuint32_t indices) - /// TBL Zresult.S, Zdata.S, Zindices.S + /// TBL Zresult.S, {Zdata.S}, Zindices.S /// public static unsafe Vector VectorTableLookup(Vector data, Vector indices) => VectorTableLookup(data, indices); /// /// svuint16_t svtbl[_u16](svuint16_t data, svuint16_t indices) - /// TBL Zresult.H, Zdata.H, Zindices.H + /// TBL Zresult.H, {Zdata.H}, Zindices.H /// public static unsafe Vector VectorTableLookup(Vector data, Vector indices) => VectorTableLookup(data, indices); /// /// svuint32_t svtbl[_u32](svuint32_t data, svuint32_t indices) - /// TBL Zresult.S, Zdata.S, Zindices.S + /// TBL Zresult.S, {Zdata.S}, Zindices.S /// public static unsafe Vector VectorTableLookup(Vector data, Vector indices) => VectorTableLookup(data, indices); /// /// svuint64_t svtbl[_u64](svuint64_t data, svuint64_t indices) - /// TBL Zresult.D, Zdata.D, Zindices.D + /// TBL Zresult.D, {Zdata.D}, Zindices.D /// public static unsafe Vector VectorTableLookup(Vector data, Vector indices) => VectorTableLookup(data, indices); From 6098bf50cc90f05ec43955853c083dbdf7f70da2 Mon Sep 17 00:00:00 2001 From: Swapnil Gaikwad Date: Wed, 26 Jun 2024 15:16:46 +0100 Subject: [PATCH 3/3] Fix instruction format in comments --- .../Arm/Sve.PlatformNotSupported.cs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.PlatformNotSupported.cs index 6c009e31d1e94..b96417b89bd2c 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.PlatformNotSupported.cs @@ -6628,61 +6628,61 @@ internal Arm64() { } /// /// svuint8_t svtbl[_u8](svuint8_t data, svuint8_t indices) - /// TBL Zresult.B, Zdata.B, Zindices.B + /// TBL Zresult.B, {Zdata.B}, Zindices.B /// public static unsafe Vector VectorTableLookup(Vector data, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svfloat64_t svtbl[_f64](svfloat64_t data, svuint64_t indices) - /// TBL Zresult.D, Zdata.D, Zindices.D + /// TBL Zresult.D, {Zdata.D}, Zindices.D /// public static unsafe Vector VectorTableLookup(Vector data, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svint16_t svtbl[_s16](svint16_t data, svuint16_t indices) - /// TBL Zresult.H, Zdata.H, Zindices.H + /// TBL Zresult.H, {Zdata.H}, Zindices.H /// public static unsafe Vector VectorTableLookup(Vector data, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svint32_t svtbl[_s32](svint32_t data, svuint32_t indices) - /// TBL Zresult.S, Zdata.S, Zindices.S + /// TBL Zresult.S, {Zdata.S}, Zindices.S /// public static unsafe Vector VectorTableLookup(Vector data, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svint64_t svtbl[_s64](svint64_t data, svuint64_t indices) - /// TBL Zresult.D, Zdata.D, Zindices.D + /// TBL Zresult.D, {Zdata.D}, Zindices.D /// public static unsafe Vector VectorTableLookup(Vector data, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svint8_t svtbl[_s8](svint8_t data, svuint8_t indices) - /// TBL Zresult.B, Zdata.B, Zindices.B + /// TBL Zresult.B, {Zdata.B}, Zindices.B /// public static unsafe Vector VectorTableLookup(Vector data, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svfloat32_t svtbl[_f32](svfloat32_t data, svuint32_t indices) - /// TBL Zresult.S, Zdata.S, Zindices.S + /// TBL Zresult.S, {Zdata.S}, Zindices.S /// public static unsafe Vector VectorTableLookup(Vector data, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint16_t svtbl[_u16](svuint16_t data, svuint16_t indices) - /// TBL Zresult.H, Zdata.H, Zindices.H + /// TBL Zresult.H, {Zdata.H}, Zindices.H /// public static unsafe Vector VectorTableLookup(Vector data, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svtbl[_u32](svuint32_t data, svuint32_t indices) - /// TBL Zresult.S, Zdata.S, Zindices.S + /// TBL Zresult.S, {Zdata.S}, Zindices.S /// public static unsafe Vector VectorTableLookup(Vector data, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svtbl[_u64](svuint64_t data, svuint64_t indices) - /// TBL Zresult.D, Zdata.D, Zindices.D + /// TBL Zresult.D, {Zdata.D}, Zindices.D /// public static unsafe Vector VectorTableLookup(Vector data, Vector indices) { throw new PlatformNotSupportedException(); }