From 7294674995d2441075b5b4ad151b6e8982ee9c6f Mon Sep 17 00:00:00 2001 From: Will Smith Date: Mon, 1 Jul 2024 21:18:58 -0700 Subject: [PATCH] JIT: Added four SVE `CreateBreak*` APIs (#104184) * Added four SVE CreateBreak* APIs * Fix comments * Added break * Formatting * Update Sve.PlatformNotSupported.cs --- src/coreclr/jit/hwintrinsic.cpp | 24 +++ src/coreclr/jit/hwintrinsiccodegenarm64.cpp | 14 ++ src/coreclr/jit/hwintrinsiclistarm64sve.h | 4 + .../Arm/Sve.PlatformNotSupported.cs | 193 ++++++++++++++++++ .../src/System/Runtime/Intrinsics/Arm/Sve.cs | 193 ++++++++++++++++++ .../ref/System.Runtime.Intrinsics.cs | 33 +++ .../GenerateHWIntrinsicTests_Arm.cs | 37 ++++ .../HardwareIntrinsics/Arm/Shared/Helpers.cs | 121 +++++++++++ .../Shared/_SveTernOpTestTemplate.template | 1 + 9 files changed, 620 insertions(+) diff --git a/src/coreclr/jit/hwintrinsic.cpp b/src/coreclr/jit/hwintrinsic.cpp index 9db2767f50796..4f016940840b2 100644 --- a/src/coreclr/jit/hwintrinsic.cpp +++ b/src/coreclr/jit/hwintrinsic.cpp @@ -1911,6 +1911,10 @@ GenTree* Compiler::impHWIntrinsic(NamedIntrinsic intrinsic, switch (intrinsic) { + case NI_Sve_CreateBreakAfterMask: + case NI_Sve_CreateBreakAfterPropagateMask: + case NI_Sve_CreateBreakBeforeMask: + case NI_Sve_CreateBreakBeforePropagateMask: case NI_Sve_CreateMaskForFirstActiveElement: case NI_Sve_CreateMaskForNextActiveElement: case NI_Sve_GetActiveElementCount: @@ -1933,6 +1937,26 @@ GenTree* Compiler::impHWIntrinsic(NamedIntrinsic intrinsic, break; } + switch (intrinsic) + { + case NI_Sve_CreateBreakAfterPropagateMask: + case NI_Sve_CreateBreakBeforePropagateMask: + { + GenTree* op3 = retNode->AsHWIntrinsic()->Op(3); + + // HWInstrinsic requires a mask for op3 + if (!varTypeIsMask(op3)) + { + retNode->AsHWIntrinsic()->Op(3) = + gtNewSimdCvtVectorToMaskNode(TYP_MASK, op3, simdBaseJitType, simdSize); + } + break; + } + + default: + break; + } + if (!varTypeIsMask(op1)) { // Op1 input is a vector. HWInstrinsic requires a mask. diff --git a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp index c568a3bad4977..2a27eef99c38e 100644 --- a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp +++ b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp @@ -2238,6 +2238,20 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) break; } + case NI_Sve_CreateBreakAfterMask: + case NI_Sve_CreateBreakBeforeMask: + { + GetEmitter()->emitInsSve_R_R_R(ins, emitSize, targetReg, op1Reg, op2Reg, INS_OPTS_SCALABLE_B); + break; + } + + case NI_Sve_CreateBreakAfterPropagateMask: + case NI_Sve_CreateBreakBeforePropagateMask: + { + GetEmitter()->emitInsSve_R_R_R_R(ins, emitSize, targetReg, op1Reg, op2Reg, op3Reg, INS_OPTS_SCALABLE_B); + break; + } + case NI_Sve_CreateMaskForFirstActiveElement: { assert(isRMW); diff --git a/src/coreclr/jit/hwintrinsiclistarm64sve.h b/src/coreclr/jit/hwintrinsiclistarm64sve.h index 688691124eab6..6a18de1253114 100644 --- a/src/coreclr/jit/hwintrinsiclistarm64sve.h +++ b/src/coreclr/jit/hwintrinsiclistarm64sve.h @@ -39,6 +39,10 @@ HARDWARE_INTRINSIC(Sve, Count16BitElements, HARDWARE_INTRINSIC(Sve, Count32BitElements, 0, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_cntw, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_NoFloatingPointUsed) HARDWARE_INTRINSIC(Sve, Count64BitElements, 0, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_cntd, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_NoFloatingPointUsed) HARDWARE_INTRINSIC(Sve, Count8BitElements, 0, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_cntb, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_NoFloatingPointUsed) +HARDWARE_INTRINSIC(Sve, CreateBreakAfterMask, -1, 2, true, {INS_sve_brka, INS_sve_brka, INS_sve_brka, INS_sve_brka, INS_sve_brka, INS_sve_brka, INS_sve_brka, INS_sve_brka, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_ExplicitMaskedOperation|HW_Flag_ReturnsPerElementMask|HW_Flag_SpecialCodeGen) +HARDWARE_INTRINSIC(Sve, CreateBreakAfterPropagateMask, -1, 3, true, {INS_sve_brkpa, INS_sve_brkpa, INS_sve_brkpa, INS_sve_brkpa, INS_sve_brkpa, INS_sve_brkpa, INS_sve_brkpa, INS_sve_brkpa, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_ExplicitMaskedOperation|HW_Flag_ReturnsPerElementMask|HW_Flag_SpecialCodeGen) +HARDWARE_INTRINSIC(Sve, CreateBreakBeforeMask, -1, 2, true, {INS_sve_brkb, INS_sve_brkb, INS_sve_brkb, INS_sve_brkb, INS_sve_brkb, INS_sve_brkb, INS_sve_brkb, INS_sve_brkb, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_ExplicitMaskedOperation|HW_Flag_ReturnsPerElementMask|HW_Flag_SpecialCodeGen) +HARDWARE_INTRINSIC(Sve, CreateBreakBeforePropagateMask, -1, 3, true, {INS_sve_brkpb, INS_sve_brkpb, INS_sve_brkpb, INS_sve_brkpb, INS_sve_brkpb, INS_sve_brkpb, INS_sve_brkpb, INS_sve_brkpb, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_ExplicitMaskedOperation|HW_Flag_ReturnsPerElementMask|HW_Flag_SpecialCodeGen) HARDWARE_INTRINSIC(Sve, CreateFalseMaskByte, -1, 0, false, {INS_invalid, INS_sve_pfalse, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_ReturnsPerElementMask) HARDWARE_INTRINSIC(Sve, CreateFalseMaskDouble, -1, 0, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_pfalse}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_ReturnsPerElementMask) HARDWARE_INTRINSIC(Sve, CreateFalseMaskInt16, -1, 0, false, {INS_invalid, INS_invalid, INS_sve_pfalse, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_ReturnsPerElementMask) 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 371da71f844ed..86517af978167 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 @@ -967,6 +967,199 @@ internal Arm64() { } public static unsafe ulong Count8BitElements([ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + /// + /// svbool_t svbrka[_b]_z(svbool_t pg, svbool_t op) + /// BRKA Presult.B, Pg/Z, Pop.B + /// + public static unsafe Vector CreateBreakAfterMask(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svbrka[_b]_z(svbool_t pg, svbool_t op) + /// BRKA Presult.B, Pg/Z, Pop.B + /// + public static unsafe Vector CreateBreakAfterMask(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svbrka[_b]_z(svbool_t pg, svbool_t op) + /// BRKA Presult.B, Pg/Z, Pop.B + /// + public static unsafe Vector CreateBreakAfterMask(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svbrka[_b]_z(svbool_t pg, svbool_t op) + /// BRKA Presult.B, Pg/Z, Pop.B + /// + public static unsafe Vector CreateBreakAfterMask(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svbrka[_b]_z(svbool_t pg, svbool_t op) + /// BRKA Presult.B, Pg/Z, Pop.B + /// + public static unsafe Vector CreateBreakAfterMask(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svbrka[_b]_z(svbool_t pg, svbool_t op) + /// BRKA Presult.B, Pg/Z, Pop.B + /// + public static unsafe Vector CreateBreakAfterMask(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svbrka[_b]_z(svbool_t pg, svbool_t op) + /// BRKA Presult.B, Pg/Z, Pop.B + /// + public static unsafe Vector CreateBreakAfterMask(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svbrka[_b]_z(svbool_t pg, svbool_t op) + /// BRKA Presult.B, Pg/Z, Pop.B + /// + public static unsafe Vector CreateBreakAfterMask(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svbrkpa[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BRKPA Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector CreateBreakAfterPropagateMask(Vector mask, Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svbrkpa[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BRKPA Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector CreateBreakAfterPropagateMask(Vector mask, Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svbrkpa[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BRKPA Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector CreateBreakAfterPropagateMask(Vector mask, Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svbrkpa[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BRKPA Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector CreateBreakAfterPropagateMask(Vector mask, Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svbrkpa[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BRKPA Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector CreateBreakAfterPropagateMask(Vector mask, Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svbrkpa[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BRKPA Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector CreateBreakAfterPropagateMask(Vector mask, Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svbrkpa[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BRKPA Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector CreateBreakAfterPropagateMask(Vector mask, Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svbrkpa[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BRKPA Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector CreateBreakAfterPropagateMask(Vector mask, Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svbrkb[_b]_z(svbool_t pg, svbool_t op) + /// BRKB Presult.B, Pg/Z, Pop.B + /// + public static unsafe Vector CreateBreakBeforeMask(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svbrkb[_b]_z(svbool_t pg, svbool_t op) + /// BRKB Presult.B, Pg/Z, Pop.B + /// + public static unsafe Vector CreateBreakBeforeMask(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svbrkb[_b]_z(svbool_t pg, svbool_t op) + /// BRKB Presult.B, Pg/Z, Pop.B + /// + public static unsafe Vector CreateBreakBeforeMask(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svbrkb[_b]_z(svbool_t pg, svbool_t op) + /// BRKB Presult.B, Pg/Z, Pop.B + /// + public static unsafe Vector CreateBreakBeforeMask(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svbrkb[_b]_z(svbool_t pg, svbool_t op) + /// BRKB Presult.B, Pg/Z, Pop.B + /// + public static unsafe Vector CreateBreakBeforeMask(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svbrkb[_b]_z(svbool_t pg, svbool_t op) + /// BRKB Presult.B, Pg/Z, Pop.B + /// + public static unsafe Vector CreateBreakBeforeMask(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svbrkb[_b]_z(svbool_t pg, svbool_t op) + /// BRKB Presult.B, Pg/Z, Pop.B + /// + public static unsafe Vector CreateBreakBeforeMask(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svbrkb[_b]_z(svbool_t pg, svbool_t op) + /// BRKB Presult.B, Pg/Z, Pop.B + /// + public static unsafe Vector CreateBreakBeforeMask(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svbrkpb[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BRKPB Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector CreateBreakBeforePropagateMask(Vector mask, Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svbrkpb[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BRKPB Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector CreateBreakBeforePropagateMask(Vector mask, Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svbrkpb[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BRKPB Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector CreateBreakBeforePropagateMask(Vector mask, Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svbrkpb[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BRKPB Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector CreateBreakBeforePropagateMask(Vector mask, Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svbrkpb[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BRKPB Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector CreateBreakBeforePropagateMask(Vector mask, Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svbrkpb[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BRKPB Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector CreateBreakBeforePropagateMask(Vector mask, Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svbrkpb[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BRKPB Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector CreateBreakBeforePropagateMask(Vector mask, Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svbool_t svbrkpb[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BRKPB Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector CreateBreakBeforePropagateMask(Vector mask, Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// Set all predicate elements to false /// 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 39d8dde224aa9..fa6a76e39bb67 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 @@ -1025,6 +1025,199 @@ internal Arm64() { } public static unsafe ulong Count8BitElements([ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => Count8BitElements(pattern); + /// + /// svbool_t svbrka[_b]_z(svbool_t pg, svbool_t op) + /// BRKA Presult.B, Pg/Z, Pop.B + /// + public static unsafe Vector CreateBreakAfterMask(Vector mask, Vector srcMask) => CreateBreakAfterMask(mask, srcMask); + + /// + /// svbool_t svbrka[_b]_z(svbool_t pg, svbool_t op) + /// BRKA Presult.B, Pg/Z, Pop.B + /// + public static unsafe Vector CreateBreakAfterMask(Vector mask, Vector srcMask) => CreateBreakAfterMask(mask, srcMask); + + /// + /// svbool_t svbrka[_b]_z(svbool_t pg, svbool_t op) + /// BRKA Presult.B, Pg/Z, Pop.B + /// + public static unsafe Vector CreateBreakAfterMask(Vector mask, Vector srcMask) => CreateBreakAfterMask(mask, srcMask); + + /// + /// svbool_t svbrka[_b]_z(svbool_t pg, svbool_t op) + /// BRKA Presult.B, Pg/Z, Pop.B + /// + public static unsafe Vector CreateBreakAfterMask(Vector mask, Vector srcMask) => CreateBreakAfterMask(mask, srcMask); + + /// + /// svbool_t svbrka[_b]_z(svbool_t pg, svbool_t op) + /// BRKA Presult.B, Pg/Z, Pop.B + /// + public static unsafe Vector CreateBreakAfterMask(Vector mask, Vector srcMask) => CreateBreakAfterMask(mask, srcMask); + + /// + /// svbool_t svbrka[_b]_z(svbool_t pg, svbool_t op) + /// BRKA Presult.B, Pg/Z, Pop.B + /// + public static unsafe Vector CreateBreakAfterMask(Vector mask, Vector srcMask) => CreateBreakAfterMask(mask, srcMask); + + /// + /// svbool_t svbrka[_b]_z(svbool_t pg, svbool_t op) + /// BRKA Presult.B, Pg/Z, Pop.B + /// + public static unsafe Vector CreateBreakAfterMask(Vector mask, Vector srcMask) => CreateBreakAfterMask(mask, srcMask); + + /// + /// svbool_t svbrka[_b]_z(svbool_t pg, svbool_t op) + /// BRKA Presult.B, Pg/Z, Pop.B + /// + public static unsafe Vector CreateBreakAfterMask(Vector mask, Vector srcMask) => CreateBreakAfterMask(mask, srcMask); + + /// + /// svbool_t svbrkpa[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BRKPA Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector CreateBreakAfterPropagateMask(Vector mask, Vector left, Vector right) => CreateBreakAfterPropagateMask(mask, left, right); + + /// + /// svbool_t svbrkpa[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BRKPA Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector CreateBreakAfterPropagateMask(Vector mask, Vector left, Vector right) => CreateBreakAfterPropagateMask(mask, left, right); + + /// + /// svbool_t svbrkpa[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BRKPA Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector CreateBreakAfterPropagateMask(Vector mask, Vector left, Vector right) => CreateBreakAfterPropagateMask(mask, left, right); + + /// + /// svbool_t svbrkpa[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BRKPA Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector CreateBreakAfterPropagateMask(Vector mask, Vector left, Vector right) => CreateBreakAfterPropagateMask(mask, left, right); + + /// + /// svbool_t svbrkpa[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BRKPA Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector CreateBreakAfterPropagateMask(Vector mask, Vector left, Vector right) => CreateBreakAfterPropagateMask(mask, left, right); + + /// + /// svbool_t svbrkpa[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BRKPA Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector CreateBreakAfterPropagateMask(Vector mask, Vector left, Vector right) => CreateBreakAfterPropagateMask(mask, left, right); + + /// + /// svbool_t svbrkpa[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BRKPA Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector CreateBreakAfterPropagateMask(Vector mask, Vector left, Vector right) => CreateBreakAfterPropagateMask(mask, left, right); + + /// + /// svbool_t svbrkpa[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BRKPA Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector CreateBreakAfterPropagateMask(Vector mask, Vector left, Vector right) => CreateBreakAfterPropagateMask(mask, left, right); + + /// + /// svbool_t svbrkb[_b]_z(svbool_t pg, svbool_t op) + /// BRKB Presult.B, Pg/Z, Pop.B + /// + public static unsafe Vector CreateBreakBeforeMask(Vector mask, Vector srcMask) => CreateBreakBeforeMask(mask, srcMask); + + /// + /// svbool_t svbrkb[_b]_z(svbool_t pg, svbool_t op) + /// BRKB Presult.B, Pg/Z, Pop.B + /// + public static unsafe Vector CreateBreakBeforeMask(Vector mask, Vector srcMask) => CreateBreakBeforeMask(mask, srcMask); + + /// + /// svbool_t svbrkb[_b]_z(svbool_t pg, svbool_t op) + /// BRKB Presult.B, Pg/Z, Pop.B + /// + public static unsafe Vector CreateBreakBeforeMask(Vector mask, Vector srcMask) => CreateBreakBeforeMask(mask, srcMask); + + /// + /// svbool_t svbrkb[_b]_z(svbool_t pg, svbool_t op) + /// BRKB Presult.B, Pg/Z, Pop.B + /// + public static unsafe Vector CreateBreakBeforeMask(Vector mask, Vector srcMask) => CreateBreakBeforeMask(mask, srcMask); + + /// + /// svbool_t svbrkb[_b]_z(svbool_t pg, svbool_t op) + /// BRKB Presult.B, Pg/Z, Pop.B + /// + public static unsafe Vector CreateBreakBeforeMask(Vector mask, Vector srcMask) => CreateBreakBeforeMask(mask, srcMask); + + /// + /// svbool_t svbrkb[_b]_z(svbool_t pg, svbool_t op) + /// BRKB Presult.B, Pg/Z, Pop.B + /// + public static unsafe Vector CreateBreakBeforeMask(Vector mask, Vector srcMask) => CreateBreakBeforeMask(mask, srcMask); + + /// + /// svbool_t svbrkb[_b]_z(svbool_t pg, svbool_t op) + /// BRKB Presult.B, Pg/Z, Pop.B + /// + public static unsafe Vector CreateBreakBeforeMask(Vector mask, Vector srcMask) => CreateBreakBeforeMask(mask, srcMask); + + /// + /// svbool_t svbrkb[_b]_z(svbool_t pg, svbool_t op) + /// BRKB Presult.B, Pg/Z, Pop.B + /// + public static unsafe Vector CreateBreakBeforeMask(Vector mask, Vector srcMask) => CreateBreakBeforeMask(mask, srcMask); + + /// + /// svbool_t svbrkpb[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BRKPB Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector CreateBreakBeforePropagateMask(Vector mask, Vector left, Vector right) => CreateBreakBeforePropagateMask(mask, left, right); + + /// + /// svbool_t svbrkpb[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BRKPB Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector CreateBreakBeforePropagateMask(Vector mask, Vector left, Vector right) => CreateBreakBeforePropagateMask(mask, left, right); + + /// + /// svbool_t svbrkpb[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BRKPB Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector CreateBreakBeforePropagateMask(Vector mask, Vector left, Vector right) => CreateBreakBeforePropagateMask(mask, left, right); + + /// + /// svbool_t svbrkpb[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BRKPB Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector CreateBreakBeforePropagateMask(Vector mask, Vector left, Vector right) => CreateBreakBeforePropagateMask(mask, left, right); + + /// + /// svbool_t svbrkpb[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BRKPB Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector CreateBreakBeforePropagateMask(Vector mask, Vector left, Vector right) => CreateBreakBeforePropagateMask(mask, left, right); + + /// + /// svbool_t svbrkpb[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BRKPB Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector CreateBreakBeforePropagateMask(Vector mask, Vector left, Vector right) => CreateBreakBeforePropagateMask(mask, left, right); + + /// + /// svbool_t svbrkpb[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BRKPB Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector CreateBreakBeforePropagateMask(Vector mask, Vector left, Vector right) => CreateBreakBeforePropagateMask(mask, left, right); + + /// + /// svbool_t svbrkpb[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BRKPB Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector CreateBreakBeforePropagateMask(Vector mask, Vector left, Vector right) => CreateBreakBeforePropagateMask(mask, left, right); + + /// Set all predicate elements to false /// 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 1904b956195d0..7827cdf52eb82 100644 --- a/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs +++ b/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs @@ -4329,6 +4329,39 @@ internal Arm64() { } public static ulong Count64BitElements([ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } public static ulong Count8BitElements([ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static System.Numerics.Vector CreateBreakAfterMask(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static System.Numerics.Vector CreateBreakAfterMask(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static System.Numerics.Vector CreateBreakAfterMask(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static System.Numerics.Vector CreateBreakAfterMask(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static System.Numerics.Vector CreateBreakAfterMask(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static System.Numerics.Vector CreateBreakAfterMask(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static System.Numerics.Vector CreateBreakAfterMask(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static System.Numerics.Vector CreateBreakAfterMask(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static System.Numerics.Vector CreateBreakAfterPropagateMask(System.Numerics.Vector mask, System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CreateBreakAfterPropagateMask(System.Numerics.Vector mask, System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CreateBreakAfterPropagateMask(System.Numerics.Vector mask, System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CreateBreakAfterPropagateMask(System.Numerics.Vector mask, System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CreateBreakAfterPropagateMask(System.Numerics.Vector mask, System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CreateBreakAfterPropagateMask(System.Numerics.Vector mask, System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CreateBreakAfterPropagateMask(System.Numerics.Vector mask, System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CreateBreakAfterPropagateMask(System.Numerics.Vector mask, System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CreateBreakBeforeMask(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static System.Numerics.Vector CreateBreakBeforeMask(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static System.Numerics.Vector CreateBreakBeforeMask(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static System.Numerics.Vector CreateBreakBeforeMask(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static System.Numerics.Vector CreateBreakBeforeMask(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static System.Numerics.Vector CreateBreakBeforeMask(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static System.Numerics.Vector CreateBreakBeforeMask(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static System.Numerics.Vector CreateBreakBeforeMask(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static System.Numerics.Vector CreateBreakBeforePropagateMask(System.Numerics.Vector mask, System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CreateBreakBeforePropagateMask(System.Numerics.Vector mask, System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CreateBreakBeforePropagateMask(System.Numerics.Vector mask, System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CreateBreakBeforePropagateMask(System.Numerics.Vector mask, System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CreateBreakBeforePropagateMask(System.Numerics.Vector mask, System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CreateBreakBeforePropagateMask(System.Numerics.Vector mask, System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CreateBreakBeforePropagateMask(System.Numerics.Vector mask, System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CreateBreakBeforePropagateMask(System.Numerics.Vector mask, System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector CreateFalseMaskByte() { throw null; } public static System.Numerics.Vector CreateFalseMaskDouble() { throw null; } public static System.Numerics.Vector CreateFalseMaskInt16() { throw null; } diff --git a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs index 0719ba73f68c5..47dd86be195db 100644 --- a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs +++ b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs @@ -186,6 +186,7 @@ ("_SveImmBinaryOpTestTemplate.template", "SveVecImmBinOpTest.template", new Dictionary { ["TemplateName"] = "Simple", ["TemplateValidationLogic"] = SimpleVecOpTest_ValidationLogic, ["TemplateValidationLogicForCndSel"] = SimpleVecOpTest_ValidationLogicForCndSel }), ("_SveImmUnaryOpTestTemplate.template", "SveVecImmUnOpTest.template", new Dictionary { ["TemplateName"] = "Simple", ["TemplateValidationLogic"] = SimpleVecOpTest_ValidationLogic, ["TemplateValidationLogicForCndSel"] = SimpleVecOpTest_ValidationLogicForCndSel }), ("_SveTernOpTestTemplate.template", "SveVecTernOpTest.template", new Dictionary { ["TemplateName"] = "Simple", ["TemplateValidationLogic"] = SimpleVecOpTest_ValidationLogic, ["TemplateValidationLogicForCndSel"] = SimpleTernVecOpTest_ValidationLogicForCndSel }), + ("_SveTernOpTestTemplate.template", "SveVecTernOpVecTest.template", new Dictionary { ["TemplateName"] = "Simple", ["TemplateValidationLogic"] = SimpleVecOpTest_VectorValidationLogic, ["TemplateValidationLogicForCndSel"] = SimpleVecOpTest_VectorValidationLogicForCndSel }), ("_SveTernOpFirstArgTestTemplate.template", "SveVecTernOpFirstArgTest.template", new Dictionary { ["TemplateName"] = "Simple", ["TemplateValidationLogic"] = SimpleVecOpTest_ValidationLogic, ["TemplateValidationLogicForCndSel"] = SimpleTernVecOpTest_ValidationLogicForCndSel }), ("_SveImmTernOpTestTemplate.template", "SveVecImmTernOpTest.template", new Dictionary { ["TemplateName"] = "Simple", ["TemplateValidationLogic"] = SimpleVecOpTest_ValidationLogic, ["TemplateValidationLogicForCndSel"] = SimpleTernVecOpTest_ValidationLogicForCndSel }), ("_SveTernOpMaskedOpTestTemplate.template", "SveVecTernOpMaskedTest.template", new Dictionary { ["TemplateName"] = "Simple", ["TemplateValidationLogic"] = SimpleVecOpTest_ValidationLogic, ["TemplateValidationLogicForCndSel"] = SimpleTernVecOpTest_ValidationLogicForCndSel }), @@ -3100,6 +3101,42 @@ ("ScalarUnOpTest.template", new Dictionary { ["TestName"] = "Sve_Count64BitElements", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Count64BitElements", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (UInt64)(Unsafe.SizeOf>() / sizeof(Int64)));",}), ("ScalarUnOpTest.template", new Dictionary { ["TestName"] = "Sve_Count8BitElements", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Count8BitElements", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (UInt64)(Unsafe.SizeOf>() / sizeof(Byte)));",}), + ("SveVecBinOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateBreakAfterMask_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateBreakAfterMask", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskByte()", ["NextValueOp2"] = "Helpers.getMaskByte()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateBreakAfterMask(left, right))", ["GetVectorResult"] = "Helpers.CreateBreakAfterMask(left, right)"}), + ("SveVecBinOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateBreakAfterMask_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateBreakAfterMask", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskUInt16()", ["NextValueOp2"] = "Helpers.getMaskUInt16()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateBreakAfterMask(left, right))", ["GetVectorResult"] = "Helpers.CreateBreakAfterMask(left, right)"}), + ("SveVecBinOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateBreakAfterMask_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateBreakAfterMask", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskUInt32()", ["NextValueOp2"] = "Helpers.getMaskUInt32()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateBreakAfterMask(left, right))", ["GetVectorResult"] = "Helpers.CreateBreakAfterMask(left, right)"}), + ("SveVecBinOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateBreakAfterMask_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateBreakAfterMask", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskUInt64()", ["NextValueOp2"] = "Helpers.getMaskUInt64()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateBreakAfterMask(left, right))", ["GetVectorResult"] = "Helpers.CreateBreakAfterMask(left, right)"}), + ("SveVecBinOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateBreakAfterMask_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateBreakAfterMask", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskSByte()", ["NextValueOp2"] = "Helpers.getMaskSByte()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateBreakAfterMask(left, right))", ["GetVectorResult"] = "Helpers.CreateBreakAfterMask(left, right)"}), + ("SveVecBinOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateBreakAfterMask_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateBreakAfterMask", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskInt16()", ["NextValueOp2"] = "Helpers.getMaskInt16()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateBreakAfterMask(left, right))", ["GetVectorResult"] = "Helpers.CreateBreakAfterMask(left, right)"}), + ("SveVecBinOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateBreakAfterMask_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateBreakAfterMask", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskInt32()", ["NextValueOp2"] = "Helpers.getMaskInt32()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateBreakAfterMask(left, right))", ["GetVectorResult"] = "Helpers.CreateBreakAfterMask(left, right)"}), + ("SveVecBinOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateBreakAfterMask_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateBreakAfterMask", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskInt64()", ["NextValueOp2"] = "Helpers.getMaskInt64()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateBreakAfterMask(left, right))", ["GetVectorResult"] = "Helpers.CreateBreakAfterMask(left, right)"}), + + ("SveVecTernOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateBreakAfterPropagateMask_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateBreakAfterPropagateMask", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskByte()", ["NextValueOp2"] = "Helpers.getMaskByte()", ["NextValueOp3"] = "Helpers.getMaskByte()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateBreakAfterPropagateMask(firstOp, secondOp, thirdOp))", ["GetVectorResult"] = "Helpers.CreateBreakAfterPropagateMask(first, second, third)"}), + ("SveVecTernOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateBreakAfterPropagateMask_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateBreakAfterPropagateMask", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2BaseType"] = "UInt16", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskUInt16()", ["NextValueOp2"] = "Helpers.getMaskUInt16()", ["NextValueOp3"] = "Helpers.getMaskUInt16()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateBreakAfterPropagateMask(firstOp, secondOp, thirdOp))", ["GetVectorResult"] = "Helpers.CreateBreakAfterPropagateMask(first, second, third)"}), + ("SveVecTernOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateBreakAfterPropagateMask_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateBreakAfterPropagateMask", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "UInt32", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskUInt32()", ["NextValueOp2"] = "Helpers.getMaskUInt32()", ["NextValueOp3"] = "Helpers.getMaskUInt32()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateBreakAfterPropagateMask(firstOp, secondOp, thirdOp))", ["GetVectorResult"] = "Helpers.CreateBreakAfterPropagateMask(first, second, third)"}), + ("SveVecTernOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateBreakAfterPropagateMask_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateBreakAfterPropagateMask", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "UInt64", ["Op3BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskUInt64()", ["NextValueOp2"] = "Helpers.getMaskUInt64()", ["NextValueOp3"] = "Helpers.getMaskUInt64()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateBreakAfterPropagateMask(firstOp, secondOp, thirdOp))", ["GetVectorResult"] = "Helpers.CreateBreakAfterPropagateMask(first, second, third)"}), + ("SveVecTernOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateBreakAfterPropagateMask_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateBreakAfterPropagateMask", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["Op2BaseType"] = "SByte", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskSByte()", ["NextValueOp2"] = "Helpers.getMaskSByte()", ["NextValueOp3"] = "Helpers.getMaskSByte()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateBreakAfterPropagateMask(firstOp, secondOp, thirdOp))", ["GetVectorResult"] = "Helpers.CreateBreakAfterPropagateMask(first, second, third)"}), + ("SveVecTernOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateBreakAfterPropagateMask_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateBreakAfterPropagateMask", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2BaseType"] = "Int16", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskInt16()", ["NextValueOp2"] = "Helpers.getMaskInt16()", ["NextValueOp3"] = "Helpers.getMaskInt16()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateBreakAfterPropagateMask(firstOp, secondOp, thirdOp))", ["GetVectorResult"] = "Helpers.CreateBreakAfterPropagateMask(first, second, third)"}), + ("SveVecTernOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateBreakAfterPropagateMask_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateBreakAfterPropagateMask", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Int32", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskInt32()", ["NextValueOp2"] = "Helpers.getMaskInt32()", ["NextValueOp3"] = "Helpers.getMaskInt32()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateBreakAfterPropagateMask(firstOp, secondOp, thirdOp))", ["GetVectorResult"] = "Helpers.CreateBreakAfterPropagateMask(first, second, third)"}), + ("SveVecTernOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateBreakAfterPropagateMask_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateBreakAfterPropagateMask", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Int64", ["Op3BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskInt64()", ["NextValueOp2"] = "Helpers.getMaskInt64()", ["NextValueOp3"] = "Helpers.getMaskInt64()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateBreakAfterPropagateMask(firstOp, secondOp, thirdOp))", ["GetVectorResult"] = "Helpers.CreateBreakAfterPropagateMask(first, second, third)"}), + + ("SveVecBinOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateBreakBeforeMask_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateBreakBeforeMask", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskByte()", ["NextValueOp2"] = "Helpers.getMaskByte()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateBreakBeforeMask(left, right))", ["GetVectorResult"] = "Helpers.CreateBreakBeforeMask(left, right)"}), + ("SveVecBinOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateBreakBeforeMask_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateBreakBeforeMask", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskUInt16()", ["NextValueOp2"] = "Helpers.getMaskUInt16()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateBreakBeforeMask(left, right))", ["GetVectorResult"] = "Helpers.CreateBreakBeforeMask(left, right)"}), + ("SveVecBinOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateBreakBeforeMask_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateBreakBeforeMask", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskUInt32()", ["NextValueOp2"] = "Helpers.getMaskUInt32()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateBreakBeforeMask(left, right))", ["GetVectorResult"] = "Helpers.CreateBreakBeforeMask(left, right)"}), + ("SveVecBinOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateBreakBeforeMask_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateBreakBeforeMask", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskUInt64()", ["NextValueOp2"] = "Helpers.getMaskUInt64()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateBreakBeforeMask(left, right))", ["GetVectorResult"] = "Helpers.CreateBreakBeforeMask(left, right)"}), + ("SveVecBinOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateBreakBeforeMask_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateBreakBeforeMask", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskSByte()", ["NextValueOp2"] = "Helpers.getMaskSByte()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateBreakBeforeMask(left, right))", ["GetVectorResult"] = "Helpers.CreateBreakBeforeMask(left, right)"}), + ("SveVecBinOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateBreakBeforeMask_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateBreakBeforeMask", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskInt16()", ["NextValueOp2"] = "Helpers.getMaskInt16()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateBreakBeforeMask(left, right))", ["GetVectorResult"] = "Helpers.CreateBreakBeforeMask(left, right)"}), + ("SveVecBinOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateBreakBeforeMask_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateBreakBeforeMask", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskInt32()", ["NextValueOp2"] = "Helpers.getMaskInt32()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateBreakBeforeMask(left, right))", ["GetVectorResult"] = "Helpers.CreateBreakBeforeMask(left, right)"}), + ("SveVecBinOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateBreakBeforeMask_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateBreakBeforeMask", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskInt64()", ["NextValueOp2"] = "Helpers.getMaskInt64()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateBreakBeforeMask(left, right))", ["GetVectorResult"] = "Helpers.CreateBreakBeforeMask(left, right)"}), + + ("SveVecTernOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateBreakBeforePropagateMask_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateBreakBeforePropagateMask", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskByte()", ["NextValueOp2"] = "Helpers.getMaskByte()", ["NextValueOp3"] = "Helpers.getMaskByte()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateBreakBeforePropagateMask(firstOp, secondOp, thirdOp))", ["GetVectorResult"] = "Helpers.CreateBreakBeforePropagateMask(first, second, third)"}), + ("SveVecTernOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateBreakBeforePropagateMask_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateBreakBeforePropagateMask", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2BaseType"] = "UInt16", ["Op3BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskUInt16()", ["NextValueOp2"] = "Helpers.getMaskUInt16()", ["NextValueOp3"] = "Helpers.getMaskUInt16()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateBreakBeforePropagateMask(firstOp, secondOp, thirdOp))", ["GetVectorResult"] = "Helpers.CreateBreakBeforePropagateMask(first, second, third)"}), + ("SveVecTernOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateBreakBeforePropagateMask_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateBreakBeforePropagateMask", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "UInt32", ["Op3BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskUInt32()", ["NextValueOp2"] = "Helpers.getMaskUInt32()", ["NextValueOp3"] = "Helpers.getMaskUInt32()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateBreakBeforePropagateMask(firstOp, secondOp, thirdOp))", ["GetVectorResult"] = "Helpers.CreateBreakBeforePropagateMask(first, second, third)"}), + ("SveVecTernOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateBreakBeforePropagateMask_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateBreakBeforePropagateMask", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "UInt64", ["Op3BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskUInt64()", ["NextValueOp2"] = "Helpers.getMaskUInt64()", ["NextValueOp3"] = "Helpers.getMaskUInt64()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateBreakBeforePropagateMask(firstOp, secondOp, thirdOp))", ["GetVectorResult"] = "Helpers.CreateBreakBeforePropagateMask(first, second, third)"}), + ("SveVecTernOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateBreakBeforePropagateMask_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateBreakBeforePropagateMask", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["Op2BaseType"] = "SByte", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskSByte()", ["NextValueOp2"] = "Helpers.getMaskSByte()", ["NextValueOp3"] = "Helpers.getMaskSByte()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateBreakBeforePropagateMask(firstOp, secondOp, thirdOp))", ["GetVectorResult"] = "Helpers.CreateBreakBeforePropagateMask(first, second, third)"}), + ("SveVecTernOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateBreakBeforePropagateMask_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateBreakBeforePropagateMask", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2BaseType"] = "Int16", ["Op3BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskInt16()", ["NextValueOp2"] = "Helpers.getMaskInt16()", ["NextValueOp3"] = "Helpers.getMaskInt16()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateBreakBeforePropagateMask(firstOp, secondOp, thirdOp))", ["GetVectorResult"] = "Helpers.CreateBreakBeforePropagateMask(first, second, third)"}), + ("SveVecTernOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateBreakBeforePropagateMask_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateBreakBeforePropagateMask", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Int32", ["Op3BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskInt32()", ["NextValueOp2"] = "Helpers.getMaskInt32()", ["NextValueOp3"] = "Helpers.getMaskInt32()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateBreakBeforePropagateMask(firstOp, secondOp, thirdOp))", ["GetVectorResult"] = "Helpers.CreateBreakBeforePropagateMask(first, second, third)"}), + ("SveVecTernOpVecTest.template", new Dictionary { ["TestName"] = "Sve_CreateBreakBeforePropagateMask_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateBreakBeforePropagateMask", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Int64", ["Op3BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskInt64()", ["NextValueOp2"] = "Helpers.getMaskInt64()", ["NextValueOp3"] = "Helpers.getMaskInt64()", ["ValidateVectorResult"] = "!result.SequenceEqual(Helpers.CreateBreakBeforePropagateMask(firstOp, secondOp, thirdOp))", ["GetVectorResult"] = "Helpers.CreateBreakBeforePropagateMask(first, second, third)"}), + ("ScalarBinOpRetVecTest.template",new Dictionary {["TestName"] = "Sve_CreateWhileLessThanMask16Bit_Int32", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateWhileLessThanMask16Bit", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.WhileLessThanMask(left + (Int32)i, right) != (Int32)result[i]",}), ("ScalarBinOpRetVecTest.template",new Dictionary {["TestName"] = "Sve_CreateWhileLessThanMask16Bit_Int64", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateWhileLessThanMask16Bit", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.WhileLessThanMask(left + (Int64)i, right) != (Int64)result[i]",}), ("ScalarBinOpRetVecTest.template",new Dictionary {["TestName"] = "Sve_CreateWhileLessThanMask16Bit_UInt32", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateWhileLessThanMask16Bit", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.WhileLessThanMask(left + (UInt32)i, right) != (UInt32)result[i]",}), diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs index 2af2aea572c60..3e987ec461297 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs @@ -7578,5 +7578,126 @@ public static ulong Splice(ulong[] first, ulong[] second, ulong[] maskArray, int return (index < rangeSize) ? first[start + index] : second[index - rangeSize]; } + public static T LastActive(T[] mask, T[] x) where T : IBinaryInteger + { + for (var i = mask.Length - 1; i >= 0; i--) + { + if (mask[i] != T.Zero) + { + return x[i]; + } + } + return T.Zero; + } + + public static T[] CreateBreakAfterMask(T[] mask, T[] op) where T : IBinaryInteger + { + var count = mask.Length; + var result = new T[count]; + var isBreakSet = false; + for (var i = 0; i < count; i++) + { + var isElementActive = op[i] != T.Zero; + if (mask[i] != T.Zero) + { + if (isBreakSet) + { + result[i] = T.Zero; + } + else + { + result[i] = T.One; + } + isBreakSet = isBreakSet || isElementActive; + } + else + { + result[i] = T.Zero; + } + } + return result; + } + + public static T[] CreateBreakAfterPropagateMask(T[] mask, T[] op1, T[] op2) where T : IBinaryInteger + { + var count = mask.Length; + var result = new T[count]; + var isLastActive = LastActive(mask, op1) != T.Zero; + for (var i = 0; i < count; i++) + { + if (mask[i] != T.Zero) + { + if (isLastActive) + { + result[i] = T.One; + } + else + { + result[i] = T.Zero; + } + isLastActive = isLastActive && (op2[i] == T.Zero); + } + else + { + result[i] = T.Zero; + } + } + return result; + } + + public static T[] CreateBreakBeforeMask(T[] mask, T[] op) where T : IBinaryInteger + { + var count = mask.Length; + var result = new T[count]; + var isBreakSet = false; + for (var i = 0; i < count; i++) + { + var isElementActive = op[i] != T.Zero; + if (mask[i] != T.Zero) + { + isBreakSet = isBreakSet || isElementActive; + if (isBreakSet) + { + result[i] = T.Zero; + } + else + { + result[i] = T.One; + } + } + else + { + result[i] = T.Zero; + } + } + return result; + } + + public static T[] CreateBreakBeforePropagateMask(T[] mask, T[] op1, T[] op2) where T : IBinaryInteger + { + var count = mask.Length; + var result = new T[count]; + var isLastActive = LastActive(mask, op1) != T.Zero; + for (var i = 0; i < count; i++) + { + if (mask[i] != T.Zero) + { + isLastActive = isLastActive && (op2[i] == T.Zero); + if (isLastActive) + { + result[i] = T.One; + } + else + { + result[i] = T.Zero; + } + } + else + { + result[i] = T.Zero; + } + } + return result; + } } } diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveTernOpTestTemplate.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveTernOpTestTemplate.template index 044643bfa5fe6..b69c21ce196dd 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveTernOpTestTemplate.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveTernOpTestTemplate.template @@ -9,6 +9,7 @@ ******************************************************************************/ using System; +using System.Linq; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices;