diff --git a/src/tests/Common/GenerateHWIntrinsicTests/Arm/SveTests.cs b/src/tests/Common/GenerateHWIntrinsicTests/Arm/SveTests.cs index c5e0cc221b2e33..433da9776b85d2 100644 --- a/src/tests/Common/GenerateHWIntrinsicTests/Arm/SveTests.cs +++ b/src/tests/Common/GenerateHWIntrinsicTests/Arm/SveTests.cs @@ -417,16 +417,16 @@ public static (string templateFileName, Dictionary templateData) ("SveGatherPrefetchIndices.template", new Dictionary { ["TestName"] = "Sve_GatherPrefetch8Bit_Indices_byte_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "GatherPrefetch8Bit", ["RetBaseType"] = "void", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["Op2BaseType"] = "void", ["Op3VectorType"] = "Vector", ["Op3BaseType"] = "UInt64",["Op4BaseType"] = "SvePrefetchType",["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt64()", ["ValidPrefetch"] = "SvePrefetchType.StoreL3Temporal", ["InvalidPrefetch"] = "(SvePrefetchType)234"}), ("SveGatherPrefetchIndices.template", new Dictionary { ["TestName"] = "Sve_GatherPrefetch8Bit_Indices_sbyte_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "GatherPrefetch8Bit", ["RetBaseType"] = "void", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["Op2BaseType"] = "void", ["Op3VectorType"] = "Vector", ["Op3BaseType"] = "UInt64",["Op4BaseType"] = "SvePrefetchType",["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetUInt64()", ["ValidPrefetch"] = "SvePrefetchType.StoreL1Temporal", ["InvalidPrefetch"] = "(SvePrefetchType)86"}), - ("SveVecImmUnOpTest.template", new Dictionary { ["TestName"] = "Sve_DuplicateSelectedScalarToVector_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "DuplicateSelectedScalarToVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["InvalidImm"] = "16", ["Imm"] = "TestLibrary.Generator.GetByte() % 16", ["ValidateIterResult"] = "result[i] != (imm < Op1ElementCount ? firstOp[imm] : 0)", ["GetIterResult"] = "(Single)(imm < Op1ElementCount ? firstOp[imm] : 0)"}), - ("SveVecImmUnOpTest.template", new Dictionary { ["TestName"] = "Sve_DuplicateSelectedScalarToVector_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "DuplicateSelectedScalarToVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["InvalidImm"] = "8", ["Imm"] = "TestLibrary.Generator.GetByte() % 8", ["ValidateIterResult"] = "result[i] != (imm < Op1ElementCount ? firstOp[imm] : 0)", ["GetIterResult"] = "(Double)(imm < Op1ElementCount ? firstOp[imm] : 0)"}), - ("SveVecImmUnOpTest.template", new Dictionary { ["TestName"] = "Sve_DuplicateSelectedScalarToVector_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "DuplicateSelectedScalarToVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["InvalidImm"] = "64", ["Imm"] = "TestLibrary.Generator.GetByte() % 64", ["ValidateIterResult"] = "result[i] != (imm < Op1ElementCount ? firstOp[imm] : 0)", ["GetIterResult"] = "(SByte)(imm < Op1ElementCount ? firstOp[imm] : 0)"}), - ("SveVecImmUnOpTest.template", new Dictionary { ["TestName"] = "Sve_DuplicateSelectedScalarToVector_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "DuplicateSelectedScalarToVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["InvalidImm"] = "32", ["Imm"] = "TestLibrary.Generator.GetByte() % 32", ["ValidateIterResult"] = "result[i] != (imm < Op1ElementCount ? firstOp[imm] : 0)", ["GetIterResult"] = "(Int16)(imm < Op1ElementCount ? firstOp[imm] : 0)"}), - ("SveVecImmUnOpTest.template", new Dictionary { ["TestName"] = "Sve_DuplicateSelectedScalarToVector_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "DuplicateSelectedScalarToVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["InvalidImm"] = "16", ["Imm"] = "TestLibrary.Generator.GetByte() % 16", ["ValidateIterResult"] = "result[i] != (imm < Op1ElementCount ? firstOp[imm] : 0)", ["GetIterResult"] = "(Int32)(imm < Op1ElementCount ? firstOp[imm] : 0)"}), - ("SveVecImmUnOpTest.template", new Dictionary { ["TestName"] = "Sve_DuplicateSelectedScalarToVector_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "DuplicateSelectedScalarToVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["InvalidImm"] = "8", ["Imm"] = "TestLibrary.Generator.GetByte() % 8", ["ValidateIterResult"] = "result[i] != (imm < Op1ElementCount ? firstOp[imm] : 0)", ["GetIterResult"] = "(Int64)(imm < Op1ElementCount ? firstOp[imm] : 0)"}), - ("SveVecImmUnOpTest.template", new Dictionary { ["TestName"] = "Sve_DuplicateSelectedScalarToVector_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "DuplicateSelectedScalarToVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["InvalidImm"] = "64", ["Imm"] = "TestLibrary.Generator.GetByte() % 64", ["ValidateIterResult"] = "result[i] != (imm < Op1ElementCount ? firstOp[imm] : 0)", ["GetIterResult"] = "(Byte)(imm < Op1ElementCount ? firstOp[imm] : 0)"}), - ("SveVecImmUnOpTest.template", new Dictionary { ["TestName"] = "Sve_DuplicateSelectedScalarToVector_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "DuplicateSelectedScalarToVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["InvalidImm"] = "32", ["Imm"] = "TestLibrary.Generator.GetByte() % 32", ["ValidateIterResult"] = "result[i] != (imm < Op1ElementCount ? firstOp[imm] : 0)", ["GetIterResult"] = "(UInt16)(imm < Op1ElementCount ? firstOp[imm] : 0)"}), - ("SveVecImmUnOpTest.template", new Dictionary { ["TestName"] = "Sve_DuplicateSelectedScalarToVector_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "DuplicateSelectedScalarToVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["InvalidImm"] = "16", ["Imm"] = "TestLibrary.Generator.GetByte() % 16", ["ValidateIterResult"] = "result[i] != (imm < Op1ElementCount ? firstOp[imm] : 0)", ["GetIterResult"] = "(UInt32)(imm < Op1ElementCount ? firstOp[imm] : 0)"}), - ("SveVecImmUnOpTest.template", new Dictionary { ["TestName"] = "Sve_DuplicateSelectedScalarToVector_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "DuplicateSelectedScalarToVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["InvalidImm"] = "8", ["Imm"] = "TestLibrary.Generator.GetByte() % 8", ["ValidateIterResult"] = "result[i] != (imm < Op1ElementCount ? firstOp[imm] : 0)", ["GetIterResult"] = "(UInt64)(imm < Op1ElementCount ? firstOp[imm] : 0)"}), + ("SveVecImmUnOpTest.template", new Dictionary { ["TestName"] = "Sve_DuplicateSelectedScalarToVector_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "DuplicateSelectedScalarToVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["InvalidImm"] = "16", ["Imm"] = "(Byte)11", ["ValidateIterResult"] = "result[i] != (Imm < Op1ElementCount ? firstOp[Imm] : 0)", ["GetIterResult"] = "(Single)(Imm < Op1ElementCount ? firstOp[Imm] : 0)"}), + ("SveVecImmUnOpTest.template", new Dictionary { ["TestName"] = "Sve_DuplicateSelectedScalarToVector_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "DuplicateSelectedScalarToVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["InvalidImm"] = "8", ["Imm"] = "(Byte)2", ["ValidateIterResult"] = "result[i] != (Imm < Op1ElementCount ? firstOp[Imm] : 0)", ["GetIterResult"] = "(Double)(Imm < Op1ElementCount ? firstOp[Imm] : 0)"}), + ("SveVecImmUnOpTest.template", new Dictionary { ["TestName"] = "Sve_DuplicateSelectedScalarToVector_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "DuplicateSelectedScalarToVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["InvalidImm"] = "64", ["Imm"] = "(Byte)47", ["ValidateIterResult"] = "result[i] != (Imm < Op1ElementCount ? firstOp[Imm] : 0)", ["GetIterResult"] = "(SByte)(Imm < Op1ElementCount ? firstOp[Imm] : 0)"}), + ("SveVecImmUnOpTest.template", new Dictionary { ["TestName"] = "Sve_DuplicateSelectedScalarToVector_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "DuplicateSelectedScalarToVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["InvalidImm"] = "32", ["Imm"] = "(Byte)30", ["ValidateIterResult"] = "result[i] != (Imm < Op1ElementCount ? firstOp[Imm] : 0)", ["GetIterResult"] = "(Int16)(Imm < Op1ElementCount ? firstOp[Imm] : 0)"}), + ("SveVecImmUnOpTest.template", new Dictionary { ["TestName"] = "Sve_DuplicateSelectedScalarToVector_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "DuplicateSelectedScalarToVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["InvalidImm"] = "16", ["Imm"] = "(Byte)4", ["ValidateIterResult"] = "result[i] != (Imm < Op1ElementCount ? firstOp[Imm] : 0)", ["GetIterResult"] = "(Int32)(Imm < Op1ElementCount ? firstOp[Imm] : 0)"}), + ("SveVecImmUnOpTest.template", new Dictionary { ["TestName"] = "Sve_DuplicateSelectedScalarToVector_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "DuplicateSelectedScalarToVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["InvalidImm"] = "8", ["Imm"] = "(Byte)5", ["ValidateIterResult"] = "result[i] != (Imm < Op1ElementCount ? firstOp[Imm] : 0)", ["GetIterResult"] = "(Int64)(Imm < Op1ElementCount ? firstOp[Imm] : 0)"}), + ("SveVecImmUnOpTest.template", new Dictionary { ["TestName"] = "Sve_DuplicateSelectedScalarToVector_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "DuplicateSelectedScalarToVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["InvalidImm"] = "64", ["Imm"] = "(Byte)17", ["ValidateIterResult"] = "result[i] != (Imm < Op1ElementCount ? firstOp[Imm] : 0)", ["GetIterResult"] = "(Byte)(Imm < Op1ElementCount ? firstOp[Imm] : 0)"}), + ("SveVecImmUnOpTest.template", new Dictionary { ["TestName"] = "Sve_DuplicateSelectedScalarToVector_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "DuplicateSelectedScalarToVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["InvalidImm"] = "32", ["Imm"] = "(Byte)25", ["ValidateIterResult"] = "result[i] != (Imm < Op1ElementCount ? firstOp[Imm] : 0)", ["GetIterResult"] = "(UInt16)(Imm < Op1ElementCount ? firstOp[Imm] : 0)"}), + ("SveVecImmUnOpTest.template", new Dictionary { ["TestName"] = "Sve_DuplicateSelectedScalarToVector_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "DuplicateSelectedScalarToVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["InvalidImm"] = "16", ["Imm"] = "(Byte)14", ["ValidateIterResult"] = "result[i] != (Imm < Op1ElementCount ? firstOp[Imm] : 0)", ["GetIterResult"] = "(UInt32)(Imm < Op1ElementCount ? firstOp[Imm] : 0)"}), + ("SveVecImmUnOpTest.template", new Dictionary { ["TestName"] = "Sve_DuplicateSelectedScalarToVector_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "DuplicateSelectedScalarToVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["InvalidImm"] = "8", ["Imm"] = "(Byte)1", ["ValidateIterResult"] = "result[i] != (Imm < Op1ElementCount ? firstOp[Imm] : 0)", ["GetIterResult"] = "(UInt64)(Imm < Op1ElementCount ? firstOp[Imm] : 0)"}), ("SveVecBinOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateMaskForFirstActiveElement_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateMaskForFirstActiveElement", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskSByte()", ["NextValueOp2"] = "Helpers.getMaskSByte()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateMaskForFirstActiveElement(left, right))", ["GetVectorResult"] = "Helpers.CreateMaskForFirstActiveElement(left, right)"}), ("SveVecBinOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateMaskForFirstActiveElement_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateMaskForFirstActiveElement", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskInt16()", ["NextValueOp2"] = "Helpers.getMaskInt16()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateMaskForFirstActiveElement(left, right))", ["GetVectorResult"] = "Helpers.CreateMaskForFirstActiveElement(left, right)"}), @@ -1320,10 +1320,10 @@ public static (string templateFileName, Dictionary templateData) ("SveVecBinOpDifferentTypesTest.template", new Dictionary { ["TestName"] = "Sve_ShiftRightArithmetic_short_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ShiftRightArithmetic", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.ShiftRight(left[i], right[(i * sizeof(short)) / sizeof(ulong)]) != result[i]", ["GetIterResult"] = "Helpers.ShiftRight(left[i], right[(i * sizeof(short)) / sizeof(ulong)])"}), ("SveVecBinOpDifferentTypesTest.template", new Dictionary { ["TestName"] = "Sve_ShiftRightArithmetic_int_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ShiftRightArithmetic", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.ShiftRight(left[i], right[(i * sizeof(int)) / sizeof(ulong)]) != result[i]", ["GetIterResult"] = "Helpers.ShiftRight(left[i], right[(i * sizeof(int)) / sizeof(ulong)])"}), - ("SveVecImmUnOpTest.template", new Dictionary {["TestName"] = "Sve_ShiftRightArithmeticForDivide_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ShiftRightArithmeticForDivide", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["InvalidImm"] = "0", ["Imm"] = "(TestLibrary.Generator.GetByte() % 8) + 1", ["ValidateIterResult"] = "Helpers.ShiftRight(firstOp[i], (ulong)imm) != result[i]", ["GetIterResult"] = "Helpers.ShiftRight(firstOp[i], (ulong)imm)"}), - ("SveVecImmUnOpTest.template", new Dictionary {["TestName"] = "Sve_ShiftRightArithmeticForDivide_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ShiftRightArithmeticForDivide", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["InvalidImm"] = "0", ["Imm"] = "(TestLibrary.Generator.GetByte() % 16) + 1", ["ValidateIterResult"] = "Helpers.ShiftRight(firstOp[i], (ulong)imm) != result[i]", ["GetIterResult"] = "Helpers.ShiftRight(firstOp[i], (ulong)imm)"}), - ("SveVecImmUnOpTest.template", new Dictionary {["TestName"] = "Sve_ShiftRightArithmeticForDivide_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ShiftRightArithmeticForDivide", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["InvalidImm"] = "0", ["Imm"] = "(TestLibrary.Generator.GetByte() % 32) + 1", ["ValidateIterResult"] = "Helpers.ShiftRight(firstOp[i], (ulong)imm) != result[i]", ["GetIterResult"] = "Helpers.ShiftRight(firstOp[i], (ulong)imm)"}), - ("SveVecImmUnOpTest.template", new Dictionary {["TestName"] = "Sve_ShiftRightArithmeticForDivide_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ShiftRightArithmeticForDivide", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["InvalidImm"] = "0", ["Imm"] = "(TestLibrary.Generator.GetByte() % 64) + 1", ["ValidateIterResult"] = "Helpers.ShiftRight(firstOp[i], (ulong)imm) != result[i]", ["GetIterResult"] = "Helpers.ShiftRight(firstOp[i], (ulong)imm)"}), + ("SveVecImmUnOpTest.template", new Dictionary {["TestName"] = "Sve_ShiftRightArithmeticForDivide_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ShiftRightArithmeticForDivide", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["InvalidImm"] = "0", ["Imm"] = "(Byte)8", ["ValidateIterResult"] = "Helpers.ShiftRight(firstOp[i], (ulong)Imm) != result[i]", ["GetIterResult"] = "Helpers.ShiftRight(firstOp[i], (ulong)Imm)"}), + ("SveVecImmUnOpTest.template", new Dictionary {["TestName"] = "Sve_ShiftRightArithmeticForDivide_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ShiftRightArithmeticForDivide", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["InvalidImm"] = "0", ["Imm"] = "(Byte)14", ["ValidateIterResult"] = "Helpers.ShiftRight(firstOp[i], (ulong)Imm) != result[i]", ["GetIterResult"] = "Helpers.ShiftRight(firstOp[i], (ulong)Imm)"}), + ("SveVecImmUnOpTest.template", new Dictionary {["TestName"] = "Sve_ShiftRightArithmeticForDivide_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ShiftRightArithmeticForDivide", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["InvalidImm"] = "0", ["Imm"] = "(Byte)22", ["ValidateIterResult"] = "Helpers.ShiftRight(firstOp[i], (ulong)Imm) != result[i]", ["GetIterResult"] = "Helpers.ShiftRight(firstOp[i], (ulong)Imm)"}), + ("SveVecImmUnOpTest.template", new Dictionary {["TestName"] = "Sve_ShiftRightArithmeticForDivide_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ShiftRightArithmeticForDivide", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["InvalidImm"] = "0", ["Imm"] = "(Byte)64", ["ValidateIterResult"] = "Helpers.ShiftRight(firstOp[i], (ulong)Imm) != result[i]", ["GetIterResult"] = "Helpers.ShiftRight(firstOp[i], (ulong)Imm)"}), ("SveVecBinOpDifferentTypesTest.template", new Dictionary { ["TestName"] = "Sve_ShiftRightLogical_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ShiftRightLogical", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.ShiftRight(left[i], (ulong)right[i]) != result[i]", ["GetIterResult"] = "Helpers.ShiftRight(left[i], (ulong)right[i])"}), ("SveVecBinOpDifferentTypesTest.template", new Dictionary { ["TestName"] = "Sve_ShiftRightLogical_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ShiftRightLogical", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.ShiftRight(left[i], (ulong)right[i]) != result[i]", ["GetIterResult"] = "Helpers.ShiftRight(left[i], (ulong)right[i])"}), diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveImmUnaryOpTestTemplate.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveImmUnaryOpTestTemplate.template index 7b73bd5f3deb15..375e0d9effe0c2 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveImmUnaryOpTestTemplate.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveImmUnaryOpTestTemplate.template @@ -126,7 +126,6 @@ namespace JIT.HardwareIntrinsics.Arm private struct TestStruct { public {Op1VectorType}<{Op1BaseType}> _fld; - public byte _imm; public static TestStruct Create() { @@ -134,17 +133,16 @@ namespace JIT.HardwareIntrinsics.Arm for (var i = 0; i < Op1ElementCount; i++) { _data[i] = {NextValueOp1}; } Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld), ref Unsafe.As<{Op1BaseType}, byte>(ref _data[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); - testStruct._imm = (byte)({Imm}); return testStruct; } public void RunStructFldScenario({TemplateName}UnaryOpTest__{TestName} testClass) { - var result = {Isa}.{Method}(_fld, _imm); + var result = {Isa}.{Method}(_fld, {Imm}); Unsafe.Write(testClass._dataTable.outArrayPtr, result); - testClass.ValidateResult(_fld, _imm, testClass._dataTable.outArrayPtr); + testClass.ValidateResult(_fld, testClass._dataTable.outArrayPtr); } } @@ -152,7 +150,7 @@ namespace JIT.HardwareIntrinsics.Arm private static readonly int Op1ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); private static readonly int RetElementCount = Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>() / sizeof({RetBaseType}); - private static readonly byte Imm = (byte)({Imm}); + private static readonly byte Imm = {Imm}; private static {RetBaseType}[] _maskData = new {RetBaseType}[RetElementCount]; private static {Op1BaseType}[] _data = new {Op1BaseType}[Op1ElementCount]; @@ -189,11 +187,11 @@ namespace JIT.HardwareIntrinsics.Arm var result = {Isa}.{Method}( Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArrayPtr), - Imm + {Imm} ); Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, Imm, _dataTable.outArrayPtr); + ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); } public void RunBasicScenario_UnsafeRead_InvalidImm() @@ -227,11 +225,11 @@ namespace JIT.HardwareIntrinsics.Arm var result = {Isa}.{Method}( {LoadIsa}.Load{Op1VectorType}(loadMask, ({Op1BaseType}*)(_dataTable.inArrayPtr)), - Imm + {Imm} ); Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, Imm, _dataTable.outArrayPtr); + ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); } public void RunReflectionScenario_UnsafeRead() @@ -241,11 +239,11 @@ namespace JIT.HardwareIntrinsics.Arm var result = typeof({Isa}).GetMethod(nameof({Isa}.{Method}), new Type[] { typeof({Op1VectorType}<{Op1BaseType}>), typeof(byte) }) .Invoke(null, new object[] { Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArrayPtr), - Imm + (byte){Imm} }); Unsafe.Write(_dataTable.outArrayPtr, ({RetVectorType}<{RetBaseType}>)(result)); - ValidateResult(_dataTable.inArrayPtr, Imm, _dataTable.outArrayPtr); + ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); } public void RunLclVarScenario_UnsafeRead() @@ -253,20 +251,20 @@ namespace JIT.HardwareIntrinsics.Arm TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); var op = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArrayPtr); - var result = {Isa}.{Method}(op, Imm); + var result = {Isa}.{Method}(op, {Imm}); Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(op, Imm, _dataTable.outArrayPtr); + ValidateResult(op, _dataTable.outArrayPtr); } public void RunClassFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); - var result = {Isa}.{Method}(_fld, Imm); + var result = {Isa}.{Method}(_fld, {Imm}); Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_fld, Imm, _dataTable.outArrayPtr); + ValidateResult(_fld, _dataTable.outArrayPtr); } public void RunStructLclFldScenario() @@ -274,10 +272,10 @@ namespace JIT.HardwareIntrinsics.Arm TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); var test = TestStruct.Create(); - var result = {Isa}.{Method}(test._fld, test._imm); + var result = {Isa}.{Method}(test._fld, {Imm}); Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(test._fld, test._imm, _dataTable.outArrayPtr); + ValidateResult(test._fld, _dataTable.outArrayPtr); } public void RunStructFldScenario() @@ -354,7 +352,7 @@ namespace JIT.HardwareIntrinsics.Arm [method: MethodImpl(MethodImplOptions.AggressiveInlining)] private void ConditionalSelectScenario_TrueValue({RetVectorType}<{RetBaseType}> mask, {Op1VectorType}<{Op1BaseType}> op, {RetVectorType}<{RetBaseType}> falseOp) { - var result = Sve.ConditionalSelect(mask, {Isa}.{Method}(op, Imm), falseOp); + var result = Sve.ConditionalSelect(mask, {Isa}.{Method}(op, {Imm}), falseOp); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateConditionalSelectResult_TrueValue(mask, op, falseOp, Imm, _dataTable.outArrayPtr); } @@ -362,7 +360,7 @@ namespace JIT.HardwareIntrinsics.Arm [method: MethodImpl(MethodImplOptions.AggressiveInlining)] private void ConditionalSelectScenario_FalseValue({RetVectorType}<{RetBaseType}> mask, {Op1VectorType}<{Op1BaseType}> op, {RetVectorType}<{RetBaseType}> trueOp) { - var result = Sve.ConditionalSelect(mask, trueOp, {Isa}.{Method}(op, Imm)); + var result = Sve.ConditionalSelect(mask, trueOp, {Isa}.{Method}(op, {Imm})); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateConditionalSelectResult_FalseValue(mask, op, trueOp, Imm, _dataTable.outArrayPtr); } @@ -440,7 +438,7 @@ namespace JIT.HardwareIntrinsics.Arm } } - private void ValidateResult({Op1VectorType}<{Op1BaseType}> op, byte imm, void* result, [CallerMemberName] string method = "") + private void ValidateResult({Op1VectorType}<{Op1BaseType}> op, void* result, [CallerMemberName] string method = "") { {Op1BaseType}[] inArray = new {Op1BaseType}[Op1ElementCount]; {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; @@ -448,10 +446,10 @@ namespace JIT.HardwareIntrinsics.Arm Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray[0]), op); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>()); - ValidateResult(inArray, imm, outArray, method); + ValidateResult(inArray, outArray, method); } - private void ValidateResult(void* op, byte imm, void* result, [CallerMemberName] string method = "") + private void ValidateResult(void* op, void* result, [CallerMemberName] string method = "") { {Op1BaseType}[] inArray = new {Op1BaseType}[Op1ElementCount]; {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; @@ -459,10 +457,10 @@ namespace JIT.HardwareIntrinsics.Arm Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray[0]), ref Unsafe.AsRef(op), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>()); - ValidateResult(inArray, imm, outArray, method); + ValidateResult(inArray, outArray, method); } - private void ValidateResult({Op1BaseType}[] firstOp, byte imm, {RetBaseType}[] result, [CallerMemberName] string method = "") + private void ValidateResult({Op1BaseType}[] firstOp, {RetBaseType}[] result, [CallerMemberName] string method = "") { bool succeeded = true; @@ -472,7 +470,7 @@ namespace JIT.HardwareIntrinsics.Arm { TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>, byte): {method} failed:"); TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); - TestLibrary.TestFramework.LogInformation($" imm: ({string.Join(", ", imm)})"); + TestLibrary.TestFramework.LogInformation($" imm: ({string.Join(", ", Imm)})"); TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); TestLibrary.TestFramework.LogInformation(string.Empty);