From 2cb7632582ca8375c7f53246741cb50c62674574 Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Wed, 3 Jul 2024 21:08:33 -0700 Subject: [PATCH 01/10] Add AbsoluteCompare*() APIs --- .../Arm/Sve.PlatformNotSupported.cs | 56 ++++++++++++++++++ .../src/System/Runtime/Intrinsics/Arm/Sve.cs | 57 +++++++++++++++++++ .../ref/System.Runtime.Intrinsics.cs | 9 +++ 3 files changed, 122 insertions(+) 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 b56d0f795d59f..4986db2b44607 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 @@ -75,6 +75,62 @@ internal Arm64() { } /// public static unsafe Vector Abs(Vector value) { throw new PlatformNotSupportedException(); } + /// Absolute compare greater than + + /// + /// svbool_t svacgt[_f32](svbool_t pg, svfloat32_t op1, svfloat32_t op2) + /// FACGT Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector AbsoluteCompareGreaterThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svacgt[_f64](svbool_t pg, svfloat64_t op1, svfloat64_t op2) + /// FACGT Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector AbsoluteCompareGreaterThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// Absolute compare greater than or equal to + + /// + /// svbool_t svacge[_f32](svbool_t pg, svfloat32_t op1, svfloat32_t op2) + /// FACGE Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector AbsoluteCompareGreaterThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svacge[_f64](svbool_t pg, svfloat64_t op1, svfloat64_t op2) + /// FACGE Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector AbsoluteCompareGreaterThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// Absolute compare less than + + /// + /// svbool_t svaclt[_f32](svbool_t pg, svfloat32_t op1, svfloat32_t op2) + /// FACLT Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector AbsoluteCompareLessThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svaclt[_f64](svbool_t pg, svfloat64_t op1, svfloat64_t op2) + /// FACLT Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector AbsoluteCompareLessThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// Absolute compare less than or equal to + + /// + /// svbool_t svacle[_f32](svbool_t pg, svfloat32_t op1, svfloat32_t op2) + /// FACLE Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector AbsoluteCompareLessThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svacle[_f64](svbool_t pg, svfloat64_t op1, svfloat64_t op2) + /// FACLE Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector AbsoluteCompareLessThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + /// AbsoluteDifference : Absolute difference /// 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 979a712112c65..b1e64fe0d94fd 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 @@ -103,6 +103,63 @@ internal Arm64() { } /// public static unsafe Vector Abs(Vector value) => Abs(value); + + /// Absolute compare greater than + + /// + /// svbool_t svacgt[_f32](svbool_t pg, svfloat32_t op1, svfloat32_t op2) + /// FACGT Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector AbsoluteCompareGreaterThan(Vector left, Vector right) => AbsoluteCompareGreaterThan(left, right); + + /// + /// svbool_t svacgt[_f64](svbool_t pg, svfloat64_t op1, svfloat64_t op2) + /// FACGT Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector AbsoluteCompareGreaterThan(Vector left, Vector right) => AbsoluteCompareGreaterThan(left, right); + + /// Absolute compare greater than or equal to + + /// + /// svbool_t svacge[_f32](svbool_t pg, svfloat32_t op1, svfloat32_t op2) + /// FACGE Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector AbsoluteCompareGreaterThanOrEqual(Vector left, Vector right) => AbsoluteCompareGreaterThanOrEqual(left, right); + + /// + /// svbool_t svacge[_f64](svbool_t pg, svfloat64_t op1, svfloat64_t op2) + /// FACGE Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector AbsoluteCompareGreaterThanOrEqual(Vector left, Vector right) => AbsoluteCompareGreaterThanOrEqual(left, right); + + /// Absolute compare less than + + /// + /// svbool_t svaclt[_f32](svbool_t pg, svfloat32_t op1, svfloat32_t op2) + /// FACLT Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector AbsoluteCompareLessThan(Vector left, Vector right) => AbsoluteCompareLessThan(left, right); + + /// + /// svbool_t svaclt[_f64](svbool_t pg, svfloat64_t op1, svfloat64_t op2) + /// FACLT Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector AbsoluteCompareLessThan(Vector left, Vector right) => AbsoluteCompareLessThan(left, right); + + /// Absolute compare less than or equal to + + /// + /// svbool_t svacle[_f32](svbool_t pg, svfloat32_t op1, svfloat32_t op2) + /// FACLE Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector AbsoluteCompareLessThanOrEqual(Vector left, Vector right) => AbsoluteCompareLessThanOrEqual(left, right); + + /// + /// svbool_t svacle[_f64](svbool_t pg, svfloat64_t op1, svfloat64_t op2) + /// FACLE Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector AbsoluteCompareLessThanOrEqual(Vector left, Vector right) => AbsoluteCompareLessThanOrEqual(left, right); + /// AbsoluteDifference : Absolute difference /// 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 66fc0bdd4127a..d64849a7b197e 100644 --- a/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs +++ b/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs @@ -4202,6 +4202,15 @@ internal Arm64() { } public static System.Numerics.Vector Abs(System.Numerics.Vector value) { throw null; } public static System.Numerics.Vector Abs(System.Numerics.Vector value) { throw null; } + public static System.Numerics.Vector AbsoluteCompareGreaterThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector AbsoluteCompareGreaterThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector AbsoluteCompareGreaterThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector AbsoluteCompareGreaterThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector AbsoluteCompareLessThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector AbsoluteCompareLessThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector AbsoluteCompareLessThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector AbsoluteCompareLessThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector AbsoluteDifference(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } public static System.Numerics.Vector AbsoluteDifference(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } public static System.Numerics.Vector AbsoluteDifference(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } From 07c1b561362d97344006f739da5dda342608aca7 Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Wed, 3 Jul 2024 21:10:21 -0700 Subject: [PATCH 02/10] Map API to instructions --- src/coreclr/jit/hwintrinsiclistarm64sve.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/coreclr/jit/hwintrinsiclistarm64sve.h b/src/coreclr/jit/hwintrinsiclistarm64sve.h index 6933f8e2f9b81..69096b437f8f7 100644 --- a/src/coreclr/jit/hwintrinsiclistarm64sve.h +++ b/src/coreclr/jit/hwintrinsiclistarm64sve.h @@ -17,6 +17,10 @@ // SVE Intrinsics #define FIRST_NI_Sve NI_Sve_Abs HARDWARE_INTRINSIC(Sve, Abs, -1, -1, false, {INS_sve_abs, INS_invalid, INS_sve_abs, INS_invalid, INS_sve_abs, INS_invalid, INS_sve_abs, INS_invalid, INS_sve_fabs, INS_sve_fabs}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation) +HARDWARE_INTRINSIC(Sve, AbsoluteCompareGreaterThan, -1, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_facgt, INS_sve_facgt}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_ReturnsPerElementMask) +HARDWARE_INTRINSIC(Sve, AbsoluteCompareGreaterThanOrEqual, -1, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_facge, INS_sve_facge}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_ReturnsPerElementMask) +HARDWARE_INTRINSIC(Sve, AbsoluteCompareLessThan, -1, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_faclt, INS_sve_faclt}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_ReturnsPerElementMask) +HARDWARE_INTRINSIC(Sve, AbsoluteCompareLessThanOrEqual, -1, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_facle, INS_sve_facle}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_ReturnsPerElementMask) HARDWARE_INTRINSIC(Sve, AbsoluteDifference, -1, -1, false, {INS_sve_sabd, INS_sve_uabd, INS_sve_sabd, INS_sve_uabd, INS_sve_sabd, INS_sve_uabd, INS_sve_sabd, INS_sve_uabd, INS_sve_fabd, INS_sve_fabd}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_HasRMWSemantics|HW_Flag_LowMaskedOperation) HARDWARE_INTRINSIC(Sve, Add, -1, -1, false, {INS_sve_add, INS_sve_add, INS_sve_add, INS_sve_add, INS_sve_add, INS_sve_add, INS_sve_add, INS_sve_add, INS_sve_fadd, INS_sve_fadd}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_OptionalEmbeddedMaskedOperation|HW_Flag_HasRMWSemantics|HW_Flag_LowMaskedOperation) HARDWARE_INTRINSIC(Sve, AddAcross, -1, 1, true, {INS_sve_saddv, INS_sve_uaddv, INS_sve_saddv, INS_sve_uaddv, INS_sve_saddv, INS_sve_uaddv, INS_sve_uaddv, INS_sve_uaddv, INS_sve_faddv, INS_sve_faddv}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_BaseTypeFromFirstArg|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation) From 7b01c1739c583112b7e63415672185263524925d Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Wed, 3 Jul 2024 21:47:44 -0700 Subject: [PATCH 03/10] Add test coverage --- .../GenerateHWIntrinsicTests_Arm.cs | 20 + .../HardwareIntrinsics/Arm/Shared/Helpers.cs | 265 ++++++++ .../_SveBinaryRetMaskOpTestTemplate.template | 571 ++++++++++++++++++ 3 files changed, 856 insertions(+) create mode 100644 src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveBinaryRetMaskOpTestTemplate.template diff --git a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs index 8f6bf8a33af23..a966d64bfab91 100644 --- a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs +++ b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs @@ -78,6 +78,16 @@ } }"; +const string SimpleVecOpTest_ValidationLogicForCndSelMask = @"for (var i = 0; i < RetElementCount; i++) + { + {Op1BaseType} iterResult = ({GetIterResult} != 0) ? trueVal[i] : falseVal[i]; + if (iterResult != result[i]) + { + succeeded = false; + break; + } + }"; + const string SimpleVecOpTest_ValidationLogicForCndSel_FalseValue = @"for (var i = 0; i < RetElementCount; i++) { {Op1BaseType} iterResult = (mask[i] != 0) ? trueVal[i] : {GetIterResult}; @@ -263,6 +273,7 @@ ("_SveBinaryOpTestTemplate.template", "SveVecBinOpTest.template", new Dictionary { ["TemplateName"] = "Simple", ["TemplateValidationLogic"] = SimpleVecOpTest_ValidationLogic, ["TemplateValidationLogicForCndSel"] = SimpleVecOpTest_ValidationLogicForCndSel, ["TemplateValidationLogicForCndSel_FalseValue"] = SimpleVecOpTest_ValidationLogicForCndSel_FalseValue }), ("_SveBinaryOpTestTemplate.template", "SveVecBinOpVecTest.template", new Dictionary { ["TemplateName"] = "Simple", ["TemplateValidationLogic"] = SimpleVecOpTest_VectorValidationLogic, ["TemplateValidationLogicForCndSel"] = SimpleVecOpTest_VectorValidationLogicForCndSel, ["TemplateValidationLogicForCndSel_FalseValue"] = SimpleVecOpTest_VectorValidationLogicForCndSel_FalseValue }), ("_SveBinaryOpTestTemplate.template", "SveVecBinOpConvertTest.template", new Dictionary { ["TemplateName"] = "Simple", ["TemplateValidationLogic"] = SimpleVecOpTest_ValidationLogic, ["TemplateValidationLogicForCndSel"] = SimpleTernVecOpTest_ValidationLogicForCndSel, ["TemplateValidationLogicForCndSel_FalseValue"] = SimpleTernVecOpTest_ValidationLogicForCndSel_FalseValue }), + ("_SveBinaryRetMaskOpTestTemplate.template", "SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TemplateName"] = "Simple", ["TemplateValidationLogic"] = SimpleVecOpTest_ValidationLogic, ["TemplateValidationLogicForCndSel"] = SimpleTernVecOpTest_ValidationLogicForCndSel, ["TemplateValidationLogicForCndSel_FalseValue"] = SimpleTernVecOpTest_ValidationLogicForCndSel_FalseValue, ["TemplateValidationLogicForCndSelMask"] = SimpleVecOpTest_ValidationLogicForCndSelMask }), ("_SveBinaryOpDifferentTypesTestTemplate.template", "SveVecBinOpDifferentTypesTest.template", new Dictionary { ["TemplateName"] = "Simple", ["TemplateValidationLogic"] = SimpleVecOpTest_ValidationLogic, ["TemplateValidationLogicForCndSel"] = SimpleVecOpTest_ValidationLogicForCndSel, ["TemplateValidationLogicForCndSel_FalseValue"] = SimpleVecOpTest_ValidationLogicForCndSel_FalseValue }), ("_SveBinaryMaskOpTestTemplate.template", "SveMaskVecBinOpConvertTest.template", new Dictionary { ["TemplateName"] = "Simple", ["TemplateValidationLogic"] = SimpleVecOpTest_ValidationLogic, ["TemplateValidationLogicForCndSel"] = SimpleVecOpTest_ValidationLogicForCndSel, ["TemplateValidationLogicForCndSel_FalseValue"] = SimpleVecOpTest_ValidationLogicForCndSel_FalseValue }), ("_SveImmBinaryOpTestTemplate.template", "SveVecImmBinOpTest.template", new Dictionary { ["TemplateName"] = "Simple", ["TemplateValidationLogic"] = SimpleVecOpTest_ValidationLogic, ["TemplateValidationLogicForCndSel"] = SimpleVecOpTest_ValidationLogicForCndSel, ["TemplateValidationLogicForCndSel_FalseValue"] = SimpleVecOpTest_ValidationLogicForCndSel_FalseValue }), @@ -3056,6 +3067,15 @@ ("SveSimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sve_Abs_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Abs", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "-TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.Abs(firstOp[i]) != result[i]", ["GetIterResult"] = "(int)Helpers.Abs(leftOp[i])"}), ("SveSimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sve_Abs_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Abs", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "-TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "(long)Helpers.Abs(firstOp[i]) != (long)result[i]", ["GetIterResult"] = "(long)Helpers.Abs(leftOp[i])"}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary {["TestName"] = "Sve_AbsoluteCompareGreaterThan_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "AbsoluteCompareGreaterThan", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.SveAbsoluteCompareGreaterThan(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveAbsoluteCompareGreaterThan(leftOp[i], rightOp[i])", ["ConvertFunc"] = "BitConverter.SingleToInt32Bits"}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary {["TestName"] = "Sve_AbsoluteCompareGreaterThan_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "AbsoluteCompareGreaterThan", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helpers.SveAbsoluteCompareGreaterThan(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveAbsoluteCompareGreaterThan(leftOp[i], rightOp[i])", ["ConvertFunc"] = "BitConverter.DoubleToInt64Bits"}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary {["TestName"] = "Sve_AbsoluteCompareGreaterThanOrEqual_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "AbsoluteCompareGreaterThanOrEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.SveAbsoluteCompareGreaterThanOrEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveAbsoluteCompareGreaterThanOrEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary {["TestName"] = "Sve_AbsoluteCompareGreaterThanOrEqual_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "AbsoluteCompareGreaterThanOrEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helpers.SveAbsoluteCompareGreaterThanOrEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveAbsoluteCompareGreaterThanOrEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary {["TestName"] = "Sve_AbsoluteCompareLessThan_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "AbsoluteCompareLessThan", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.SveAbsoluteCompareLessThan(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveAbsoluteCompareLessThan(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary {["TestName"] = "Sve_AbsoluteCompareLessThan_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "AbsoluteCompareLessThan", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helpers.SveAbsoluteCompareLessThan(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveAbsoluteCompareLessThan(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary {["TestName"] = "Sve_AbsoluteCompareLessThanOrEqual_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "AbsoluteCompareLessThanOrEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.SveAbsoluteCompareLessThanOrEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveAbsoluteCompareLessThanOrEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary {["TestName"] = "Sve_AbsoluteCompareLessThanOrEqual_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "AbsoluteCompareLessThanOrEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helpers.SveAbsoluteCompareLessThanOrEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveAbsoluteCompareLessThanOrEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_AbsoluteDifference_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "AbsoluteDifference", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.AbsoluteDifference(left[i], right[i])) != BitConverter.SingleToInt32Bits(result[i])", ["GetIterResult"] = "Helpers.AbsoluteDifference(left[i], right[i])", ["ConvertFunc"] = "BitConverter.SingleToInt32Bits"}), ("SveVecBinOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_AbsoluteDifference_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "AbsoluteDifference", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.AbsoluteDifference(left[i], right[i])) != BitConverter.DoubleToInt64Bits(result[i])", ["GetIterResult"] = "Helpers.AbsoluteDifference(left[i], right[i])", ["ConvertFunc"] = "BitConverter.DoubleToInt64Bits"}), ("SveVecBinOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_AbsoluteDifference_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "AbsoluteDifference", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "(sbyte)TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.AbsoluteDifference(left[i], right[i]) != result[i]", ["GetIterResult"] = "(sbyte)Helpers.AbsoluteDifference(left[i], right[i])", ["ConvertFunc"] = ""}), diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs index 3e987ec461297..3d6bcec978024 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs @@ -1667,6 +1667,271 @@ public static float AbsoluteCompareLessThanOrEqual(float left, float right) return BitConverter.Int32BitsToSingle(result); } + + public static double SveAbsoluteCompareGreaterThan(double left, double right) + { + long result = 0; + + left = Math.Abs(left); + right = Math.Abs(right); + + if (left > right) + { + result = 1; + } + + return BitConverter.Int64BitsToDouble(result); + } + + public static float SveAbsoluteCompareGreaterThan(float left, float right) + { + int result = 0; + + left = Math.Abs(left); + right = Math.Abs(right); + + if (left > right) + { + result = 1; + } + + return BitConverter.Int32BitsToSingle(result); + } + + public static double SveAbsoluteCompareGreaterThanOrEqual(double left, double right) + { + long result = 0; + + left = Math.Abs(left); + right = Math.Abs(right); + + if (left >= right) + { + result = 1; + } + + return BitConverter.Int64BitsToDouble(result); + } + + public static float SveAbsoluteCompareGreaterThanOrEqual(float left, float right) + { + int result = 0; + + left = Math.Abs(left); + right = Math.Abs(right); + + if (left >= right) + { + result = 1; + } + + return BitConverter.Int32BitsToSingle(result); + } + + public static double SveAbsoluteCompareLessThan(double left, double right) + { + long result = 0; + + left = Math.Abs(left); + right = Math.Abs(right); + + if (left < right) + { + result = 1; + } + + return BitConverter.Int64BitsToDouble(result); + } + + public static float SveAbsoluteCompareLessThan(float left, float right) + { + int result = 0; + + left = Math.Abs(left); + right = Math.Abs(right); + + if (left < right) + { + result = 1; + } + + return BitConverter.Int32BitsToSingle(result); + } + + public static double SveAbsoluteCompareLessThanOrEqual(double left, double right) + { + long result = 0; + + left = Math.Abs(left); + right = Math.Abs(right); + + if (left <= right) + { + result = 1; + } + + return BitConverter.Int64BitsToDouble(result); + } + + public static float SveAbsoluteCompareLessThanOrEqual(float left, float right) + { + int result = 0; + + left = Math.Abs(left); + right = Math.Abs(right); + + if (left <= right) + { + result = 1; + } + + return BitConverter.Int32BitsToSingle(result); + } + + public static double SveCompareEqual(double left, double right) + { + long result = 0; + + if (left == right) + { + result = 1; + } + + return BitConverter.Int64BitsToDouble(result); + } + + public static float SveCompareEqual(float left, float right) + { + int result = 0; + + if (left == right) + { + result = 1; + } + + return BitConverter.Int32BitsToSingle(result); + } + + public static double SveCompareGreaterThan(double left, double right) + { + long result = 0; + + if (left > right) + { + result = 1; + } + + return BitConverter.Int64BitsToDouble(result); + } + + public static float SveCompareGreaterThan(float left, float right) + { + int result = 0; + + if (left > right) + { + result = 1; + } + + return BitConverter.Int32BitsToSingle(result); + } + + public static double SveCompareGreaterThanOrEqual(double left, double right) + { + long result = 0; + + if (left >= right) + { + result = 1; + } + + return BitConverter.Int64BitsToDouble(result); + } + + public static float SveCompareGreaterThanOrEqual(float left, float right) + { + int result = 0; + + if (left >= right) + { + result = 1; + } + + return BitConverter.Int32BitsToSingle(result); + } + + public static double SveCompareLessThan(double left, double right) + { + long result = 0; + + if (left < right) + { + result = 1; + } + + return BitConverter.Int64BitsToDouble(result); + } + + public static float SveCompareLessThan(float left, float right) + { + int result = 0; + + if (left < right) + { + result = 1; + } + + return BitConverter.Int32BitsToSingle(result); + } + + public static double SveCompareLessThanOrEqual(double left, double right) + { + long result = 0; + + if (left <= right) + { + result = 1; + } + + return BitConverter.Int64BitsToDouble(result); + } + + public static float SveCompareLessThanOrEqual(float left, float right) + { + int result = 0; + + if (left <= right) + { + result = 1; + } + + return BitConverter.Int32BitsToSingle(result); + } + + public static double SveCompareTest(double left, double right) + { + long result = 0; + + if ((BitConverter.DoubleToInt64Bits(left) & BitConverter.DoubleToInt64Bits(right)) != 0) + { + result = 1; + } + + return BitConverter.Int64BitsToDouble(result); + } + + public static float SveCompareTest(float left, float right) + { + int result = 0; + + if ((BitConverter.SingleToInt32Bits(left) & BitConverter.SingleToInt32Bits(right)) != 0) + { + result = 1; + } + + return BitConverter.Int32BitsToSingle(result); + } + public static double CompareEqual(double left, double right) { long result = 0; diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveBinaryRetMaskOpTestTemplate.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveBinaryRetMaskOpTestTemplate.template new file mode 100644 index 0000000000000..81c8e6f7950e1 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveBinaryRetMaskOpTestTemplate.template @@ -0,0 +1,571 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; +using Xunit; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + [Fact] + public static void {TestName}() + { + var test = new {TemplateName}BinaryOpTest__{TestName}(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if ({LoadIsa}.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + + // Validates executing the test inside conditional, with op1 as falseValue + test.ConditionalSelect_Op1(); + + // Validates executing the test inside conditional, with op2 as falseValue + test.ConditionalSelect_Op2(); + + // Validates executing the test inside conditional, with op3 as falseValue + test.ConditionalSelect_FalseOp(); + + // Validates executing the test inside conditional, with op3 as zero + test.ConditionalSelect_ZeroOp(); + + // Validates the API can be used to load the mask + //test.RunLoadMask(); + + // Validates the API can be used inside ConditionalSelect + //test.ConditionalSelect_MethodMask(); + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class {TemplateName}BinaryOpTest__{TestName} + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable({Op1BaseType}[] inArray1, {Op2BaseType}[] inArray2, {RetBaseType}[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<{Op2BaseType}>(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<{RetBaseType}>(); + if ((alignment != 64 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException($"Invalid value of alignment: {alignment}, sizeOfinArray1: {sizeOfinArray1}, sizeOfinArray2: {sizeOfinArray2}, sizeOfoutArray: {sizeOfoutArray}"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As<{Op2BaseType}, byte>(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public {Op1VectorType}<{Op1BaseType}> _fld1; + public {Op2VectorType}<{Op2BaseType}> _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld1), ref Unsafe.As<{Op1BaseType}, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp2}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op2VectorType}<{Op2BaseType}>, byte>(ref testStruct._fld2), ref Unsafe.As<{Op2BaseType}, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<{Op2VectorType}<{Op2BaseType}>>()); + + return testStruct; + } + + public void RunStructFldScenario({TemplateName}BinaryOpTest__{TestName} testClass) + { + var result = {Isa}.{Method}(_fld1, _fld2); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = {LargestVectorSize}; + + private static readonly int Op1ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); + private static readonly int Op2ElementCount = Unsafe.SizeOf<{Op2VectorType}<{Op2BaseType}>>() / sizeof({Op2BaseType}); + private static readonly int RetElementCount = Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>() / sizeof({RetBaseType}); + + private static {Op1BaseType}[] _maskData = new {Op1BaseType}[Op1ElementCount]; + private static {Op1BaseType}[] _data1 = new {Op1BaseType}[Op1ElementCount]; + private static {Op2BaseType}[] _data2 = new {Op2BaseType}[Op2ElementCount]; + + private {Op1VectorType}<{Op1BaseType}> _mask; + private {Op1VectorType}<{Op1BaseType}> _fld1; + private {Op2VectorType}<{Op2BaseType}> _fld2; + private {Op2VectorType}<{Op2BaseType}> _falseFld; + + private DataTable _dataTable; + + public {TemplateName}BinaryOpTest__{TestName}() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _maskData[i] = ({Op1BaseType})({NextValueOp1} % 2); } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref _mask), ref Unsafe.As<{Op1BaseType}, byte>(ref _maskData[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref _fld1), ref Unsafe.As<{Op1BaseType}, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp2}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op2VectorType}<{Op2BaseType}>, byte>(ref _fld2), ref Unsafe.As<{Op2BaseType}, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<{Op2VectorType}<{Op2BaseType}>>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op2VectorType}<{Op2BaseType}>, byte>(ref _falseFld), ref Unsafe.As<{Op2BaseType}, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<{Op2VectorType}<{Op2BaseType}>>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp2}; } + _dataTable = new DataTable(_data1, _data2, new {RetBaseType}[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => {Isa}.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = {Isa}.{Method}( + Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr), + Unsafe.Read<{Op2VectorType}<{Op2BaseType}>>(_dataTable.inArray2Ptr) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + {Op1VectorType}<{Op1BaseType}> loadMask = Sve.CreateTrueMask{RetBaseType}(SveMaskPattern.All); + + var result = {Isa}.{Method}( + {LoadIsa}.Load{Op1VectorType}(loadMask, ({Op1BaseType}*)(_dataTable.inArray1Ptr)), + {LoadIsa}.Load{Op2VectorType}(loadMask, ({Op2BaseType}*)(_dataTable.inArray2Ptr)) + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunLoadMask() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLoadMask)); + + {Op1VectorType}<{Op1BaseType}> loadMask = {Isa}.{Method}(_fld1, _fld2); + + var result = {LoadIsa}.Load{Op1VectorType}(loadMask, ({Op1BaseType}*)(_dataTable.inArray1Ptr)); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateConditionalSelectMaskResult(_fld1, _fld2, Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr), {Op1VectorType}<{Op1BaseType}>.Zero, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof({Isa}).GetMethod(nameof({Isa}.{Method}), new Type[] { typeof({Op1VectorType}<{Op1BaseType}>), typeof({Op2VectorType}<{Op2BaseType}>) }) + .Invoke(null, new object[] { + Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr), + Unsafe.Read<{Op2VectorType}<{Op2BaseType}>>(_dataTable.inArray2Ptr) + }); + + Unsafe.Write(_dataTable.outArrayPtr, ({RetVectorType}<{RetBaseType}>)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read<{Op2VectorType}<{Op2BaseType}>>(_dataTable.inArray2Ptr); + var result = {Isa}.{Method}(op1, op2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = {Isa}.{Method}(_fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = {Isa}.{Method}(test._fld1, test._fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void ConditionalSelect_Op1() + { + TestLibrary.TestFramework.BeginScenario("ConditionalSelect_Op1_mask - operation in TrueValue"); + ConditionalSelectScenario_TrueValue(_mask, _fld1, _fld2, _fld1); + + TestLibrary.TestFramework.BeginScenario("ConditionalSelect_Op1_zero - operation in TrueValue"); + ConditionalSelectScenario_TrueValue({Op1VectorType}<{Op1BaseType}>.Zero, _fld1, _fld2, _fld1); + + TestLibrary.TestFramework.BeginScenario("ConditionalSelect_Op1_all - operation in TrueValue"); + ConditionalSelectScenario_TrueValue({Op1VectorType}<{Op1BaseType}>.AllBitsSet, _fld1, _fld2, _fld1); + + TestLibrary.TestFramework.BeginScenario("ConditionalSelect_Op1_mask - operation in FalseValue"); + ConditionalSelectScenario_FalseValue(_mask, _fld1, _fld2, _fld1); + + TestLibrary.TestFramework.BeginScenario("ConditionalSelect_Op1_zero - operation in FalseValue"); + ConditionalSelectScenario_FalseValue({Op1VectorType}<{Op1BaseType}>.Zero, _fld1, _fld2, _fld1); + + TestLibrary.TestFramework.BeginScenario("ConditionalSelect_Op1_all - operation in FalseValue"); + ConditionalSelectScenario_FalseValue({Op1VectorType}<{Op1BaseType}>.AllBitsSet, _fld1, _fld2, _fld1); + } + + public void ConditionalSelect_Op2() + { + TestLibrary.TestFramework.BeginScenario("ConditionalSelect_Op2_mask - operation in TrueValue"); + ConditionalSelectScenario_TrueValue(_mask, _fld1, _fld2, _fld2); + + TestLibrary.TestFramework.BeginScenario("ConditionalSelect_Op2_zero - operation in TrueValue"); + ConditionalSelectScenario_TrueValue({Op1VectorType}<{Op1BaseType}>.Zero, _fld1, _fld2, _fld2); + + TestLibrary.TestFramework.BeginScenario("ConditionalSelect_Op2_all - operation in TrueValue"); + ConditionalSelectScenario_TrueValue({Op1VectorType}<{Op1BaseType}>.AllBitsSet, _fld1, _fld2, _fld2); + + TestLibrary.TestFramework.BeginScenario("ConditionalSelect_Op2_mask - operation in FalseValue"); + ConditionalSelectScenario_FalseValue(_mask, _fld1, _fld2, _fld2); + + TestLibrary.TestFramework.BeginScenario("ConditionalSelect_Op2_zero - operation in FalseValue"); + ConditionalSelectScenario_FalseValue({Op1VectorType}<{Op1BaseType}>.Zero, _fld1, _fld2, _fld2); + + TestLibrary.TestFramework.BeginScenario("ConditionalSelect_Op2_all - operation in FalseValue"); + ConditionalSelectScenario_FalseValue({Op1VectorType}<{Op1BaseType}>.AllBitsSet, _fld1, _fld2, _fld2); + } + + public void ConditionalSelect_FalseOp() + { + TestLibrary.TestFramework.BeginScenario("ConditionalSelect_FalseOp_mask - operation in TrueValue"); + ConditionalSelectScenario_TrueValue(_mask, _fld1, _fld2, _falseFld); + + TestLibrary.TestFramework.BeginScenario("ConditionalSelect_FalseOp_zero - operation in TrueValue"); + ConditionalSelectScenario_TrueValue({Op1VectorType}<{Op1BaseType}>.Zero, _fld1, _fld2, _falseFld); + + TestLibrary.TestFramework.BeginScenario("ConditionalSelect_FalseOp_all - operation in TrueValue"); + ConditionalSelectScenario_TrueValue({Op1VectorType}<{Op1BaseType}>.AllBitsSet, _fld1, _fld2, _falseFld); + + TestLibrary.TestFramework.BeginScenario("ConditionalSelect_FalseOp_mask - operation in FalseValue"); + ConditionalSelectScenario_FalseValue(_mask, _fld1, _fld2, _falseFld); + + TestLibrary.TestFramework.BeginScenario("ConditionalSelect_FalseOp_zero - operation in FalseValue"); + ConditionalSelectScenario_FalseValue({Op1VectorType}<{Op1BaseType}>.Zero, _fld1, _fld2, _falseFld); + + TestLibrary.TestFramework.BeginScenario("ConditionalSelect_FalseOp_all - operation in FalseValue"); + ConditionalSelectScenario_FalseValue({Op1VectorType}<{Op1BaseType}>.AllBitsSet, _fld1, _fld2, _falseFld); + } + + public void ConditionalSelect_ZeroOp() + { + TestLibrary.TestFramework.BeginScenario("ConditionalSelect_ZeroOp_mask - operation in TrueValue"); + ConditionalSelectScenario_TrueValue(_mask, _fld1, _fld2, {Op1VectorType}<{Op1BaseType}>.Zero); + + TestLibrary.TestFramework.BeginScenario("ConditionalSelect_ZeroOp_zero - operation in TrueValue"); + ConditionalSelectScenario_TrueValue({Op1VectorType}<{Op1BaseType}>.Zero, _fld1, _fld2, {Op1VectorType}<{Op1BaseType}>.Zero); + + TestLibrary.TestFramework.BeginScenario("ConditionalSelect_ZeroOp_all - operation in TrueValue"); + ConditionalSelectScenario_TrueValue({Op1VectorType}<{Op1BaseType}>.AllBitsSet, _fld1, _fld2, {Op1VectorType}<{Op1BaseType}>.Zero); + + TestLibrary.TestFramework.BeginScenario("ConditionalSelect_ZeroOp_mask - operation in FalseValue"); + ConditionalSelectScenario_FalseValue(_mask, _fld1, _fld2, {Op1VectorType}<{Op1BaseType}>.Zero); + + TestLibrary.TestFramework.BeginScenario("ConditionalSelect_ZeroOp_zero - operation in FalseValue"); + ConditionalSelectScenario_FalseValue({Op1VectorType}<{Op1BaseType}>.Zero, _fld1, _fld2, {Op1VectorType}<{Op1BaseType}>.Zero); + + TestLibrary.TestFramework.BeginScenario("ConditionalSelect_ZeroOp_all - operation in FalseValue"); + ConditionalSelectScenario_FalseValue({Op1VectorType}<{Op1BaseType}>.AllBitsSet, _fld1, _fld2, {Op1VectorType}<{Op1BaseType}>.Zero); + } + + [method: MethodImpl(MethodImplOptions.AggressiveInlining)] + private void ConditionalSelectScenario_TrueValue({Op1VectorType}<{Op1BaseType}> mask, {Op1VectorType}<{Op1BaseType}> op1, {Op1VectorType}<{Op1BaseType}> op2, {Op1VectorType}<{Op1BaseType}> falseOp) + { + var result = Sve.ConditionalSelect(mask, {Isa}.{Method}(op1, op2), falseOp); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateConditionalSelectResult_TrueValue(mask, op1, op2, falseOp, _dataTable.outArrayPtr); + } + + [method: MethodImpl(MethodImplOptions.AggressiveInlining)] + private void ConditionalSelectScenario_FalseValue({Op1VectorType}<{Op1BaseType}> mask, {Op1VectorType}<{Op1BaseType}> op1, {Op1VectorType}<{Op1BaseType}> op2, {Op1VectorType}<{Op1BaseType}> trueOp) + { + var result = Sve.ConditionalSelect(mask, trueOp, {Isa}.{Method}(op1, op2)); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateConditionalSelectResult_FalseValue(mask, op1, op2, trueOp, _dataTable.outArrayPtr); + } + + public void ConditionalSelect_MethodMask() + { + TestLibrary.TestFramework.BeginScenario("ConditionalSelect_Methodmask - operation in TrueValue"); + var result = Sve.ConditionalSelect({Isa}.{Method}(_fld1, _fld2), _fld1, _fld2); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateConditionalSelectMaskResult(_fld1, _fld2, _fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateConditionalSelectResult_TrueValue({Op1VectorType}<{Op1BaseType}> maskOp, {Op1VectorType}<{Op1BaseType}> leftOp, {Op1VectorType}<{Op1BaseType}> rightOp, {Op1VectorType}<{Op1BaseType}> falseOp, void* output, [CallerMemberName] string method = "") + { + {Op1BaseType}[] mask = new {Op1BaseType}[Op1ElementCount]; + {Op1BaseType}[] left = new {Op1BaseType}[Op1ElementCount]; + {Op1BaseType}[] right = new {Op1BaseType}[Op1ElementCount]; + {Op1BaseType}[] falseVal = new {Op1BaseType}[Op1ElementCount]; + {RetBaseType}[] result = new {RetBaseType}[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref mask[0]), maskOp); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref left[0]), leftOp); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref right[0]), rightOp); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref falseVal[0]), falseOp); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref result[0]), ref Unsafe.AsRef(output), (uint)Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>()); + + bool succeeded = true; + + {TemplateValidationLogicForCndSel} + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>, {Op2VectorType}<{Op2BaseType}>): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" mask: ({string.Join(", ", mask)})"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" falseOp: ({string.Join(", ", falseVal)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + + private void ValidateConditionalSelectResult_FalseValue({Op1VectorType}<{Op1BaseType}> maskOp, {Op1VectorType}<{Op1BaseType}> leftOp, {Op1VectorType}<{Op1BaseType}> rightOp, {Op1VectorType}<{Op1BaseType}> trueOp, void* output, [CallerMemberName] string method = "") + { + {Op1BaseType}[] mask = new {Op1BaseType}[Op1ElementCount]; + {Op1BaseType}[] left = new {Op1BaseType}[Op1ElementCount]; + {Op1BaseType}[] right = new {Op1BaseType}[Op1ElementCount]; + {Op1BaseType}[] trueVal = new {Op1BaseType}[Op1ElementCount]; + {RetBaseType}[] result = new {RetBaseType}[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref mask[0]), maskOp); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref left[0]), leftOp); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref right[0]), rightOp); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref trueVal[0]), trueOp); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref result[0]), ref Unsafe.AsRef(output), (uint)Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>()); + + bool succeeded = true; + + {TemplateValidationLogicForCndSel_FalseValue} + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>, {Op2VectorType}<{Op2BaseType}>): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" mask: ({string.Join(", ", mask)})"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" trueOp: ({string.Join(", ", trueVal)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + + private void ValidateConditionalSelectMaskResult({Op1VectorType}<{Op1BaseType}> leftOp, {Op1VectorType}<{Op1BaseType}> rightOp, {Op1VectorType}<{Op1BaseType}> trueOp, {Op1VectorType}<{Op1BaseType}> falseOp, void* output, [CallerMemberName] string method = "") + { + {Op1BaseType}[] left = new {Op1BaseType}[Op1ElementCount]; + {Op1BaseType}[] right = new {Op1BaseType}[Op1ElementCount]; + {Op1BaseType}[] trueVal = new {Op1BaseType}[Op1ElementCount]; + {Op1BaseType}[] falseVal = new {Op1BaseType}[Op1ElementCount]; + {RetBaseType}[] result = new {RetBaseType}[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref left[0]), leftOp); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref right[0]), rightOp); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref trueVal[0]), trueOp); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref falseVal[0]), falseOp); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref result[0]), ref Unsafe.AsRef(output), (uint)Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>()); + + bool succeeded = true; + + {TemplateValidationLogicForCndSelMask} + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>, {Op2VectorType}<{Op2BaseType}>): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" trueOp: ({string.Join(", ", trueVal)})"); + TestLibrary.TestFramework.LogInformation($" falseOp: ({string.Join(", ", falseVal)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + + private void ValidateResult({Op1VectorType}<{Op1BaseType}> op1, {Op2VectorType}<{Op2BaseType}> op2, void* result, [CallerMemberName] string method = "") + { + {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; + {Op2BaseType}[] inArray2 = new {Op2BaseType}[Op2ElementCount]; + {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op2BaseType}, byte>(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; + {Op2BaseType}[] inArray2 = new {Op2BaseType}[Op2ElementCount]; + {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op2BaseType}, byte>(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf<{Op2VectorType}<{Op2BaseType}>>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult({Op1BaseType}[] left, {Op2BaseType}[] right, {RetBaseType}[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + {TemplateValidationLogic} + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>, {Op2VectorType}<{Op2BaseType}>): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); + TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} From 91526ba69a75f5c56106f3f8fefa44d59c2b9572 Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Thu, 4 Jul 2024 11:40:36 -0700 Subject: [PATCH 04/10] Add support for AbsoluteCompare --- src/coreclr/jit/hwintrinsiccodegenarm64.cpp | 9 ++++++- src/coreclr/jit/lowerarmarch.cpp | 8 +++++- src/coreclr/jit/lsraarm64.cpp | 27 ++------------------- 3 files changed, 17 insertions(+), 27 deletions(-) diff --git a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp index 342620742d0ba..65eef0795c2cb 100644 --- a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp +++ b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp @@ -586,7 +586,14 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) case 2: { - assert(instrIsRMW); + if (!instrIsRMW) + { + // Perform the actual "predicated" operation so that `embMaskOp1Reg` is the first operand + // and `embMaskOp2Reg` is the second operand. + GetEmitter()->emitIns_R_R_R_R(insEmbMask, emitSize, targetReg, maskReg, embMaskOp1Reg, + embMaskOp2Reg, opt); + break; + } insScalableOpts sopt = INS_SCALABLE_OPTS_NONE; bool hasShift = false; diff --git a/src/coreclr/jit/lowerarmarch.cpp b/src/coreclr/jit/lowerarmarch.cpp index b739aeedab740..f98f129d80fca 100644 --- a/src/coreclr/jit/lowerarmarch.cpp +++ b/src/coreclr/jit/lowerarmarch.cpp @@ -1331,12 +1331,18 @@ GenTree* Lowering::LowerHWIntrinsic(GenTreeHWIntrinsic* node) var_types simdType = Compiler::getSIMDTypeForSize(simdSize); GenTree* trueMask = comp->gtNewSimdAllTrueMaskNode(simdBaseJitType, simdSize); GenTree* falseVal = comp->gtNewZeroConNode(simdType); + var_types nodeType = simdType; + + if (HWIntrinsicInfo::ReturnsPerElementMask(node->GetHWIntrinsicId())) + { + nodeType = TYP_MASK; + } BlockRange().InsertBefore(node, trueMask); BlockRange().InsertBefore(node, falseVal); GenTreeHWIntrinsic* condSelNode = - comp->gtNewSimdHWIntrinsicNode(simdType, trueMask, node, falseVal, NI_Sve_ConditionalSelect, + comp->gtNewSimdHWIntrinsicNode(nodeType, trueMask, node, falseVal, NI_Sve_ConditionalSelect, simdBaseJitType, simdSize); BlockRange().InsertAfter(node, condSelNode); if (foundUse) diff --git a/src/coreclr/jit/lsraarm64.cpp b/src/coreclr/jit/lsraarm64.cpp index c553edb9305ab..2ef61f0be1ccb 100644 --- a/src/coreclr/jit/lsraarm64.cpp +++ b/src/coreclr/jit/lsraarm64.cpp @@ -1981,30 +1981,7 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree, int* pDstCou getLowVectorOperandAndCandidates(intrin, &lowVectorOperandNum, &lowVectorCandidates); } - if ((intrin.id == NI_Sve_ConditionalSelect) && (intrin.op2->IsEmbMaskOp()) && - (intrin.op2->isRMWHWIntrinsic(compiler))) - { - // For ConditionalSelect, if there is an embedded operation, and the operation has RMW semantics - // then record delay-free for them. - GenTreeHWIntrinsic* intrinEmbOp2 = intrin.op2->AsHWIntrinsic(); - size_t numArgs = intrinEmbOp2->GetOperandCount(); - assert((numArgs == 1) || (numArgs == 2)); - const HWIntrinsic intrinEmb(intrinEmbOp2); - if (HWIntrinsicInfo::IsLowVectorOperation(intrinEmb.id)) - { - getLowVectorOperandAndCandidates(intrinEmb, &lowVectorOperandNum, &lowVectorCandidates); - } - - tgtPrefUse = BuildUse(intrinEmbOp2->Op(1)); - srcCount += 1; - - for (size_t argNum = 2; argNum <= numArgs; argNum++) - { - srcCount += BuildDelayFreeUses(intrinEmbOp2->Op(argNum), intrinEmbOp2->Op(1), - (argNum == lowVectorOperandNum) ? lowVectorCandidates : RBM_NONE); - } - } - else if (tgtPrefOp2) + if (tgtPrefOp2) { if (!intrin.op2->isContained()) { @@ -2059,7 +2036,7 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree, int* pDstCou { SingleTypeRegSet candidates = lowVectorOperandNum == 2 ? lowVectorCandidates : RBM_NONE; - if (intrin.op2->gtType == TYP_MASK) + if (intrin.op2->OperIsHWIntrinsic(NI_Sve_ConvertVectorToMask)) { assert(lowVectorOperandNum != 2); candidates = RBM_ALLMASK.GetPredicateRegSet(); From f59568102c709da368124422c6b9d9f11f920c65 Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Thu, 4 Jul 2024 11:41:24 -0700 Subject: [PATCH 05/10] uncomment some other tests --- .../Arm/Shared/_SveBinaryRetMaskOpTestTemplate.template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveBinaryRetMaskOpTestTemplate.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveBinaryRetMaskOpTestTemplate.template index 81c8e6f7950e1..cc9fe1d9e4ea2 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveBinaryRetMaskOpTestTemplate.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveBinaryRetMaskOpTestTemplate.template @@ -64,10 +64,10 @@ namespace JIT.HardwareIntrinsics.Arm test.ConditionalSelect_ZeroOp(); // Validates the API can be used to load the mask - //test.RunLoadMask(); + test.RunLoadMask(); // Validates the API can be used inside ConditionalSelect - //test.ConditionalSelect_MethodMask(); + test.ConditionalSelect_MethodMask(); } else { From e99d57b5742842ca594f65c4eee0c72deaaba7d3 Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Thu, 4 Jul 2024 11:50:21 -0700 Subject: [PATCH 06/10] Add CompareGreater* and CompareLess* APIs --- .../Arm/Sve.PlatformNotSupported.cs | 472 ++++++++++++++++-- .../src/System/Runtime/Intrinsics/Arm/Sve.cs | 471 +++++++++++++++-- .../ref/System.Runtime.Intrinsics.cs | 68 +++ 3 files changed, 933 insertions(+), 78 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 4986db2b44607..9ae6931090dbd 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 @@ -696,6 +696,439 @@ internal Arm64() { } /// public static unsafe Vector BooleanNot(Vector value) { throw new PlatformNotSupportedException(); } + /// Shuffle active elements of vector to the right and fill with zero + + /// + /// svfloat64_t svcompact[_f64](svbool_t pg, svfloat64_t op) + /// COMPACT Zresult.D, Pg, Zop.D + /// + public static unsafe Vector Compact(Vector mask, Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// svint32_t svcompact[_s32](svbool_t pg, svint32_t op) + /// COMPACT Zresult.S, Pg, Zop.S + /// + public static unsafe Vector Compact(Vector mask, Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// svint64_t svcompact[_s64](svbool_t pg, svint64_t op) + /// COMPACT Zresult.D, Pg, Zop.D + /// + public static unsafe Vector Compact(Vector mask, Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// svfloat32_t svcompact[_f32](svbool_t pg, svfloat32_t op) + /// COMPACT Zresult.S, Pg, Zop.S + /// + public static unsafe Vector Compact(Vector mask, Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// svuint32_t svcompact[_u32](svbool_t pg, svuint32_t op) + /// COMPACT Zresult.S, Pg, Zop.S + /// + public static unsafe Vector Compact(Vector mask, Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// svuint64_t svcompact[_u64](svbool_t pg, svuint64_t op) + /// COMPACT Zresult.D, Pg, Zop.D + /// + public static unsafe Vector Compact(Vector mask, Vector value) { throw new PlatformNotSupportedException(); } + + /// Compare greater than + + /// + /// svbool_t svcmpgt[_u8](svbool_t pg, svuint8_t op1, svuint8_t op2) + /// CMPHI Presult.B, Pg/Z, Zop1.B, Zop2.B + /// + public static unsafe Vector CompareGreaterThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpgt_wide[_u8](svbool_t pg, svuint8_t op1, svuint64_t op2) + /// CMPHI Presult.B, Pg/Z, Zop1.B, Zop2.D + /// + public static unsafe Vector CompareGreaterThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpgt[_f64](svbool_t pg, svfloat64_t op1, svfloat64_t op2) + /// FCMGT Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector CompareGreaterThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpgt[_s16](svbool_t pg, svint16_t op1, svint16_t op2) + /// CMPGT Presult.H, Pg/Z, Zop1.H, Zop2.H + /// + public static unsafe Vector CompareGreaterThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpgt_wide[_s16](svbool_t pg, svint16_t op1, svint64_t op2) + /// CMPGT Presult.H, Pg/Z, Zop1.H, Zop2.D + /// + public static unsafe Vector CompareGreaterThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpgt[_s32](svbool_t pg, svint32_t op1, svint32_t op2) + /// CMPGT Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector CompareGreaterThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpgt_wide[_s32](svbool_t pg, svint32_t op1, svint64_t op2) + /// CMPGT Presult.S, Pg/Z, Zop1.S, Zop2.D + /// + public static unsafe Vector CompareGreaterThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpgt[_s64](svbool_t pg, svint64_t op1, svint64_t op2) + /// CMPGT Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector CompareGreaterThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpgt[_s8](svbool_t pg, svint8_t op1, svint8_t op2) + /// CMPGT Presult.B, Pg/Z, Zop1.B, Zop2.B + /// + public static unsafe Vector CompareGreaterThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpgt_wide[_s8](svbool_t pg, svint8_t op1, svint64_t op2) + /// CMPGT Presult.B, Pg/Z, Zop1.B, Zop2.D + /// + public static unsafe Vector CompareGreaterThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpgt[_f32](svbool_t pg, svfloat32_t op1, svfloat32_t op2) + /// FCMGT Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector CompareGreaterThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpgt[_u16](svbool_t pg, svuint16_t op1, svuint16_t op2) + /// CMPHI Presult.H, Pg/Z, Zop1.H, Zop2.H + /// + public static unsafe Vector CompareGreaterThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpgt_wide[_u16](svbool_t pg, svuint16_t op1, svuint64_t op2) + /// CMPHI Presult.H, Pg/Z, Zop1.H, Zop2.D + /// + public static unsafe Vector CompareGreaterThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpgt[_u32](svbool_t pg, svuint32_t op1, svuint32_t op2) + /// CMPHI Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector CompareGreaterThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpgt_wide[_u32](svbool_t pg, svuint32_t op1, svuint64_t op2) + /// CMPHI Presult.S, Pg/Z, Zop1.S, Zop2.D + /// + public static unsafe Vector CompareGreaterThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpgt[_u64](svbool_t pg, svuint64_t op1, svuint64_t op2) + /// CMPHI Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector CompareGreaterThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + + /// Compare greater than or equal to + + /// + /// svbool_t svcmpge[_u8](svbool_t pg, svuint8_t op1, svuint8_t op2) + /// CMPHS Presult.B, Pg/Z, Zop1.B, Zop2.B + /// + public static unsafe Vector CompareGreaterThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpge_wide[_u8](svbool_t pg, svuint8_t op1, svuint64_t op2) + /// CMPHS Presult.B, Pg/Z, Zop1.B, Zop2.D + /// + public static unsafe Vector CompareGreaterThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpge[_f64](svbool_t pg, svfloat64_t op1, svfloat64_t op2) + /// FCMGE Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector CompareGreaterThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpge[_s16](svbool_t pg, svint16_t op1, svint16_t op2) + /// CMPGE Presult.H, Pg/Z, Zop1.H, Zop2.H + /// + public static unsafe Vector CompareGreaterThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpge_wide[_s16](svbool_t pg, svint16_t op1, svint64_t op2) + /// CMPGE Presult.H, Pg/Z, Zop1.H, Zop2.D + /// + public static unsafe Vector CompareGreaterThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpge[_s32](svbool_t pg, svint32_t op1, svint32_t op2) + /// CMPGE Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector CompareGreaterThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpge_wide[_s32](svbool_t pg, svint32_t op1, svint64_t op2) + /// CMPGE Presult.S, Pg/Z, Zop1.S, Zop2.D + /// + public static unsafe Vector CompareGreaterThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpge[_s64](svbool_t pg, svint64_t op1, svint64_t op2) + /// CMPGE Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector CompareGreaterThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpge[_s8](svbool_t pg, svint8_t op1, svint8_t op2) + /// CMPGE Presult.B, Pg/Z, Zop1.B, Zop2.B + /// + public static unsafe Vector CompareGreaterThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpge_wide[_s8](svbool_t pg, svint8_t op1, svint64_t op2) + /// CMPGE Presult.B, Pg/Z, Zop1.B, Zop2.D + /// + public static unsafe Vector CompareGreaterThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpge[_f32](svbool_t pg, svfloat32_t op1, svfloat32_t op2) + /// FCMGE Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector CompareGreaterThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpge[_u16](svbool_t pg, svuint16_t op1, svuint16_t op2) + /// CMPHS Presult.H, Pg/Z, Zop1.H, Zop2.H + /// + public static unsafe Vector CompareGreaterThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpge_wide[_u16](svbool_t pg, svuint16_t op1, svuint64_t op2) + /// CMPHS Presult.H, Pg/Z, Zop1.H, Zop2.D + /// + public static unsafe Vector CompareGreaterThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpge[_u32](svbool_t pg, svuint32_t op1, svuint32_t op2) + /// CMPHS Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector CompareGreaterThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpge_wide[_u32](svbool_t pg, svuint32_t op1, svuint64_t op2) + /// CMPHS Presult.S, Pg/Z, Zop1.S, Zop2.D + /// + public static unsafe Vector CompareGreaterThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpge[_u64](svbool_t pg, svuint64_t op1, svuint64_t op2) + /// CMPHS Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector CompareGreaterThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + + /// Compare less than + + /// + /// svbool_t svcmplt[_u8](svbool_t pg, svuint8_t op1, svuint8_t op2) + /// CMPHI Presult.B, Pg/Z, Zop2.B, Zop1.B + /// + public static unsafe Vector CompareLessThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmplt_wide[_u8](svbool_t pg, svuint8_t op1, svuint64_t op2) + /// CMPLO Presult.B, Pg/Z, Zop1.B, Zop2.D + /// + public static unsafe Vector CompareLessThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmplt[_f64](svbool_t pg, svfloat64_t op1, svfloat64_t op2) + /// FCMGT Presult.D, Pg/Z, Zop2.D, Zop1.D + /// + public static unsafe Vector CompareLessThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmplt[_s16](svbool_t pg, svint16_t op1, svint16_t op2) + /// CMPGT Presult.H, Pg/Z, Zop2.H, Zop1.H + /// + public static unsafe Vector CompareLessThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmplt_wide[_s16](svbool_t pg, svint16_t op1, svint64_t op2) + /// CMPLT Presult.H, Pg/Z, Zop1.H, Zop2.D + /// + public static unsafe Vector CompareLessThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmplt[_s32](svbool_t pg, svint32_t op1, svint32_t op2) + /// CMPGT Presult.S, Pg/Z, Zop2.S, Zop1.S + /// + public static unsafe Vector CompareLessThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmplt_wide[_s32](svbool_t pg, svint32_t op1, svint64_t op2) + /// CMPLT Presult.S, Pg/Z, Zop1.S, Zop2.D + /// + public static unsafe Vector CompareLessThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmplt[_s64](svbool_t pg, svint64_t op1, svint64_t op2) + /// CMPGT Presult.D, Pg/Z, Zop2.D, Zop1.D + /// + public static unsafe Vector CompareLessThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmplt[_s8](svbool_t pg, svint8_t op1, svint8_t op2) + /// CMPGT Presult.B, Pg/Z, Zop2.B, Zop1.B + /// + public static unsafe Vector CompareLessThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmplt_wide[_s8](svbool_t pg, svint8_t op1, svint64_t op2) + /// CMPLT Presult.B, Pg/Z, Zop1.B, Zop2.D + /// + public static unsafe Vector CompareLessThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmplt[_f32](svbool_t pg, svfloat32_t op1, svfloat32_t op2) + /// FCMGT Presult.S, Pg/Z, Zop2.S, Zop1.S + /// + public static unsafe Vector CompareLessThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmplt[_u16](svbool_t pg, svuint16_t op1, svuint16_t op2) + /// CMPHI Presult.H, Pg/Z, Zop2.H, Zop1.H + /// + public static unsafe Vector CompareLessThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmplt_wide[_u16](svbool_t pg, svuint16_t op1, svuint64_t op2) + /// CMPLO Presult.H, Pg/Z, Zop1.H, Zop2.D + /// + public static unsafe Vector CompareLessThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmplt[_u32](svbool_t pg, svuint32_t op1, svuint32_t op2) + /// CMPHI Presult.S, Pg/Z, Zop2.S, Zop1.S + /// + public static unsafe Vector CompareLessThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmplt_wide[_u32](svbool_t pg, svuint32_t op1, svuint64_t op2) + /// CMPLO Presult.S, Pg/Z, Zop1.S, Zop2.D + /// + public static unsafe Vector CompareLessThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmplt[_u64](svbool_t pg, svuint64_t op1, svuint64_t op2) + /// CMPHI Presult.D, Pg/Z, Zop2.D, Zop1.D + /// + public static unsafe Vector CompareLessThan(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + + /// Compare less than or equal to + + /// + /// svbool_t svcmple[_u8](svbool_t pg, svuint8_t op1, svuint8_t op2) + /// CMPHS Presult.B, Pg/Z, Zop2.B, Zop1.B + /// + public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmple_wide[_u8](svbool_t pg, svuint8_t op1, svuint64_t op2) + /// CMPLS Presult.B, Pg/Z, Zop1.B, Zop2.D + /// + public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmple[_f64](svbool_t pg, svfloat64_t op1, svfloat64_t op2) + /// FCMGE Presult.D, Pg/Z, Zop2.D, Zop1.D + /// + public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmple[_s16](svbool_t pg, svint16_t op1, svint16_t op2) + /// CMPGE Presult.H, Pg/Z, Zop2.H, Zop1.H + /// + public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmple_wide[_s16](svbool_t pg, svint16_t op1, svint64_t op2) + /// CMPLE Presult.H, Pg/Z, Zop1.H, Zop2.D + /// + public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmple[_s32](svbool_t pg, svint32_t op1, svint32_t op2) + /// CMPGE Presult.S, Pg/Z, Zop2.S, Zop1.S + /// + public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmple_wide[_s32](svbool_t pg, svint32_t op1, svint64_t op2) + /// CMPLE Presult.S, Pg/Z, Zop1.S, Zop2.D + /// + public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmple[_s64](svbool_t pg, svint64_t op1, svint64_t op2) + /// CMPGE Presult.D, Pg/Z, Zop2.D, Zop1.D + /// + public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmple[_s8](svbool_t pg, svint8_t op1, svint8_t op2) + /// CMPGE Presult.B, Pg/Z, Zop2.B, Zop1.B + /// + public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmple_wide[_s8](svbool_t pg, svint8_t op1, svint64_t op2) + /// CMPLE Presult.B, Pg/Z, Zop1.B, Zop2.D + /// + public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmple[_f32](svbool_t pg, svfloat32_t op1, svfloat32_t op2) + /// FCMGE Presult.S, Pg/Z, Zop2.S, Zop1.S + /// + public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmple[_u16](svbool_t pg, svuint16_t op1, svuint16_t op2) + /// CMPHS Presult.H, Pg/Z, Zop2.H, Zop1.H + /// + public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmple_wide[_u16](svbool_t pg, svuint16_t op1, svuint64_t op2) + /// CMPLS Presult.H, Pg/Z, Zop1.H, Zop2.D + /// + public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmple[_u32](svbool_t pg, svuint32_t op1, svuint32_t op2) + /// CMPHS Presult.S, Pg/Z, Zop2.S, Zop1.S + /// + public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmple_wide[_u32](svbool_t pg, svuint32_t op1, svuint64_t op2) + /// CMPLS Presult.S, Pg/Z, Zop1.S, Zop2.D + /// + public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmple[_u64](svbool_t pg, svuint64_t op1, svuint64_t op2) + /// CMPHS Presult.D, Pg/Z, Zop2.D, Zop1.D + /// + public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + /// Compute vector addresses for 16-bit data /// @@ -803,45 +1236,6 @@ internal Arm64() { } /// public static unsafe Vector Compute8BitAddresses(Vector bases, Vector indices) { throw new PlatformNotSupportedException(); } - /// Shuffle active elements of vector to the right and fill with zero - - /// - /// svfloat64_t svcompact[_f64](svbool_t pg, svfloat64_t op) - /// COMPACT Zresult.D, Pg, Zop.D - /// - public static unsafe Vector Compact(Vector mask, Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// svint32_t svcompact[_s32](svbool_t pg, svint32_t op) - /// COMPACT Zresult.S, Pg, Zop.S - /// - public static unsafe Vector Compact(Vector mask, Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// svint64_t svcompact[_s64](svbool_t pg, svint64_t op) - /// COMPACT Zresult.D, Pg, Zop.D - /// - public static unsafe Vector Compact(Vector mask, Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// svfloat32_t svcompact[_f32](svbool_t pg, svfloat32_t op) - /// COMPACT Zresult.S, Pg, Zop.S - /// - public static unsafe Vector Compact(Vector mask, Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// svuint32_t svcompact[_u32](svbool_t pg, svuint32_t op) - /// COMPACT Zresult.S, Pg, Zop.S - /// - public static unsafe Vector Compact(Vector mask, Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// svuint64_t svcompact[_u64](svbool_t pg, svuint64_t op) - /// COMPACT Zresult.D, Pg, Zop.D - /// - public static unsafe Vector Compact(Vector mask, Vector value) { throw new PlatformNotSupportedException(); } - - /// Compare equal to /// ConditionalSelect : Conditionally select elements 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 b1e64fe0d94fd..62834f61f1923 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 @@ -726,6 +726,438 @@ internal Arm64() { } /// public static unsafe Vector BooleanNot(Vector value) => BooleanNot(value); + /// Shuffle active elements of vector to the right and fill with zero + + /// + /// svfloat64_t svcompact[_f64](svbool_t pg, svfloat64_t op) + /// COMPACT Zresult.D, Pg, Zop.D + /// + public static unsafe Vector Compact(Vector mask, Vector value) => Compact(mask, value); + + /// + /// svint32_t svcompact[_s32](svbool_t pg, svint32_t op) + /// COMPACT Zresult.S, Pg, Zop.S + /// + public static unsafe Vector Compact(Vector mask, Vector value) => Compact(mask, value); + + /// + /// svint64_t svcompact[_s64](svbool_t pg, svint64_t op) + /// COMPACT Zresult.D, Pg, Zop.D + /// + public static unsafe Vector Compact(Vector mask, Vector value) => Compact(mask, value); + + /// + /// svfloat32_t svcompact[_f32](svbool_t pg, svfloat32_t op) + /// COMPACT Zresult.S, Pg, Zop.S + /// + public static unsafe Vector Compact(Vector mask, Vector value) => Compact(mask, value); + + /// + /// svuint32_t svcompact[_u32](svbool_t pg, svuint32_t op) + /// COMPACT Zresult.S, Pg, Zop.S + /// + public static unsafe Vector Compact(Vector mask, Vector value) => Compact(mask, value); + + /// + /// svuint64_t svcompact[_u64](svbool_t pg, svuint64_t op) + /// COMPACT Zresult.D, Pg, Zop.D + /// + public static unsafe Vector Compact(Vector mask, Vector value) => Compact(mask, value); + + /// Compare greater than + + /// + /// svbool_t svcmpgt[_u8](svbool_t pg, svuint8_t op1, svuint8_t op2) + /// CMPHI Presult.B, Pg/Z, Zop1.B, Zop2.B + /// + public static unsafe Vector CompareGreaterThan(Vector left, Vector right) => CompareGreaterThan(left, right); + + /// + /// svbool_t svcmpgt_wide[_u8](svbool_t pg, svuint8_t op1, svuint64_t op2) + /// CMPHI Presult.B, Pg/Z, Zop1.B, Zop2.D + /// + public static unsafe Vector CompareGreaterThan(Vector left, Vector right) => CompareGreaterThan(left, right); + + /// + /// svbool_t svcmpgt[_f64](svbool_t pg, svfloat64_t op1, svfloat64_t op2) + /// FCMGT Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector CompareGreaterThan(Vector left, Vector right) => CompareGreaterThan(left, right); + + /// + /// svbool_t svcmpgt[_s16](svbool_t pg, svint16_t op1, svint16_t op2) + /// CMPGT Presult.H, Pg/Z, Zop1.H, Zop2.H + /// + public static unsafe Vector CompareGreaterThan(Vector left, Vector right) => CompareGreaterThan(left, right); + + /// + /// svbool_t svcmpgt_wide[_s16](svbool_t pg, svint16_t op1, svint64_t op2) + /// CMPGT Presult.H, Pg/Z, Zop1.H, Zop2.D + /// + public static unsafe Vector CompareGreaterThan(Vector left, Vector right) => CompareGreaterThan(left, right); + + /// + /// svbool_t svcmpgt[_s32](svbool_t pg, svint32_t op1, svint32_t op2) + /// CMPGT Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector CompareGreaterThan(Vector left, Vector right) => CompareGreaterThan(left, right); + + /// + /// svbool_t svcmpgt_wide[_s32](svbool_t pg, svint32_t op1, svint64_t op2) + /// CMPGT Presult.S, Pg/Z, Zop1.S, Zop2.D + /// + public static unsafe Vector CompareGreaterThan(Vector left, Vector right) => CompareGreaterThan(left, right); + + /// + /// svbool_t svcmpgt[_s64](svbool_t pg, svint64_t op1, svint64_t op2) + /// CMPGT Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector CompareGreaterThan(Vector left, Vector right) => CompareGreaterThan(left, right); + + /// + /// svbool_t svcmpgt[_s8](svbool_t pg, svint8_t op1, svint8_t op2) + /// CMPGT Presult.B, Pg/Z, Zop1.B, Zop2.B + /// + public static unsafe Vector CompareGreaterThan(Vector left, Vector right) => CompareGreaterThan(left, right); + + /// + /// svbool_t svcmpgt_wide[_s8](svbool_t pg, svint8_t op1, svint64_t op2) + /// CMPGT Presult.B, Pg/Z, Zop1.B, Zop2.D + /// + public static unsafe Vector CompareGreaterThan(Vector left, Vector right) => CompareGreaterThan(left, right); + + /// + /// svbool_t svcmpgt[_f32](svbool_t pg, svfloat32_t op1, svfloat32_t op2) + /// FCMGT Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector CompareGreaterThan(Vector left, Vector right) => CompareGreaterThan(left, right); + + /// + /// svbool_t svcmpgt[_u16](svbool_t pg, svuint16_t op1, svuint16_t op2) + /// CMPHI Presult.H, Pg/Z, Zop1.H, Zop2.H + /// + public static unsafe Vector CompareGreaterThan(Vector left, Vector right) => CompareGreaterThan(left, right); + + /// + /// svbool_t svcmpgt_wide[_u16](svbool_t pg, svuint16_t op1, svuint64_t op2) + /// CMPHI Presult.H, Pg/Z, Zop1.H, Zop2.D + /// + public static unsafe Vector CompareGreaterThan(Vector left, Vector right) => CompareGreaterThan(left, right); + + /// + /// svbool_t svcmpgt[_u32](svbool_t pg, svuint32_t op1, svuint32_t op2) + /// CMPHI Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector CompareGreaterThan(Vector left, Vector right) => CompareGreaterThan(left, right); + + /// + /// svbool_t svcmpgt_wide[_u32](svbool_t pg, svuint32_t op1, svuint64_t op2) + /// CMPHI Presult.S, Pg/Z, Zop1.S, Zop2.D + /// + public static unsafe Vector CompareGreaterThan(Vector left, Vector right) => CompareGreaterThan(left, right); + + /// + /// svbool_t svcmpgt[_u64](svbool_t pg, svuint64_t op1, svuint64_t op2) + /// CMPHI Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector CompareGreaterThan(Vector left, Vector right) => CompareGreaterThan(left, right); + + + /// Compare greater than or equal to + + /// + /// svbool_t svcmpge[_u8](svbool_t pg, svuint8_t op1, svuint8_t op2) + /// CMPHS Presult.B, Pg/Z, Zop1.B, Zop2.B + /// + public static unsafe Vector CompareGreaterThanOrEqual(Vector left, Vector right) => CompareGreaterThanOrEqual(left, right); + + /// + /// svbool_t svcmpge_wide[_u8](svbool_t pg, svuint8_t op1, svuint64_t op2) + /// CMPHS Presult.B, Pg/Z, Zop1.B, Zop2.D + /// + public static unsafe Vector CompareGreaterThanOrEqual(Vector left, Vector right) => CompareGreaterThanOrEqual(left, right); + + /// + /// svbool_t svcmpge[_f64](svbool_t pg, svfloat64_t op1, svfloat64_t op2) + /// FCMGE Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector CompareGreaterThanOrEqual(Vector left, Vector right) => CompareGreaterThanOrEqual(left, right); + + /// + /// svbool_t svcmpge[_s16](svbool_t pg, svint16_t op1, svint16_t op2) + /// CMPGE Presult.H, Pg/Z, Zop1.H, Zop2.H + /// + public static unsafe Vector CompareGreaterThanOrEqual(Vector left, Vector right) => CompareGreaterThanOrEqual(left, right); + + /// + /// svbool_t svcmpge_wide[_s16](svbool_t pg, svint16_t op1, svint64_t op2) + /// CMPGE Presult.H, Pg/Z, Zop1.H, Zop2.D + /// + public static unsafe Vector CompareGreaterThanOrEqual(Vector left, Vector right) => CompareGreaterThanOrEqual(left, right); + + /// + /// svbool_t svcmpge[_s32](svbool_t pg, svint32_t op1, svint32_t op2) + /// CMPGE Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector CompareGreaterThanOrEqual(Vector left, Vector right) => CompareGreaterThanOrEqual(left, right); + + /// + /// svbool_t svcmpge_wide[_s32](svbool_t pg, svint32_t op1, svint64_t op2) + /// CMPGE Presult.S, Pg/Z, Zop1.S, Zop2.D + /// + public static unsafe Vector CompareGreaterThanOrEqual(Vector left, Vector right) => CompareGreaterThanOrEqual(left, right); + + /// + /// svbool_t svcmpge[_s64](svbool_t pg, svint64_t op1, svint64_t op2) + /// CMPGE Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector CompareGreaterThanOrEqual(Vector left, Vector right) => CompareGreaterThanOrEqual(left, right); + + /// + /// svbool_t svcmpge[_s8](svbool_t pg, svint8_t op1, svint8_t op2) + /// CMPGE Presult.B, Pg/Z, Zop1.B, Zop2.B + /// + public static unsafe Vector CompareGreaterThanOrEqual(Vector left, Vector right) => CompareGreaterThanOrEqual(left, right); + + /// + /// svbool_t svcmpge_wide[_s8](svbool_t pg, svint8_t op1, svint64_t op2) + /// CMPGE Presult.B, Pg/Z, Zop1.B, Zop2.D + /// + public static unsafe Vector CompareGreaterThanOrEqual(Vector left, Vector right) => CompareGreaterThanOrEqual(left, right); + + /// + /// svbool_t svcmpge[_f32](svbool_t pg, svfloat32_t op1, svfloat32_t op2) + /// FCMGE Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector CompareGreaterThanOrEqual(Vector left, Vector right) => CompareGreaterThanOrEqual(left, right); + + /// + /// svbool_t svcmpge[_u16](svbool_t pg, svuint16_t op1, svuint16_t op2) + /// CMPHS Presult.H, Pg/Z, Zop1.H, Zop2.H + /// + public static unsafe Vector CompareGreaterThanOrEqual(Vector left, Vector right) => CompareGreaterThanOrEqual(left, right); + + /// + /// svbool_t svcmpge_wide[_u16](svbool_t pg, svuint16_t op1, svuint64_t op2) + /// CMPHS Presult.H, Pg/Z, Zop1.H, Zop2.D + /// + public static unsafe Vector CompareGreaterThanOrEqual(Vector left, Vector right) => CompareGreaterThanOrEqual(left, right); + + /// + /// svbool_t svcmpge[_u32](svbool_t pg, svuint32_t op1, svuint32_t op2) + /// CMPHS Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector CompareGreaterThanOrEqual(Vector left, Vector right) => CompareGreaterThanOrEqual(left, right); + + /// + /// svbool_t svcmpge_wide[_u32](svbool_t pg, svuint32_t op1, svuint64_t op2) + /// CMPHS Presult.S, Pg/Z, Zop1.S, Zop2.D + /// + public static unsafe Vector CompareGreaterThanOrEqual(Vector left, Vector right) => CompareGreaterThanOrEqual(left, right); + + /// + /// svbool_t svcmpge[_u64](svbool_t pg, svuint64_t op1, svuint64_t op2) + /// CMPHS Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector CompareGreaterThanOrEqual(Vector left, Vector right) => CompareGreaterThanOrEqual(left, right); + + /// Compare less than + + /// + /// svbool_t svcmplt[_u8](svbool_t pg, svuint8_t op1, svuint8_t op2) + /// CMPHI Presult.B, Pg/Z, Zop2.B, Zop1.B + /// + public static unsafe Vector CompareLessThan(Vector left, Vector right) => CompareLessThan(left, right); + + /// + /// svbool_t svcmplt_wide[_u8](svbool_t pg, svuint8_t op1, svuint64_t op2) + /// CMPLO Presult.B, Pg/Z, Zop1.B, Zop2.D + /// + public static unsafe Vector CompareLessThan(Vector left, Vector right) => CompareLessThan(left, right); + + /// + /// svbool_t svcmplt[_f64](svbool_t pg, svfloat64_t op1, svfloat64_t op2) + /// FCMGT Presult.D, Pg/Z, Zop2.D, Zop1.D + /// + public static unsafe Vector CompareLessThan(Vector left, Vector right) => CompareLessThan(left, right); + + /// + /// svbool_t svcmplt[_s16](svbool_t pg, svint16_t op1, svint16_t op2) + /// CMPGT Presult.H, Pg/Z, Zop2.H, Zop1.H + /// + public static unsafe Vector CompareLessThan(Vector left, Vector right) => CompareLessThan(left, right); + + /// + /// svbool_t svcmplt_wide[_s16](svbool_t pg, svint16_t op1, svint64_t op2) + /// CMPLT Presult.H, Pg/Z, Zop1.H, Zop2.D + /// + public static unsafe Vector CompareLessThan(Vector left, Vector right) => CompareLessThan(left, right); + + /// + /// svbool_t svcmplt[_s32](svbool_t pg, svint32_t op1, svint32_t op2) + /// CMPGT Presult.S, Pg/Z, Zop2.S, Zop1.S + /// + public static unsafe Vector CompareLessThan(Vector left, Vector right) => CompareLessThan(left, right); + + /// + /// svbool_t svcmplt_wide[_s32](svbool_t pg, svint32_t op1, svint64_t op2) + /// CMPLT Presult.S, Pg/Z, Zop1.S, Zop2.D + /// + public static unsafe Vector CompareLessThan(Vector left, Vector right) => CompareLessThan(left, right); + + /// + /// svbool_t svcmplt[_s64](svbool_t pg, svint64_t op1, svint64_t op2) + /// CMPGT Presult.D, Pg/Z, Zop2.D, Zop1.D + /// + public static unsafe Vector CompareLessThan(Vector left, Vector right) => CompareLessThan(left, right); + + /// + /// svbool_t svcmplt[_s8](svbool_t pg, svint8_t op1, svint8_t op2) + /// CMPGT Presult.B, Pg/Z, Zop2.B, Zop1.B + /// + public static unsafe Vector CompareLessThan(Vector left, Vector right) => CompareLessThan(left, right); + + /// + /// svbool_t svcmplt_wide[_s8](svbool_t pg, svint8_t op1, svint64_t op2) + /// CMPLT Presult.B, Pg/Z, Zop1.B, Zop2.D + /// + public static unsafe Vector CompareLessThan(Vector left, Vector right) => CompareLessThan(left, right); + + /// + /// svbool_t svcmplt[_f32](svbool_t pg, svfloat32_t op1, svfloat32_t op2) + /// FCMGT Presult.S, Pg/Z, Zop2.S, Zop1.S + /// + public static unsafe Vector CompareLessThan(Vector left, Vector right) => CompareLessThan(left, right); + + /// + /// svbool_t svcmplt[_u16](svbool_t pg, svuint16_t op1, svuint16_t op2) + /// CMPHI Presult.H, Pg/Z, Zop2.H, Zop1.H + /// + public static unsafe Vector CompareLessThan(Vector left, Vector right) => CompareLessThan(left, right); + + /// + /// svbool_t svcmplt_wide[_u16](svbool_t pg, svuint16_t op1, svuint64_t op2) + /// CMPLO Presult.H, Pg/Z, Zop1.H, Zop2.D + /// + public static unsafe Vector CompareLessThan(Vector left, Vector right) => CompareLessThan(left, right); + + /// + /// svbool_t svcmplt[_u32](svbool_t pg, svuint32_t op1, svuint32_t op2) + /// CMPHI Presult.S, Pg/Z, Zop2.S, Zop1.S + /// + public static unsafe Vector CompareLessThan(Vector left, Vector right) => CompareLessThan(left, right); + + /// + /// svbool_t svcmplt_wide[_u32](svbool_t pg, svuint32_t op1, svuint64_t op2) + /// CMPLO Presult.S, Pg/Z, Zop1.S, Zop2.D + /// + public static unsafe Vector CompareLessThan(Vector left, Vector right) => CompareLessThan(left, right); + + /// + /// svbool_t svcmplt[_u64](svbool_t pg, svuint64_t op1, svuint64_t op2) + /// CMPHI Presult.D, Pg/Z, Zop2.D, Zop1.D + /// + public static unsafe Vector CompareLessThan(Vector left, Vector right) => CompareLessThan(left, right); + + + /// Compare less than or equal to + + /// + /// svbool_t svcmple[_u8](svbool_t pg, svuint8_t op1, svuint8_t op2) + /// CMPHS Presult.B, Pg/Z, Zop2.B, Zop1.B + /// + public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) => CompareLessThanOrEqual(left, right); + + /// + /// svbool_t svcmple_wide[_u8](svbool_t pg, svuint8_t op1, svuint64_t op2) + /// CMPLS Presult.B, Pg/Z, Zop1.B, Zop2.D + /// + public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) => CompareLessThanOrEqual(left, right); + + /// + /// svbool_t svcmple[_f64](svbool_t pg, svfloat64_t op1, svfloat64_t op2) + /// FCMGE Presult.D, Pg/Z, Zop2.D, Zop1.D + /// + public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) => CompareLessThanOrEqual(left, right); + + /// + /// svbool_t svcmple[_s16](svbool_t pg, svint16_t op1, svint16_t op2) + /// CMPGE Presult.H, Pg/Z, Zop2.H, Zop1.H + /// + public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) => CompareLessThanOrEqual(left, right); + + /// + /// svbool_t svcmple_wide[_s16](svbool_t pg, svint16_t op1, svint64_t op2) + /// CMPLE Presult.H, Pg/Z, Zop1.H, Zop2.D + /// + public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) => CompareLessThanOrEqual(left, right); + + /// + /// svbool_t svcmple[_s32](svbool_t pg, svint32_t op1, svint32_t op2) + /// CMPGE Presult.S, Pg/Z, Zop2.S, Zop1.S + /// + public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) => CompareLessThanOrEqual(left, right); + + /// + /// svbool_t svcmple_wide[_s32](svbool_t pg, svint32_t op1, svint64_t op2) + /// CMPLE Presult.S, Pg/Z, Zop1.S, Zop2.D + /// + public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) => CompareLessThanOrEqual(left, right); + + /// + /// svbool_t svcmple[_s64](svbool_t pg, svint64_t op1, svint64_t op2) + /// CMPGE Presult.D, Pg/Z, Zop2.D, Zop1.D + /// + public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) => CompareLessThanOrEqual(left, right); + + /// + /// svbool_t svcmple[_s8](svbool_t pg, svint8_t op1, svint8_t op2) + /// CMPGE Presult.B, Pg/Z, Zop2.B, Zop1.B + /// + public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) => CompareLessThanOrEqual(left, right); + + /// + /// svbool_t svcmple_wide[_s8](svbool_t pg, svint8_t op1, svint64_t op2) + /// CMPLE Presult.B, Pg/Z, Zop1.B, Zop2.D + /// + public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) => CompareLessThanOrEqual(left, right); + + /// + /// svbool_t svcmple[_f32](svbool_t pg, svfloat32_t op1, svfloat32_t op2) + /// FCMGE Presult.S, Pg/Z, Zop2.S, Zop1.S + /// + public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) => CompareLessThanOrEqual(left, right); + + /// + /// svbool_t svcmple[_u16](svbool_t pg, svuint16_t op1, svuint16_t op2) + /// CMPHS Presult.H, Pg/Z, Zop2.H, Zop1.H + /// + public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) => CompareLessThanOrEqual(left, right); + + /// + /// svbool_t svcmple_wide[_u16](svbool_t pg, svuint16_t op1, svuint64_t op2) + /// CMPLS Presult.H, Pg/Z, Zop1.H, Zop2.D + /// + public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) => CompareLessThanOrEqual(left, right); + + /// + /// svbool_t svcmple[_u32](svbool_t pg, svuint32_t op1, svuint32_t op2) + /// CMPHS Presult.S, Pg/Z, Zop2.S, Zop1.S + /// + public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) => CompareLessThanOrEqual(left, right); + + /// + /// svbool_t svcmple_wide[_u32](svbool_t pg, svuint32_t op1, svuint64_t op2) + /// CMPLS Presult.S, Pg/Z, Zop1.S, Zop2.D + /// + public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) => CompareLessThanOrEqual(left, right); + + /// + /// svbool_t svcmple[_u64](svbool_t pg, svuint64_t op1, svuint64_t op2) + /// CMPHS Presult.D, Pg/Z, Zop2.D, Zop1.D + /// + public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) => CompareLessThanOrEqual(left, right); + /// Compute vector addresses for 16-bit data /// @@ -833,45 +1265,6 @@ internal Arm64() { } /// public static unsafe Vector Compute8BitAddresses(Vector bases, Vector indices) => Compute8BitAddresses(bases, indices); - /// Shuffle active elements of vector to the right and fill with zero - - /// - /// svfloat64_t svcompact[_f64](svbool_t pg, svfloat64_t op) - /// COMPACT Zresult.D, Pg, Zop.D - /// - public static unsafe Vector Compact(Vector mask, Vector value) => Compact(mask, value); - - /// - /// svint32_t svcompact[_s32](svbool_t pg, svint32_t op) - /// COMPACT Zresult.S, Pg, Zop.S - /// - public static unsafe Vector Compact(Vector mask, Vector value) => Compact(mask, value); - - /// - /// svint64_t svcompact[_s64](svbool_t pg, svint64_t op) - /// COMPACT Zresult.D, Pg, Zop.D - /// - public static unsafe Vector Compact(Vector mask, Vector value) => Compact(mask, value); - - /// - /// svfloat32_t svcompact[_f32](svbool_t pg, svfloat32_t op) - /// COMPACT Zresult.S, Pg, Zop.S - /// - public static unsafe Vector Compact(Vector mask, Vector value) => Compact(mask, value); - - /// - /// svuint32_t svcompact[_u32](svbool_t pg, svuint32_t op) - /// COMPACT Zresult.S, Pg, Zop.S - /// - public static unsafe Vector Compact(Vector mask, Vector value) => Compact(mask, value); - - /// - /// svuint64_t svcompact[_u64](svbool_t pg, svuint64_t op) - /// COMPACT Zresult.D, Pg, Zop.D - /// - public static unsafe Vector Compact(Vector mask, Vector value) => Compact(mask, value); - - /// Compare equal to /// ConditionalSelect : Conditionally select elements 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 d64849a7b197e..d4686fb5e0cc5 100644 --- a/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs +++ b/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs @@ -4296,6 +4296,74 @@ internal Arm64() { } public static System.Numerics.Vector Compact(System.Numerics.Vector mask, System.Numerics.Vector value) { throw null; } public static System.Numerics.Vector Compact(System.Numerics.Vector mask, System.Numerics.Vector value) { throw null; } + public static System.Numerics.Vector CompareGreaterThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareGreaterThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareGreaterThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareGreaterThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareGreaterThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareGreaterThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareGreaterThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareGreaterThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareGreaterThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareGreaterThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareGreaterThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareGreaterThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareGreaterThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareGreaterThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareGreaterThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareGreaterThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + + public static System.Numerics.Vector CompareGreaterThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareGreaterThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareGreaterThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareGreaterThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareGreaterThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareGreaterThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareGreaterThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareGreaterThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareGreaterThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareGreaterThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareGreaterThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareGreaterThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareGreaterThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareGreaterThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareGreaterThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareGreaterThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + + public static System.Numerics.Vector CompareLessThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareLessThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareLessThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareLessThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareLessThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareLessThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareLessThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareLessThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareLessThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareLessThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareLessThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareLessThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareLessThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareLessThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareLessThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareLessThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + + public static System.Numerics.Vector CompareLessThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareLessThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareLessThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareLessThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareLessThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareLessThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareLessThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareLessThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareLessThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareLessThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareLessThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareLessThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareLessThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareLessThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareLessThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareLessThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector Compute16BitAddresses(System.Numerics.Vector bases, System.Numerics.Vector indices) { throw null; } public static System.Numerics.Vector Compute16BitAddresses(System.Numerics.Vector bases, System.Numerics.Vector indices) { throw null; } public static System.Numerics.Vector Compute16BitAddresses(System.Numerics.Vector bases, System.Numerics.Vector indices) { throw null; } From d71da4046f4a0a8176c9a92ab27a863412e2389f Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Thu, 4 Jul 2024 11:56:30 -0700 Subject: [PATCH 07/10] Add remaining Compare* APIs --- .../Arm/Sve.PlatformNotSupported.cs | 175 +++++++++++++++++ .../src/System/Runtime/Intrinsics/Arm/Sve.cs | 176 ++++++++++++++++++ .../ref/System.Runtime.Intrinsics.cs | 33 +++- 3 files changed, 383 insertions(+), 1 deletion(-) 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 9ae6931090dbd..10318cb724040 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 @@ -734,6 +734,86 @@ internal Arm64() { } /// public static unsafe Vector Compact(Vector mask, Vector value) { throw new PlatformNotSupportedException(); } + /// Compare equal to + + /// + /// svbool_t svcmpeq[_u8](svbool_t pg, svuint8_t op1, svuint8_t op2) + /// CMPEQ Presult.B, Pg/Z, Zop1.B, Zop2.B + /// + public static unsafe Vector CompareEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpeq[_f64](svbool_t pg, svfloat64_t op1, svfloat64_t op2) + /// FCMEQ Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector CompareEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpeq[_s16](svbool_t pg, svint16_t op1, svint16_t op2) + /// CMPEQ Presult.H, Pg/Z, Zop1.H, Zop2.H + /// + public static unsafe Vector CompareEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpeq_wide[_s16](svbool_t pg, svint16_t op1, svint64_t op2) + /// CMPEQ Presult.H, Pg/Z, Zop1.H, Zop2.D + /// + public static unsafe Vector CompareEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpeq[_s32](svbool_t pg, svint32_t op1, svint32_t op2) + /// CMPEQ Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector CompareEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpeq_wide[_s32](svbool_t pg, svint32_t op1, svint64_t op2) + /// CMPEQ Presult.S, Pg/Z, Zop1.S, Zop2.D + /// + public static unsafe Vector CompareEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpeq[_s64](svbool_t pg, svint64_t op1, svint64_t op2) + /// CMPEQ Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector CompareEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpeq[_s8](svbool_t pg, svint8_t op1, svint8_t op2) + /// CMPEQ Presult.B, Pg/Z, Zop1.B, Zop2.B + /// + public static unsafe Vector CompareEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpeq_wide[_s8](svbool_t pg, svint8_t op1, svint64_t op2) + /// CMPEQ Presult.B, Pg/Z, Zop1.B, Zop2.D + /// + public static unsafe Vector CompareEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpeq[_f32](svbool_t pg, svfloat32_t op1, svfloat32_t op2) + /// FCMEQ Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector CompareEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpeq[_u16](svbool_t pg, svuint16_t op1, svuint16_t op2) + /// CMPEQ Presult.H, Pg/Z, Zop1.H, Zop2.H + /// + public static unsafe Vector CompareEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpeq[_u32](svbool_t pg, svuint32_t op1, svuint32_t op2) + /// CMPEQ Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector CompareEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpeq[_u64](svbool_t pg, svuint64_t op1, svuint64_t op2) + /// CMPEQ Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector CompareEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + /// Compare greater than /// @@ -1129,6 +1209,101 @@ internal Arm64() { } /// public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + /// Compare not equal to + + /// + /// svbool_t svcmpne[_u8](svbool_t pg, svuint8_t op1, svuint8_t op2) + /// CMPNE Presult.B, Pg/Z, Zop1.B, Zop2.B + /// + public static unsafe Vector CompareNotEqualTo(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpne[_f64](svbool_t pg, svfloat64_t op1, svfloat64_t op2) + /// FCMNE Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector CompareNotEqualTo(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpne[_s16](svbool_t pg, svint16_t op1, svint16_t op2) + /// CMPNE Presult.H, Pg/Z, Zop1.H, Zop2.H + /// + public static unsafe Vector CompareNotEqualTo(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpne_wide[_s16](svbool_t pg, svint16_t op1, svint64_t op2) + /// CMPNE Presult.H, Pg/Z, Zop1.H, Zop2.D + /// + public static unsafe Vector CompareNotEqualTo(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpne[_s32](svbool_t pg, svint32_t op1, svint32_t op2) + /// CMPNE Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector CompareNotEqualTo(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpne_wide[_s32](svbool_t pg, svint32_t op1, svint64_t op2) + /// CMPNE Presult.S, Pg/Z, Zop1.S, Zop2.D + /// + public static unsafe Vector CompareNotEqualTo(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpne[_s64](svbool_t pg, svint64_t op1, svint64_t op2) + /// CMPNE Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector CompareNotEqualTo(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpne[_s8](svbool_t pg, svint8_t op1, svint8_t op2) + /// CMPNE Presult.B, Pg/Z, Zop1.B, Zop2.B + /// + public static unsafe Vector CompareNotEqualTo(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpne_wide[_s8](svbool_t pg, svint8_t op1, svint64_t op2) + /// CMPNE Presult.B, Pg/Z, Zop1.B, Zop2.D + /// + public static unsafe Vector CompareNotEqualTo(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpne[_f32](svbool_t pg, svfloat32_t op1, svfloat32_t op2) + /// FCMNE Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector CompareNotEqualTo(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpne[_u16](svbool_t pg, svuint16_t op1, svuint16_t op2) + /// CMPNE Presult.H, Pg/Z, Zop1.H, Zop2.H + /// + public static unsafe Vector CompareNotEqualTo(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpne[_u32](svbool_t pg, svuint32_t op1, svuint32_t op2) + /// CMPNE Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector CompareNotEqualTo(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpne[_u64](svbool_t pg, svuint64_t op1, svuint64_t op2) + /// CMPNE Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector CompareNotEqualTo(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + + /// Compare unordered with + + /// + /// svbool_t svcmpuo[_f64](svbool_t pg, svfloat64_t op1, svfloat64_t op2) + /// FCMUO Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector CompareUnordered(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svcmpuo[_f32](svbool_t pg, svfloat32_t op1, svfloat32_t op2) + /// FCMUO Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector CompareUnordered(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + /// Compute vector addresses for 16-bit data /// 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 62834f61f1923..f12e1f4d48ba2 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 @@ -764,6 +764,87 @@ internal Arm64() { } /// public static unsafe Vector Compact(Vector mask, Vector value) => Compact(mask, value); + + /// Compare equal to + + /// + /// svbool_t svcmpeq[_u8](svbool_t pg, svuint8_t op1, svuint8_t op2) + /// CMPEQ Presult.B, Pg/Z, Zop1.B, Zop2.B + /// + public static unsafe Vector CompareEqual(Vector left, Vector right) => CompareEqual(left, right); + + /// + /// svbool_t svcmpeq[_f64](svbool_t pg, svfloat64_t op1, svfloat64_t op2) + /// FCMEQ Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector CompareEqual(Vector left, Vector right) => CompareEqual(left, right); + + /// + /// svbool_t svcmpeq[_s16](svbool_t pg, svint16_t op1, svint16_t op2) + /// CMPEQ Presult.H, Pg/Z, Zop1.H, Zop2.H + /// + public static unsafe Vector CompareEqual(Vector left, Vector right) => CompareEqual(left, right); + + /// + /// svbool_t svcmpeq_wide[_s16](svbool_t pg, svint16_t op1, svint64_t op2) + /// CMPEQ Presult.H, Pg/Z, Zop1.H, Zop2.D + /// + public static unsafe Vector CompareEqual(Vector left, Vector right) => CompareEqual(left, right); + + /// + /// svbool_t svcmpeq[_s32](svbool_t pg, svint32_t op1, svint32_t op2) + /// CMPEQ Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector CompareEqual(Vector left, Vector right) => CompareEqual(left, right); + + /// + /// svbool_t svcmpeq_wide[_s32](svbool_t pg, svint32_t op1, svint64_t op2) + /// CMPEQ Presult.S, Pg/Z, Zop1.S, Zop2.D + /// + public static unsafe Vector CompareEqual(Vector left, Vector right) => CompareEqual(left, right); + + /// + /// svbool_t svcmpeq[_s64](svbool_t pg, svint64_t op1, svint64_t op2) + /// CMPEQ Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector CompareEqual(Vector left, Vector right) => CompareEqual(left, right); + + /// + /// svbool_t svcmpeq[_s8](svbool_t pg, svint8_t op1, svint8_t op2) + /// CMPEQ Presult.B, Pg/Z, Zop1.B, Zop2.B + /// + public static unsafe Vector CompareEqual(Vector left, Vector right) => CompareEqual(left, right); + + /// + /// svbool_t svcmpeq_wide[_s8](svbool_t pg, svint8_t op1, svint64_t op2) + /// CMPEQ Presult.B, Pg/Z, Zop1.B, Zop2.D + /// + public static unsafe Vector CompareEqual(Vector left, Vector right) => CompareEqual(left, right); + + /// + /// svbool_t svcmpeq[_f32](svbool_t pg, svfloat32_t op1, svfloat32_t op2) + /// FCMEQ Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector CompareEqual(Vector left, Vector right) => CompareEqual(left, right); + + /// + /// svbool_t svcmpeq[_u16](svbool_t pg, svuint16_t op1, svuint16_t op2) + /// CMPEQ Presult.H, Pg/Z, Zop1.H, Zop2.H + /// + public static unsafe Vector CompareEqual(Vector left, Vector right) => CompareEqual(left, right); + + /// + /// svbool_t svcmpeq[_u32](svbool_t pg, svuint32_t op1, svuint32_t op2) + /// CMPEQ Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector CompareEqual(Vector left, Vector right) => CompareEqual(left, right); + + /// + /// svbool_t svcmpeq[_u64](svbool_t pg, svuint64_t op1, svuint64_t op2) + /// CMPEQ Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector CompareEqual(Vector left, Vector right) => CompareEqual(left, right); + /// Compare greater than /// @@ -1158,6 +1239,101 @@ internal Arm64() { } /// public static unsafe Vector CompareLessThanOrEqual(Vector left, Vector right) => CompareLessThanOrEqual(left, right); + /// Compare not equal to + + /// + /// svbool_t svcmpne[_u8](svbool_t pg, svuint8_t op1, svuint8_t op2) + /// CMPNE Presult.B, Pg/Z, Zop1.B, Zop2.B + /// + public static unsafe Vector CompareNotEqualTo(Vector left, Vector right) => CompareNotEqualTo(left, right); + + /// + /// svbool_t svcmpne[_f64](svbool_t pg, svfloat64_t op1, svfloat64_t op2) + /// FCMNE Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector CompareNotEqualTo(Vector left, Vector right) => CompareNotEqualTo(left, right); + + /// + /// svbool_t svcmpne[_s16](svbool_t pg, svint16_t op1, svint16_t op2) + /// CMPNE Presult.H, Pg/Z, Zop1.H, Zop2.H + /// + public static unsafe Vector CompareNotEqualTo(Vector left, Vector right) => CompareNotEqualTo(left, right); + + /// + /// svbool_t svcmpne_wide[_s16](svbool_t pg, svint16_t op1, svint64_t op2) + /// CMPNE Presult.H, Pg/Z, Zop1.H, Zop2.D + /// + public static unsafe Vector CompareNotEqualTo(Vector left, Vector right) => CompareNotEqualTo(left, right); + + /// + /// svbool_t svcmpne[_s32](svbool_t pg, svint32_t op1, svint32_t op2) + /// CMPNE Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector CompareNotEqualTo(Vector left, Vector right) => CompareNotEqualTo(left, right); + + /// + /// svbool_t svcmpne_wide[_s32](svbool_t pg, svint32_t op1, svint64_t op2) + /// CMPNE Presult.S, Pg/Z, Zop1.S, Zop2.D + /// + public static unsafe Vector CompareNotEqualTo(Vector left, Vector right) => CompareNotEqualTo(left, right); + + /// + /// svbool_t svcmpne[_s64](svbool_t pg, svint64_t op1, svint64_t op2) + /// CMPNE Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector CompareNotEqualTo(Vector left, Vector right) => CompareNotEqualTo(left, right); + + /// + /// svbool_t svcmpne[_s8](svbool_t pg, svint8_t op1, svint8_t op2) + /// CMPNE Presult.B, Pg/Z, Zop1.B, Zop2.B + /// + public static unsafe Vector CompareNotEqualTo(Vector left, Vector right) => CompareNotEqualTo(left, right); + + /// + /// svbool_t svcmpne_wide[_s8](svbool_t pg, svint8_t op1, svint64_t op2) + /// CMPNE Presult.B, Pg/Z, Zop1.B, Zop2.D + /// + public static unsafe Vector CompareNotEqualTo(Vector left, Vector right) => CompareNotEqualTo(left, right); + + /// + /// svbool_t svcmpne[_f32](svbool_t pg, svfloat32_t op1, svfloat32_t op2) + /// FCMNE Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector CompareNotEqualTo(Vector left, Vector right) => CompareNotEqualTo(left, right); + + /// + /// svbool_t svcmpne[_u16](svbool_t pg, svuint16_t op1, svuint16_t op2) + /// CMPNE Presult.H, Pg/Z, Zop1.H, Zop2.H + /// + public static unsafe Vector CompareNotEqualTo(Vector left, Vector right) => CompareNotEqualTo(left, right); + + /// + /// svbool_t svcmpne[_u32](svbool_t pg, svuint32_t op1, svuint32_t op2) + /// CMPNE Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector CompareNotEqualTo(Vector left, Vector right) => CompareNotEqualTo(left, right); + + /// + /// svbool_t svcmpne[_u64](svbool_t pg, svuint64_t op1, svuint64_t op2) + /// CMPNE Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector CompareNotEqualTo(Vector left, Vector right) => CompareNotEqualTo(left, right); + + + /// Compare unordered with + + /// + /// svbool_t svcmpuo[_f64](svbool_t pg, svfloat64_t op1, svfloat64_t op2) + /// FCMUO Presult.D, Pg/Z, Zop1.D, Zop2.D + /// + public static unsafe Vector CompareUnordered(Vector left, Vector right) => CompareUnordered(left, right); + + /// + /// svbool_t svcmpuo[_f32](svbool_t pg, svfloat32_t op1, svfloat32_t op2) + /// FCMUO Presult.S, Pg/Z, Zop1.S, Zop2.S + /// + public static unsafe Vector CompareUnordered(Vector left, Vector right) => CompareUnordered(left, right); + /// Compute vector addresses for 16-bit data /// 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 d4686fb5e0cc5..f4885977916ae 100644 --- a/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs +++ b/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs @@ -4296,6 +4296,20 @@ internal Arm64() { } public static System.Numerics.Vector Compact(System.Numerics.Vector mask, System.Numerics.Vector value) { throw null; } public static System.Numerics.Vector Compact(System.Numerics.Vector mask, System.Numerics.Vector value) { throw null; } + public static System.Numerics.Vector CompareEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareGreaterThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } public static System.Numerics.Vector CompareGreaterThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } public static System.Numerics.Vector CompareGreaterThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } @@ -4346,7 +4360,7 @@ internal Arm64() { } public static System.Numerics.Vector CompareLessThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } public static System.Numerics.Vector CompareLessThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } public static System.Numerics.Vector CompareLessThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } - + public static System.Numerics.Vector CompareLessThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } public static System.Numerics.Vector CompareLessThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } public static System.Numerics.Vector CompareLessThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } @@ -4364,6 +4378,23 @@ internal Arm64() { } public static System.Numerics.Vector CompareLessThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } public static System.Numerics.Vector CompareLessThanOrEqual(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareNotEqualTo(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareNotEqualTo(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareNotEqualTo(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareNotEqualTo(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareNotEqualTo(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareNotEqualTo(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareNotEqualTo(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareNotEqualTo(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareNotEqualTo(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareNotEqualTo(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareNotEqualTo(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareNotEqualTo(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareNotEqualTo(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + + public static System.Numerics.Vector CompareUnordered(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CompareUnordered(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector Compute16BitAddresses(System.Numerics.Vector bases, System.Numerics.Vector indices) { throw null; } public static System.Numerics.Vector Compute16BitAddresses(System.Numerics.Vector bases, System.Numerics.Vector indices) { throw null; } public static System.Numerics.Vector Compute16BitAddresses(System.Numerics.Vector bases, System.Numerics.Vector indices) { throw null; } From 82e75a8f3343984f1a0c46c105826c513dc97ed8 Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Thu, 4 Jul 2024 12:04:43 -0700 Subject: [PATCH 08/10] Map API to instructions --- src/coreclr/jit/hwintrinsiclistarm64sve.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/coreclr/jit/hwintrinsiclistarm64sve.h b/src/coreclr/jit/hwintrinsiclistarm64sve.h index 69096b437f8f7..9288662fd003a 100644 --- a/src/coreclr/jit/hwintrinsiclistarm64sve.h +++ b/src/coreclr/jit/hwintrinsiclistarm64sve.h @@ -30,6 +30,13 @@ HARDWARE_INTRINSIC(Sve, AndAcross, HARDWARE_INTRINSIC(Sve, BitwiseClear, -1, -1, false, {INS_sve_bic, INS_sve_bic, INS_sve_bic, INS_sve_bic, INS_sve_bic, INS_sve_bic, INS_sve_bic, INS_sve_bic, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_OptionalEmbeddedMaskedOperation|HW_Flag_HasRMWSemantics|HW_Flag_LowMaskedOperation) HARDWARE_INTRINSIC(Sve, BooleanNot, -1, -1, false, {INS_sve_cnot, INS_sve_cnot, INS_sve_cnot, INS_sve_cnot, INS_sve_cnot, INS_sve_cnot, INS_sve_cnot, INS_sve_cnot, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation) HARDWARE_INTRINSIC(Sve, Compact, -1, 2, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_compact, INS_sve_compact, INS_sve_compact, INS_sve_compact, INS_sve_compact, INS_sve_compact}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_ExplicitMaskedOperation|HW_Flag_LowMaskedOperation) +HARDWARE_INTRINSIC(Sve, CompareEqual, -1, -1, false, {INS_sve_cmpeq, INS_sve_cmpeq, INS_sve_cmpeq, INS_sve_cmpeq, INS_sve_cmpeq, INS_sve_cmpeq, INS_sve_cmpeq, INS_sve_cmpeq, INS_sve_fcmeq, INS_sve_fcmeq}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_ReturnsPerElementMask) +HARDWARE_INTRINSIC(Sve, CompareGreaterThan, -1, -1, false, {INS_sve_cmpgt, INS_sve_cmphi, INS_sve_cmpgt, INS_sve_cmphi, INS_sve_cmpgt, INS_sve_cmphi, INS_sve_cmpgt, INS_sve_cmphi, INS_sve_fcmgt, INS_sve_fcmgt}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_ReturnsPerElementMask) +HARDWARE_INTRINSIC(Sve, CompareGreaterThanOrEqual, -1, -1, false, {INS_sve_cmpge, INS_sve_cmphs, INS_sve_cmpge, INS_sve_cmphs, INS_sve_cmpge, INS_sve_cmphs, INS_sve_cmpge, INS_sve_cmphs, INS_sve_fcmge, INS_sve_fcmge}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_ReturnsPerElementMask) +HARDWARE_INTRINSIC(Sve, CompareLessThan, -1, -1, false, {INS_sve_cmplt, INS_sve_cmplo, INS_sve_cmplt, INS_sve_cmplo, INS_sve_cmplt, INS_sve_cmplo, INS_sve_cmplt, INS_sve_cmplo, INS_sve_fcmlt, INS_sve_fcmlt}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_ReturnsPerElementMask) +HARDWARE_INTRINSIC(Sve, CompareLessThanOrEqual, -1, -1, false, {INS_sve_cmple, INS_sve_cmpls, INS_sve_cmple, INS_sve_cmpls, INS_sve_cmple, INS_sve_cmpls, INS_sve_cmple, INS_sve_cmpls, INS_sve_fcmle, INS_sve_fcmle}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_ReturnsPerElementMask) +HARDWARE_INTRINSIC(Sve, CompareNotEqualTo, -1, -1, false, {INS_sve_cmpne, INS_sve_cmpne, INS_sve_cmpne, INS_sve_cmpne, INS_sve_cmpne, INS_sve_cmpne, INS_sve_cmpne, INS_sve_cmpne, INS_sve_fcmne, INS_sve_fcmne}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_ReturnsPerElementMask) +HARDWARE_INTRINSIC(Sve, CompareUnordered, -1, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_fcmuo, INS_sve_fcmuo}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_ReturnsPerElementMask) HARDWARE_INTRINSIC(Sve, Compute16BitAddresses, -1, 2, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_adr, INS_invalid, INS_sve_adr, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_SpecialCodeGen) HARDWARE_INTRINSIC(Sve, Compute32BitAddresses, -1, 2, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_adr, INS_invalid, INS_sve_adr, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_SpecialCodeGen) HARDWARE_INTRINSIC(Sve, Compute64BitAddresses, -1, 2, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_adr, INS_invalid, INS_sve_adr, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_SpecialCodeGen) From 66168148b535eac364fadc8374c5deda1a328ce9 Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Fri, 5 Jul 2024 00:46:49 -0700 Subject: [PATCH 09/10] fix test cases --- .../GenerateHWIntrinsicTests_Arm.cs | 93 +++++++- .../HardwareIntrinsics/Arm/Shared/Helpers.cs | 208 ++++++------------ 2 files changed, 146 insertions(+), 155 deletions(-) diff --git a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs index a966d64bfab91..2185f41a11ca7 100644 --- a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs +++ b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs @@ -180,6 +180,16 @@ const string SimpleTernVecOpTest_ValidationLogicForCndSel = @"for (var i = 0; i < RetElementCount; i++) { {Op1BaseType} iterResult = (mask[i] != 0) ? {GetIterResult} : falseVal[i]; + if ({ConvertFunc}(iterResult) != {ConvertFunc}(result[i])) + { + succeeded = false; + break; + } + }"; + +const string SimpleTernVecOpTest_ValidationLogicForCndSel_FalseValue = @"for (var i = 0; i < RetElementCount; i++) + { + {Op1BaseType} iterResult = (mask[i] != 0) ? trueVal[i] : {GetIterResult}; if (mask[i] != 0) { // Pick the trueValue @@ -193,18 +203,8 @@ { // For false, the values are merged with destination, and we do not know // those contents would be, so skip verification for them. - } - }"; - -const string SimpleTernVecOpTest_ValidationLogicForCndSel_FalseValue = @"for (var i = 0; i < RetElementCount; i++) - { - {Op1BaseType} iterResult = (mask[i] != 0) ? trueVal[i] : {GetIterResult}; - if ({ConvertFunc}(iterResult) != {ConvertFunc}(result[i])) - { - succeeded = false; - break; } - }"; + }"; const string VecPairBinOpTest_ValidationLogic = @" int index = 0; @@ -273,7 +273,7 @@ ("_SveBinaryOpTestTemplate.template", "SveVecBinOpTest.template", new Dictionary { ["TemplateName"] = "Simple", ["TemplateValidationLogic"] = SimpleVecOpTest_ValidationLogic, ["TemplateValidationLogicForCndSel"] = SimpleVecOpTest_ValidationLogicForCndSel, ["TemplateValidationLogicForCndSel_FalseValue"] = SimpleVecOpTest_ValidationLogicForCndSel_FalseValue }), ("_SveBinaryOpTestTemplate.template", "SveVecBinOpVecTest.template", new Dictionary { ["TemplateName"] = "Simple", ["TemplateValidationLogic"] = SimpleVecOpTest_VectorValidationLogic, ["TemplateValidationLogicForCndSel"] = SimpleVecOpTest_VectorValidationLogicForCndSel, ["TemplateValidationLogicForCndSel_FalseValue"] = SimpleVecOpTest_VectorValidationLogicForCndSel_FalseValue }), ("_SveBinaryOpTestTemplate.template", "SveVecBinOpConvertTest.template", new Dictionary { ["TemplateName"] = "Simple", ["TemplateValidationLogic"] = SimpleVecOpTest_ValidationLogic, ["TemplateValidationLogicForCndSel"] = SimpleTernVecOpTest_ValidationLogicForCndSel, ["TemplateValidationLogicForCndSel_FalseValue"] = SimpleTernVecOpTest_ValidationLogicForCndSel_FalseValue }), - ("_SveBinaryRetMaskOpTestTemplate.template", "SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TemplateName"] = "Simple", ["TemplateValidationLogic"] = SimpleVecOpTest_ValidationLogic, ["TemplateValidationLogicForCndSel"] = SimpleTernVecOpTest_ValidationLogicForCndSel, ["TemplateValidationLogicForCndSel_FalseValue"] = SimpleTernVecOpTest_ValidationLogicForCndSel_FalseValue, ["TemplateValidationLogicForCndSelMask"] = SimpleVecOpTest_ValidationLogicForCndSelMask }), + ("_SveBinaryRetMaskOpTestTemplate.template", "SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TemplateName"] = "Simple", ["TemplateValidationLogic"] = SimpleVecOpTest_ValidationLogic, ["TemplateValidationLogicForCndSel"] = SimpleTernVecOpTest_ValidationLogicForCndSel, ["TemplateValidationLogicForCndSel_FalseValue"] = SimpleTernVecOpTest_ValidationLogicForCndSel_FalseValue, ["TemplateValidationLogicForCndSelMask"] = SimpleVecOpTest_ValidationLogicForCndSelMask }), ("_SveBinaryOpDifferentTypesTestTemplate.template", "SveVecBinOpDifferentTypesTest.template", new Dictionary { ["TemplateName"] = "Simple", ["TemplateValidationLogic"] = SimpleVecOpTest_ValidationLogic, ["TemplateValidationLogicForCndSel"] = SimpleVecOpTest_ValidationLogicForCndSel, ["TemplateValidationLogicForCndSel_FalseValue"] = SimpleVecOpTest_ValidationLogicForCndSel_FalseValue }), ("_SveBinaryMaskOpTestTemplate.template", "SveMaskVecBinOpConvertTest.template", new Dictionary { ["TemplateName"] = "Simple", ["TemplateValidationLogic"] = SimpleVecOpTest_ValidationLogic, ["TemplateValidationLogicForCndSel"] = SimpleVecOpTest_ValidationLogicForCndSel, ["TemplateValidationLogicForCndSel_FalseValue"] = SimpleVecOpTest_ValidationLogicForCndSel_FalseValue }), ("_SveImmBinaryOpTestTemplate.template", "SveVecImmBinOpTest.template", new Dictionary { ["TemplateName"] = "Simple", ["TemplateValidationLogic"] = SimpleVecOpTest_ValidationLogic, ["TemplateValidationLogicForCndSel"] = SimpleVecOpTest_ValidationLogicForCndSel, ["TemplateValidationLogicForCndSel_FalseValue"] = SimpleVecOpTest_ValidationLogicForCndSel_FalseValue }), @@ -3161,6 +3161,75 @@ ("SveVecBinOpVecTest.template", new Dictionary { ["TestName"] = "Sve_Compact_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Compact", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.Compact(left, right))", ["GetVectorResult"] = "Helpers.Compact(left, right)",}), ("SveVecBinOpVecTest.template", new Dictionary { ["TestName"] = "Sve_Compact_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Compact", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.Compact(left, right))", ["GetVectorResult"] = "Helpers.Compact(left, right)",}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareEqual_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.SveCompareEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = "BitConverter.SingleToInt32Bits"}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareEqual_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helpers.SveCompareEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = "BitConverter.DoubleToInt64Bits"}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareEqual_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.SveCompareEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareEqual_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.SveCompareEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareEqual_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.SveCompareEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareEqual_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.SveCompareEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareEqual_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.SveCompareEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareEqual_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.SveCompareEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareEqual_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.SveCompareEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareEqual_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.SveCompareEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareGreaterThan_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.SveCompareGreaterThan(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareGreaterThan(leftOp[i], rightOp[i])", ["ConvertFunc"] = "BitConverter.SingleToInt32Bits"}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareGreaterThan_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helpers.SveCompareGreaterThan(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareGreaterThan(leftOp[i], rightOp[i])", ["ConvertFunc"] = "BitConverter.DoubleToInt64Bits"}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareGreaterThan_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.SveCompareGreaterThan(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareGreaterThan(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareGreaterThan_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.SveCompareGreaterThan(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareGreaterThan(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareGreaterThan_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.SveCompareGreaterThan(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareGreaterThan(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareGreaterThan_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.SveCompareGreaterThan(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareGreaterThan(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareGreaterThan_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.SveCompareGreaterThan(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareGreaterThan(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareGreaterThan_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.SveCompareGreaterThan(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareGreaterThan(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareGreaterThan_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.SveCompareGreaterThan(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareGreaterThan(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareGreaterThan_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.SveCompareGreaterThan(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareGreaterThan(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + + ("SveVecBinRetMaskOpConvertTest.template",new Dictionary {["TestName"] = "Sve_CompareGreaterThanOrEqual_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.SveCompareGreaterThanOrEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareGreaterThanOrEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = "BitConverter.SingleToInt32Bits"}), + ("SveVecBinRetMaskOpConvertTest.template",new Dictionary {["TestName"] = "Sve_CompareGreaterThanOrEqual_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helpers.SveCompareGreaterThanOrEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareGreaterThanOrEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = "BitConverter.DoubleToInt64Bits"}), + ("SveVecBinRetMaskOpConvertTest.template",new Dictionary {["TestName"] = "Sve_CompareGreaterThanOrEqual_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.SveCompareGreaterThanOrEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareGreaterThanOrEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template",new Dictionary {["TestName"] = "Sve_CompareGreaterThanOrEqual_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.SveCompareGreaterThanOrEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareGreaterThanOrEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template",new Dictionary {["TestName"] = "Sve_CompareGreaterThanOrEqual_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.SveCompareGreaterThanOrEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareGreaterThanOrEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template",new Dictionary {["TestName"] = "Sve_CompareGreaterThanOrEqual_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.SveCompareGreaterThanOrEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareGreaterThanOrEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template",new Dictionary {["TestName"] = "Sve_CompareGreaterThanOrEqual_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.SveCompareGreaterThanOrEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareGreaterThanOrEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template",new Dictionary {["TestName"] = "Sve_CompareGreaterThanOrEqual_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.SveCompareGreaterThanOrEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareGreaterThanOrEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template",new Dictionary {["TestName"] = "Sve_CompareGreaterThanOrEqual_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.SveCompareGreaterThanOrEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareGreaterThanOrEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template",new Dictionary {["TestName"] = "Sve_CompareGreaterThanOrEqual_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareGreaterThanOrEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.SveCompareGreaterThanOrEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareGreaterThanOrEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareLessThan_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.SveCompareLessThan(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareLessThan(leftOp[i], rightOp[i])", ["ConvertFunc"] = "BitConverter.SingleToInt32Bits"}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareLessThan_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helpers.SveCompareLessThan(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareLessThan(leftOp[i], rightOp[i])", ["ConvertFunc"] = "BitConverter.DoubleToInt64Bits"}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareLessThan_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.SveCompareLessThan(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareLessThan(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareLessThan_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.SveCompareLessThan(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareLessThan(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareLessThan_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.SveCompareLessThan(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareLessThan(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareLessThan_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.SveCompareLessThan(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareLessThan(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareLessThan_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.SveCompareLessThan(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareLessThan(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareLessThan_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.SveCompareLessThan(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareLessThan(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareLessThan_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.SveCompareLessThan(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareLessThan(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareLessThan_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareLessThan", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.SveCompareLessThan(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareLessThan(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + + ("SveVecBinRetMaskOpConvertTest.template",new Dictionary { ["TestName"] = "Sve_CompareLessThanOrEqual_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.SveCompareLessThanOrEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareLessThanOrEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = "BitConverter.SingleToInt32Bits"}), + ("SveVecBinRetMaskOpConvertTest.template",new Dictionary { ["TestName"] = "Sve_CompareLessThanOrEqual_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helpers.SveCompareLessThanOrEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareLessThanOrEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = "BitConverter.DoubleToInt64Bits"}), + ("SveVecBinRetMaskOpConvertTest.template",new Dictionary { ["TestName"] = "Sve_CompareLessThanOrEqual_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.SveCompareLessThanOrEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareLessThanOrEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template",new Dictionary { ["TestName"] = "Sve_CompareLessThanOrEqual_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.SveCompareLessThanOrEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareLessThanOrEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template",new Dictionary { ["TestName"] = "Sve_CompareLessThanOrEqual_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.SveCompareLessThanOrEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareLessThanOrEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template",new Dictionary { ["TestName"] = "Sve_CompareLessThanOrEqual_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.SveCompareLessThanOrEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareLessThanOrEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template",new Dictionary { ["TestName"] = "Sve_CompareLessThanOrEqual_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.SveCompareLessThanOrEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareLessThanOrEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template",new Dictionary { ["TestName"] = "Sve_CompareLessThanOrEqual_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.SveCompareLessThanOrEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareLessThanOrEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template",new Dictionary { ["TestName"] = "Sve_CompareLessThanOrEqual_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.SveCompareLessThanOrEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareLessThanOrEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template",new Dictionary { ["TestName"] = "Sve_CompareLessThanOrEqual_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareLessThanOrEqual", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.SveCompareLessThanOrEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareLessThanOrEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareNotEqualTo_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareNotEqualTo", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.SveCompareNotEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareNotEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = "BitConverter.SingleToInt32Bits"}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareNotEqualTo_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareNotEqualTo", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helpers.SveCompareNotEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareNotEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = "BitConverter.DoubleToInt64Bits"}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareNotEqualTo_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareNotEqualTo", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.SveCompareNotEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareNotEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareNotEqualTo_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareNotEqualTo", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.SveCompareNotEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareNotEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareNotEqualTo_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareNotEqualTo", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.SveCompareNotEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareNotEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareNotEqualTo_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareNotEqualTo", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.SveCompareNotEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareNotEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareNotEqualTo_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareNotEqualTo", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.SveCompareNotEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareNotEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareNotEqualTo_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareNotEqualTo", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.SveCompareNotEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareNotEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareNotEqualTo_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareNotEqualTo", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.SveCompareNotEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareNotEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareNotEqualTo_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareNotEqualTo", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.SveCompareNotEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareNotEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), + + // ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareUnordered_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareUnordered", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helperes.SveCompareUnordered(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helperes.SveCompareUnordered(leftOp[i], rightOp[i])", ["ConvertFunc"] = "BitConverter.SingleToInt32Bits"}), + // ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareUnordered_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareUnordered", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helperes.SveCompareUnordered(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helperes.SveCompareUnordered(leftOp[i], rightOp[i])", ["ConvertFunc"] = "BitConverter.DoubleToInt64Bits"}), + ("SveMaskVecBinOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_Compute16BitAddresses_uint_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Compute16BitAddresses", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "(left[i] + ((uint)right[i] * 2)) != result[i]", ["GetIterResult"] = "(left[i] + ((uint)right[i] * 2))"}), ("SveMaskVecBinOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_Compute16BitAddresses_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Compute16BitAddresses", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "(left[i] + (right[i] * 2)) != result[i]", ["GetIterResult"] = "(left[i] + (right[i] * 2))"}), ("SveMaskVecBinOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_Compute16BitAddresses_ulong_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Compute16BitAddresses", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "(left[i] + ((ulong)right[i] * 2)) != result[i]", ["GetIterResult"] = "(left[i] + ((ulong)right[i] * 2))"}), diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs index 3d6bcec978024..52d3546a40520 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs @@ -1788,149 +1788,71 @@ public static float SveAbsoluteCompareLessThanOrEqual(float left, float right) return BitConverter.Int32BitsToSingle(result); } - public static double SveCompareEqual(double left, double right) - { - long result = 0; - - if (left == right) - { - result = 1; - } - - return BitConverter.Int64BitsToDouble(result); - } - - public static float SveCompareEqual(float left, float right) - { - int result = 0; - - if (left == right) - { - result = 1; - } - - return BitConverter.Int32BitsToSingle(result); - } - - public static double SveCompareGreaterThan(double left, double right) - { - long result = 0; - - if (left > right) - { - result = 1; - } - - return BitConverter.Int64BitsToDouble(result); - } - - public static float SveCompareGreaterThan(float left, float right) - { - int result = 0; - - if (left > right) - { - result = 1; - } - - return BitConverter.Int32BitsToSingle(result); - } - - public static double SveCompareGreaterThanOrEqual(double left, double right) - { - long result = 0; - - if (left >= right) - { - result = 1; - } - - return BitConverter.Int64BitsToDouble(result); - } - - public static float SveCompareGreaterThanOrEqual(float left, float right) - { - int result = 0; - - if (left >= right) - { - result = 1; - } - - return BitConverter.Int32BitsToSingle(result); - } - - public static double SveCompareLessThan(double left, double right) - { - long result = 0; - - if (left < right) - { - result = 1; - } - - return BitConverter.Int64BitsToDouble(result); - } - - public static float SveCompareLessThan(float left, float right) - { - int result = 0; - - if (left < right) - { - result = 1; - } - - return BitConverter.Int32BitsToSingle(result); - } - - public static double SveCompareLessThanOrEqual(double left, double right) - { - long result = 0; - - if (left <= right) - { - result = 1; - } - - return BitConverter.Int64BitsToDouble(result); - } - - public static float SveCompareLessThanOrEqual(float left, float right) - { - int result = 0; - - if (left <= right) - { - result = 1; - } - - return BitConverter.Int32BitsToSingle(result); - } - - public static double SveCompareTest(double left, double right) - { - long result = 0; - - if ((BitConverter.DoubleToInt64Bits(left) & BitConverter.DoubleToInt64Bits(right)) != 0) - { - result = 1; - } - - return BitConverter.Int64BitsToDouble(result); - } - - public static float SveCompareTest(float left, float right) - { - int result = 0; - - if ((BitConverter.SingleToInt32Bits(left) & BitConverter.SingleToInt32Bits(right)) != 0) - { - result = 1; - } - - return BitConverter.Int32BitsToSingle(result); - } + public static double SveCompareEqual(double left, double right) => BitConverter.Int64BitsToDouble((left == right) ? 1 : 0); + public static float SveCompareEqual(float left, float right) => BitConverter.Int32BitsToSingle((left == right) ? 1 : 0); + public static sbyte SveCompareEqual(sbyte left, sbyte right) => (sbyte)((left == right) ? 1 : 0); + public static byte SveCompareEqual(byte left, byte right) => (byte)((left == right) ? 1 : 0); + public static short SveCompareEqual(short left, short right) => (short)((left == right) ? 1 : 0); + public static ushort SveCompareEqual(ushort left, ushort right) => (ushort)((left == right) ? 1 : 0); + public static int SveCompareEqual(int left, int right) => (int)((left == right) ? 1 : 0); + public static uint SveCompareEqual(uint left, uint right) => (uint)((left == right) ? 1 : 0); + public static long SveCompareEqual(long left, long right) => (long)((left == right) ? 1 : 0); + public static ulong SveCompareEqual(ulong left, ulong right) => (ulong)((left == right) ? 1 : 0); + + public static double SveCompareNotEqual(double left, double right) => BitConverter.Int64BitsToDouble((left != right) ? 1 : 0); + public static float SveCompareNotEqual(float left, float right) => BitConverter.Int32BitsToSingle((left != right) ? 1 : 0); + public static sbyte SveCompareNotEqual(sbyte left, sbyte right) => (sbyte)((left != right) ? 1 : 0); + public static byte SveCompareNotEqual(byte left, byte right) => (byte)((left != right) ? 1 : 0); + public static short SveCompareNotEqual(short left, short right) => (short)((left != right) ? 1 : 0); + public static ushort SveCompareNotEqual(ushort left, ushort right) => (ushort)((left != right) ? 1 : 0); + public static int SveCompareNotEqual(int left, int right) => (int)((left != right) ? 1 : 0); + public static uint SveCompareNotEqual(uint left, uint right) => (uint)((left != right) ? 1 : 0); + public static long SveCompareNotEqual(long left, long right) => (long)((left != right) ? 1 : 0); + public static ulong SveCompareNotEqual(ulong left, ulong right) => (ulong)((left != right) ? 1 : 0); + + public static double SveCompareGreaterThan(double left, double right) => BitConverter.Int64BitsToDouble((left > right) ? 1 : 0); + public static float SveCompareGreaterThan(float left, float right) => BitConverter.Int32BitsToSingle((left > right) ? 1 : 0); + public static sbyte SveCompareGreaterThan(sbyte left, sbyte right) => (sbyte)((left > right) ? 1 : 0); + public static byte SveCompareGreaterThan(byte left, byte right) => (byte)((left > right) ? 1 : 0); + public static short SveCompareGreaterThan(short left, short right) => (short)((left > right) ? 1 : 0); + public static ushort SveCompareGreaterThan(ushort left, ushort right) => (ushort)((left > right) ? 1 : 0); + public static int SveCompareGreaterThan(int left, int right) => (int)((left > right) ? 1 : 0); + public static uint SveCompareGreaterThan(uint left, uint right) => (uint)((left > right) ? 1 : 0); + public static long SveCompareGreaterThan(long left, long right) => (long)((left > right) ? 1 : 0); + public static ulong SveCompareGreaterThan(ulong left, ulong right) => (ulong)((left > right) ? 1 : 0); + + public static double SveCompareGreaterThanOrEqual(double left, double right) => BitConverter.Int64BitsToDouble((left >= right) ? 1 : 0); + public static float SveCompareGreaterThanOrEqual(float left, float right) => BitConverter.Int32BitsToSingle((left >= right) ? 1 : 0); + public static sbyte SveCompareGreaterThanOrEqual(sbyte left, sbyte right) => (sbyte)((left >= right) ? 1 : 0); + public static byte SveCompareGreaterThanOrEqual(byte left, byte right) => (byte)((left >= right) ? 1 : 0); + public static short SveCompareGreaterThanOrEqual(short left, short right) => (short)((left >= right) ? 1 : 0); + public static ushort SveCompareGreaterThanOrEqual(ushort left, ushort right) => (ushort)((left >= right) ? 1 : 0); + public static int SveCompareGreaterThanOrEqual(int left, int right) => (int)((left >= right) ? 1 : 0); + public static uint SveCompareGreaterThanOrEqual(uint left, uint right) => (uint)((left >= right) ? 1 : 0); + public static long SveCompareGreaterThanOrEqual(long left, long right) => (long)((left >= right) ? 1 : 0); + public static ulong SveCompareGreaterThanOrEqual(ulong left, ulong right) => (ulong)((left >= right) ? 1 : 0); + + public static double SveCompareLessThan(double left, double right) => BitConverter.Int64BitsToDouble((left < right) ? 1 : 0); + public static float SveCompareLessThan(float left, float right) => BitConverter.Int32BitsToSingle((left < right) ? 1 : 0); + public static sbyte SveCompareLessThan(sbyte left, sbyte right) => (sbyte)((left < right) ? 1 : 0); + public static byte SveCompareLessThan(byte left, byte right) => (byte)((left < right) ? 1 : 0); + public static short SveCompareLessThan(short left, short right) => (short)((left < right) ? 1 : 0); + public static ushort SveCompareLessThan(ushort left, ushort right) => (ushort)((left < right) ? 1 : 0); + public static int SveCompareLessThan(int left, int right) => (int)((left < right) ? 1 : 0); + public static uint SveCompareLessThan(uint left, uint right) => (uint)((left < right) ? 1 : 0); + public static long SveCompareLessThan(long left, long right) => (long)((left < right) ? 1 : 0); + public static ulong SveCompareLessThan(ulong left, ulong right) => (ulong)((left < right) ? 1 : 0); + + public static double SveCompareLessThanOrEqual(double left, double right) => BitConverter.Int64BitsToDouble((left <= right) ? 1 : 0); + public static float SveCompareLessThanOrEqual(float left, float right) => BitConverter.Int32BitsToSingle((left <= right) ? 1 : 0); + public static sbyte SveCompareLessThanOrEqual(sbyte left, sbyte right) => (sbyte)((left <= right) ? 1 : 0); + public static byte SveCompareLessThanOrEqual(byte left, byte right) => (byte)((left <= right) ? 1 : 0); + public static short SveCompareLessThanOrEqual(short left, short right) => (short)((left <= right) ? 1 : 0); + public static ushort SveCompareLessThanOrEqual(ushort left, ushort right) => (ushort)((left <= right) ? 1 : 0); + public static int SveCompareLessThanOrEqual(int left, int right) => (int)((left <= right) ? 1 : 0); + public static uint SveCompareLessThanOrEqual(uint left, uint right) => (uint)((left <= right) ? 1 : 0); + public static long SveCompareLessThanOrEqual(long left, long right) => (long)((left <= right) ? 1 : 0); + public static ulong SveCompareLessThanOrEqual(ulong left, ulong right) => (ulong)((left <= right) ? 1 : 0); public static double CompareEqual(double left, double right) { From 4762e3c9e84c3dc0a8ba092ce14e90be687327b3 Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Fri, 5 Jul 2024 09:33:37 -0700 Subject: [PATCH 10/10] Add test coverage for Sve.CompareUnordered --- .../GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs | 4 ++-- src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs index 2185f41a11ca7..1caaf29a9d226 100644 --- a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs +++ b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs @@ -3227,8 +3227,8 @@ ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareNotEqualTo_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareNotEqualTo", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.SveCompareNotEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareNotEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareNotEqualTo_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareNotEqualTo", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.SveCompareNotEqual(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareNotEqual(leftOp[i], rightOp[i])", ["ConvertFunc"] = ""}), - // ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareUnordered_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareUnordered", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helperes.SveCompareUnordered(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helperes.SveCompareUnordered(leftOp[i], rightOp[i])", ["ConvertFunc"] = "BitConverter.SingleToInt32Bits"}), - // ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareUnordered_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareUnordered", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helperes.SveCompareUnordered(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helperes.SveCompareUnordered(leftOp[i], rightOp[i])", ["ConvertFunc"] = "BitConverter.DoubleToInt64Bits"}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareUnordered_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareUnordered", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.SveCompareUnordered(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareUnordered(leftOp[i], rightOp[i])", ["ConvertFunc"] = "BitConverter.SingleToInt32Bits"}), + ("SveVecBinRetMaskOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_CompareUnordered_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CompareUnordered", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helpers.SveCompareUnordered(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.SveCompareUnordered(leftOp[i], rightOp[i])", ["ConvertFunc"] = "BitConverter.DoubleToInt64Bits"}), ("SveMaskVecBinOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_Compute16BitAddresses_uint_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Compute16BitAddresses", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "(left[i] + ((uint)right[i] * 2)) != result[i]", ["GetIterResult"] = "(left[i] + ((uint)right[i] * 2))"}), ("SveMaskVecBinOpConvertTest.template", new Dictionary { ["TestName"] = "Sve_Compute16BitAddresses_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Compute16BitAddresses", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "(left[i] + (right[i] * 2)) != result[i]", ["GetIterResult"] = "(left[i] + (right[i] * 2))"}), diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs index 52d3546a40520..ebffa0504f744 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs @@ -1854,6 +1854,9 @@ public static float SveAbsoluteCompareLessThanOrEqual(float left, float right) public static long SveCompareLessThanOrEqual(long left, long right) => (long)((left <= right) ? 1 : 0); public static ulong SveCompareLessThanOrEqual(ulong left, ulong right) => (ulong)((left <= right) ? 1 : 0); + public static double SveCompareUnordered(double left, double right) => BitConverter.Int64BitsToDouble((double.IsNaN(left) || double.IsNaN(right)) ? 1 : 0); + public static float SveCompareUnordered(float left, float right) => BitConverter.Int32BitsToSingle((float.IsNaN(left) || float.IsNaN(right)) ? 1 : 0); + public static double CompareEqual(double left, double right) { long result = 0;