From 51c328b808280a73cd2f48ca9e7ed5e640ac2140 Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Fri, 3 May 2024 09:23:52 +0100 Subject: [PATCH 01/29] JIT ARM64-SVE: Add saturating decrement/increment by element count --- src/coreclr/jit/hwintrinsic.cpp | 21 +- src/coreclr/jit/hwintrinsic.h | 37 +- src/coreclr/jit/hwintrinsicarm64.cpp | 46 ++ src/coreclr/jit/hwintrinsiccodegenarm64.cpp | 53 ++ src/coreclr/jit/hwintrinsiclistarm64sve.h | 18 + src/coreclr/jit/lowerarmarch.cpp | 21 + src/coreclr/jit/lsraarm64.cpp | 18 + .../Arm/Sve.PlatformNotSupported.cs | 582 ++++++++++++++++++ .../src/System/Runtime/Intrinsics/Arm/Sve.cs | 559 +++++++++++++++++ .../ref/System.Runtime.Intrinsics.cs | 89 +++ .../GenerateHWIntrinsicTests_Arm.cs | 53 ++ .../Arm/Shared/ScalarImm2UnOpTest.template | 198 ++++++ .../_SveImm2UnaryOpTestTemplate.template | 312 ++++++++++ 13 files changed, 2005 insertions(+), 2 deletions(-) create mode 100644 src/tests/JIT/HardwareIntrinsics/Arm/Shared/ScalarImm2UnOpTest.template create mode 100644 src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveImm2UnaryOpTestTemplate.template diff --git a/src/coreclr/jit/hwintrinsic.cpp b/src/coreclr/jit/hwintrinsic.cpp index e6b0e5fa72ffb1..9fbc228628c68c 100644 --- a/src/coreclr/jit/hwintrinsic.cpp +++ b/src/coreclr/jit/hwintrinsic.cpp @@ -1241,7 +1241,26 @@ GenTree* Compiler::impHWIntrinsic(NamedIntrinsic intrinsic, unsigned int sizeBytes; simdBaseJitType = getBaseJitTypeAndSizeOfSIMDType(clsHnd, &sizeBytes); - assert((category == HW_Category_Special) || (category == HW_Category_Helper) || (sizeBytes != 0)); + +#if defined(TARGET_ARM64) + if (simdBaseJitType == CORINFO_TYPE_UNDEF && HWIntrinsicInfo::HasScalarVariant(intrinsic)) + { + // Did not find a valid vector type. The intrinsic has alternate scalar version. Switch to that. + + assert(sizeBytes == 0); + intrinsic = HWIntrinsicInfo::GetScalarVariant(intrinsic); + category = HWIntrinsicInfo::lookupCategory(intrinsic); + isa = HWIntrinsicInfo::lookupIsa(intrinsic); + + simdBaseJitType = sig->retType; + assert(simdBaseJitType != CORINFO_TYPE_VOID); + assert(simdBaseJitType != CORINFO_TYPE_UNDEF); + } + else +#endif + { + assert((category == HW_Category_Special) || (category == HW_Category_Helper) || (sizeBytes != 0)); + } } } diff --git a/src/coreclr/jit/hwintrinsic.h b/src/coreclr/jit/hwintrinsic.h index 2f7690c091e9fa..0b25a425f51ad4 100644 --- a/src/coreclr/jit/hwintrinsic.h +++ b/src/coreclr/jit/hwintrinsic.h @@ -232,10 +232,12 @@ enum HWIntrinsicFlag : unsigned int // The intrinsic has an enum operand. Using this implies HW_Flag_HasImmediateOperand. HW_Flag_HasEnumOperand = 0x1000000, + HW_Flag_HasScalarVariant = 0x2000000, + #endif // TARGET_XARCH // The intrinsic is a FusedMultiplyAdd intrinsic - HW_Flag_FmaIntrinsic = 0x20000000, + HW_Flag_FmaIntrinsic = 0x40000000, HW_Flag_CanBenefitFromConstantProp = 0x80000000, }; @@ -915,6 +917,39 @@ struct HWIntrinsicInfo return (flags & HW_Flag_HasEnumOperand) != 0; } + static bool HasScalarVariant(NamedIntrinsic id) + { + const HWIntrinsicFlag flags = lookupFlags(id); + return (flags & HW_Flag_HasScalarVariant) != 0; + } + + static NamedIntrinsic GetScalarVariant(NamedIntrinsic id) + { + switch (id) + { + case NI_Sve_SaturatingDecrementBy16BitElementCount: + return NI_Sve_SaturatingDecrementBy16BitElementCountScalar; + + case NI_Sve_SaturatingDecrementBy32BitElementCount: + return NI_Sve_SaturatingDecrementBy32BitElementCountScalar; + + case NI_Sve_SaturatingDecrementBy64BitElementCount: + return NI_Sve_SaturatingDecrementBy64BitElementCountScalar; + + case NI_Sve_SaturatingIncrementBy16BitElementCount: + return NI_Sve_SaturatingIncrementBy16BitElementCountScalar; + + case NI_Sve_SaturatingIncrementBy32BitElementCount: + return NI_Sve_SaturatingIncrementBy32BitElementCountScalar; + + case NI_Sve_SaturatingIncrementBy64BitElementCount: + return NI_Sve_SaturatingIncrementBy64BitElementCountScalar; + + default: + unreached(); + } + } + #endif // TARGET_ARM64 static bool HasSpecialSideEffect(NamedIntrinsic id) diff --git a/src/coreclr/jit/hwintrinsicarm64.cpp b/src/coreclr/jit/hwintrinsicarm64.cpp index ce3d6e5e69fa2d..a17fa01a8435e8 100644 --- a/src/coreclr/jit/hwintrinsicarm64.cpp +++ b/src/coreclr/jit/hwintrinsicarm64.cpp @@ -255,6 +255,25 @@ void Compiler::getHWIntrinsicImmOps(NamedIntrinsic intrinsic, imm2Pos = 0; break; + case NI_Sve_SaturatingDecrementBy16BitElementCount: + case NI_Sve_SaturatingDecrementBy32BitElementCount: + case NI_Sve_SaturatingDecrementBy64BitElementCount: + case NI_Sve_SaturatingDecrementBy8BitElementCount: + case NI_Sve_SaturatingIncrementBy16BitElementCount: + case NI_Sve_SaturatingIncrementBy32BitElementCount: + case NI_Sve_SaturatingIncrementBy64BitElementCount: + case NI_Sve_SaturatingIncrementBy8BitElementCount: + case NI_Sve_SaturatingDecrementBy16BitElementCountScalar: + case NI_Sve_SaturatingDecrementBy32BitElementCountScalar: + case NI_Sve_SaturatingDecrementBy64BitElementCountScalar: + case NI_Sve_SaturatingIncrementBy16BitElementCountScalar: + case NI_Sve_SaturatingIncrementBy32BitElementCountScalar: + case NI_Sve_SaturatingIncrementBy64BitElementCountScalar: + assert(sig->numArgs == 3); + imm1Pos = 1; + imm2Pos = 0; + break; + default: assert(sig->numArgs > 0); imm1Pos = 0; @@ -436,6 +455,33 @@ void HWIntrinsicInfo::lookupImmBounds( immUpperBound = (int)SVE_PATTERN_ALL; break; + case NI_Sve_SaturatingDecrementBy16BitElementCount: + case NI_Sve_SaturatingDecrementBy32BitElementCount: + case NI_Sve_SaturatingDecrementBy64BitElementCount: + case NI_Sve_SaturatingDecrementBy8BitElementCount: + case NI_Sve_SaturatingIncrementBy16BitElementCount: + case NI_Sve_SaturatingIncrementBy32BitElementCount: + case NI_Sve_SaturatingIncrementBy64BitElementCount: + case NI_Sve_SaturatingIncrementBy8BitElementCount: + case NI_Sve_SaturatingDecrementBy16BitElementCountScalar: + case NI_Sve_SaturatingDecrementBy32BitElementCountScalar: + case NI_Sve_SaturatingDecrementBy64BitElementCountScalar: + case NI_Sve_SaturatingIncrementBy16BitElementCountScalar: + case NI_Sve_SaturatingIncrementBy32BitElementCountScalar: + case NI_Sve_SaturatingIncrementBy64BitElementCountScalar: + if (immNumber == 1) + { + immLowerBound = 1; + immUpperBound = 16; + } + else + { + assert(immNumber == 2); + immLowerBound = (int)SVE_PATTERN_POW2; + immUpperBound = (int)SVE_PATTERN_ALL; + } + break; + default: unreached(); } diff --git a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp index c0dcd95b5b1b9e..40245c8be0524c 100644 --- a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp +++ b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp @@ -1713,6 +1713,59 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) INS_SCALABLE_OPTS_UNPREDICATED); break; + case NI_Sve_SaturatingDecrementBy16BitElementCount: + case NI_Sve_SaturatingDecrementBy32BitElementCount: + case NI_Sve_SaturatingDecrementBy64BitElementCount: + case NI_Sve_SaturatingDecrementBy8BitElementCount: + case NI_Sve_SaturatingIncrementBy16BitElementCount: + case NI_Sve_SaturatingIncrementBy32BitElementCount: + case NI_Sve_SaturatingIncrementBy64BitElementCount: + case NI_Sve_SaturatingIncrementBy8BitElementCount: + { + assert(isRMW); + if (targetReg != op1Reg) + { + GetEmitter()->emitIns_Mov(INS_mov, emitTypeSize(node), targetReg, op1Reg, /* canSkip */ true); + } + + // Cannot use create a lookup table for 2 immediates. Therefore the immediates must be constants, + // and can be used directly (instead of via HWIntrinsicImmOpHelper). + + assert(hasImmediateOperand); + int scale = (int)intrin.op2->AsIntCon()->gtIconVal; + insSvePattern pattern = (insSvePattern)intrin.op3->AsIntCon()->gtIconVal; + + // Use scalable vector sizes. + GetEmitter()->emitIns_R_PATTERN_I(ins, emitSize, targetReg, pattern, scale, opt); + break; + } + + case NI_Sve_SaturatingDecrementBy16BitElementCountScalar: + case NI_Sve_SaturatingDecrementBy32BitElementCountScalar: + case NI_Sve_SaturatingDecrementBy64BitElementCountScalar: + case NI_Sve_SaturatingIncrementBy16BitElementCountScalar: + case NI_Sve_SaturatingIncrementBy32BitElementCountScalar: + case NI_Sve_SaturatingIncrementBy64BitElementCountScalar: + { + assert(isRMW); + if (targetReg != op1Reg) + { + GetEmitter()->emitIns_Mov(INS_mov, emitTypeSize(node), targetReg, op1Reg, /* canSkip */ true); + } + + // Cannot use create a lookup table for 2 immediates. Therefore the immediates must be constants, + // and can be used directly (instead of via HWIntrinsicImmOpHelper). + + assert(hasImmediateOperand); + int scale = (int)intrin.op2->AsIntCon()->gtIconVal; + insSvePattern pattern = (insSvePattern)intrin.op3->AsIntCon()->gtIconVal; + + // Use scalar sizes. + emitSize = emitActualTypeSize(node->gtType); + GetEmitter()->emitIns_R_PATTERN_I(ins, emitSize, targetReg, pattern, scale); + break; + } + default: unreached(); } diff --git a/src/coreclr/jit/hwintrinsiclistarm64sve.h b/src/coreclr/jit/hwintrinsiclistarm64sve.h index 3e70c507d015a2..605cdb42920941 100644 --- a/src/coreclr/jit/hwintrinsiclistarm64sve.h +++ b/src/coreclr/jit/hwintrinsiclistarm64sve.h @@ -107,6 +107,16 @@ HARDWARE_INTRINSIC(Sve, MultiplySubtract, HARDWARE_INTRINSIC(Sve, Negate, -1, -1, false, {INS_sve_neg, INS_invalid, INS_sve_neg, INS_invalid, INS_sve_neg, INS_invalid, INS_sve_neg, INS_invalid, INS_sve_fneg, INS_sve_fneg}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation) HARDWARE_INTRINSIC(Sve, Or, -1, -1, false, {INS_sve_orr, INS_sve_orr, INS_sve_orr, INS_sve_orr, INS_sve_orr, INS_sve_orr, INS_sve_orr, INS_sve_orr, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_OptionalEmbeddedMaskedOperation|HW_Flag_HasRMWSemantics|HW_Flag_LowMaskedOperation) HARDWARE_INTRINSIC(Sve, OrAcross, -1, -1, false, {INS_sve_orv, INS_sve_orv, INS_sve_orv, INS_sve_orv, INS_sve_orv, INS_sve_orv, INS_sve_orv, INS_sve_orv, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation) + +HARDWARE_INTRINSIC(Sve, SaturatingDecrementBy16BitElementCount, -1, 3, true, {INS_invalid, INS_invalid, INS_sve_sqdech, INS_sve_uqdech, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_HasScalarVariant|HW_Flag_NoJmpTableIMM|HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Sve, SaturatingDecrementBy32BitElementCount, -1, 3, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqdecw, INS_sve_uqdecw, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_HasScalarVariant|HW_Flag_NoJmpTableIMM|HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Sve, SaturatingDecrementBy64BitElementCount, -1, 3, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqdecd, INS_sve_uqdecd, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_HasScalarVariant|HW_Flag_NoJmpTableIMM|HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Sve, SaturatingDecrementBy8BitElementCount, 0, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqdecb, INS_sve_uqdecb, INS_sve_sqdecb, INS_sve_uqdecb, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_NoJmpTableIMM|HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Sve, SaturatingIncrementBy16BitElementCount, -1, 3, true, {INS_invalid, INS_invalid, INS_sve_sqinch, INS_sve_uqinch, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_HasScalarVariant|HW_Flag_NoJmpTableIMM|HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Sve, SaturatingIncrementBy32BitElementCount, -1, 3, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqincw, INS_sve_uqincw, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_HasScalarVariant|HW_Flag_NoJmpTableIMM|HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Sve, SaturatingIncrementBy64BitElementCount, -1, 3, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqincd, INS_sve_uqincd, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_HasScalarVariant|HW_Flag_NoJmpTableIMM|HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Sve, SaturatingIncrementBy8BitElementCount, 0, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqincb, INS_sve_uqincb, INS_sve_sqincb, INS_sve_uqincb, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_NoJmpTableIMM|HW_Flag_HasRMWSemantics) + HARDWARE_INTRINSIC(Sve, SignExtend16, -1, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sxth, INS_invalid, INS_sve_sxth, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation) HARDWARE_INTRINSIC(Sve, SignExtend32, -1, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sxtw, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation) HARDWARE_INTRINSIC(Sve, SignExtend8, -1, -1, false, {INS_invalid, INS_invalid, INS_sve_sxtb, INS_invalid, INS_sve_sxtb, INS_invalid, INS_sve_sxtb, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation) @@ -137,6 +147,14 @@ HARDWARE_INTRINSIC(Sve, ConvertMaskToVector, HARDWARE_INTRINSIC(Sve, ConvertVectorToMask, -1, 2, true, {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_cmpne, INS_sve_cmpne}, HW_Category_Helper, HW_Flag_Scalable|HW_Flag_ReturnsPerElementMask|HW_Flag_LowMaskedOperation) HARDWARE_INTRINSIC(Sve, CreateTrueMaskAll, -1, -1, false, {INS_sve_ptrue, INS_sve_ptrue, INS_sve_ptrue, INS_sve_ptrue, INS_sve_ptrue, INS_sve_ptrue, INS_sve_ptrue, INS_sve_ptrue, INS_sve_ptrue, INS_sve_ptrue}, HW_Category_Helper, HW_Flag_Scalable|HW_Flag_ReturnsPerElementMask) +// Scalar variants of Saturating*By*BitElementCount. There is 8bit versions as the generic version is scalar only. +HARDWARE_INTRINSIC(Sve, SaturatingDecrementBy16BitElementCountScalar, 0, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqdech, INS_sve_uqdech, INS_sve_sqdech, INS_sve_uqdech, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_NoJmpTableIMM|HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Sve, SaturatingDecrementBy32BitElementCountScalar, 0, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqdecw, INS_sve_uqdecw, INS_sve_sqdecw, INS_sve_uqdecw, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_NoJmpTableIMM|HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Sve, SaturatingDecrementBy64BitElementCountScalar, 0, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqdecd, INS_sve_uqdecd, INS_sve_sqdecd, INS_sve_uqdecd, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_NoJmpTableIMM|HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Sve, SaturatingIncrementBy16BitElementCountScalar, 0, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqinch, INS_sve_uqinch, INS_sve_sqinch, INS_sve_uqinch, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_NoJmpTableIMM|HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Sve, SaturatingIncrementBy32BitElementCountScalar, 0, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqincw, INS_sve_uqincw, INS_sve_sqincw, INS_sve_uqincw, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_NoJmpTableIMM|HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Sve, SaturatingIncrementBy64BitElementCountScalar, 0, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqincd, INS_sve_uqincd, INS_sve_sqincd, INS_sve_uqincd, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_NoJmpTableIMM|HW_Flag_HasRMWSemantics) + #endif // FEATURE_HW_INTRINSIC diff --git a/src/coreclr/jit/lowerarmarch.cpp b/src/coreclr/jit/lowerarmarch.cpp index 3a32d9003e1a15..a350d3444e33e3 100644 --- a/src/coreclr/jit/lowerarmarch.cpp +++ b/src/coreclr/jit/lowerarmarch.cpp @@ -3372,6 +3372,27 @@ void Lowering::ContainCheckHWIntrinsic(GenTreeHWIntrinsic* node) } break; + case NI_Sve_SaturatingDecrementBy16BitElementCount: + case NI_Sve_SaturatingDecrementBy32BitElementCount: + case NI_Sve_SaturatingDecrementBy64BitElementCount: + case NI_Sve_SaturatingDecrementBy8BitElementCount: + case NI_Sve_SaturatingIncrementBy16BitElementCount: + case NI_Sve_SaturatingIncrementBy32BitElementCount: + case NI_Sve_SaturatingIncrementBy64BitElementCount: + case NI_Sve_SaturatingIncrementBy8BitElementCount: + case NI_Sve_SaturatingDecrementBy16BitElementCountScalar: + case NI_Sve_SaturatingDecrementBy32BitElementCountScalar: + case NI_Sve_SaturatingDecrementBy64BitElementCountScalar: + case NI_Sve_SaturatingIncrementBy16BitElementCountScalar: + case NI_Sve_SaturatingIncrementBy32BitElementCountScalar: + case NI_Sve_SaturatingIncrementBy64BitElementCountScalar: + assert(hasImmediateOperand); + assert(intrin.op2->IsCnsIntOrI()); + assert(intrin.op3->IsCnsIntOrI()); + MakeSrcContained(node, intrin.op2); + MakeSrcContained(node, intrin.op3); + break; + default: unreached(); } diff --git a/src/coreclr/jit/lsraarm64.cpp b/src/coreclr/jit/lsraarm64.cpp index 264bc70b0a74de..29624bff78e2d9 100644 --- a/src/coreclr/jit/lsraarm64.cpp +++ b/src/coreclr/jit/lsraarm64.cpp @@ -1471,6 +1471,24 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree, int* pDstCou needBranchTargetReg = !intrin.op1->isContainedIntOrIImmed(); break; + case NI_Sve_SaturatingDecrementBy16BitElementCount: + case NI_Sve_SaturatingDecrementBy32BitElementCount: + case NI_Sve_SaturatingDecrementBy64BitElementCount: + case NI_Sve_SaturatingDecrementBy8BitElementCount: + case NI_Sve_SaturatingIncrementBy16BitElementCount: + case NI_Sve_SaturatingIncrementBy32BitElementCount: + case NI_Sve_SaturatingIncrementBy64BitElementCount: + case NI_Sve_SaturatingIncrementBy8BitElementCount: + case NI_Sve_SaturatingDecrementBy16BitElementCountScalar: + case NI_Sve_SaturatingDecrementBy32BitElementCountScalar: + case NI_Sve_SaturatingDecrementBy64BitElementCountScalar: + case NI_Sve_SaturatingIncrementBy16BitElementCountScalar: + case NI_Sve_SaturatingIncrementBy32BitElementCountScalar: + case NI_Sve_SaturatingIncrementBy64BitElementCountScalar: + assert(intrin.op2->isContainedIntOrIImmed()); + assert(intrin.op4->isContainedIntOrIImmed()); + break; + default: unreached(); } 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 e4042d961a4f21..ec59827844d34f 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 @@ -2436,6 +2436,588 @@ internal Arm64() { } public static unsafe Vector OrAcross(Vector value) { throw new PlatformNotSupportedException(); } + /// Saturating decrement by number of halfword elements + + /// + /// int32_t svqdech_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQDECH Xtied, Wtied, pattern, MUL #imm_factor + /// + public static unsafe int SaturatingDecrementBy16BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// int64_t svqdech_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQDECH Xtied, pattern, MUL #imm_factor + /// + public static unsafe long SaturatingDecrementBy16BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// uint32_t svqdech_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQDECH Wtied, pattern, MUL #imm_factor + /// + public static unsafe uint SaturatingDecrementBy16BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// uint64_t svqdech_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQDECH Xtied, pattern, MUL #imm_factor + /// + public static unsafe ulong SaturatingDecrementBy16BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// svint16_t svqdech_pat[_s16](svint16_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQDECH Ztied.H, pattern, MUL #imm_factor + /// MOVPRFX Zresult, Zop; SQDECH Zresult.H, pattern, MUL #imm_factor + /// + public static unsafe Vector SaturatingDecrementBy16BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// svuint16_t svqdech_pat[_u16](svuint16_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQDECH Ztied.H, pattern, MUL #imm_factor + /// MOVPRFX Zresult, Zop; UQDECH Zresult.H, pattern, MUL #imm_factor + /// + public static unsafe Vector SaturatingDecrementBy16BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + + /// Saturating decrement by number of word elements + + /// + /// int32_t svqdecw_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQDECW Xtied, Wtied, pattern, MUL #imm_factor + /// + public static unsafe int SaturatingDecrementBy32BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// int64_t svqdecw_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQDECW Xtied, pattern, MUL #imm_factor + /// + public static unsafe long SaturatingDecrementBy32BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// uint32_t svqdecw_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQDECW Wtied, pattern, MUL #imm_factor + /// + public static unsafe uint SaturatingDecrementBy32BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// uint64_t svqdecw_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQDECW Xtied, pattern, MUL #imm_factor + /// + public static unsafe ulong SaturatingDecrementBy32BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// svint32_t svqdecw_pat[_s32](svint32_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQDECW Ztied.S, pattern, MUL #imm_factor + /// MOVPRFX Zresult, Zop; SQDECW Zresult.S, pattern, MUL #imm_factor + /// + public static unsafe Vector SaturatingDecrementBy32BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// svuint32_t svqdecw_pat[_u32](svuint32_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQDECW Ztied.S, pattern, MUL #imm_factor + /// MOVPRFX Zresult, Zop; UQDECW Zresult.S, pattern, MUL #imm_factor + /// + public static unsafe Vector SaturatingDecrementBy32BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + + /// Saturating decrement by number of doubleword elements + + /// + /// int32_t svqdecd_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQDECD Xtied, Wtied, pattern, MUL #imm_factor + /// + public static unsafe int SaturatingDecrementBy64BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// int64_t svqdecd_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQDECD Xtied, pattern, MUL #imm_factor + /// + public static unsafe long SaturatingDecrementBy64BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// uint32_t svqdecd_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQDECD Wtied, pattern, MUL #imm_factor + /// + public static unsafe uint SaturatingDecrementBy64BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// uint64_t svqdecd_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQDECD Xtied, pattern, MUL #imm_factor + /// + public static unsafe ulong SaturatingDecrementBy64BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// svint64_t svqdecd_pat[_s64](svint64_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQDECD Ztied.D, pattern, MUL #imm_factor + /// MOVPRFX Zresult, Zop; SQDECD Zresult.D, pattern, MUL #imm_factor + /// + public static unsafe Vector SaturatingDecrementBy64BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// svuint64_t svqdecd_pat[_u64](svuint64_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQDECD Ztied.D, pattern, MUL #imm_factor + /// MOVPRFX Zresult, Zop; UQDECD Zresult.D, pattern, MUL #imm_factor + /// + public static unsafe Vector SaturatingDecrementBy64BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + + /// Saturating decrement by number of byte elements + + /// + /// int32_t svqdecb_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQDECB Xtied, Wtied, pattern, MUL #imm_factor + /// + public static unsafe int SaturatingDecrementBy8BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// int64_t svqdecb_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQDECB Xtied, pattern, MUL #imm_factor + /// + public static unsafe long SaturatingDecrementBy8BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// uint32_t svqdecb_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQDECB Wtied, pattern, MUL #imm_factor + /// + public static unsafe uint SaturatingDecrementBy8BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// uint64_t svqdecb_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQDECB Xtied, pattern, MUL #imm_factor + /// + public static unsafe ulong SaturatingDecrementBy8BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + + /// Saturating decrement by active element count + + /// + /// int32_t svqdecp[_n_s32]_b8(int32_t op, svbool_t pg) + /// SQDECP Xtied, Pg.B, Wtied + /// + public static unsafe int SaturatingDecrementByActiveElementCount(int value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// int64_t svqdecp[_n_s64]_b8(int64_t op, svbool_t pg) + /// SQDECP Xtied, Pg.B + /// + public static unsafe long SaturatingDecrementByActiveElementCount(long value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// uint32_t svqdecp[_n_u32]_b8(uint32_t op, svbool_t pg) + /// UQDECP Wtied, Pg.B + /// + public static unsafe uint SaturatingDecrementByActiveElementCount(uint value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// uint64_t svqdecp[_n_u64]_b8(uint64_t op, svbool_t pg) + /// UQDECP Xtied, Pg.B + /// + public static unsafe ulong SaturatingDecrementByActiveElementCount(ulong value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// svint16_t svqdecp[_s16](svint16_t op, svbool_t pg) + /// SQDECP Ztied.H, Pg + /// MOVPRFX Zresult, Zop; SQDECP Zresult.H, Pg + /// + public static unsafe Vector SaturatingDecrementByActiveElementCount(Vector value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// svint32_t svqdecp[_s32](svint32_t op, svbool_t pg) + /// SQDECP Ztied.S, Pg + /// MOVPRFX Zresult, Zop; SQDECP Zresult.S, Pg + /// + public static unsafe Vector SaturatingDecrementByActiveElementCount(Vector value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// svint64_t svqdecp[_s64](svint64_t op, svbool_t pg) + /// SQDECP Ztied.D, Pg + /// MOVPRFX Zresult, Zop; SQDECP Zresult.D, Pg + /// + public static unsafe Vector SaturatingDecrementByActiveElementCount(Vector value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// int32_t svqdecp[_n_s32]_b16(int32_t op, svbool_t pg) + /// SQDECP Xtied, Pg.H, Wtied + /// + public static unsafe int SaturatingDecrementByActiveElementCount(int value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// int64_t svqdecp[_n_s64]_b16(int64_t op, svbool_t pg) + /// SQDECP Xtied, Pg.H + /// + public static unsafe long SaturatingDecrementByActiveElementCount(long value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// uint32_t svqdecp[_n_u32]_b16(uint32_t op, svbool_t pg) + /// UQDECP Wtied, Pg.H + /// + public static unsafe uint SaturatingDecrementByActiveElementCount(uint value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// uint64_t svqdecp[_n_u64]_b16(uint64_t op, svbool_t pg) + /// UQDECP Xtied, Pg.H + /// + public static unsafe ulong SaturatingDecrementByActiveElementCount(ulong value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// svuint16_t svqdecp[_u16](svuint16_t op, svbool_t pg) + /// UQDECP Ztied.H, Pg + /// MOVPRFX Zresult, Zop; UQDECP Zresult.H, Pg + /// + public static unsafe Vector SaturatingDecrementByActiveElementCount(Vector value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// int32_t svqdecp[_n_s32]_b32(int32_t op, svbool_t pg) + /// SQDECP Xtied, Pg.S, Wtied + /// + public static unsafe int SaturatingDecrementByActiveElementCount(int value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// int64_t svqdecp[_n_s64]_b32(int64_t op, svbool_t pg) + /// SQDECP Xtied, Pg.S + /// + public static unsafe long SaturatingDecrementByActiveElementCount(long value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// uint32_t svqdecp[_n_u32]_b32(uint32_t op, svbool_t pg) + /// UQDECP Wtied, Pg.S + /// + public static unsafe uint SaturatingDecrementByActiveElementCount(uint value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// uint64_t svqdecp[_n_u64]_b32(uint64_t op, svbool_t pg) + /// UQDECP Xtied, Pg.S + /// + public static unsafe ulong SaturatingDecrementByActiveElementCount(ulong value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// svuint32_t svqdecp[_u32](svuint32_t op, svbool_t pg) + /// UQDECP Ztied.S, Pg + /// MOVPRFX Zresult, Zop; UQDECP Zresult.S, Pg + /// + public static unsafe Vector SaturatingDecrementByActiveElementCount(Vector value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// int32_t svqdecp[_n_s32]_b64(int32_t op, svbool_t pg) + /// SQDECP Xtied, Pg.D, Wtied + /// + public static unsafe int SaturatingDecrementByActiveElementCount(int value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// int64_t svqdecp[_n_s64]_b64(int64_t op, svbool_t pg) + /// SQDECP Xtied, Pg.D + /// + public static unsafe long SaturatingDecrementByActiveElementCount(long value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// uint32_t svqdecp[_n_u32]_b64(uint32_t op, svbool_t pg) + /// UQDECP Wtied, Pg.D + /// + public static unsafe uint SaturatingDecrementByActiveElementCount(uint value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// uint64_t svqdecp[_n_u64]_b64(uint64_t op, svbool_t pg) + /// UQDECP Xtied, Pg.D + /// + public static unsafe ulong SaturatingDecrementByActiveElementCount(ulong value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// svuint64_t svqdecp[_u64](svuint64_t op, svbool_t pg) + /// UQDECP Ztied.D, Pg + /// MOVPRFX Zresult, Zop; UQDECP Zresult.D, Pg + /// + public static unsafe Vector SaturatingDecrementByActiveElementCount(Vector value, Vector from) { throw new PlatformNotSupportedException(); } + + + /// Saturating increment by number of halfword elements + + /// + /// int32_t svqinch_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQINCH Xtied, Wtied, pattern, MUL #imm_factor + /// + public static unsafe int SaturatingIncrementBy16BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// int64_t svqinch_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQINCH Xtied, pattern, MUL #imm_factor + /// + public static unsafe long SaturatingIncrementBy16BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// uint32_t svqinch_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQINCH Wtied, pattern, MUL #imm_factor + /// + public static unsafe uint SaturatingIncrementBy16BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// uint64_t svqinch_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQINCH Xtied, pattern, MUL #imm_factor + /// + public static unsafe ulong SaturatingIncrementBy16BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// svint16_t svqinch_pat[_s16](svint16_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQINCH Ztied.H, pattern, MUL #imm_factor + /// MOVPRFX Zresult, Zop; SQINCH Zresult.H, pattern, MUL #imm_factor + /// + public static unsafe Vector SaturatingIncrementBy16BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// svuint16_t svqinch_pat[_u16](svuint16_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQINCH Ztied.H, pattern, MUL #imm_factor + /// MOVPRFX Zresult, Zop; UQINCH Zresult.H, pattern, MUL #imm_factor + /// + public static unsafe Vector SaturatingIncrementBy16BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + + /// Saturating increment by number of word elements + + /// + /// int32_t svqincw_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQINCW Xtied, Wtied, pattern, MUL #imm_factor + /// + public static unsafe int SaturatingIncrementBy32BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// int64_t svqincw_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQINCW Xtied, pattern, MUL #imm_factor + /// + public static unsafe long SaturatingIncrementBy32BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// uint32_t svqincw_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQINCW Wtied, pattern, MUL #imm_factor + /// + public static unsafe uint SaturatingIncrementBy32BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// uint64_t svqincw_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQINCW Xtied, pattern, MUL #imm_factor + /// + public static unsafe ulong SaturatingIncrementBy32BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// svint32_t svqincw_pat[_s32](svint32_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQINCW Ztied.S, pattern, MUL #imm_factor + /// MOVPRFX Zresult, Zop; SQINCW Zresult.S, pattern, MUL #imm_factor + /// + public static unsafe Vector SaturatingIncrementBy32BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// svuint32_t svqincw_pat[_u32](svuint32_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQINCW Ztied.S, pattern, MUL #imm_factor + /// MOVPRFX Zresult, Zop; UQINCW Zresult.S, pattern, MUL #imm_factor + /// + public static unsafe Vector SaturatingIncrementBy32BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + + /// Saturating increment by number of doubleword elements + + /// + /// int32_t svqincd_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQINCD Xtied, Wtied, pattern, MUL #imm_factor + /// + public static unsafe int SaturatingIncrementBy64BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// int64_t svqincd_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQINCD Xtied, pattern, MUL #imm_factor + /// + public static unsafe long SaturatingIncrementBy64BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// uint32_t svqincd_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQINCD Wtied, pattern, MUL #imm_factor + /// + public static unsafe uint SaturatingIncrementBy64BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// uint64_t svqincd_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQINCD Xtied, pattern, MUL #imm_factor + /// + public static unsafe ulong SaturatingIncrementBy64BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// svint64_t svqincd_pat[_s64](svint64_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQINCD Ztied.D, pattern, MUL #imm_factor + /// MOVPRFX Zresult, Zop; SQINCD Zresult.D, pattern, MUL #imm_factor + /// + public static unsafe Vector SaturatingIncrementBy64BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// svuint64_t svqincd_pat[_u64](svuint64_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQINCD Ztied.D, pattern, MUL #imm_factor + /// MOVPRFX Zresult, Zop; UQINCD Zresult.D, pattern, MUL #imm_factor + /// + public static unsafe Vector SaturatingIncrementBy64BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + + /// Saturating increment by number of byte elements + + /// + /// int32_t svqincb_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQINCB Xtied, Wtied, pattern, MUL #imm_factor + /// + public static unsafe int SaturatingIncrementBy8BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// int64_t svqincb_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQINCB Xtied, pattern, MUL #imm_factor + /// + public static unsafe long SaturatingIncrementBy8BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// uint32_t svqincb_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQINCB Wtied, pattern, MUL #imm_factor + /// + public static unsafe uint SaturatingIncrementBy8BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + /// + /// uint64_t svqincb_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQINCB Xtied, pattern, MUL #imm_factor + /// + public static unsafe ulong SaturatingIncrementBy8BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } + + + /// Saturating increment by active element count + + /// + /// int32_t svqincp[_n_s32]_b8(int32_t op, svbool_t pg) + /// SQINCP Xtied, Pg.B, Wtied + /// + public static unsafe int SaturatingIncrementByActiveElementCount(int value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// int64_t svqincp[_n_s64]_b8(int64_t op, svbool_t pg) + /// SQINCP Xtied, Pg.B + /// + public static unsafe long SaturatingIncrementByActiveElementCount(long value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// uint32_t svqincp[_n_u32]_b8(uint32_t op, svbool_t pg) + /// UQINCP Wtied, Pg.B + /// + public static unsafe uint SaturatingIncrementByActiveElementCount(uint value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// uint64_t svqincp[_n_u64]_b8(uint64_t op, svbool_t pg) + /// UQINCP Xtied, Pg.B + /// + public static unsafe ulong SaturatingIncrementByActiveElementCount(ulong value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// svint16_t svqincp[_s16](svint16_t op, svbool_t pg) + /// SQINCP Ztied.H, Pg + /// MOVPRFX Zresult, Zop; SQINCP Zresult.H, Pg + /// + public static unsafe Vector SaturatingIncrementByActiveElementCount(Vector value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// svint32_t svqincp[_s32](svint32_t op, svbool_t pg) + /// SQINCP Ztied.S, Pg + /// MOVPRFX Zresult, Zop; SQINCP Zresult.S, Pg + /// + public static unsafe Vector SaturatingIncrementByActiveElementCount(Vector value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// svint64_t svqincp[_s64](svint64_t op, svbool_t pg) + /// SQINCP Ztied.D, Pg + /// MOVPRFX Zresult, Zop; SQINCP Zresult.D, Pg + /// + public static unsafe Vector SaturatingIncrementByActiveElementCount(Vector value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// int32_t svqincp[_n_s32]_b16(int32_t op, svbool_t pg) + /// SQINCP Xtied, Pg.H, Wtied + /// + public static unsafe int SaturatingIncrementByActiveElementCount(int value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// int64_t svqincp[_n_s64]_b16(int64_t op, svbool_t pg) + /// SQINCP Xtied, Pg.H + /// + public static unsafe long SaturatingIncrementByActiveElementCount(long value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// uint32_t svqincp[_n_u32]_b16(uint32_t op, svbool_t pg) + /// UQINCP Wtied, Pg.H + /// + public static unsafe uint SaturatingIncrementByActiveElementCount(uint value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// uint64_t svqincp[_n_u64]_b16(uint64_t op, svbool_t pg) + /// UQINCP Xtied, Pg.H + /// + public static unsafe ulong SaturatingIncrementByActiveElementCount(ulong value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// svuint16_t svqincp[_u16](svuint16_t op, svbool_t pg) + /// UQINCP Ztied.H, Pg + /// MOVPRFX Zresult, Zop; UQINCP Zresult.H, Pg + /// + public static unsafe Vector SaturatingIncrementByActiveElementCount(Vector value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// int32_t svqincp[_n_s32]_b32(int32_t op, svbool_t pg) + /// SQINCP Xtied, Pg.S, Wtied + /// + public static unsafe int SaturatingIncrementByActiveElementCount(int value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// int64_t svqincp[_n_s64]_b32(int64_t op, svbool_t pg) + /// SQINCP Xtied, Pg.S + /// + public static unsafe long SaturatingIncrementByActiveElementCount(long value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// uint32_t svqincp[_n_u32]_b32(uint32_t op, svbool_t pg) + /// UQINCP Wtied, Pg.S + /// + public static unsafe uint SaturatingIncrementByActiveElementCount(uint value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// uint64_t svqincp[_n_u64]_b32(uint64_t op, svbool_t pg) + /// UQINCP Xtied, Pg.S + /// + public static unsafe ulong SaturatingIncrementByActiveElementCount(ulong value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// svuint32_t svqincp[_u32](svuint32_t op, svbool_t pg) + /// UQINCP Ztied.S, Pg + /// MOVPRFX Zresult, Zop; UQINCP Zresult.S, Pg + /// + public static unsafe Vector SaturatingIncrementByActiveElementCount(Vector value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// int32_t svqincp[_n_s32]_b64(int32_t op, svbool_t pg) + /// SQINCP Xtied, Pg.D, Wtied + /// + public static unsafe int SaturatingIncrementByActiveElementCount(int value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// int64_t svqincp[_n_s64]_b64(int64_t op, svbool_t pg) + /// SQINCP Xtied, Pg.D + /// + public static unsafe long SaturatingIncrementByActiveElementCount(long value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// uint32_t svqincp[_n_u32]_b64(uint32_t op, svbool_t pg) + /// UQINCP Wtied, Pg.D + /// + public static unsafe uint SaturatingIncrementByActiveElementCount(uint value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// uint64_t svqincp[_n_u64]_b64(uint64_t op, svbool_t pg) + /// UQINCP Xtied, Pg.D + /// + public static unsafe ulong SaturatingIncrementByActiveElementCount(ulong value, Vector from) { throw new PlatformNotSupportedException(); } + + /// + /// svuint64_t svqincp[_u64](svuint64_t op, svbool_t pg) + /// UQINCP Ztied.D, Pg + /// MOVPRFX Zresult, Zop; UQINCP Zresult.D, Pg + /// + public static unsafe Vector SaturatingIncrementByActiveElementCount(Vector value, Vector from) { throw new PlatformNotSupportedException(); } + + /// SignExtend16 : Sign-extend the low 16 bits /// 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 0776b8c8db8c45..3a4e28d67e7552 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 @@ -2492,6 +2492,565 @@ internal Arm64() { } public static unsafe Vector OrAcross(Vector value) => OrAcross(value); + /// Saturating decrement by number of halfword elements + + /// + /// int32_t svqdech_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQDECH Xtied, Wtied, pattern, MUL #imm_factor + /// + public static unsafe int SaturatingDecrementBy16BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy16BitElementCount(value, scale, pattern); + + /// + /// int64_t svqdech_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQDECH Xtied, pattern, MUL #imm_factor + /// + public static unsafe long SaturatingDecrementBy16BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy16BitElementCount(value, scale, pattern); + + /// + /// uint32_t svqdech_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQDECH Wtied, pattern, MUL #imm_factor + /// + public static unsafe uint SaturatingDecrementBy16BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy16BitElementCount(value, scale, pattern); + + /// + /// uint64_t svqdech_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQDECH Xtied, pattern, MUL #imm_factor + /// + public static unsafe ulong SaturatingDecrementBy16BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy16BitElementCount(value, scale, pattern); + + /// + /// svint16_t svqdech_pat[_s16](svint16_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQDECH Ztied.H, pattern, MUL #imm_factor + /// + public static unsafe Vector SaturatingDecrementBy16BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy16BitElementCount(value, scale, pattern); + + /// + /// svuint16_t svqdech_pat[_u16](svuint16_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQDECH Ztied.H, pattern, MUL #imm_factor + /// + public static unsafe Vector SaturatingDecrementBy16BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy16BitElementCount(value, scale, pattern); + + + /// Saturating decrement by number of word elements + + /// + /// int32_t svqdecw_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQDECW Xtied, Wtied, pattern, MUL #imm_factor + /// + public static unsafe int SaturatingDecrementBy32BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy32BitElementCount(value, scale, pattern); + + /// + /// int64_t svqdecw_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQDECW Xtied, pattern, MUL #imm_factor + /// + public static unsafe long SaturatingDecrementBy32BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy32BitElementCount(value, scale, pattern); + + /// + /// uint32_t svqdecw_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQDECW Wtied, pattern, MUL #imm_factor + /// + public static unsafe uint SaturatingDecrementBy32BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy32BitElementCount(value, scale, pattern); + + /// + /// uint64_t svqdecw_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQDECW Xtied, pattern, MUL #imm_factor + /// + public static unsafe ulong SaturatingDecrementBy32BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy32BitElementCount(value, scale, pattern); + + /// + /// svint32_t svqdecw_pat[_s32](svint32_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQDECW Ztied.S, pattern, MUL #imm_factor + /// + public static unsafe Vector SaturatingDecrementBy32BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy32BitElementCount(value, scale, pattern); + + /// + /// svuint32_t svqdecw_pat[_u32](svuint32_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQDECW Ztied.S, pattern, MUL #imm_factor + /// + public static unsafe Vector SaturatingDecrementBy32BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy32BitElementCount(value, scale, pattern); + + + /// Saturating decrement by number of doubleword elements + + /// + /// int32_t svqdecd_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQDECD Xtied, Wtied, pattern, MUL #imm_factor + /// + public static unsafe int SaturatingDecrementBy64BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy64BitElementCount(value, scale, pattern); + + /// + /// int64_t svqdecd_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQDECD Xtied, pattern, MUL #imm_factor + /// + public static unsafe long SaturatingDecrementBy64BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy64BitElementCount(value, scale, pattern); + + /// + /// uint32_t svqdecd_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQDECD Wtied, pattern, MUL #imm_factor + /// + public static unsafe uint SaturatingDecrementBy64BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy64BitElementCount(value, scale, pattern); + + /// + /// uint64_t svqdecd_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQDECD Xtied, pattern, MUL #imm_factor + /// + public static unsafe ulong SaturatingDecrementBy64BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy64BitElementCount(value, scale, pattern); + + /// + /// svint64_t svqdecd_pat[_s64](svint64_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQDECD Ztied.D, pattern, MUL #imm_factor + /// + public static unsafe Vector SaturatingDecrementBy64BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy64BitElementCount(value, scale, pattern); + + /// + /// svuint64_t svqdecd_pat[_u64](svuint64_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQDECD Ztied.D, pattern, MUL #imm_factor + /// + public static unsafe Vector SaturatingDecrementBy64BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy64BitElementCount(value, scale, pattern); + + + /// Saturating decrement by number of byte elements + + /// + /// int32_t svqdecb_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQDECB Xtied, Wtied, pattern, MUL #imm_factor + /// + public static unsafe int SaturatingDecrementBy8BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy8BitElementCount(value, scale, pattern); + + /// + /// int64_t svqdecb_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQDECB Xtied, pattern, MUL #imm_factor + /// + public static unsafe long SaturatingDecrementBy8BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy8BitElementCount(value, scale, pattern); + + /// + /// uint32_t svqdecb_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQDECB Wtied, pattern, MUL #imm_factor + /// + public static unsafe uint SaturatingDecrementBy8BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy8BitElementCount(value, scale, pattern); + + /// + /// uint64_t svqdecb_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQDECB Xtied, pattern, MUL #imm_factor + /// + public static unsafe ulong SaturatingDecrementBy8BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy8BitElementCount(value, scale, pattern); + + + /// Saturating decrement by active element count + + /// + /// int32_t svqdecp[_n_s32]_b8(int32_t op, svbool_t pg) + /// SQDECP Xtied, Pg.B, Wtied + /// + public static unsafe int SaturatingDecrementByActiveElementCount(int value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); + + /// + /// int64_t svqdecp[_n_s64]_b8(int64_t op, svbool_t pg) + /// SQDECP Xtied, Pg.B + /// + public static unsafe long SaturatingDecrementByActiveElementCount(long value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); + + /// + /// uint32_t svqdecp[_n_u32]_b8(uint32_t op, svbool_t pg) + /// UQDECP Wtied, Pg.B + /// + public static unsafe uint SaturatingDecrementByActiveElementCount(uint value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); + + /// + /// uint64_t svqdecp[_n_u64]_b8(uint64_t op, svbool_t pg) + /// UQDECP Xtied, Pg.B + /// + public static unsafe ulong SaturatingDecrementByActiveElementCount(ulong value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); + + /// + /// svint16_t svqdecp[_s16](svint16_t op, svbool_t pg) + /// SQDECP Ztied.H, Pg + /// + public static unsafe Vector SaturatingDecrementByActiveElementCount(Vector value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); + + /// + /// svint32_t svqdecp[_s32](svint32_t op, svbool_t pg) + /// SQDECP Ztied.S, Pg + /// + public static unsafe Vector SaturatingDecrementByActiveElementCount(Vector value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); + + /// + /// svint64_t svqdecp[_s64](svint64_t op, svbool_t pg) + /// SQDECP Ztied.D, Pg + /// + public static unsafe Vector SaturatingDecrementByActiveElementCount(Vector value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); + + /// + /// int32_t svqdecp[_n_s32]_b16(int32_t op, svbool_t pg) + /// SQDECP Xtied, Pg.H, Wtied + /// + public static unsafe int SaturatingDecrementByActiveElementCount(int value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); + + /// + /// int64_t svqdecp[_n_s64]_b16(int64_t op, svbool_t pg) + /// SQDECP Xtied, Pg.H + /// + public static unsafe long SaturatingDecrementByActiveElementCount(long value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); + + /// + /// uint32_t svqdecp[_n_u32]_b16(uint32_t op, svbool_t pg) + /// UQDECP Wtied, Pg.H + /// + public static unsafe uint SaturatingDecrementByActiveElementCount(uint value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); + + /// + /// uint64_t svqdecp[_n_u64]_b16(uint64_t op, svbool_t pg) + /// UQDECP Xtied, Pg.H + /// + public static unsafe ulong SaturatingDecrementByActiveElementCount(ulong value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); + + /// + /// svuint16_t svqdecp[_u16](svuint16_t op, svbool_t pg) + /// UQDECP Ztied.H, Pg + /// + public static unsafe Vector SaturatingDecrementByActiveElementCount(Vector value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); + + /// + /// int32_t svqdecp[_n_s32]_b32(int32_t op, svbool_t pg) + /// SQDECP Xtied, Pg.S, Wtied + /// + public static unsafe int SaturatingDecrementByActiveElementCount(int value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); + + /// + /// int64_t svqdecp[_n_s64]_b32(int64_t op, svbool_t pg) + /// SQDECP Xtied, Pg.S + /// + public static unsafe long SaturatingDecrementByActiveElementCount(long value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); + + /// + /// uint32_t svqdecp[_n_u32]_b32(uint32_t op, svbool_t pg) + /// UQDECP Wtied, Pg.S + /// + public static unsafe uint SaturatingDecrementByActiveElementCount(uint value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); + + /// + /// uint64_t svqdecp[_n_u64]_b32(uint64_t op, svbool_t pg) + /// UQDECP Xtied, Pg.S + /// + public static unsafe ulong SaturatingDecrementByActiveElementCount(ulong value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); + + /// + /// svuint32_t svqdecp[_u32](svuint32_t op, svbool_t pg) + /// UQDECP Ztied.S, Pg + /// MOVPRFX Zresult, Zop; UQDECP Zresult.S, Pg + /// + public static unsafe Vector SaturatingDecrementByActiveElementCount(Vector value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); + + /// + /// int32_t svqdecp[_n_s32]_b64(int32_t op, svbool_t pg) + /// SQDECP Xtied, Pg.D, Wtied + /// + public static unsafe int SaturatingDecrementByActiveElementCount(int value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); + + /// + /// int64_t svqdecp[_n_s64]_b64(int64_t op, svbool_t pg) + /// SQDECP Xtied, Pg.D + /// + public static unsafe long SaturatingDecrementByActiveElementCount(long value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); + + /// + /// uint32_t svqdecp[_n_u32]_b64(uint32_t op, svbool_t pg) + /// UQDECP Wtied, Pg.D + /// + public static unsafe uint SaturatingDecrementByActiveElementCount(uint value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); + + /// + /// uint64_t svqdecp[_n_u64]_b64(uint64_t op, svbool_t pg) + /// UQDECP Xtied, Pg.D + /// + public static unsafe ulong SaturatingDecrementByActiveElementCount(ulong value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); + + /// + /// svuint64_t svqdecp[_u64](svuint64_t op, svbool_t pg) + /// UQDECP Ztied.D, Pg + /// + public static unsafe Vector SaturatingDecrementByActiveElementCount(Vector value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); + + + /// Saturating increment by number of halfword elements + + /// + /// int32_t svqinch_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQINCH Xtied, Wtied, pattern, MUL #imm_factor + /// + public static unsafe int SaturatingIncrementBy16BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy16BitElementCount(value, scale, pattern); + + /// + /// int64_t svqinch_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQINCH Xtied, pattern, MUL #imm_factor + /// + public static unsafe long SaturatingIncrementBy16BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy16BitElementCount(value, scale, pattern); + + /// + /// uint32_t svqinch_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQINCH Wtied, pattern, MUL #imm_factor + /// + public static unsafe uint SaturatingIncrementBy16BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy16BitElementCount(value, scale, pattern); + + /// + /// uint64_t svqinch_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQINCH Xtied, pattern, MUL #imm_factor + /// + public static unsafe ulong SaturatingIncrementBy16BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy16BitElementCount(value, scale, pattern); + + /// + /// svint16_t svqinch_pat[_s16](svint16_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQINCH Ztied.H, pattern, MUL #imm_factor + /// + public static unsafe Vector SaturatingIncrementBy16BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy16BitElementCount(value, scale, pattern); + + /// + /// svuint16_t svqinch_pat[_u16](svuint16_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQINCH Ztied.H, pattern, MUL #imm_factor + /// + public static unsafe Vector SaturatingIncrementBy16BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy16BitElementCount(value, scale, pattern); + + + /// Saturating increment by number of word elements + + /// + /// int32_t svqincw_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQINCW Xtied, Wtied, pattern, MUL #imm_factor + /// + public static unsafe int SaturatingIncrementBy32BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy32BitElementCount(value, scale, pattern); + + /// + /// int64_t svqincw_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQINCW Xtied, pattern, MUL #imm_factor + /// + public static unsafe long SaturatingIncrementBy32BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy32BitElementCount(value, scale, pattern); + + /// + /// uint32_t svqincw_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQINCW Wtied, pattern, MUL #imm_factor + /// + public static unsafe uint SaturatingIncrementBy32BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy32BitElementCount(value, scale, pattern); + + /// + /// uint64_t svqincw_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQINCW Xtied, pattern, MUL #imm_factor + /// + public static unsafe ulong SaturatingIncrementBy32BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy32BitElementCount(value, scale, pattern); + + /// + /// svint32_t svqincw_pat[_s32](svint32_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQINCW Ztied.S, pattern, MUL #imm_factor + /// + public static unsafe Vector SaturatingIncrementBy32BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy32BitElementCount(value, scale, pattern); + + /// + /// svuint32_t svqincw_pat[_u32](svuint32_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQINCW Ztied.S, pattern, MUL #imm_factor + /// + public static unsafe Vector SaturatingIncrementBy32BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy32BitElementCount(value, scale, pattern); + + + /// Saturating increment by number of doubleword elements + + /// + /// int32_t svqincd_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQINCD Xtied, Wtied, pattern, MUL #imm_factor + /// + public static unsafe int SaturatingIncrementBy64BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy64BitElementCount(value, scale, pattern); + + /// + /// int64_t svqincd_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQINCD Xtied, pattern, MUL #imm_factor + /// + public static unsafe long SaturatingIncrementBy64BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy64BitElementCount(value, scale, pattern); + + /// + /// uint32_t svqincd_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQINCD Wtied, pattern, MUL #imm_factor + /// + public static unsafe uint SaturatingIncrementBy64BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy64BitElementCount(value, scale, pattern); + + /// + /// uint64_t svqincd_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQINCD Xtied, pattern, MUL #imm_factor + /// + public static unsafe ulong SaturatingIncrementBy64BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy64BitElementCount(value, scale, pattern); + + /// + /// svint64_t svqincd_pat[_s64](svint64_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQINCD Ztied.D, pattern, MUL #imm_factor + /// + public static unsafe Vector SaturatingIncrementBy64BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy64BitElementCount(value, scale, pattern); + + /// + /// svuint64_t svqincd_pat[_u64](svuint64_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQINCD Ztied.D, pattern, MUL #imm_factor + /// + public static unsafe Vector SaturatingIncrementBy64BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy64BitElementCount(value, scale, pattern); + + + /// Saturating increment by number of byte elements + + /// + /// int32_t svqincb_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQINCB Xtied, Wtied, pattern, MUL #imm_factor + /// + public static unsafe int SaturatingIncrementBy8BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy8BitElementCount(value, scale, pattern); + + /// + /// int64_t svqincb_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) + /// SQINCB Xtied, pattern, MUL #imm_factor + /// + public static unsafe long SaturatingIncrementBy8BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy8BitElementCount(value, scale, pattern); + + /// + /// uint32_t svqincb_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQINCB Wtied, pattern, MUL #imm_factor + /// + public static unsafe uint SaturatingIncrementBy8BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy8BitElementCount(value, scale, pattern); + + /// + /// uint64_t svqincb_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) + /// UQINCB Xtied, pattern, MUL #imm_factor + /// + public static unsafe ulong SaturatingIncrementBy8BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy8BitElementCount(value, scale, pattern); + + + /// Saturating increment by active element count + + /// + /// int32_t svqincp[_n_s32]_b8(int32_t op, svbool_t pg) + /// SQINCP Xtied, Pg.B, Wtied + /// + public static unsafe int SaturatingIncrementByActiveElementCount(int value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); + + /// + /// int64_t svqincp[_n_s64]_b8(int64_t op, svbool_t pg) + /// SQINCP Xtied, Pg.B + /// + public static unsafe long SaturatingIncrementByActiveElementCount(long value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); + + /// + /// uint32_t svqincp[_n_u32]_b8(uint32_t op, svbool_t pg) + /// UQINCP Wtied, Pg.B + /// + public static unsafe uint SaturatingIncrementByActiveElementCount(uint value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); + + /// + /// uint64_t svqincp[_n_u64]_b8(uint64_t op, svbool_t pg) + /// UQINCP Xtied, Pg.B + /// + public static unsafe ulong SaturatingIncrementByActiveElementCount(ulong value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); + + /// + /// svint16_t svqincp[_s16](svint16_t op, svbool_t pg) + /// SQINCP Ztied.H, Pg + /// + public static unsafe Vector SaturatingIncrementByActiveElementCount(Vector value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); + + /// + /// svint32_t svqincp[_s32](svint32_t op, svbool_t pg) + /// SQINCP Ztied.S, Pg + /// + public static unsafe Vector SaturatingIncrementByActiveElementCount(Vector value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); + + /// + /// svint64_t svqincp[_s64](svint64_t op, svbool_t pg) + /// SQINCP Ztied.D, Pg + /// + public static unsafe Vector SaturatingIncrementByActiveElementCount(Vector value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); + + /// + /// int32_t svqincp[_n_s32]_b16(int32_t op, svbool_t pg) + /// SQINCP Xtied, Pg.H, Wtied + /// + public static unsafe int SaturatingIncrementByActiveElementCount(int value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); + + /// + /// int64_t svqincp[_n_s64]_b16(int64_t op, svbool_t pg) + /// SQINCP Xtied, Pg.H + /// + public static unsafe long SaturatingIncrementByActiveElementCount(long value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); + + /// + /// uint32_t svqincp[_n_u32]_b16(uint32_t op, svbool_t pg) + /// UQINCP Wtied, Pg.H + /// + public static unsafe uint SaturatingIncrementByActiveElementCount(uint value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); + + /// + /// uint64_t svqincp[_n_u64]_b16(uint64_t op, svbool_t pg) + /// UQINCP Xtied, Pg.H + /// + public static unsafe ulong SaturatingIncrementByActiveElementCount(ulong value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); + + /// + /// svuint16_t svqincp[_u16](svuint16_t op, svbool_t pg) + /// UQINCP Ztied.H, Pg + /// + public static unsafe Vector SaturatingIncrementByActiveElementCount(Vector value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); + + /// + /// int32_t svqincp[_n_s32]_b32(int32_t op, svbool_t pg) + /// SQINCP Xtied, Pg.S, Wtied + /// + public static unsafe int SaturatingIncrementByActiveElementCount(int value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); + + /// + /// int64_t svqincp[_n_s64]_b32(int64_t op, svbool_t pg) + /// SQINCP Xtied, Pg.S + /// + public static unsafe long SaturatingIncrementByActiveElementCount(long value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); + + /// + /// uint32_t svqincp[_n_u32]_b32(uint32_t op, svbool_t pg) + /// UQINCP Wtied, Pg.S + /// + public static unsafe uint SaturatingIncrementByActiveElementCount(uint value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); + + /// + /// uint64_t svqincp[_n_u64]_b32(uint64_t op, svbool_t pg) + /// UQINCP Xtied, Pg.S + /// + public static unsafe ulong SaturatingIncrementByActiveElementCount(ulong value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); + + /// + /// svuint32_t svqincp[_u32](svuint32_t op, svbool_t pg) + /// UQINCP Ztied.S, Pg + /// + public static unsafe Vector SaturatingIncrementByActiveElementCount(Vector value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); + + /// + /// int32_t svqincp[_n_s32]_b64(int32_t op, svbool_t pg) + /// SQINCP Xtied, Pg.D, Wtied + /// + public static unsafe int SaturatingIncrementByActiveElementCount(int value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); + + /// + /// int64_t svqincp[_n_s64]_b64(int64_t op, svbool_t pg) + /// SQINCP Xtied, Pg.D + /// + public static unsafe long SaturatingIncrementByActiveElementCount(long value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); + + /// + /// uint32_t svqincp[_n_u32]_b64(uint32_t op, svbool_t pg) + /// UQINCP Wtied, Pg.D + /// + public static unsafe uint SaturatingIncrementByActiveElementCount(uint value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); + + /// + /// uint64_t svqincp[_n_u64]_b64(uint64_t op, svbool_t pg) + /// UQINCP Xtied, Pg.D + /// + public static unsafe ulong SaturatingIncrementByActiveElementCount(ulong value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); + + /// + /// svuint64_t svqincp[_u64](svuint64_t op, svbool_t pg) + /// UQINCP Ztied.D, Pg + /// + public static unsafe Vector SaturatingIncrementByActiveElementCount(Vector value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); + + /// SignExtend16 : Sign-extend the low 16 bits /// 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 6a094cc2bd41c2..e5ce51ebe9be7e 100644 --- a/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs +++ b/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs @@ -4482,6 +4482,95 @@ internal Arm64() { } public static System.Numerics.Vector OrAcross(System.Numerics.Vector value) { throw null; } public static System.Numerics.Vector OrAcross(System.Numerics.Vector value) { throw null; } + public static int SaturatingDecrementBy16BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static long SaturatingDecrementBy16BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static uint SaturatingDecrementBy16BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static ulong SaturatingDecrementBy16BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static System.Numerics.Vector SaturatingDecrementBy16BitElementCount(System.Numerics.Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static System.Numerics.Vector SaturatingDecrementBy16BitElementCount(System.Numerics.Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static int SaturatingDecrementBy32BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static long SaturatingDecrementBy32BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static uint SaturatingDecrementBy32BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static ulong SaturatingDecrementBy32BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static System.Numerics.Vector SaturatingDecrementBy32BitElementCount(System.Numerics.Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static System.Numerics.Vector SaturatingDecrementBy32BitElementCount(System.Numerics.Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static int SaturatingDecrementBy64BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static long SaturatingDecrementBy64BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static uint SaturatingDecrementBy64BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static ulong SaturatingDecrementBy64BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static System.Numerics.Vector SaturatingDecrementBy64BitElementCount(System.Numerics.Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static System.Numerics.Vector SaturatingDecrementBy64BitElementCount(System.Numerics.Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static int SaturatingDecrementBy8BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static long SaturatingDecrementBy8BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static uint SaturatingDecrementBy8BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static ulong SaturatingDecrementBy8BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static int SaturatingDecrementByActiveElementCount(int value, System.Numerics.Vector from) { throw null; } + public static long SaturatingDecrementByActiveElementCount(long value, System.Numerics.Vector from) { throw null; } + public static uint SaturatingDecrementByActiveElementCount(uint value, System.Numerics.Vector from) { throw null; } + public static ulong SaturatingDecrementByActiveElementCount(ulong value, System.Numerics.Vector from) { throw null; } + public static System.Numerics.Vector SaturatingDecrementByActiveElementCount(System.Numerics.Vector value, System.Numerics.Vector from) { throw null; } + public static System.Numerics.Vector SaturatingDecrementByActiveElementCount(System.Numerics.Vector value, System.Numerics.Vector from) { throw null; } + public static System.Numerics.Vector SaturatingDecrementByActiveElementCount(System.Numerics.Vector value, System.Numerics.Vector from) { throw null; } + public static int SaturatingDecrementByActiveElementCount(int value, System.Numerics.Vector from) { throw null; } + public static long SaturatingDecrementByActiveElementCount(long value, System.Numerics.Vector from) { throw null; } + public static uint SaturatingDecrementByActiveElementCount(uint value, System.Numerics.Vector from) { throw null; } + public static ulong SaturatingDecrementByActiveElementCount(ulong value, System.Numerics.Vector from) { throw null; } + public static System.Numerics.Vector SaturatingDecrementByActiveElementCount(System.Numerics.Vector value, System.Numerics.Vector from) { throw null; } + public static int SaturatingDecrementByActiveElementCount(int value, System.Numerics.Vector from) { throw null; } + public static long SaturatingDecrementByActiveElementCount(long value, System.Numerics.Vector from) { throw null; } + public static uint SaturatingDecrementByActiveElementCount(uint value, System.Numerics.Vector from) { throw null; } + public static ulong SaturatingDecrementByActiveElementCount(ulong value, System.Numerics.Vector from) { throw null; } + public static System.Numerics.Vector SaturatingDecrementByActiveElementCount(System.Numerics.Vector value, System.Numerics.Vector from) { throw null; } + public static int SaturatingDecrementByActiveElementCount(int value, System.Numerics.Vector from) { throw null; } + public static long SaturatingDecrementByActiveElementCount(long value, System.Numerics.Vector from) { throw null; } + public static uint SaturatingDecrementByActiveElementCount(uint value, System.Numerics.Vector from) { throw null; } + public static ulong SaturatingDecrementByActiveElementCount(ulong value, System.Numerics.Vector from) { throw null; } + public static System.Numerics.Vector SaturatingDecrementByActiveElementCount(System.Numerics.Vector value, System.Numerics.Vector from) { throw null; } + public static int SaturatingIncrementBy16BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static long SaturatingIncrementBy16BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static uint SaturatingIncrementBy16BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static ulong SaturatingIncrementBy16BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static System.Numerics.Vector SaturatingIncrementBy16BitElementCount(System.Numerics.Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static System.Numerics.Vector SaturatingIncrementBy16BitElementCount(System.Numerics.Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static int SaturatingIncrementBy32BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static long SaturatingIncrementBy32BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static uint SaturatingIncrementBy32BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static ulong SaturatingIncrementBy32BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static System.Numerics.Vector SaturatingIncrementBy32BitElementCount(System.Numerics.Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static System.Numerics.Vector SaturatingIncrementBy32BitElementCount(System.Numerics.Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static int SaturatingIncrementBy64BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static long SaturatingIncrementBy64BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static uint SaturatingIncrementBy64BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static ulong SaturatingIncrementBy64BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static System.Numerics.Vector SaturatingIncrementBy64BitElementCount(System.Numerics.Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static System.Numerics.Vector SaturatingIncrementBy64BitElementCount(System.Numerics.Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static int SaturatingIncrementBy8BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static long SaturatingIncrementBy8BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static uint SaturatingIncrementBy8BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static ulong SaturatingIncrementBy8BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } + public static int SaturatingIncrementByActiveElementCount(int value, System.Numerics.Vector from) { throw null; } + public static long SaturatingIncrementByActiveElementCount(long value, System.Numerics.Vector from) { throw null; } + public static uint SaturatingIncrementByActiveElementCount(uint value, System.Numerics.Vector from) { throw null; } + public static ulong SaturatingIncrementByActiveElementCount(ulong value, System.Numerics.Vector from) { throw null; } + public static System.Numerics.Vector SaturatingIncrementByActiveElementCount(System.Numerics.Vector value, System.Numerics.Vector from) { throw null; } + public static System.Numerics.Vector SaturatingIncrementByActiveElementCount(System.Numerics.Vector value, System.Numerics.Vector from) { throw null; } + public static System.Numerics.Vector SaturatingIncrementByActiveElementCount(System.Numerics.Vector value, System.Numerics.Vector from) { throw null; } + public static int SaturatingIncrementByActiveElementCount(int value, System.Numerics.Vector from) { throw null; } + public static long SaturatingIncrementByActiveElementCount(long value, System.Numerics.Vector from) { throw null; } + public static uint SaturatingIncrementByActiveElementCount(uint value, System.Numerics.Vector from) { throw null; } + public static ulong SaturatingIncrementByActiveElementCount(ulong value, System.Numerics.Vector from) { throw null; } + public static System.Numerics.Vector SaturatingIncrementByActiveElementCount(System.Numerics.Vector value, System.Numerics.Vector from) { throw null; } + public static int SaturatingIncrementByActiveElementCount(int value, System.Numerics.Vector from) { throw null; } + public static long SaturatingIncrementByActiveElementCount(long value, System.Numerics.Vector from) { throw null; } + public static uint SaturatingIncrementByActiveElementCount(uint value, System.Numerics.Vector from) { throw null; } + public static ulong SaturatingIncrementByActiveElementCount(ulong value, System.Numerics.Vector from) { throw null; } + public static System.Numerics.Vector SaturatingIncrementByActiveElementCount(System.Numerics.Vector value, System.Numerics.Vector from) { throw null; } + public static int SaturatingIncrementByActiveElementCount(int value, System.Numerics.Vector from) { throw null; } + public static long SaturatingIncrementByActiveElementCount(long value, System.Numerics.Vector from) { throw null; } + public static uint SaturatingIncrementByActiveElementCount(uint value, System.Numerics.Vector from) { throw null; } + public static ulong SaturatingIncrementByActiveElementCount(ulong value, System.Numerics.Vector from) { throw null; } + public static System.Numerics.Vector SaturatingIncrementByActiveElementCount(System.Numerics.Vector value, System.Numerics.Vector from) { throw null; } + public static System.Numerics.Vector SignExtend16(System.Numerics.Vector value) { throw null; } public static System.Numerics.Vector SignExtend16(System.Numerics.Vector value) { throw null; } public static System.Numerics.Vector SignExtend32(System.Numerics.Vector value) { throw null; } diff --git a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs index 70fd2c920586d6..76f3c8a03bf720 100644 --- a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs +++ b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs @@ -146,6 +146,7 @@ ("_SveTernOpTestTemplate.template", "SveVecTernOpTest.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 }), ("_SveMinimalUnaryOpTestTemplate.template", "SveVecReduceUnOpTest.template", new Dictionary { ["TemplateName"] = "Simple", ["TemplateValidationLogic"] = VecReduceOpTest_ValidationLogic }), + ("_SveImm2UnaryOpTestTemplate.template", "SveVecImm2UnOpTest.template", new Dictionary { ["TemplateName"] = "Imm", ["TemplateValidationLogic"] = SimpleVecOpTest_ValidationLogic }), }; (string templateFileName, Dictionary templateData)[] AdvSimdInputs = new [] @@ -3244,6 +3245,58 @@ ("SveVecReduceUnOpTest.template", new Dictionary { ["TestName"] = "Sve_OrAcross_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "OrAcross", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateReduceOpResult"] = "Helpers.OrAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), ("SveVecReduceUnOpTest.template", new Dictionary { ["TestName"] = "Sve_OrAcross_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "OrAcross", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateReduceOpResult"] = "Helpers.OrAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int16))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int16))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int16))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (ulong)(2 * Unsafe.SizeOf>() / sizeof(Int16))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_vector_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (2 * Unsafe.SizeOf>() / sizeof(Int16)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_vector_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (2 * Unsafe.SizeOf>() / sizeof(Int16)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int32))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int32))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int32))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (ulong)(2 * Unsafe.SizeOf>() / sizeof(Int32))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_vector_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (2 * Unsafe.SizeOf>() / sizeof(Int32)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_vector_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (2 * Unsafe.SizeOf>() / sizeof(Int32)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int64))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int64))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int64))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (ulong)(2 * Unsafe.SizeOf>() / sizeof(Int64))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_vector_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (2 * Unsafe.SizeOf>() / sizeof(Int64)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_vector_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (ulong)(2 * Unsafe.SizeOf>() / sizeof(Int64)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Byte))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Byte))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Byte))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (ulong)(2 * Unsafe.SizeOf>() / sizeof(Byte))));",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int16))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int16))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int16))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (ulong)(2 * Unsafe.SizeOf>() / sizeof(Int16))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_vector_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (2 * Unsafe.SizeOf>() / sizeof(Int16)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_vector_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (2 * Unsafe.SizeOf>() / sizeof(Int16)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int32))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int32))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int32))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (ulong)(2 * Unsafe.SizeOf>() / sizeof(Int32))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_vector_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (2 * Unsafe.SizeOf>() / sizeof(Int32)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_vector_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (2 * Unsafe.SizeOf>() / sizeof(Int32)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int64))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int64))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int64))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (ulong)(2 * Unsafe.SizeOf>() / sizeof(Int64))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_vector_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (2 * Unsafe.SizeOf>() / sizeof(Int64)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_vector_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (ulong)(2 * Unsafe.SizeOf>() / sizeof(Int64)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Byte))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Byte))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Byte))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (ulong)(2 * Unsafe.SizeOf>() / sizeof(Byte))));",}), + ("SveSimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sve_SignExtend16_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SignExtend16", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "result[i] != Helpers.SignExtend(firstOp[i], 16, false)", ["GetIterResult"] = "Helpers.SignExtend(leftOp[i], 16, false)"}), ("SveSimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sve_SignExtend16_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SignExtend16", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "result[i] != Helpers.SignExtend(firstOp[i], 16, false)", ["GetIterResult"] = "Helpers.SignExtend(leftOp[i], 16, false)"}), ("SveSimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sve_SignExtend32_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SignExtend32", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "result[i] != Helpers.SignExtend(firstOp[i], 32, false)", ["GetIterResult"] = "Helpers.SignExtend(leftOp[i], 32, false)"}), diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/ScalarImm2UnOpTest.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/ScalarImm2UnOpTest.template new file mode 100644 index 00000000000000..48486fd5a85a19 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/ScalarImm2UnOpTest.template @@ -0,0 +1,198 @@ +// 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 ScalarImm2UnaryOpTest__{TestName}(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.ReadUnaligned + test.RunBasicScenario_UnsafeRead(); + + // Validates calling via reflection works, using Unsafe.ReadUnaligned + // test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a local works, using Unsafe.ReadUnaligned + 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(); + } + 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 ScalarImm2UnaryOpTest__{TestName} + { + private struct TestStruct + { + public {Op1BaseType} _fld; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + testStruct._fld = {NextValueOp1}; + return testStruct; + } + + public void RunStructFldScenario(ScalarImm2UnaryOpTest__{TestName} testClass) + { + var result = {Isa}.{Method}(_fld, {Imm}, {Imm2}); + testClass.ValidateResult(_fld, result); + } + } + + private static {Op1BaseType} _data; + + private {Op1BaseType} _fld; + + public ScalarImm2UnaryOpTest__{TestName}() + { + Succeeded = true; + + + _fld = {NextValueOp1}; + _data = {NextValueOp1}; + } + + 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.ReadUnaligned<{Op1BaseType}>(ref Unsafe.As<{Op1BaseType}, byte>(ref _data)), {Imm}, {Imm2} + ); + + ValidateResult(_data, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof({Isa}).GetMethod(nameof({Isa}.{Method}), new Type[] { typeof({Op1BaseType}), typeof({Op2BaseType}), typeof({Op3BaseType}) }) + .Invoke(null, new object[] { + Unsafe.ReadUnaligned<{Op1BaseType}>(ref Unsafe.As<{Op1BaseType}, byte>(ref _data)), + {Imm}, + {Imm2}, + }); + + ValidateResult(_data, ({RetBaseType})result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var data = Unsafe.ReadUnaligned<{Op1BaseType}>(ref Unsafe.As<{Op1BaseType}, byte>(ref _data)); + var result = {Isa}.{Method}(data, {Imm}, {Imm2}); + + ValidateResult(data, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = {Isa}.{Method}(_fld, {Imm}, {Imm2}); + ValidateResult(_fld, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = {Isa}.{Method}(test._fld, {Imm}, {Imm2}); + + ValidateResult(test._fld, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult({Op1BaseType} data, {RetBaseType} result, [CallerMemberName] string method = "") + { + var isUnexpectedResult = false; + + {ValidateResult} + + if (isUnexpectedResult) + { + TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1BaseType}, {Imm}, {Imm2}): {Method} failed:"); + TestLibrary.TestFramework.LogInformation($" data: {data}"); + TestLibrary.TestFramework.LogInformation($" result: {result}"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveImm2UnaryOpTestTemplate.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveImm2UnaryOpTestTemplate.template new file mode 100644 index 00000000000000..c3a9d79b8b9a5a --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveImm2UnaryOpTestTemplate.template @@ -0,0 +1,312 @@ +// 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\X86\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}UnaryOpTest__{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(); + } + 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}UnaryOpTest__{TestName} + { + private struct DataTable + { + private byte[] inArray; + private byte[] outArray; + + private GCHandle inHandle; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable({Op1BaseType}[] inArray, {RetBaseType}[] outArray, int alignment) + { + int sizeOfinArray = inArray.Length * Unsafe.SizeOf<{Op1BaseType}>(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<{RetBaseType}>(); + + if ((alignment != 64 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle = GCHandle.Alloc(this.inArray, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArrayPtr), ref Unsafe.As<{Op1BaseType}, byte>(ref inArray[0]), (uint)sizeOfinArray); + } + + public void* inArrayPtr => Align((byte*)(inHandle.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle.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}> _fld; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data[i] = {NextValueOp1}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld), ref Unsafe.As<{Op1BaseType}, byte>(ref _data[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + + return testStruct; + } + + public void RunStructFldScenario({TemplateName}UnaryOpTest__{TestName} testClass) + { + var result = {Isa}.{Method}(_fld, {Imm}, {Imm2}); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = {LargestVectorSize}; + + private static readonly int Op1ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); + private static readonly int RetElementCount = Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>() / sizeof({RetBaseType}); + private static readonly {Op2BaseType} Imm = {Imm}; + private static readonly {Op3BaseType} Imm2 = {Imm2}; + + private static {Op1BaseType}[] _data = new {Op1BaseType}[Op1ElementCount]; + + private {Op1VectorType}<{Op1BaseType}> _fld; + + private DataTable _dataTable; + + public {TemplateName}UnaryOpTest__{TestName}() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data[i] = {NextValueOp1}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref _fld), ref Unsafe.As<{Op1BaseType}, byte>(ref _data[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data[i] = {NextValueOp1}; } + _dataTable = new DataTable(_data, 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.inArrayPtr), + {Imm}, + {Imm2} + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArrayPtr, _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.inArrayPtr)), + {Imm}, + {Imm2} + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArrayPtr, _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({Op2BaseType}), typeof({Op3BaseType}) }) + .Invoke(null, new object[] { + Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArrayPtr), + {Imm}, + {Imm2}, + }); + + Unsafe.Write(_dataTable.outArrayPtr, ({RetVectorType}<{RetBaseType}>)(result)); + ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var firstOp = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArrayPtr); + var result = {Isa}.{Method}(firstOp, {Imm}, {Imm2}); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(firstOp, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = {Isa}.{Method}(_fld, {Imm}, {Imm2}); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = {Isa}.{Method}(test._fld, {Imm}, {Imm2}); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult({Op1VectorType}<{Op1BaseType}> firstOp, void* result, [CallerMemberName] string method = "") + { + {Op1BaseType}[] inArray = new {Op1BaseType}[Op1ElementCount]; + {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray[0]), firstOp); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>()); + + ValidateResult(inArray, outArray, method); + } + + private void ValidateResult(void* firstOp, void* result, [CallerMemberName] string method = "") + { + {Op1BaseType}[] inArray = new {Op1BaseType}[Op1ElementCount]; + {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray[0]), ref Unsafe.AsRef(firstOp), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>()); + + ValidateResult(inArray, outArray, method); + } + + private void ValidateResult({Op1BaseType}[] firstOp, {RetBaseType}[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + {TemplateValidationLogic} + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>, {Imm}, {Imm2}): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} From a9f6aaac6fdb762a04d992ff637de5c2f199a17d Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Fri, 17 May 2024 16:34:59 +0100 Subject: [PATCH 02/29] Add fallback for scalar variants --- .../Arm/Sve.PlatformNotSupported.cs | 283 ----------- .../src/System/Runtime/Intrinsics/Arm/Sve.cs | 443 ++++++------------ .../ref/System.Runtime.Intrinsics.cs | 43 +- .../Arm/Shared/ScalarImm2UnOpTest.template | 2 +- 4 files changed, 141 insertions(+), 630 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 dabeb4d6304eb8..0b14fd81c5d7f7 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 @@ -2639,148 +2639,6 @@ internal Arm64() { } /// public static unsafe ulong SaturatingDecrementBy8BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } - - /// Saturating decrement by active element count - - /// - /// int32_t svqdecp[_n_s32]_b8(int32_t op, svbool_t pg) - /// SQDECP Xtied, Pg.B, Wtied - /// - public static unsafe int SaturatingDecrementByActiveElementCount(int value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// int64_t svqdecp[_n_s64]_b8(int64_t op, svbool_t pg) - /// SQDECP Xtied, Pg.B - /// - public static unsafe long SaturatingDecrementByActiveElementCount(long value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// uint32_t svqdecp[_n_u32]_b8(uint32_t op, svbool_t pg) - /// UQDECP Wtied, Pg.B - /// - public static unsafe uint SaturatingDecrementByActiveElementCount(uint value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// uint64_t svqdecp[_n_u64]_b8(uint64_t op, svbool_t pg) - /// UQDECP Xtied, Pg.B - /// - public static unsafe ulong SaturatingDecrementByActiveElementCount(ulong value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// svint16_t svqdecp[_s16](svint16_t op, svbool_t pg) - /// SQDECP Ztied.H, Pg - /// MOVPRFX Zresult, Zop; SQDECP Zresult.H, Pg - /// - public static unsafe Vector SaturatingDecrementByActiveElementCount(Vector value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// svint32_t svqdecp[_s32](svint32_t op, svbool_t pg) - /// SQDECP Ztied.S, Pg - /// MOVPRFX Zresult, Zop; SQDECP Zresult.S, Pg - /// - public static unsafe Vector SaturatingDecrementByActiveElementCount(Vector value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// svint64_t svqdecp[_s64](svint64_t op, svbool_t pg) - /// SQDECP Ztied.D, Pg - /// MOVPRFX Zresult, Zop; SQDECP Zresult.D, Pg - /// - public static unsafe Vector SaturatingDecrementByActiveElementCount(Vector value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// int32_t svqdecp[_n_s32]_b16(int32_t op, svbool_t pg) - /// SQDECP Xtied, Pg.H, Wtied - /// - public static unsafe int SaturatingDecrementByActiveElementCount(int value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// int64_t svqdecp[_n_s64]_b16(int64_t op, svbool_t pg) - /// SQDECP Xtied, Pg.H - /// - public static unsafe long SaturatingDecrementByActiveElementCount(long value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// uint32_t svqdecp[_n_u32]_b16(uint32_t op, svbool_t pg) - /// UQDECP Wtied, Pg.H - /// - public static unsafe uint SaturatingDecrementByActiveElementCount(uint value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// uint64_t svqdecp[_n_u64]_b16(uint64_t op, svbool_t pg) - /// UQDECP Xtied, Pg.H - /// - public static unsafe ulong SaturatingDecrementByActiveElementCount(ulong value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// svuint16_t svqdecp[_u16](svuint16_t op, svbool_t pg) - /// UQDECP Ztied.H, Pg - /// MOVPRFX Zresult, Zop; UQDECP Zresult.H, Pg - /// - public static unsafe Vector SaturatingDecrementByActiveElementCount(Vector value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// int32_t svqdecp[_n_s32]_b32(int32_t op, svbool_t pg) - /// SQDECP Xtied, Pg.S, Wtied - /// - public static unsafe int SaturatingDecrementByActiveElementCount(int value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// int64_t svqdecp[_n_s64]_b32(int64_t op, svbool_t pg) - /// SQDECP Xtied, Pg.S - /// - public static unsafe long SaturatingDecrementByActiveElementCount(long value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// uint32_t svqdecp[_n_u32]_b32(uint32_t op, svbool_t pg) - /// UQDECP Wtied, Pg.S - /// - public static unsafe uint SaturatingDecrementByActiveElementCount(uint value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// uint64_t svqdecp[_n_u64]_b32(uint64_t op, svbool_t pg) - /// UQDECP Xtied, Pg.S - /// - public static unsafe ulong SaturatingDecrementByActiveElementCount(ulong value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// svuint32_t svqdecp[_u32](svuint32_t op, svbool_t pg) - /// UQDECP Ztied.S, Pg - /// MOVPRFX Zresult, Zop; UQDECP Zresult.S, Pg - /// - public static unsafe Vector SaturatingDecrementByActiveElementCount(Vector value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// int32_t svqdecp[_n_s32]_b64(int32_t op, svbool_t pg) - /// SQDECP Xtied, Pg.D, Wtied - /// - public static unsafe int SaturatingDecrementByActiveElementCount(int value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// int64_t svqdecp[_n_s64]_b64(int64_t op, svbool_t pg) - /// SQDECP Xtied, Pg.D - /// - public static unsafe long SaturatingDecrementByActiveElementCount(long value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// uint32_t svqdecp[_n_u32]_b64(uint32_t op, svbool_t pg) - /// UQDECP Wtied, Pg.D - /// - public static unsafe uint SaturatingDecrementByActiveElementCount(uint value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// uint64_t svqdecp[_n_u64]_b64(uint64_t op, svbool_t pg) - /// UQDECP Xtied, Pg.D - /// - public static unsafe ulong SaturatingDecrementByActiveElementCount(ulong value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// svuint64_t svqdecp[_u64](svuint64_t op, svbool_t pg) - /// UQDECP Ztied.D, Pg - /// MOVPRFX Zresult, Zop; UQDECP Zresult.D, Pg - /// - public static unsafe Vector SaturatingDecrementByActiveElementCount(Vector value, Vector from) { throw new PlatformNotSupportedException(); } - - /// Saturating increment by number of halfword elements /// @@ -2931,147 +2789,6 @@ internal Arm64() { } public static unsafe ulong SaturatingIncrementBy8BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw new PlatformNotSupportedException(); } - /// Saturating increment by active element count - - /// - /// int32_t svqincp[_n_s32]_b8(int32_t op, svbool_t pg) - /// SQINCP Xtied, Pg.B, Wtied - /// - public static unsafe int SaturatingIncrementByActiveElementCount(int value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// int64_t svqincp[_n_s64]_b8(int64_t op, svbool_t pg) - /// SQINCP Xtied, Pg.B - /// - public static unsafe long SaturatingIncrementByActiveElementCount(long value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// uint32_t svqincp[_n_u32]_b8(uint32_t op, svbool_t pg) - /// UQINCP Wtied, Pg.B - /// - public static unsafe uint SaturatingIncrementByActiveElementCount(uint value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// uint64_t svqincp[_n_u64]_b8(uint64_t op, svbool_t pg) - /// UQINCP Xtied, Pg.B - /// - public static unsafe ulong SaturatingIncrementByActiveElementCount(ulong value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// svint16_t svqincp[_s16](svint16_t op, svbool_t pg) - /// SQINCP Ztied.H, Pg - /// MOVPRFX Zresult, Zop; SQINCP Zresult.H, Pg - /// - public static unsafe Vector SaturatingIncrementByActiveElementCount(Vector value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// svint32_t svqincp[_s32](svint32_t op, svbool_t pg) - /// SQINCP Ztied.S, Pg - /// MOVPRFX Zresult, Zop; SQINCP Zresult.S, Pg - /// - public static unsafe Vector SaturatingIncrementByActiveElementCount(Vector value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// svint64_t svqincp[_s64](svint64_t op, svbool_t pg) - /// SQINCP Ztied.D, Pg - /// MOVPRFX Zresult, Zop; SQINCP Zresult.D, Pg - /// - public static unsafe Vector SaturatingIncrementByActiveElementCount(Vector value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// int32_t svqincp[_n_s32]_b16(int32_t op, svbool_t pg) - /// SQINCP Xtied, Pg.H, Wtied - /// - public static unsafe int SaturatingIncrementByActiveElementCount(int value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// int64_t svqincp[_n_s64]_b16(int64_t op, svbool_t pg) - /// SQINCP Xtied, Pg.H - /// - public static unsafe long SaturatingIncrementByActiveElementCount(long value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// uint32_t svqincp[_n_u32]_b16(uint32_t op, svbool_t pg) - /// UQINCP Wtied, Pg.H - /// - public static unsafe uint SaturatingIncrementByActiveElementCount(uint value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// uint64_t svqincp[_n_u64]_b16(uint64_t op, svbool_t pg) - /// UQINCP Xtied, Pg.H - /// - public static unsafe ulong SaturatingIncrementByActiveElementCount(ulong value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// svuint16_t svqincp[_u16](svuint16_t op, svbool_t pg) - /// UQINCP Ztied.H, Pg - /// MOVPRFX Zresult, Zop; UQINCP Zresult.H, Pg - /// - public static unsafe Vector SaturatingIncrementByActiveElementCount(Vector value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// int32_t svqincp[_n_s32]_b32(int32_t op, svbool_t pg) - /// SQINCP Xtied, Pg.S, Wtied - /// - public static unsafe int SaturatingIncrementByActiveElementCount(int value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// int64_t svqincp[_n_s64]_b32(int64_t op, svbool_t pg) - /// SQINCP Xtied, Pg.S - /// - public static unsafe long SaturatingIncrementByActiveElementCount(long value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// uint32_t svqincp[_n_u32]_b32(uint32_t op, svbool_t pg) - /// UQINCP Wtied, Pg.S - /// - public static unsafe uint SaturatingIncrementByActiveElementCount(uint value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// uint64_t svqincp[_n_u64]_b32(uint64_t op, svbool_t pg) - /// UQINCP Xtied, Pg.S - /// - public static unsafe ulong SaturatingIncrementByActiveElementCount(ulong value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// svuint32_t svqincp[_u32](svuint32_t op, svbool_t pg) - /// UQINCP Ztied.S, Pg - /// MOVPRFX Zresult, Zop; UQINCP Zresult.S, Pg - /// - public static unsafe Vector SaturatingIncrementByActiveElementCount(Vector value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// int32_t svqincp[_n_s32]_b64(int32_t op, svbool_t pg) - /// SQINCP Xtied, Pg.D, Wtied - /// - public static unsafe int SaturatingIncrementByActiveElementCount(int value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// int64_t svqincp[_n_s64]_b64(int64_t op, svbool_t pg) - /// SQINCP Xtied, Pg.D - /// - public static unsafe long SaturatingIncrementByActiveElementCount(long value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// uint32_t svqincp[_n_u32]_b64(uint32_t op, svbool_t pg) - /// UQINCP Wtied, Pg.D - /// - public static unsafe uint SaturatingIncrementByActiveElementCount(uint value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// uint64_t svqincp[_n_u64]_b64(uint64_t op, svbool_t pg) - /// UQINCP Xtied, Pg.D - /// - public static unsafe ulong SaturatingIncrementByActiveElementCount(ulong value, Vector from) { throw new PlatformNotSupportedException(); } - - /// - /// svuint64_t svqincp[_u64](svuint64_t op, svbool_t pg) - /// UQINCP Ztied.D, Pg - /// MOVPRFX Zresult, Zop; UQINCP Zresult.D, Pg - /// - public static unsafe Vector SaturatingIncrementByActiveElementCount(Vector value, Vector from) { throw new PlatformNotSupportedException(); } - - /// SignExtend16 : Sign-extend the low 16 bits /// 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 e744a967467594..bfa4d436c7cf5d 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 @@ -2551,25 +2551,25 @@ internal Arm64() { } /// int32_t svqdech_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECH Xtied, Wtied, pattern, MUL #imm_factor /// - public static unsafe int SaturatingDecrementBy16BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy16BitElementCount(value, scale, pattern); + public static unsafe int SaturatingDecrementBy16BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (int)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern))); /// /// int64_t svqdech_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECH Xtied, pattern, MUL #imm_factor /// - public static unsafe long SaturatingDecrementBy16BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy16BitElementCount(value, scale, pattern); + public static unsafe long SaturatingDecrementBy16BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (long)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern))); /// /// uint32_t svqdech_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECH Wtied, pattern, MUL #imm_factor /// - public static unsafe uint SaturatingDecrementBy16BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy16BitElementCount(value, scale, pattern); + public static unsafe uint SaturatingDecrementBy16BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (uint)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern))); /// /// uint64_t svqdech_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECH Xtied, pattern, MUL #imm_factor /// - public static unsafe ulong SaturatingDecrementBy16BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy16BitElementCount(value, scale, pattern); + public static unsafe ulong SaturatingDecrementBy16BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (ulong)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern))); /// /// svint16_t svqdech_pat[_s16](svint16_t op, enum svpattern pattern, uint64_t imm_factor) @@ -2590,25 +2590,26 @@ internal Arm64() { } /// int32_t svqdecw_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECW Xtied, Wtied, pattern, MUL #imm_factor /// - public static unsafe int SaturatingDecrementBy32BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy32BitElementCount(value, scale, pattern); + public static unsafe int SaturatingDecrementBy32BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (int)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern))); /// /// int64_t svqdecw_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECW Xtied, pattern, MUL #imm_factor /// - public static unsafe long SaturatingDecrementBy32BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy32BitElementCount(value, scale, pattern); + public static unsafe long SaturatingDecrementBy32BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (long)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern))); /// /// uint32_t svqdecw_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECW Wtied, pattern, MUL #imm_factor /// - public static unsafe uint SaturatingDecrementBy32BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy32BitElementCount(value, scale, pattern); + public static unsafe uint SaturatingDecrementBy32BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (uint)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern))); /// /// uint64_t svqdecw_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECW Xtied, pattern, MUL #imm_factor /// - public static unsafe ulong SaturatingDecrementBy32BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy32BitElementCount(value, scale, pattern); + public static unsafe ulong SaturatingDecrementBy32BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (ulong)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern))); + /// /// svint32_t svqdecw_pat[_s32](svint32_t op, enum svpattern pattern, uint64_t imm_factor) @@ -2629,25 +2630,25 @@ internal Arm64() { } /// int32_t svqdecd_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECD Xtied, Wtied, pattern, MUL #imm_factor /// - public static unsafe int SaturatingDecrementBy64BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy64BitElementCount(value, scale, pattern); + public static unsafe int SaturatingDecrementBy64BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (int)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern))); /// /// int64_t svqdecd_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECD Xtied, pattern, MUL #imm_factor /// - public static unsafe long SaturatingDecrementBy64BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy64BitElementCount(value, scale, pattern); + public static unsafe long SaturatingDecrementBy64BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (long)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern))); /// /// uint32_t svqdecd_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECD Wtied, pattern, MUL #imm_factor /// - public static unsafe uint SaturatingDecrementBy64BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy64BitElementCount(value, scale, pattern); + public static unsafe uint SaturatingDecrementBy64BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (uint)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern))); /// /// uint64_t svqdecd_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECD Xtied, pattern, MUL #imm_factor /// - public static unsafe ulong SaturatingDecrementBy64BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy64BitElementCount(value, scale, pattern); + public static unsafe ulong SaturatingDecrementBy64BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (ulong)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern))); /// /// svint64_t svqdecd_pat[_s64](svint64_t op, enum svpattern pattern, uint64_t imm_factor) @@ -2668,162 +2669,25 @@ internal Arm64() { } /// int32_t svqdecb_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECB Xtied, Wtied, pattern, MUL #imm_factor /// - public static unsafe int SaturatingDecrementBy8BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy8BitElementCount(value, scale, pattern); + public static unsafe int SaturatingDecrementBy8BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (int)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(byte), pattern))); /// /// int64_t svqdecb_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECB Xtied, pattern, MUL #imm_factor /// - public static unsafe long SaturatingDecrementBy8BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy8BitElementCount(value, scale, pattern); + public static unsafe long SaturatingDecrementBy8BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (long)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(byte), pattern))); /// /// uint32_t svqdecb_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECB Wtied, pattern, MUL #imm_factor /// - public static unsafe uint SaturatingDecrementBy8BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy8BitElementCount(value, scale, pattern); + public static unsafe uint SaturatingDecrementBy8BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (uint)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(byte), pattern))); /// /// uint64_t svqdecb_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECB Xtied, pattern, MUL #imm_factor /// - public static unsafe ulong SaturatingDecrementBy8BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy8BitElementCount(value, scale, pattern); - - - /// Saturating decrement by active element count - - /// - /// int32_t svqdecp[_n_s32]_b8(int32_t op, svbool_t pg) - /// SQDECP Xtied, Pg.B, Wtied - /// - public static unsafe int SaturatingDecrementByActiveElementCount(int value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); - - /// - /// int64_t svqdecp[_n_s64]_b8(int64_t op, svbool_t pg) - /// SQDECP Xtied, Pg.B - /// - public static unsafe long SaturatingDecrementByActiveElementCount(long value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); - - /// - /// uint32_t svqdecp[_n_u32]_b8(uint32_t op, svbool_t pg) - /// UQDECP Wtied, Pg.B - /// - public static unsafe uint SaturatingDecrementByActiveElementCount(uint value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); - - /// - /// uint64_t svqdecp[_n_u64]_b8(uint64_t op, svbool_t pg) - /// UQDECP Xtied, Pg.B - /// - public static unsafe ulong SaturatingDecrementByActiveElementCount(ulong value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); - - /// - /// svint16_t svqdecp[_s16](svint16_t op, svbool_t pg) - /// SQDECP Ztied.H, Pg - /// - public static unsafe Vector SaturatingDecrementByActiveElementCount(Vector value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); - - /// - /// svint32_t svqdecp[_s32](svint32_t op, svbool_t pg) - /// SQDECP Ztied.S, Pg - /// - public static unsafe Vector SaturatingDecrementByActiveElementCount(Vector value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); - - /// - /// svint64_t svqdecp[_s64](svint64_t op, svbool_t pg) - /// SQDECP Ztied.D, Pg - /// - public static unsafe Vector SaturatingDecrementByActiveElementCount(Vector value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); - - /// - /// int32_t svqdecp[_n_s32]_b16(int32_t op, svbool_t pg) - /// SQDECP Xtied, Pg.H, Wtied - /// - public static unsafe int SaturatingDecrementByActiveElementCount(int value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); - - /// - /// int64_t svqdecp[_n_s64]_b16(int64_t op, svbool_t pg) - /// SQDECP Xtied, Pg.H - /// - public static unsafe long SaturatingDecrementByActiveElementCount(long value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); - - /// - /// uint32_t svqdecp[_n_u32]_b16(uint32_t op, svbool_t pg) - /// UQDECP Wtied, Pg.H - /// - public static unsafe uint SaturatingDecrementByActiveElementCount(uint value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); - - /// - /// uint64_t svqdecp[_n_u64]_b16(uint64_t op, svbool_t pg) - /// UQDECP Xtied, Pg.H - /// - public static unsafe ulong SaturatingDecrementByActiveElementCount(ulong value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); - - /// - /// svuint16_t svqdecp[_u16](svuint16_t op, svbool_t pg) - /// UQDECP Ztied.H, Pg - /// - public static unsafe Vector SaturatingDecrementByActiveElementCount(Vector value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); - - /// - /// int32_t svqdecp[_n_s32]_b32(int32_t op, svbool_t pg) - /// SQDECP Xtied, Pg.S, Wtied - /// - public static unsafe int SaturatingDecrementByActiveElementCount(int value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); - - /// - /// int64_t svqdecp[_n_s64]_b32(int64_t op, svbool_t pg) - /// SQDECP Xtied, Pg.S - /// - public static unsafe long SaturatingDecrementByActiveElementCount(long value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); - - /// - /// uint32_t svqdecp[_n_u32]_b32(uint32_t op, svbool_t pg) - /// UQDECP Wtied, Pg.S - /// - public static unsafe uint SaturatingDecrementByActiveElementCount(uint value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); - - /// - /// uint64_t svqdecp[_n_u64]_b32(uint64_t op, svbool_t pg) - /// UQDECP Xtied, Pg.S - /// - public static unsafe ulong SaturatingDecrementByActiveElementCount(ulong value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); - - /// - /// svuint32_t svqdecp[_u32](svuint32_t op, svbool_t pg) - /// UQDECP Ztied.S, Pg - /// MOVPRFX Zresult, Zop; UQDECP Zresult.S, Pg - /// - public static unsafe Vector SaturatingDecrementByActiveElementCount(Vector value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); - - /// - /// int32_t svqdecp[_n_s32]_b64(int32_t op, svbool_t pg) - /// SQDECP Xtied, Pg.D, Wtied - /// - public static unsafe int SaturatingDecrementByActiveElementCount(int value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); - - /// - /// int64_t svqdecp[_n_s64]_b64(int64_t op, svbool_t pg) - /// SQDECP Xtied, Pg.D - /// - public static unsafe long SaturatingDecrementByActiveElementCount(long value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); - - /// - /// uint32_t svqdecp[_n_u32]_b64(uint32_t op, svbool_t pg) - /// UQDECP Wtied, Pg.D - /// - public static unsafe uint SaturatingDecrementByActiveElementCount(uint value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); - - /// - /// uint64_t svqdecp[_n_u64]_b64(uint64_t op, svbool_t pg) - /// UQDECP Xtied, Pg.D - /// - public static unsafe ulong SaturatingDecrementByActiveElementCount(ulong value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); - - /// - /// svuint64_t svqdecp[_u64](svuint64_t op, svbool_t pg) - /// UQDECP Ztied.D, Pg - /// - public static unsafe Vector SaturatingDecrementByActiveElementCount(Vector value, Vector from) => SaturatingDecrementByActiveElementCount(value, from); - + public static unsafe ulong SaturatingDecrementBy8BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (ulong)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(byte), pattern))); /// Saturating increment by number of halfword elements @@ -2831,25 +2695,25 @@ internal Arm64() { } /// int32_t svqinch_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCH Xtied, Wtied, pattern, MUL #imm_factor /// - public static unsafe int SaturatingIncrementBy16BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy16BitElementCount(value, scale, pattern); + public static unsafe int SaturatingIncrementBy16BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (int)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern))); /// /// int64_t svqinch_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCH Xtied, pattern, MUL #imm_factor /// - public static unsafe long SaturatingIncrementBy16BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy16BitElementCount(value, scale, pattern); + public static unsafe long SaturatingIncrementBy16BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (long)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern))); /// /// uint32_t svqinch_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCH Wtied, pattern, MUL #imm_factor /// - public static unsafe uint SaturatingIncrementBy16BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy16BitElementCount(value, scale, pattern); + public static unsafe uint SaturatingIncrementBy16BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (uint)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern))); /// /// uint64_t svqinch_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCH Xtied, pattern, MUL #imm_factor /// - public static unsafe ulong SaturatingIncrementBy16BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy16BitElementCount(value, scale, pattern); + public static unsafe ulong SaturatingIncrementBy16BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (ulong)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern))); /// /// svint16_t svqinch_pat[_s16](svint16_t op, enum svpattern pattern, uint64_t imm_factor) @@ -2870,25 +2734,25 @@ internal Arm64() { } /// int32_t svqincw_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCW Xtied, Wtied, pattern, MUL #imm_factor /// - public static unsafe int SaturatingIncrementBy32BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy32BitElementCount(value, scale, pattern); + public static unsafe int SaturatingIncrementBy32BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (int)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern))); /// /// int64_t svqincw_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCW Xtied, pattern, MUL #imm_factor /// - public static unsafe long SaturatingIncrementBy32BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy32BitElementCount(value, scale, pattern); + public static unsafe long SaturatingIncrementBy32BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (long)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern))); /// /// uint32_t svqincw_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCW Wtied, pattern, MUL #imm_factor /// - public static unsafe uint SaturatingIncrementBy32BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy32BitElementCount(value, scale, pattern); + public static unsafe uint SaturatingIncrementBy32BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (uint)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern))); /// /// uint64_t svqincw_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCW Xtied, pattern, MUL #imm_factor /// - public static unsafe ulong SaturatingIncrementBy32BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy32BitElementCount(value, scale, pattern); + public static unsafe ulong SaturatingIncrementBy32BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (ulong)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern))); /// /// svint32_t svqincw_pat[_s32](svint32_t op, enum svpattern pattern, uint64_t imm_factor) @@ -2909,25 +2773,25 @@ internal Arm64() { } /// int32_t svqincd_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCD Xtied, Wtied, pattern, MUL #imm_factor /// - public static unsafe int SaturatingIncrementBy64BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy64BitElementCount(value, scale, pattern); + public static unsafe int SaturatingIncrementBy64BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (int)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern))); /// /// int64_t svqincd_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCD Xtied, pattern, MUL #imm_factor /// - public static unsafe long SaturatingIncrementBy64BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy64BitElementCount(value, scale, pattern); + public static unsafe long SaturatingIncrementBy64BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (long)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern))); /// /// uint32_t svqincd_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCD Wtied, pattern, MUL #imm_factor /// - public static unsafe uint SaturatingIncrementBy64BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy64BitElementCount(value, scale, pattern); + public static unsafe uint SaturatingIncrementBy64BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (uint)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern))); /// /// uint64_t svqincd_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCD Xtied, pattern, MUL #imm_factor /// - public static unsafe ulong SaturatingIncrementBy64BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy64BitElementCount(value, scale, pattern); + public static unsafe ulong SaturatingIncrementBy64BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (ulong)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern))); /// /// svint64_t svqincd_pat[_s64](svint64_t op, enum svpattern pattern, uint64_t imm_factor) @@ -2948,160 +2812,24 @@ internal Arm64() { } /// int32_t svqincb_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCB Xtied, Wtied, pattern, MUL #imm_factor /// - public static unsafe int SaturatingIncrementBy8BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy8BitElementCount(value, scale, pattern); + public static unsafe int SaturatingIncrementBy8BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (int)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(byte), pattern))); /// /// int64_t svqincb_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCB Xtied, pattern, MUL #imm_factor /// - public static unsafe long SaturatingIncrementBy8BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy8BitElementCount(value, scale, pattern); - + public static unsafe long SaturatingIncrementBy8BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (long)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(byte), pattern))); /// /// uint32_t svqincb_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCB Wtied, pattern, MUL #imm_factor /// - public static unsafe uint SaturatingIncrementBy8BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy8BitElementCount(value, scale, pattern); + public static unsafe uint SaturatingIncrementBy8BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (uint)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(byte), pattern))); /// /// uint64_t svqincb_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCB Xtied, pattern, MUL #imm_factor /// - public static unsafe ulong SaturatingIncrementBy8BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy8BitElementCount(value, scale, pattern); - - - /// Saturating increment by active element count - - /// - /// int32_t svqincp[_n_s32]_b8(int32_t op, svbool_t pg) - /// SQINCP Xtied, Pg.B, Wtied - /// - public static unsafe int SaturatingIncrementByActiveElementCount(int value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); - - /// - /// int64_t svqincp[_n_s64]_b8(int64_t op, svbool_t pg) - /// SQINCP Xtied, Pg.B - /// - public static unsafe long SaturatingIncrementByActiveElementCount(long value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); - - /// - /// uint32_t svqincp[_n_u32]_b8(uint32_t op, svbool_t pg) - /// UQINCP Wtied, Pg.B - /// - public static unsafe uint SaturatingIncrementByActiveElementCount(uint value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); - - /// - /// uint64_t svqincp[_n_u64]_b8(uint64_t op, svbool_t pg) - /// UQINCP Xtied, Pg.B - /// - public static unsafe ulong SaturatingIncrementByActiveElementCount(ulong value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); - - /// - /// svint16_t svqincp[_s16](svint16_t op, svbool_t pg) - /// SQINCP Ztied.H, Pg - /// - public static unsafe Vector SaturatingIncrementByActiveElementCount(Vector value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); - - /// - /// svint32_t svqincp[_s32](svint32_t op, svbool_t pg) - /// SQINCP Ztied.S, Pg - /// - public static unsafe Vector SaturatingIncrementByActiveElementCount(Vector value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); - - /// - /// svint64_t svqincp[_s64](svint64_t op, svbool_t pg) - /// SQINCP Ztied.D, Pg - /// - public static unsafe Vector SaturatingIncrementByActiveElementCount(Vector value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); - - /// - /// int32_t svqincp[_n_s32]_b16(int32_t op, svbool_t pg) - /// SQINCP Xtied, Pg.H, Wtied - /// - public static unsafe int SaturatingIncrementByActiveElementCount(int value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); - - /// - /// int64_t svqincp[_n_s64]_b16(int64_t op, svbool_t pg) - /// SQINCP Xtied, Pg.H - /// - public static unsafe long SaturatingIncrementByActiveElementCount(long value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); - - /// - /// uint32_t svqincp[_n_u32]_b16(uint32_t op, svbool_t pg) - /// UQINCP Wtied, Pg.H - /// - public static unsafe uint SaturatingIncrementByActiveElementCount(uint value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); - - /// - /// uint64_t svqincp[_n_u64]_b16(uint64_t op, svbool_t pg) - /// UQINCP Xtied, Pg.H - /// - public static unsafe ulong SaturatingIncrementByActiveElementCount(ulong value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); - - /// - /// svuint16_t svqincp[_u16](svuint16_t op, svbool_t pg) - /// UQINCP Ztied.H, Pg - /// - public static unsafe Vector SaturatingIncrementByActiveElementCount(Vector value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); - - /// - /// int32_t svqincp[_n_s32]_b32(int32_t op, svbool_t pg) - /// SQINCP Xtied, Pg.S, Wtied - /// - public static unsafe int SaturatingIncrementByActiveElementCount(int value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); - - /// - /// int64_t svqincp[_n_s64]_b32(int64_t op, svbool_t pg) - /// SQINCP Xtied, Pg.S - /// - public static unsafe long SaturatingIncrementByActiveElementCount(long value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); - - /// - /// uint32_t svqincp[_n_u32]_b32(uint32_t op, svbool_t pg) - /// UQINCP Wtied, Pg.S - /// - public static unsafe uint SaturatingIncrementByActiveElementCount(uint value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); - - /// - /// uint64_t svqincp[_n_u64]_b32(uint64_t op, svbool_t pg) - /// UQINCP Xtied, Pg.S - /// - public static unsafe ulong SaturatingIncrementByActiveElementCount(ulong value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); - - /// - /// svuint32_t svqincp[_u32](svuint32_t op, svbool_t pg) - /// UQINCP Ztied.S, Pg - /// - public static unsafe Vector SaturatingIncrementByActiveElementCount(Vector value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); - - /// - /// int32_t svqincp[_n_s32]_b64(int32_t op, svbool_t pg) - /// SQINCP Xtied, Pg.D, Wtied - /// - public static unsafe int SaturatingIncrementByActiveElementCount(int value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); - - /// - /// int64_t svqincp[_n_s64]_b64(int64_t op, svbool_t pg) - /// SQINCP Xtied, Pg.D - /// - public static unsafe long SaturatingIncrementByActiveElementCount(long value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); - - /// - /// uint32_t svqincp[_n_u32]_b64(uint32_t op, svbool_t pg) - /// UQINCP Wtied, Pg.D - /// - public static unsafe uint SaturatingIncrementByActiveElementCount(uint value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); - - /// - /// uint64_t svqincp[_n_u64]_b64(uint64_t op, svbool_t pg) - /// UQINCP Xtied, Pg.D - /// - public static unsafe ulong SaturatingIncrementByActiveElementCount(ulong value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); - - /// - /// svuint64_t svqincp[_u64](svuint64_t op, svbool_t pg) - /// UQINCP Ztied.D, Pg - /// - public static unsafe Vector SaturatingIncrementByActiveElementCount(Vector value, Vector from) => SaturatingIncrementByActiveElementCount(value, from); + public static unsafe ulong SaturatingIncrementBy8BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (ulong)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(byte), pattern))); /// SignExtend16 : Sign-extend the low 16 bits @@ -3945,5 +3673,110 @@ internal Arm64() { } /// ZIP1 Presult.D, Pop1.D, Pop2.D /// public static unsafe Vector ZipLow(Vector left, Vector right) => ZipLow(left, right); + + + + private static int AddSaturateScalar(int left, int right) + { + int result = (int)(left + right); + bool overflow = (right < 0) ? (result > left) : (result < right); + return overflow ? (result > 0 ? int.MinValue : int.MaxValue) : result; + } + + private static long AddSaturateScalar(long left, long right) + { + long result = (long)(left + right); + bool overflow = (right < 0) ? (result > left) : (result < right); + return overflow ? (result > 0 ? long.MinValue : long.MaxValue) : result; + } + + private static uint AddSaturateScalar(uint left, uint right) + { + uint result = (uint)(left + right); + bool overflow = (result < left); + return overflow ? uint.MaxValue : result; + } + + private static ulong AddSaturateScalar(ulong left, ulong right) + { + ulong result = (ulong)(left + right); + bool overflow = (result < left); + return overflow ? ulong.MaxValue : result; + } + + private static int SubtractSaturateScalar(int left, int right) + { + int result = (int)(left - right); + bool overflow = (right < 0) ? (result < left) : (result > left); + return overflow ? (result > 0 ? int.MinValue : int.MaxValue) : result; + } + + private static long SubtractSaturateScalar(long left, long right) + { + long result = (long)(left - right); + bool overflow = (right < 0) ? (result < left) : (result > left); + return overflow ? (result > 0 ? long.MinValue : long.MaxValue) : result; + } + + private static uint SubtractSaturateScalar(uint left, uint right) + { + uint result = (uint)(left - right); + bool overflow = (left < right); + return overflow ? uint.MinValue : result; + } + + private static ulong SubtractSaturateScalar(ulong left, ulong right) + { + ulong result = (ulong)(left - right); + bool overflow = (left < right); + return overflow ? ulong.MinValue : result; + } + + // Given a vector length for a given type, return the number of elements when pattern is applied + private static int decodePredicateCount(int totalElems, SveMaskPattern pattern) + { + switch(pattern) + { + case SveMaskPattern.LargestPowerOf2: + int ret = 1; + while (totalElems >= (2^ret)) { ret++; } + return 2^(ret - 1); + case SveMaskPattern.VectorCount1: + return (totalElems > 1) ? 1 : 0; + case SveMaskPattern.VectorCount2: + return (totalElems > 2) ? 2 : 0; + case SveMaskPattern.VectorCount3: + return (totalElems > 3) ? 3 : 0; + case SveMaskPattern.VectorCount4: + return (totalElems > 4) ? 4 : 0; + case SveMaskPattern.VectorCount5: + return (totalElems > 5) ? 5 : 0; + case SveMaskPattern.VectorCount6: + return (totalElems > 6) ? 6 : 0; + case SveMaskPattern.VectorCount7: + return (totalElems > 7) ? 7 : 0; + case SveMaskPattern.VectorCount8: + return (totalElems > 8) ? 8 : 0; + case SveMaskPattern.VectorCount16: + return (totalElems > 16) ? 16 : 0; + case SveMaskPattern.VectorCount32: + return (totalElems > 32) ? 32 : 0; + case SveMaskPattern.VectorCount64: + return (totalElems > 64) ? 64 : 0; + case SveMaskPattern.VectorCount128: + return (totalElems > 128) ? 128 : 0; + case SveMaskPattern.VectorCount256: + return (totalElems > 256) ? 256 : 0; + case SveMaskPattern.LargestMultipleOf4: + return totalElems - (totalElems % 4); + case SveMaskPattern.LargestMultipleOf3: + return totalElems - (totalElems % 3); + case SveMaskPattern.All: + return totalElems; + default: + break; + } + return 0; + } } } 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 05eb2213e2cd3d..8ce0671b23416e 100644 --- a/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs +++ b/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs @@ -4531,28 +4531,7 @@ internal Arm64() { } public static long SaturatingDecrementBy8BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } public static uint SaturatingDecrementBy8BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } public static ulong SaturatingDecrementBy8BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } - public static int SaturatingDecrementByActiveElementCount(int value, System.Numerics.Vector from) { throw null; } - public static long SaturatingDecrementByActiveElementCount(long value, System.Numerics.Vector from) { throw null; } - public static uint SaturatingDecrementByActiveElementCount(uint value, System.Numerics.Vector from) { throw null; } - public static ulong SaturatingDecrementByActiveElementCount(ulong value, System.Numerics.Vector from) { throw null; } - public static System.Numerics.Vector SaturatingDecrementByActiveElementCount(System.Numerics.Vector value, System.Numerics.Vector from) { throw null; } - public static System.Numerics.Vector SaturatingDecrementByActiveElementCount(System.Numerics.Vector value, System.Numerics.Vector from) { throw null; } - public static System.Numerics.Vector SaturatingDecrementByActiveElementCount(System.Numerics.Vector value, System.Numerics.Vector from) { throw null; } - public static int SaturatingDecrementByActiveElementCount(int value, System.Numerics.Vector from) { throw null; } - public static long SaturatingDecrementByActiveElementCount(long value, System.Numerics.Vector from) { throw null; } - public static uint SaturatingDecrementByActiveElementCount(uint value, System.Numerics.Vector from) { throw null; } - public static ulong SaturatingDecrementByActiveElementCount(ulong value, System.Numerics.Vector from) { throw null; } - public static System.Numerics.Vector SaturatingDecrementByActiveElementCount(System.Numerics.Vector value, System.Numerics.Vector from) { throw null; } - public static int SaturatingDecrementByActiveElementCount(int value, System.Numerics.Vector from) { throw null; } - public static long SaturatingDecrementByActiveElementCount(long value, System.Numerics.Vector from) { throw null; } - public static uint SaturatingDecrementByActiveElementCount(uint value, System.Numerics.Vector from) { throw null; } - public static ulong SaturatingDecrementByActiveElementCount(ulong value, System.Numerics.Vector from) { throw null; } - public static System.Numerics.Vector SaturatingDecrementByActiveElementCount(System.Numerics.Vector value, System.Numerics.Vector from) { throw null; } - public static int SaturatingDecrementByActiveElementCount(int value, System.Numerics.Vector from) { throw null; } - public static long SaturatingDecrementByActiveElementCount(long value, System.Numerics.Vector from) { throw null; } - public static uint SaturatingDecrementByActiveElementCount(uint value, System.Numerics.Vector from) { throw null; } - public static ulong SaturatingDecrementByActiveElementCount(ulong value, System.Numerics.Vector from) { throw null; } - public static System.Numerics.Vector SaturatingDecrementByActiveElementCount(System.Numerics.Vector value, System.Numerics.Vector from) { throw null; } + public static int SaturatingIncrementBy16BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } public static long SaturatingIncrementBy16BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } public static uint SaturatingIncrementBy16BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } @@ -4579,25 +4558,7 @@ internal Arm64() { } public static long SaturatingIncrementByActiveElementCount(long value, System.Numerics.Vector from) { throw null; } public static uint SaturatingIncrementByActiveElementCount(uint value, System.Numerics.Vector from) { throw null; } public static ulong SaturatingIncrementByActiveElementCount(ulong value, System.Numerics.Vector from) { throw null; } - public static System.Numerics.Vector SaturatingIncrementByActiveElementCount(System.Numerics.Vector value, System.Numerics.Vector from) { throw null; } - public static System.Numerics.Vector SaturatingIncrementByActiveElementCount(System.Numerics.Vector value, System.Numerics.Vector from) { throw null; } - public static System.Numerics.Vector SaturatingIncrementByActiveElementCount(System.Numerics.Vector value, System.Numerics.Vector from) { throw null; } - public static int SaturatingIncrementByActiveElementCount(int value, System.Numerics.Vector from) { throw null; } - public static long SaturatingIncrementByActiveElementCount(long value, System.Numerics.Vector from) { throw null; } - public static uint SaturatingIncrementByActiveElementCount(uint value, System.Numerics.Vector from) { throw null; } - public static ulong SaturatingIncrementByActiveElementCount(ulong value, System.Numerics.Vector from) { throw null; } - public static System.Numerics.Vector SaturatingIncrementByActiveElementCount(System.Numerics.Vector value, System.Numerics.Vector from) { throw null; } - public static int SaturatingIncrementByActiveElementCount(int value, System.Numerics.Vector from) { throw null; } - public static long SaturatingIncrementByActiveElementCount(long value, System.Numerics.Vector from) { throw null; } - public static uint SaturatingIncrementByActiveElementCount(uint value, System.Numerics.Vector from) { throw null; } - public static ulong SaturatingIncrementByActiveElementCount(ulong value, System.Numerics.Vector from) { throw null; } - public static System.Numerics.Vector SaturatingIncrementByActiveElementCount(System.Numerics.Vector value, System.Numerics.Vector from) { throw null; } - public static int SaturatingIncrementByActiveElementCount(int value, System.Numerics.Vector from) { throw null; } - public static long SaturatingIncrementByActiveElementCount(long value, System.Numerics.Vector from) { throw null; } - public static uint SaturatingIncrementByActiveElementCount(uint value, System.Numerics.Vector from) { throw null; } - public static ulong SaturatingIncrementByActiveElementCount(ulong value, System.Numerics.Vector from) { throw null; } - public static System.Numerics.Vector SaturatingIncrementByActiveElementCount(System.Numerics.Vector value, System.Numerics.Vector from) { throw null; } - + public static System.Numerics.Vector SignExtend16(System.Numerics.Vector value) { throw null; } public static System.Numerics.Vector SignExtend16(System.Numerics.Vector value) { throw null; } public static System.Numerics.Vector SignExtend32(System.Numerics.Vector value) { throw null; } diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/ScalarImm2UnOpTest.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/ScalarImm2UnOpTest.template index 48486fd5a85a19..83e3cf0428517c 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/ScalarImm2UnOpTest.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/ScalarImm2UnOpTest.template @@ -31,7 +31,7 @@ namespace JIT.HardwareIntrinsics.Arm test.RunBasicScenario_UnsafeRead(); // Validates calling via reflection works, using Unsafe.ReadUnaligned - // test.RunReflectionScenario_UnsafeRead(); + test.RunReflectionScenario_UnsafeRead(); // Validates passing a local works, using Unsafe.ReadUnaligned test.RunLclVarScenario_UnsafeRead(); From a40951f2315950bdd524818c5588e99e3546361d Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Fri, 17 May 2024 17:16:47 +0100 Subject: [PATCH 03/29] Add fallback for vector variants --- .../src/System/Runtime/Intrinsics/Arm/Sve.cs | 24 +++++++++---------- .../_SveImm2UnaryOpTestTemplate.template | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) 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 bfa4d436c7cf5d..e4148cdd0cfa8d 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 @@ -2575,13 +2575,13 @@ internal Arm64() { } /// svint16_t svqdech_pat[_s16](svint16_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECH Ztied.H, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingDecrementBy16BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy16BitElementCount(value, scale, pattern); + public static unsafe Vector SaturatingDecrementBy16BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturate(value, new Vector((short)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern)))); /// /// svuint16_t svqdech_pat[_u16](svuint16_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECH Ztied.H, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingDecrementBy16BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy16BitElementCount(value, scale, pattern); + public static unsafe Vector SaturatingDecrementBy16BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturate(value, new Vector((ushort)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern)))); /// Saturating decrement by number of word elements @@ -2615,13 +2615,13 @@ internal Arm64() { } /// svint32_t svqdecw_pat[_s32](svint32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECW Ztied.S, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingDecrementBy32BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy32BitElementCount(value, scale, pattern); + public static unsafe Vector SaturatingDecrementBy32BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturate(value, new Vector((int)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern)))); /// /// svuint32_t svqdecw_pat[_u32](svuint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECW Ztied.S, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingDecrementBy32BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy32BitElementCount(value, scale, pattern); + public static unsafe Vector SaturatingDecrementBy32BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturate(value, new Vector((uint)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern)))); /// Saturating decrement by number of doubleword elements @@ -2654,13 +2654,13 @@ internal Arm64() { } /// svint64_t svqdecd_pat[_s64](svint64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECD Ztied.D, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingDecrementBy64BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy64BitElementCount(value, scale, pattern); + public static unsafe Vector SaturatingDecrementBy64BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturate(value, new Vector((long)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern)))); /// /// svuint64_t svqdecd_pat[_u64](svuint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECD Ztied.D, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingDecrementBy64BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy64BitElementCount(value, scale, pattern); + public static unsafe Vector SaturatingDecrementBy64BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturate(value, new Vector((ulong)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern)))); /// Saturating decrement by number of byte elements @@ -2719,13 +2719,13 @@ internal Arm64() { } /// svint16_t svqinch_pat[_s16](svint16_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCH Ztied.H, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingIncrementBy16BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy16BitElementCount(value, scale, pattern); + public static unsafe Vector SaturatingIncrementBy16BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturate(value, new Vector((short)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern)))); /// /// svuint16_t svqinch_pat[_u16](svuint16_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCH Ztied.H, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingIncrementBy16BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy16BitElementCount(value, scale, pattern); + public static unsafe Vector SaturatingIncrementBy16BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturate(value, new Vector((ushort)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern)))); /// Saturating increment by number of word elements @@ -2758,13 +2758,13 @@ internal Arm64() { } /// svint32_t svqincw_pat[_s32](svint32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCW Ztied.S, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingIncrementBy32BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy32BitElementCount(value, scale, pattern); + public static unsafe Vector SaturatingIncrementBy32BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturate(value, new Vector((int)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern)))); /// /// svuint32_t svqincw_pat[_u32](svuint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCW Ztied.S, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingIncrementBy32BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy32BitElementCount(value, scale, pattern); + public static unsafe Vector SaturatingIncrementBy32BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturate(value, new Vector((uint)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern)))); /// Saturating increment by number of doubleword elements @@ -2797,13 +2797,13 @@ internal Arm64() { } /// svint64_t svqincd_pat[_s64](svint64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCD Ztied.D, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingIncrementBy64BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy64BitElementCount(value, scale, pattern); + public static unsafe Vector SaturatingIncrementBy64BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturate(value, new Vector((long)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern)))); /// /// svuint64_t svqincd_pat[_u64](svuint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCD Ztied.D, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingIncrementBy64BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy64BitElementCount(value, scale, pattern); + public static unsafe Vector SaturatingIncrementBy64BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturate(value, new Vector((ulong)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern)))); /// Saturating increment by number of byte elements diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveImm2UnaryOpTestTemplate.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveImm2UnaryOpTestTemplate.template index c3a9d79b8b9a5a..7b711084591b98 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveImm2UnaryOpTestTemplate.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveImm2UnaryOpTestTemplate.template @@ -37,7 +37,7 @@ namespace JIT.HardwareIntrinsics.Arm } // Validates calling via reflection works, using Unsafe.Read - // test.RunReflectionScenario_UnsafeRead(); + test.RunReflectionScenario_UnsafeRead(); // Validates passing a local works, using Unsafe.Read test.RunLclVarScenario_UnsafeRead(); From a43e87035edf5a7f2dd672ae50a6e135dd02eaae Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Mon, 20 May 2024 14:02:01 +0100 Subject: [PATCH 04/29] HW_Flag_HasScalarVariant comment --- src/coreclr/jit/hwintrinsic.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/coreclr/jit/hwintrinsic.h b/src/coreclr/jit/hwintrinsic.h index 8e171c29ebb581..554e56228e777b 100644 --- a/src/coreclr/jit/hwintrinsic.h +++ b/src/coreclr/jit/hwintrinsic.h @@ -232,6 +232,8 @@ enum HWIntrinsicFlag : unsigned int // The intrinsic has an enum operand. Using this implies HW_Flag_HasImmediateOperand. HW_Flag_HasEnumOperand = 0x1000000, + // The intrinsic comes in both vector and scalar variants. During the import stage if the basetype is scalar, + // then the intrinsic should be switched to a scalar only version. HW_Flag_HasScalarVariant = 0x2000000, #endif // TARGET_XARCH From e7001118a2f4a6e9dfa5e80d8a90015166c1f28e Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Mon, 20 May 2024 15:07:46 +0100 Subject: [PATCH 05/29] Add IsCnsIntOrI asserts --- src/coreclr/jit/hwintrinsiccodegenarm64.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp index 40245c8be0524c..930ec43849919a 100644 --- a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp +++ b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp @@ -1732,6 +1732,8 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) // and can be used directly (instead of via HWIntrinsicImmOpHelper). assert(hasImmediateOperand); + assert(intrin.op2->IsCnsIntOrI()); + assert(intrin.op3->IsCnsIntOrI()); int scale = (int)intrin.op2->AsIntCon()->gtIconVal; insSvePattern pattern = (insSvePattern)intrin.op3->AsIntCon()->gtIconVal; @@ -1757,6 +1759,8 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) // and can be used directly (instead of via HWIntrinsicImmOpHelper). assert(hasImmediateOperand); + assert(intrin.op2->IsCnsIntOrI()); + assert(intrin.op3->IsCnsIntOrI()); int scale = (int)intrin.op2->AsIntCon()->gtIconVal; insSvePattern pattern = (insSvePattern)intrin.op3->AsIntCon()->gtIconVal; From a6cb5e383d146a66b44402443ef18087ec2d3144 Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Mon, 20 May 2024 15:14:36 +0100 Subject: [PATCH 06/29] Simpler SubtractSaturateScalar() --- .../src/System/Runtime/Intrinsics/Arm/Sve.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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 e4148cdd0cfa8d..1edb524e71560e 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 @@ -3720,16 +3720,12 @@ private static long SubtractSaturateScalar(long left, long right) private static uint SubtractSaturateScalar(uint left, uint right) { - uint result = (uint)(left - right); - bool overflow = (left < right); - return overflow ? uint.MinValue : result; + return (left < right) ? uint.MinValue : (left - right); } private static ulong SubtractSaturateScalar(ulong left, ulong right) { - ulong result = (ulong)(left - right); - bool overflow = (left < right); - return overflow ? ulong.MinValue : result; + return (left < right) ? ulong.MinValue : (left - right); } // Given a vector length for a given type, return the number of elements when pattern is applied From 1e6082f2bd7436a982a05abcf8cb2fe43debd5d4 Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Mon, 20 May 2024 15:22:17 +0100 Subject: [PATCH 07/29] Combine codegen cases --- src/coreclr/jit/hwintrinsiccodegenarm64.cpp | 40 +++++++-------------- 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp index 930ec43849919a..f6eed9386352b2 100644 --- a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp +++ b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp @@ -1713,6 +1713,18 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) INS_SCALABLE_OPTS_UNPREDICATED); break; + + case NI_Sve_SaturatingDecrementBy16BitElementCountScalar: + case NI_Sve_SaturatingDecrementBy32BitElementCountScalar: + case NI_Sve_SaturatingDecrementBy64BitElementCountScalar: + case NI_Sve_SaturatingIncrementBy16BitElementCountScalar: + case NI_Sve_SaturatingIncrementBy32BitElementCountScalar: + case NI_Sve_SaturatingIncrementBy64BitElementCountScalar: + // Use scalar sizes. + emitSize = emitActualTypeSize(node->gtType); + opt = INS_OPTS_NONE; + FALLTHROUGH; + case NI_Sve_SaturatingDecrementBy16BitElementCount: case NI_Sve_SaturatingDecrementBy32BitElementCount: case NI_Sve_SaturatingDecrementBy64BitElementCount: @@ -1737,38 +1749,10 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) int scale = (int)intrin.op2->AsIntCon()->gtIconVal; insSvePattern pattern = (insSvePattern)intrin.op3->AsIntCon()->gtIconVal; - // Use scalable vector sizes. GetEmitter()->emitIns_R_PATTERN_I(ins, emitSize, targetReg, pattern, scale, opt); break; } - case NI_Sve_SaturatingDecrementBy16BitElementCountScalar: - case NI_Sve_SaturatingDecrementBy32BitElementCountScalar: - case NI_Sve_SaturatingDecrementBy64BitElementCountScalar: - case NI_Sve_SaturatingIncrementBy16BitElementCountScalar: - case NI_Sve_SaturatingIncrementBy32BitElementCountScalar: - case NI_Sve_SaturatingIncrementBy64BitElementCountScalar: - { - assert(isRMW); - if (targetReg != op1Reg) - { - GetEmitter()->emitIns_Mov(INS_mov, emitTypeSize(node), targetReg, op1Reg, /* canSkip */ true); - } - - // Cannot use create a lookup table for 2 immediates. Therefore the immediates must be constants, - // and can be used directly (instead of via HWIntrinsicImmOpHelper). - - assert(hasImmediateOperand); - assert(intrin.op2->IsCnsIntOrI()); - assert(intrin.op3->IsCnsIntOrI()); - int scale = (int)intrin.op2->AsIntCon()->gtIconVal; - insSvePattern pattern = (insSvePattern)intrin.op3->AsIntCon()->gtIconVal; - - // Use scalar sizes. - emitSize = emitActualTypeSize(node->gtType); - GetEmitter()->emitIns_R_PATTERN_I(ins, emitSize, targetReg, pattern, scale); - break; - } default: unreached(); From 84a5d229594aa9de28a5fe086b859e4e1cffe9a2 Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Mon, 20 May 2024 15:26:18 +0100 Subject: [PATCH 08/29] Inline DecodePredicateCount() --- .../src/System/Runtime/Intrinsics/Arm/Sve.cs | 91 ++++++++++--------- 1 file changed, 46 insertions(+), 45 deletions(-) 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 1edb524e71560e..f770ce1aa72cb1 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 @@ -2551,37 +2551,37 @@ internal Arm64() { } /// int32_t svqdech_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECH Xtied, Wtied, pattern, MUL #imm_factor /// - public static unsafe int SaturatingDecrementBy16BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (int)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern))); + public static unsafe int SaturatingDecrementBy16BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (int)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern))); /// /// int64_t svqdech_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECH Xtied, pattern, MUL #imm_factor /// - public static unsafe long SaturatingDecrementBy16BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (long)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern))); + public static unsafe long SaturatingDecrementBy16BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (long)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern))); /// /// uint32_t svqdech_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECH Wtied, pattern, MUL #imm_factor /// - public static unsafe uint SaturatingDecrementBy16BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (uint)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern))); + public static unsafe uint SaturatingDecrementBy16BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (uint)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern))); /// /// uint64_t svqdech_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECH Xtied, pattern, MUL #imm_factor /// - public static unsafe ulong SaturatingDecrementBy16BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (ulong)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern))); + public static unsafe ulong SaturatingDecrementBy16BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (ulong)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern))); /// /// svint16_t svqdech_pat[_s16](svint16_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECH Ztied.H, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingDecrementBy16BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturate(value, new Vector((short)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern)))); + public static unsafe Vector SaturatingDecrementBy16BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturate(value, new Vector((short)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern)))); /// /// svuint16_t svqdech_pat[_u16](svuint16_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECH Ztied.H, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingDecrementBy16BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturate(value, new Vector((ushort)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern)))); + public static unsafe Vector SaturatingDecrementBy16BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturate(value, new Vector((ushort)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern)))); /// Saturating decrement by number of word elements @@ -2590,38 +2590,38 @@ internal Arm64() { } /// int32_t svqdecw_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECW Xtied, Wtied, pattern, MUL #imm_factor /// - public static unsafe int SaturatingDecrementBy32BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (int)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern))); + public static unsafe int SaturatingDecrementBy32BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (int)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern))); /// /// int64_t svqdecw_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECW Xtied, pattern, MUL #imm_factor /// - public static unsafe long SaturatingDecrementBy32BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (long)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern))); + public static unsafe long SaturatingDecrementBy32BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (long)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern))); /// /// uint32_t svqdecw_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECW Wtied, pattern, MUL #imm_factor /// - public static unsafe uint SaturatingDecrementBy32BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (uint)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern))); + public static unsafe uint SaturatingDecrementBy32BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (uint)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern))); /// /// uint64_t svqdecw_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECW Xtied, pattern, MUL #imm_factor /// - public static unsafe ulong SaturatingDecrementBy32BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (ulong)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern))); + public static unsafe ulong SaturatingDecrementBy32BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (ulong)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern))); /// /// svint32_t svqdecw_pat[_s32](svint32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECW Ztied.S, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingDecrementBy32BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturate(value, new Vector((int)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern)))); + public static unsafe Vector SaturatingDecrementBy32BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturate(value, new Vector((int)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern)))); /// /// svuint32_t svqdecw_pat[_u32](svuint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECW Ztied.S, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingDecrementBy32BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturate(value, new Vector((uint)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern)))); + public static unsafe Vector SaturatingDecrementBy32BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturate(value, new Vector((uint)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern)))); /// Saturating decrement by number of doubleword elements @@ -2630,37 +2630,37 @@ internal Arm64() { } /// int32_t svqdecd_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECD Xtied, Wtied, pattern, MUL #imm_factor /// - public static unsafe int SaturatingDecrementBy64BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (int)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern))); + public static unsafe int SaturatingDecrementBy64BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (int)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern))); /// /// int64_t svqdecd_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECD Xtied, pattern, MUL #imm_factor /// - public static unsafe long SaturatingDecrementBy64BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (long)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern))); + public static unsafe long SaturatingDecrementBy64BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (long)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern))); /// /// uint32_t svqdecd_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECD Wtied, pattern, MUL #imm_factor /// - public static unsafe uint SaturatingDecrementBy64BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (uint)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern))); + public static unsafe uint SaturatingDecrementBy64BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (uint)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern))); /// /// uint64_t svqdecd_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECD Xtied, pattern, MUL #imm_factor /// - public static unsafe ulong SaturatingDecrementBy64BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (ulong)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern))); + public static unsafe ulong SaturatingDecrementBy64BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (ulong)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern))); /// /// svint64_t svqdecd_pat[_s64](svint64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECD Ztied.D, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingDecrementBy64BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturate(value, new Vector((long)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern)))); + public static unsafe Vector SaturatingDecrementBy64BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturate(value, new Vector((long)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern)))); /// /// svuint64_t svqdecd_pat[_u64](svuint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECD Ztied.D, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingDecrementBy64BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturate(value, new Vector((ulong)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern)))); + public static unsafe Vector SaturatingDecrementBy64BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturate(value, new Vector((ulong)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern)))); /// Saturating decrement by number of byte elements @@ -2669,25 +2669,25 @@ internal Arm64() { } /// int32_t svqdecb_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECB Xtied, Wtied, pattern, MUL #imm_factor /// - public static unsafe int SaturatingDecrementBy8BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (int)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(byte), pattern))); + public static unsafe int SaturatingDecrementBy8BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (int)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(byte), pattern))); /// /// int64_t svqdecb_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECB Xtied, pattern, MUL #imm_factor /// - public static unsafe long SaturatingDecrementBy8BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (long)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(byte), pattern))); + public static unsafe long SaturatingDecrementBy8BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (long)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(byte), pattern))); /// /// uint32_t svqdecb_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECB Wtied, pattern, MUL #imm_factor /// - public static unsafe uint SaturatingDecrementBy8BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (uint)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(byte), pattern))); + public static unsafe uint SaturatingDecrementBy8BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (uint)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(byte), pattern))); /// /// uint64_t svqdecb_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECB Xtied, pattern, MUL #imm_factor /// - public static unsafe ulong SaturatingDecrementBy8BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (ulong)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(byte), pattern))); + public static unsafe ulong SaturatingDecrementBy8BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (ulong)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(byte), pattern))); /// Saturating increment by number of halfword elements @@ -2695,37 +2695,37 @@ internal Arm64() { } /// int32_t svqinch_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCH Xtied, Wtied, pattern, MUL #imm_factor /// - public static unsafe int SaturatingIncrementBy16BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (int)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern))); + public static unsafe int SaturatingIncrementBy16BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (int)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern))); /// /// int64_t svqinch_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCH Xtied, pattern, MUL #imm_factor /// - public static unsafe long SaturatingIncrementBy16BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (long)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern))); + public static unsafe long SaturatingIncrementBy16BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (long)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern))); /// /// uint32_t svqinch_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCH Wtied, pattern, MUL #imm_factor /// - public static unsafe uint SaturatingIncrementBy16BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (uint)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern))); + public static unsafe uint SaturatingIncrementBy16BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (uint)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern))); /// /// uint64_t svqinch_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCH Xtied, pattern, MUL #imm_factor /// - public static unsafe ulong SaturatingIncrementBy16BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (ulong)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern))); + public static unsafe ulong SaturatingIncrementBy16BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (ulong)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern))); /// /// svint16_t svqinch_pat[_s16](svint16_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCH Ztied.H, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingIncrementBy16BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturate(value, new Vector((short)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern)))); + public static unsafe Vector SaturatingIncrementBy16BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturate(value, new Vector((short)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern)))); /// /// svuint16_t svqinch_pat[_u16](svuint16_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCH Ztied.H, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingIncrementBy16BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturate(value, new Vector((ushort)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern)))); + public static unsafe Vector SaturatingIncrementBy16BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturate(value, new Vector((ushort)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern)))); /// Saturating increment by number of word elements @@ -2734,37 +2734,37 @@ internal Arm64() { } /// int32_t svqincw_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCW Xtied, Wtied, pattern, MUL #imm_factor /// - public static unsafe int SaturatingIncrementBy32BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (int)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern))); + public static unsafe int SaturatingIncrementBy32BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (int)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern))); /// /// int64_t svqincw_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCW Xtied, pattern, MUL #imm_factor /// - public static unsafe long SaturatingIncrementBy32BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (long)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern))); + public static unsafe long SaturatingIncrementBy32BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (long)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern))); /// /// uint32_t svqincw_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCW Wtied, pattern, MUL #imm_factor /// - public static unsafe uint SaturatingIncrementBy32BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (uint)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern))); + public static unsafe uint SaturatingIncrementBy32BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (uint)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern))); /// /// uint64_t svqincw_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCW Xtied, pattern, MUL #imm_factor /// - public static unsafe ulong SaturatingIncrementBy32BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (ulong)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern))); + public static unsafe ulong SaturatingIncrementBy32BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (ulong)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern))); /// /// svint32_t svqincw_pat[_s32](svint32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCW Ztied.S, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingIncrementBy32BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturate(value, new Vector((int)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern)))); + public static unsafe Vector SaturatingIncrementBy32BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturate(value, new Vector((int)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern)))); /// /// svuint32_t svqincw_pat[_u32](svuint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCW Ztied.S, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingIncrementBy32BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturate(value, new Vector((uint)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern)))); + public static unsafe Vector SaturatingIncrementBy32BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturate(value, new Vector((uint)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern)))); /// Saturating increment by number of doubleword elements @@ -2773,37 +2773,37 @@ internal Arm64() { } /// int32_t svqincd_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCD Xtied, Wtied, pattern, MUL #imm_factor /// - public static unsafe int SaturatingIncrementBy64BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (int)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern))); + public static unsafe int SaturatingIncrementBy64BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (int)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern))); /// /// int64_t svqincd_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCD Xtied, pattern, MUL #imm_factor /// - public static unsafe long SaturatingIncrementBy64BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (long)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern))); + public static unsafe long SaturatingIncrementBy64BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (long)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern))); /// /// uint32_t svqincd_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCD Wtied, pattern, MUL #imm_factor /// - public static unsafe uint SaturatingIncrementBy64BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (uint)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern))); + public static unsafe uint SaturatingIncrementBy64BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (uint)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern))); /// /// uint64_t svqincd_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCD Xtied, pattern, MUL #imm_factor /// - public static unsafe ulong SaturatingIncrementBy64BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (ulong)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern))); + public static unsafe ulong SaturatingIncrementBy64BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (ulong)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern))); /// /// svint64_t svqincd_pat[_s64](svint64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCD Ztied.D, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingIncrementBy64BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturate(value, new Vector((long)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern)))); + public static unsafe Vector SaturatingIncrementBy64BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturate(value, new Vector((long)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern)))); /// /// svuint64_t svqincd_pat[_u64](svuint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCD Ztied.D, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingIncrementBy64BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturate(value, new Vector((ulong)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern)))); + public static unsafe Vector SaturatingIncrementBy64BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturate(value, new Vector((ulong)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern)))); /// Saturating increment by number of byte elements @@ -2812,24 +2812,24 @@ internal Arm64() { } /// int32_t svqincb_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCB Xtied, Wtied, pattern, MUL #imm_factor /// - public static unsafe int SaturatingIncrementBy8BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (int)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(byte), pattern))); + public static unsafe int SaturatingIncrementBy8BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (int)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(byte), pattern))); /// /// int64_t svqincb_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCB Xtied, pattern, MUL #imm_factor /// - public static unsafe long SaturatingIncrementBy8BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (long)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(byte), pattern))); + public static unsafe long SaturatingIncrementBy8BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (long)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(byte), pattern))); /// /// uint32_t svqincb_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCB Wtied, pattern, MUL #imm_factor /// - public static unsafe uint SaturatingIncrementBy8BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (uint)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(byte), pattern))); + public static unsafe uint SaturatingIncrementBy8BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (uint)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(byte), pattern))); /// /// uint64_t svqincb_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCB Xtied, pattern, MUL #imm_factor /// - public static unsafe ulong SaturatingIncrementBy8BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (ulong)(scale * decodePredicateCount(Unsafe.SizeOf>() / sizeof(byte), pattern))); + public static unsafe ulong SaturatingIncrementBy8BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (ulong)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(byte), pattern))); /// SignExtend16 : Sign-extend the low 16 bits @@ -3729,7 +3729,8 @@ private static ulong SubtractSaturateScalar(ulong left, ulong right) } // Given a vector length for a given type, return the number of elements when pattern is applied - private static int decodePredicateCount(int totalElems, SveMaskPattern pattern) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static int DecodePredicateCount(int totalElems, SveMaskPattern pattern) { switch(pattern) { From 4a9dc8a1a6ceca9de5d1e196c45352818fcd3400 Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Tue, 21 May 2024 09:43:27 +0100 Subject: [PATCH 09/29] Remove C# fallbacks --- src/coreclr/jit/hwintrinsiclistarm64sve.h | 28 +-- .../src/System/Runtime/Intrinsics/Arm/Sve.cs | 208 +++++------------- 2 files changed, 68 insertions(+), 168 deletions(-) diff --git a/src/coreclr/jit/hwintrinsiclistarm64sve.h b/src/coreclr/jit/hwintrinsiclistarm64sve.h index e586e32851b9bd..23a39cc8414295 100644 --- a/src/coreclr/jit/hwintrinsiclistarm64sve.h +++ b/src/coreclr/jit/hwintrinsiclistarm64sve.h @@ -110,14 +110,14 @@ HARDWARE_INTRINSIC(Sve, Negate, HARDWARE_INTRINSIC(Sve, Or, -1, -1, false, {INS_sve_orr, INS_sve_orr, INS_sve_orr, INS_sve_orr, INS_sve_orr, INS_sve_orr, INS_sve_orr, INS_sve_orr, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_OptionalEmbeddedMaskedOperation|HW_Flag_HasRMWSemantics|HW_Flag_LowMaskedOperation) HARDWARE_INTRINSIC(Sve, OrAcross, -1, -1, false, {INS_sve_orv, INS_sve_orv, INS_sve_orv, INS_sve_orv, INS_sve_orv, INS_sve_orv, INS_sve_orv, INS_sve_orv, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation) -HARDWARE_INTRINSIC(Sve, SaturatingDecrementBy16BitElementCount, -1, 3, true, {INS_invalid, INS_invalid, INS_sve_sqdech, INS_sve_uqdech, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_HasScalarVariant|HW_Flag_NoJmpTableIMM|HW_Flag_HasRMWSemantics) -HARDWARE_INTRINSIC(Sve, SaturatingDecrementBy32BitElementCount, -1, 3, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqdecw, INS_sve_uqdecw, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_HasScalarVariant|HW_Flag_NoJmpTableIMM|HW_Flag_HasRMWSemantics) -HARDWARE_INTRINSIC(Sve, SaturatingDecrementBy64BitElementCount, -1, 3, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqdecd, INS_sve_uqdecd, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_HasScalarVariant|HW_Flag_NoJmpTableIMM|HW_Flag_HasRMWSemantics) -HARDWARE_INTRINSIC(Sve, SaturatingDecrementBy8BitElementCount, 0, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqdecb, INS_sve_uqdecb, INS_sve_sqdecb, INS_sve_uqdecb, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_NoJmpTableIMM|HW_Flag_HasRMWSemantics) -HARDWARE_INTRINSIC(Sve, SaturatingIncrementBy16BitElementCount, -1, 3, true, {INS_invalid, INS_invalid, INS_sve_sqinch, INS_sve_uqinch, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_HasScalarVariant|HW_Flag_NoJmpTableIMM|HW_Flag_HasRMWSemantics) -HARDWARE_INTRINSIC(Sve, SaturatingIncrementBy32BitElementCount, -1, 3, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqincw, INS_sve_uqincw, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_HasScalarVariant|HW_Flag_NoJmpTableIMM|HW_Flag_HasRMWSemantics) -HARDWARE_INTRINSIC(Sve, SaturatingIncrementBy64BitElementCount, -1, 3, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqincd, INS_sve_uqincd, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_HasScalarVariant|HW_Flag_NoJmpTableIMM|HW_Flag_HasRMWSemantics) -HARDWARE_INTRINSIC(Sve, SaturatingIncrementBy8BitElementCount, 0, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqincb, INS_sve_uqincb, INS_sve_sqincb, INS_sve_uqincb, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_NoJmpTableIMM|HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Sve, SaturatingDecrementBy16BitElementCount, -1, 3, true, {INS_invalid, INS_invalid, INS_sve_sqdech, INS_sve_uqdech, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_HasScalarVariant|HW_Flag_SpecialImport|HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Sve, SaturatingDecrementBy32BitElementCount, -1, 3, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqdecw, INS_sve_uqdecw, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_HasScalarVariant|HW_Flag_SpecialImport|HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Sve, SaturatingDecrementBy64BitElementCount, -1, 3, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqdecd, INS_sve_uqdecd, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_HasScalarVariant|HW_Flag_SpecialImport|HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Sve, SaturatingDecrementBy8BitElementCount, 0, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqdecb, INS_sve_uqdecb, INS_sve_sqdecb, INS_sve_uqdecb, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_SpecialImport|HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Sve, SaturatingIncrementBy16BitElementCount, -1, 3, true, {INS_invalid, INS_invalid, INS_sve_sqinch, INS_sve_uqinch, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_HasScalarVariant|HW_Flag_SpecialImport|HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Sve, SaturatingIncrementBy32BitElementCount, -1, 3, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqincw, INS_sve_uqincw, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_HasScalarVariant|HW_Flag_SpecialImport|HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Sve, SaturatingIncrementBy64BitElementCount, -1, 3, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqincd, INS_sve_uqincd, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_HasScalarVariant|HW_Flag_SpecialImport|HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Sve, SaturatingIncrementBy8BitElementCount, 0, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqincb, INS_sve_uqincb, INS_sve_sqincb, INS_sve_uqincb, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_SpecialImport|HW_Flag_HasRMWSemantics) HARDWARE_INTRINSIC(Sve, SignExtend16, -1, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sxth, INS_invalid, INS_sve_sxth, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation) HARDWARE_INTRINSIC(Sve, SignExtend32, -1, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sxtw, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation) @@ -150,12 +150,12 @@ HARDWARE_INTRINSIC(Sve, ConvertVectorToMask, HARDWARE_INTRINSIC(Sve, CreateTrueMaskAll, -1, -1, false, {INS_sve_ptrue, INS_sve_ptrue, INS_sve_ptrue, INS_sve_ptrue, INS_sve_ptrue, INS_sve_ptrue, INS_sve_ptrue, INS_sve_ptrue, INS_sve_ptrue, INS_sve_ptrue}, HW_Category_Helper, HW_Flag_Scalable|HW_Flag_ReturnsPerElementMask) // Scalar variants of Saturating*By*BitElementCount. There is 8bit versions as the generic version is scalar only. -HARDWARE_INTRINSIC(Sve, SaturatingDecrementBy16BitElementCountScalar, 0, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqdech, INS_sve_uqdech, INS_sve_sqdech, INS_sve_uqdech, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_NoJmpTableIMM|HW_Flag_HasRMWSemantics) -HARDWARE_INTRINSIC(Sve, SaturatingDecrementBy32BitElementCountScalar, 0, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqdecw, INS_sve_uqdecw, INS_sve_sqdecw, INS_sve_uqdecw, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_NoJmpTableIMM|HW_Flag_HasRMWSemantics) -HARDWARE_INTRINSIC(Sve, SaturatingDecrementBy64BitElementCountScalar, 0, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqdecd, INS_sve_uqdecd, INS_sve_sqdecd, INS_sve_uqdecd, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_NoJmpTableIMM|HW_Flag_HasRMWSemantics) -HARDWARE_INTRINSIC(Sve, SaturatingIncrementBy16BitElementCountScalar, 0, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqinch, INS_sve_uqinch, INS_sve_sqinch, INS_sve_uqinch, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_NoJmpTableIMM|HW_Flag_HasRMWSemantics) -HARDWARE_INTRINSIC(Sve, SaturatingIncrementBy32BitElementCountScalar, 0, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqincw, INS_sve_uqincw, INS_sve_sqincw, INS_sve_uqincw, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_NoJmpTableIMM|HW_Flag_HasRMWSemantics) -HARDWARE_INTRINSIC(Sve, SaturatingIncrementBy64BitElementCountScalar, 0, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqincd, INS_sve_uqincd, INS_sve_sqincd, INS_sve_uqincd, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_NoJmpTableIMM|HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Sve, SaturatingDecrementBy16BitElementCountScalar, 0, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqdech, INS_sve_uqdech, INS_sve_sqdech, INS_sve_uqdech, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_SpecialImport|HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Sve, SaturatingDecrementBy32BitElementCountScalar, 0, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqdecw, INS_sve_uqdecw, INS_sve_sqdecw, INS_sve_uqdecw, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_SpecialImport|HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Sve, SaturatingDecrementBy64BitElementCountScalar, 0, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqdecd, INS_sve_uqdecd, INS_sve_sqdecd, INS_sve_uqdecd, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_SpecialImport|HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Sve, SaturatingIncrementBy16BitElementCountScalar, 0, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqinch, INS_sve_uqinch, INS_sve_sqinch, INS_sve_uqinch, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_SpecialImport|HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Sve, SaturatingIncrementBy32BitElementCountScalar, 0, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqincw, INS_sve_uqincw, INS_sve_sqincw, INS_sve_uqincw, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_SpecialImport|HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Sve, SaturatingIncrementBy64BitElementCountScalar, 0, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqincd, INS_sve_uqincd, INS_sve_sqincd, INS_sve_uqincd, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_SpecialImport|HW_Flag_HasRMWSemantics) #endif // FEATURE_HW_INTRINSIC 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 f770ce1aa72cb1..ac6f7b738143f2 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 @@ -2545,291 +2545,292 @@ internal Arm64() { } public static unsafe Vector OrAcross(Vector value) => OrAcross(value); - /// Saturating decrement by number of halfword elements + /// Saturating decrement by number of halfword elements /// /// int32_t svqdech_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECH Xtied, Wtied, pattern, MUL #imm_factor /// - public static unsafe int SaturatingDecrementBy16BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (int)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern))); + public static unsafe int SaturatingDecrementBy16BitElementCount(int value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy16BitElementCount(value, scale, pattern); /// /// int64_t svqdech_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECH Xtied, pattern, MUL #imm_factor /// - public static unsafe long SaturatingDecrementBy16BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (long)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern))); + public static unsafe long SaturatingDecrementBy16BitElementCount(long value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy16BitElementCount(value, scale, pattern); /// /// uint32_t svqdech_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECH Wtied, pattern, MUL #imm_factor /// - public static unsafe uint SaturatingDecrementBy16BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (uint)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern))); + public static unsafe uint SaturatingDecrementBy16BitElementCount(uint value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy16BitElementCount(value, scale, pattern); /// /// uint64_t svqdech_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECH Xtied, pattern, MUL #imm_factor /// - public static unsafe ulong SaturatingDecrementBy16BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (ulong)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern))); + public static unsafe ulong SaturatingDecrementBy16BitElementCount(ulong value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy16BitElementCount(value, scale, pattern); /// /// svint16_t svqdech_pat[_s16](svint16_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECH Ztied.H, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingDecrementBy16BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturate(value, new Vector((short)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern)))); + public static unsafe Vector SaturatingDecrementBy16BitElementCount(Vector value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy16BitElementCount(value, scale, pattern); /// /// svuint16_t svqdech_pat[_u16](svuint16_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECH Ztied.H, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingDecrementBy16BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturate(value, new Vector((ushort)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern)))); + public static unsafe Vector SaturatingDecrementBy16BitElementCount(Vector value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy16BitElementCount(value, scale, pattern); - /// Saturating decrement by number of word elements + /// Saturating decrement by number of word elements /// /// int32_t svqdecw_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECW Xtied, Wtied, pattern, MUL #imm_factor /// - public static unsafe int SaturatingDecrementBy32BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (int)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern))); + public static unsafe int SaturatingDecrementBy32BitElementCount(int value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy32BitElementCount(value, scale, pattern); /// /// int64_t svqdecw_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECW Xtied, pattern, MUL #imm_factor /// - public static unsafe long SaturatingDecrementBy32BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (long)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern))); + public static unsafe long SaturatingDecrementBy32BitElementCount(long value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy32BitElementCount(value, scale, pattern); /// /// uint32_t svqdecw_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECW Wtied, pattern, MUL #imm_factor /// - public static unsafe uint SaturatingDecrementBy32BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (uint)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern))); + public static unsafe uint SaturatingDecrementBy32BitElementCount(uint value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy32BitElementCount(value, scale, pattern); /// /// uint64_t svqdecw_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECW Xtied, pattern, MUL #imm_factor /// - public static unsafe ulong SaturatingDecrementBy32BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (ulong)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern))); - + public static unsafe ulong SaturatingDecrementBy32BitElementCount(ulong value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy32BitElementCount(value, scale, pattern); /// /// svint32_t svqdecw_pat[_s32](svint32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECW Ztied.S, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingDecrementBy32BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturate(value, new Vector((int)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern)))); + public static unsafe Vector SaturatingDecrementBy32BitElementCount(Vector value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy32BitElementCount(value, scale, pattern); /// /// svuint32_t svqdecw_pat[_u32](svuint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECW Ztied.S, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingDecrementBy32BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturate(value, new Vector((uint)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern)))); + public static unsafe Vector SaturatingDecrementBy32BitElementCount(Vector value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy32BitElementCount(value, scale, pattern); - /// Saturating decrement by number of doubleword elements + /// Saturating decrement by number of doubleword elements /// /// int32_t svqdecd_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECD Xtied, Wtied, pattern, MUL #imm_factor /// - public static unsafe int SaturatingDecrementBy64BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (int)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern))); + public static unsafe int SaturatingDecrementBy64BitElementCount(int value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy64BitElementCount(value, scale, pattern); /// /// int64_t svqdecd_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECD Xtied, pattern, MUL #imm_factor /// - public static unsafe long SaturatingDecrementBy64BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (long)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern))); + public static unsafe long SaturatingDecrementBy64BitElementCount(long value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy64BitElementCount(value, scale, pattern); /// /// uint32_t svqdecd_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECD Wtied, pattern, MUL #imm_factor /// - public static unsafe uint SaturatingDecrementBy64BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (uint)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern))); + public static unsafe uint SaturatingDecrementBy64BitElementCount(uint value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy64BitElementCount(value, scale, pattern); /// /// uint64_t svqdecd_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECD Xtied, pattern, MUL #imm_factor /// - public static unsafe ulong SaturatingDecrementBy64BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (ulong)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern))); + public static unsafe ulong SaturatingDecrementBy64BitElementCount(ulong value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy64BitElementCount(value, scale, pattern); /// /// svint64_t svqdecd_pat[_s64](svint64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECD Ztied.D, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingDecrementBy64BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturate(value, new Vector((long)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern)))); + public static unsafe Vector SaturatingDecrementBy64BitElementCount(Vector value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy64BitElementCount(value, scale, pattern); /// /// svuint64_t svqdecd_pat[_u64](svuint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECD Ztied.D, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingDecrementBy64BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturate(value, new Vector((ulong)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern)))); + public static unsafe Vector SaturatingDecrementBy64BitElementCount(Vector value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy64BitElementCount(value, scale, pattern); - /// Saturating decrement by number of byte elements + /// Saturating decrement by number of byte elements /// /// int32_t svqdecb_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECB Xtied, Wtied, pattern, MUL #imm_factor /// - public static unsafe int SaturatingDecrementBy8BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (int)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(byte), pattern))); + public static unsafe int SaturatingDecrementBy8BitElementCount(int value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy8BitElementCount(value, scale, pattern); /// /// int64_t svqdecb_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECB Xtied, pattern, MUL #imm_factor /// - public static unsafe long SaturatingDecrementBy8BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (long)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(byte), pattern))); + public static unsafe long SaturatingDecrementBy8BitElementCount(long value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy8BitElementCount(value, scale, pattern); /// /// uint32_t svqdecb_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECB Wtied, pattern, MUL #imm_factor /// - public static unsafe uint SaturatingDecrementBy8BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (uint)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(byte), pattern))); + public static unsafe uint SaturatingDecrementBy8BitElementCount(uint value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy8BitElementCount(value, scale, pattern); /// /// uint64_t svqdecb_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECB Xtied, pattern, MUL #imm_factor /// - public static unsafe ulong SaturatingDecrementBy8BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SubtractSaturateScalar(value, (ulong)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(byte), pattern))); + public static unsafe ulong SaturatingDecrementBy8BitElementCount(ulong value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy8BitElementCount(value, scale, pattern); + - /// Saturating increment by number of halfword elements + /// Saturating increment by number of halfword elements /// /// int32_t svqinch_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCH Xtied, Wtied, pattern, MUL #imm_factor /// - public static unsafe int SaturatingIncrementBy16BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (int)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern))); + public static unsafe int SaturatingIncrementBy16BitElementCount(int value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy16BitElementCount(value, scale, pattern); /// /// int64_t svqinch_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCH Xtied, pattern, MUL #imm_factor /// - public static unsafe long SaturatingIncrementBy16BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (long)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern))); + public static unsafe long SaturatingIncrementBy16BitElementCount(long value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy16BitElementCount(value, scale, pattern); /// /// uint32_t svqinch_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCH Wtied, pattern, MUL #imm_factor /// - public static unsafe uint SaturatingIncrementBy16BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (uint)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern))); + public static unsafe uint SaturatingIncrementBy16BitElementCount(uint value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy16BitElementCount(value, scale, pattern); /// /// uint64_t svqinch_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCH Xtied, pattern, MUL #imm_factor /// - public static unsafe ulong SaturatingIncrementBy16BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (ulong)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern))); + public static unsafe ulong SaturatingIncrementBy16BitElementCount(ulong value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy16BitElementCount(value, scale, pattern); /// /// svint16_t svqinch_pat[_s16](svint16_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCH Ztied.H, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingIncrementBy16BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturate(value, new Vector((short)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern)))); + public static unsafe Vector SaturatingIncrementBy16BitElementCount(Vector value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy16BitElementCount(value, scale, pattern); /// /// svuint16_t svqinch_pat[_u16](svuint16_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCH Ztied.H, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingIncrementBy16BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturate(value, new Vector((ushort)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(short), pattern)))); + public static unsafe Vector SaturatingIncrementBy16BitElementCount(Vector value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy16BitElementCount(value, scale, pattern); - /// Saturating increment by number of word elements + /// Saturating increment by number of word elements /// /// int32_t svqincw_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCW Xtied, Wtied, pattern, MUL #imm_factor /// - public static unsafe int SaturatingIncrementBy32BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (int)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern))); + public static unsafe int SaturatingIncrementBy32BitElementCount(int value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy32BitElementCount(value, scale, pattern); /// /// int64_t svqincw_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCW Xtied, pattern, MUL #imm_factor /// - public static unsafe long SaturatingIncrementBy32BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (long)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern))); + public static unsafe long SaturatingIncrementBy32BitElementCount(long value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy32BitElementCount(value, scale, pattern); /// /// uint32_t svqincw_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCW Wtied, pattern, MUL #imm_factor /// - public static unsafe uint SaturatingIncrementBy32BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (uint)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern))); + public static unsafe uint SaturatingIncrementBy32BitElementCount(uint value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy32BitElementCount(value, scale, pattern); /// /// uint64_t svqincw_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCW Xtied, pattern, MUL #imm_factor /// - public static unsafe ulong SaturatingIncrementBy32BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (ulong)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern))); + public static unsafe ulong SaturatingIncrementBy32BitElementCount(ulong value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy32BitElementCount(value, scale, pattern); /// /// svint32_t svqincw_pat[_s32](svint32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCW Ztied.S, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingIncrementBy32BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturate(value, new Vector((int)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern)))); + public static unsafe Vector SaturatingIncrementBy32BitElementCount(Vector value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy32BitElementCount(value, scale, pattern); /// /// svuint32_t svqincw_pat[_u32](svuint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCW Ztied.S, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingIncrementBy32BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturate(value, new Vector((uint)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(int), pattern)))); + public static unsafe Vector SaturatingIncrementBy32BitElementCount(Vector value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy32BitElementCount(value, scale, pattern); - /// Saturating increment by number of doubleword elements + /// Saturating increment by number of doubleword elements /// /// int32_t svqincd_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCD Xtied, Wtied, pattern, MUL #imm_factor /// - public static unsafe int SaturatingIncrementBy64BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (int)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern))); + public static unsafe int SaturatingIncrementBy64BitElementCount(int value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy64BitElementCount(value, scale, pattern); /// /// int64_t svqincd_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCD Xtied, pattern, MUL #imm_factor /// - public static unsafe long SaturatingIncrementBy64BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (long)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern))); + public static unsafe long SaturatingIncrementBy64BitElementCount(long value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy64BitElementCount(value, scale, pattern); /// /// uint32_t svqincd_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCD Wtied, pattern, MUL #imm_factor /// - public static unsafe uint SaturatingIncrementBy64BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (uint)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern))); + public static unsafe uint SaturatingIncrementBy64BitElementCount(uint value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy64BitElementCount(value, scale, pattern); /// /// uint64_t svqincd_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCD Xtied, pattern, MUL #imm_factor /// - public static unsafe ulong SaturatingIncrementBy64BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (ulong)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern))); + public static unsafe ulong SaturatingIncrementBy64BitElementCount(ulong value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy64BitElementCount(value, scale, pattern); /// /// svint64_t svqincd_pat[_s64](svint64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCD Ztied.D, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingIncrementBy64BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturate(value, new Vector((long)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern)))); + public static unsafe Vector SaturatingIncrementBy64BitElementCount(Vector value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy64BitElementCount(value, scale, pattern); /// /// svuint64_t svqincd_pat[_u64](svuint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCD Ztied.D, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingIncrementBy64BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturate(value, new Vector((ulong)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(long), pattern)))); + public static unsafe Vector SaturatingIncrementBy64BitElementCount(Vector value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy64BitElementCount(value, scale, pattern); - /// Saturating increment by number of byte elements + /// Saturating increment by number of byte elements /// /// int32_t svqincb_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCB Xtied, Wtied, pattern, MUL #imm_factor /// - public static unsafe int SaturatingIncrementBy8BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (int)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(byte), pattern))); + public static unsafe int SaturatingIncrementBy8BitElementCount(int value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy8BitElementCount(value, scale, pattern); /// /// int64_t svqincb_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCB Xtied, pattern, MUL #imm_factor /// - public static unsafe long SaturatingIncrementBy8BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (long)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(byte), pattern))); + public static unsafe long SaturatingIncrementBy8BitElementCount(long value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy8BitElementCount(value, scale, pattern); + /// /// uint32_t svqincb_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCB Wtied, pattern, MUL #imm_factor /// - public static unsafe uint SaturatingIncrementBy8BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (uint)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(byte), pattern))); + public static unsafe uint SaturatingIncrementBy8BitElementCount(uint value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy8BitElementCount(value, scale, pattern); /// /// uint64_t svqincb_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCB Xtied, pattern, MUL #imm_factor /// - public static unsafe ulong SaturatingIncrementBy8BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => AddSaturateScalar(value, (ulong)(scale * DecodePredicateCount(Unsafe.SizeOf>() / sizeof(byte), pattern))); + public static unsafe ulong SaturatingIncrementBy8BitElementCount(ulong value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy8BitElementCount(value, scale, pattern); /// SignExtend16 : Sign-extend the low 16 bits @@ -3674,106 +3675,5 @@ internal Arm64() { } /// public static unsafe Vector ZipLow(Vector left, Vector right) => ZipLow(left, right); - - - private static int AddSaturateScalar(int left, int right) - { - int result = (int)(left + right); - bool overflow = (right < 0) ? (result > left) : (result < right); - return overflow ? (result > 0 ? int.MinValue : int.MaxValue) : result; - } - - private static long AddSaturateScalar(long left, long right) - { - long result = (long)(left + right); - bool overflow = (right < 0) ? (result > left) : (result < right); - return overflow ? (result > 0 ? long.MinValue : long.MaxValue) : result; - } - - private static uint AddSaturateScalar(uint left, uint right) - { - uint result = (uint)(left + right); - bool overflow = (result < left); - return overflow ? uint.MaxValue : result; - } - - private static ulong AddSaturateScalar(ulong left, ulong right) - { - ulong result = (ulong)(left + right); - bool overflow = (result < left); - return overflow ? ulong.MaxValue : result; - } - - private static int SubtractSaturateScalar(int left, int right) - { - int result = (int)(left - right); - bool overflow = (right < 0) ? (result < left) : (result > left); - return overflow ? (result > 0 ? int.MinValue : int.MaxValue) : result; - } - - private static long SubtractSaturateScalar(long left, long right) - { - long result = (long)(left - right); - bool overflow = (right < 0) ? (result < left) : (result > left); - return overflow ? (result > 0 ? long.MinValue : long.MaxValue) : result; - } - - private static uint SubtractSaturateScalar(uint left, uint right) - { - return (left < right) ? uint.MinValue : (left - right); - } - - private static ulong SubtractSaturateScalar(ulong left, ulong right) - { - return (left < right) ? ulong.MinValue : (left - right); - } - - // Given a vector length for a given type, return the number of elements when pattern is applied - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static int DecodePredicateCount(int totalElems, SveMaskPattern pattern) - { - switch(pattern) - { - case SveMaskPattern.LargestPowerOf2: - int ret = 1; - while (totalElems >= (2^ret)) { ret++; } - return 2^(ret - 1); - case SveMaskPattern.VectorCount1: - return (totalElems > 1) ? 1 : 0; - case SveMaskPattern.VectorCount2: - return (totalElems > 2) ? 2 : 0; - case SveMaskPattern.VectorCount3: - return (totalElems > 3) ? 3 : 0; - case SveMaskPattern.VectorCount4: - return (totalElems > 4) ? 4 : 0; - case SveMaskPattern.VectorCount5: - return (totalElems > 5) ? 5 : 0; - case SveMaskPattern.VectorCount6: - return (totalElems > 6) ? 6 : 0; - case SveMaskPattern.VectorCount7: - return (totalElems > 7) ? 7 : 0; - case SveMaskPattern.VectorCount8: - return (totalElems > 8) ? 8 : 0; - case SveMaskPattern.VectorCount16: - return (totalElems > 16) ? 16 : 0; - case SveMaskPattern.VectorCount32: - return (totalElems > 32) ? 32 : 0; - case SveMaskPattern.VectorCount64: - return (totalElems > 64) ? 64 : 0; - case SveMaskPattern.VectorCount128: - return (totalElems > 128) ? 128 : 0; - case SveMaskPattern.VectorCount256: - return (totalElems > 256) ? 256 : 0; - case SveMaskPattern.LargestMultipleOf4: - return totalElems - (totalElems % 4); - case SveMaskPattern.LargestMultipleOf3: - return totalElems - (totalElems % 3); - case SveMaskPattern.All: - return totalElems; - default: - break; - } - return 0; - } } } From 5025a8c5a87818d339d412d90aa1b237e4c1eb41 Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Thu, 23 May 2024 14:02:38 +0100 Subject: [PATCH 10/29] Add HWIntrinsicImmOpHelper variant --- src/coreclr/jit/codegen.h | 5 +- src/coreclr/jit/hwintrinsiccodegenarm64.cpp | 84 +++++++++++++++++---- src/coreclr/jit/lowerarmarch.cpp | 12 ++- src/coreclr/jit/lsraarm64.cpp | 5 +- 4 files changed, 86 insertions(+), 20 deletions(-) diff --git a/src/coreclr/jit/codegen.h b/src/coreclr/jit/codegen.h index 2262fe3d9e2de1..0fb903c3eb6b8d 100644 --- a/src/coreclr/jit/codegen.h +++ b/src/coreclr/jit/codegen.h @@ -994,7 +994,9 @@ class CodeGen final : public CodeGenInterface class HWIntrinsicImmOpHelper final { public: - HWIntrinsicImmOpHelper(CodeGen* codeGen, GenTree* immOp, GenTreeHWIntrinsic* intrin, int immNum = 1); + HWIntrinsicImmOpHelper(CodeGen* codeGen, GenTree* immOp, GenTreeHWIntrinsic* intrin); + + HWIntrinsicImmOpHelper(CodeGen* codeGen, regNumber nonConstImmReg, int immLowerBound, int immUpperBound, GenTreeHWIntrinsic* intrin); void EmitBegin(); void EmitCaseEnd(); @@ -1040,6 +1042,7 @@ class CodeGen final : public CodeGenInterface regNumber nonConstImmReg; regNumber branchTargetReg; }; + #endif // TARGET_ARM64 #endif // FEATURE_HW_INTRINSICS diff --git a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp index f6eed9386352b2..29d3dd63d7c588 100644 --- a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp +++ b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp @@ -23,7 +23,6 @@ // codeGen -- an instance of CodeGen class. // immOp -- an immediate operand of the intrinsic. // intrin -- a hardware intrinsic tree node. -// immNumber -- which immediate operand to use (most intrinsics only have one). // // Note: This class is designed to be used in the following way // HWIntrinsicImmOpHelper helper(this, immOp, intrin); @@ -38,8 +37,7 @@ // CodeGen::HWIntrinsicImmOpHelper::HWIntrinsicImmOpHelper(CodeGen* codeGen, GenTree* immOp, - GenTreeHWIntrinsic* intrin, - int immNumber /* = 1 */) + GenTreeHWIntrinsic* intrin) : codeGen(codeGen) , endLabel(nullptr) , nonZeroLabel(nullptr) @@ -79,12 +77,12 @@ CodeGen::HWIntrinsicImmOpHelper::HWIntrinsicImmOpHelper(CodeGen* code const unsigned int indexedElementSimdSize = genTypeSize(indexedElementOpType); HWIntrinsicInfo::lookupImmBounds(intrin->GetHWIntrinsicId(), indexedElementSimdSize, - intrin->GetSimdBaseType(), immNumber, &immLowerBound, &immUpperBound); + intrin->GetSimdBaseType(), 1, &immLowerBound, &immUpperBound); } else { HWIntrinsicInfo::lookupImmBounds(intrin->GetHWIntrinsicId(), intrin->GetSimdSize(), - intrin->GetSimdBaseType(), immNumber, &immLowerBound, &immUpperBound); + intrin->GetSimdBaseType(), 1, &immLowerBound, &immUpperBound); } nonConstImmReg = immOp->GetRegNum(); @@ -109,6 +107,40 @@ CodeGen::HWIntrinsicImmOpHelper::HWIntrinsicImmOpHelper(CodeGen* code } } +CodeGen::HWIntrinsicImmOpHelper::HWIntrinsicImmOpHelper(CodeGen* codeGen, + regNumber nonConstImmReg, + int immLowerBound, + int immUpperBound, + GenTreeHWIntrinsic* intrin) + : codeGen(codeGen) + , endLabel(nullptr) + , nonZeroLabel(nullptr) + , immValue(immLowerBound) + , immLowerBound(immLowerBound) + , immUpperBound(immUpperBound) + , nonConstImmReg(nonConstImmReg) + , branchTargetReg(REG_NA) +{ + assert(codeGen != nullptr); + + if (TestImmOpZeroOrOne()) + { + nonZeroLabel = codeGen->genCreateTempLabel(); + } + else + { + // At the moment, this helper supports only intrinsics that correspond to one machine instruction. + // If we ever encounter an intrinsic that is either lowered into multiple instructions or + // the number of instructions that correspond to each case is unknown apriori - we can extend support to + // these by + // using the same approach as in hwintrinsicxarch.cpp - adding an additional indirection level in form of a + // branch table. + branchTargetReg = codeGen->internalRegisters.GetSingle(intrin); + } + + endLabel = codeGen->genCreateTempLabel(); +} + //------------------------------------------------------------------------ // EmitBegin: emits the beginning of a "switch" table, no-op if an immediate operand is constant. // @@ -1740,16 +1772,42 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) GetEmitter()->emitIns_Mov(INS_mov, emitTypeSize(node), targetReg, op1Reg, /* canSkip */ true); } - // Cannot use create a lookup table for 2 immediates. Therefore the immediates must be constants, - // and can be used directly (instead of via HWIntrinsicImmOpHelper). + if (intrin.op2->IsCnsIntOrI() && intrin.op3->IsCnsIntOrI()) + { + // Both immediates are constant, emit the intruction. - assert(hasImmediateOperand); - assert(intrin.op2->IsCnsIntOrI()); - assert(intrin.op3->IsCnsIntOrI()); - int scale = (int)intrin.op2->AsIntCon()->gtIconVal; - insSvePattern pattern = (insSvePattern)intrin.op3->AsIntCon()->gtIconVal; + assert(intrin.op2->isContainedIntOrIImmed() && intrin.op3->isContainedIntOrIImmed()); + int scale = (int)intrin.op2->AsIntCon()->gtIconVal; + insSvePattern pattern = (insSvePattern)intrin.op3->AsIntCon()->gtIconVal; + GetEmitter()->emitIns_R_PATTERN_I(ins, emitSize, targetReg, pattern, scale, opt); + } + else + { + // Use the helper to generate a table. - GetEmitter()->emitIns_R_PATTERN_I(ins, emitSize, targetReg, pattern, scale, opt); + assert(!intrin.op2->isContainedIntOrIImmed() && !intrin.op3->isContainedIntOrIImmed()); + emitAttr scalarSize = emitActualTypeSize(node->gtType); + + // Combine the second immediate (pattern, op3) into the first (scale, op2). + GetEmitter()->emitIns_R_R_I(INS_sub, scalarSize, op2Reg, op2Reg, 1); + GetEmitter()->emitIns_R_R_I(INS_lsl, scalarSize, op3Reg, op3Reg, 4); + GetEmitter()->emitIns_R_R_R(INS_orr, scalarSize, op2Reg, op2Reg, op3Reg); + + // Generate a table using the combined immediate. + HWIntrinsicImmOpHelper helper(this, op2Reg, 0, 511, node); + for (helper.EmitBegin(); !helper.Done(); helper.EmitCaseEnd()) + { + const int value = helper.ImmValue(); + const int scale = (value & 0xF) + 1; + const insSvePattern pattern = (insSvePattern)(value >> 4); + GetEmitter()->emitIns_R_PATTERN_I(ins, emitSize, targetReg, pattern, scale, opt); + } + + // Restore the immediates. + GetEmitter()->emitIns_R_R_I(INS_and, scalarSize, op2Reg, op2Reg, 0xF); + GetEmitter()->emitIns_R_R_I(INS_lsr, scalarSize, op3Reg, op3Reg, 4); + GetEmitter()->emitIns_R_R_I(INS_add, scalarSize, op2Reg, op2Reg, 1); + } break; } diff --git a/src/coreclr/jit/lowerarmarch.cpp b/src/coreclr/jit/lowerarmarch.cpp index 272ca9f59e0f3c..cebda711b24f6b 100644 --- a/src/coreclr/jit/lowerarmarch.cpp +++ b/src/coreclr/jit/lowerarmarch.cpp @@ -3397,10 +3397,14 @@ void Lowering::ContainCheckHWIntrinsic(GenTreeHWIntrinsic* node) case NI_Sve_SaturatingIncrementBy32BitElementCountScalar: case NI_Sve_SaturatingIncrementBy64BitElementCountScalar: assert(hasImmediateOperand); - assert(intrin.op2->IsCnsIntOrI()); - assert(intrin.op3->IsCnsIntOrI()); - MakeSrcContained(node, intrin.op2); - MakeSrcContained(node, intrin.op3); + assert(varTypeIsIntegral(intrin.op2)); + assert(varTypeIsIntegral(intrin.op3)); + // Can only avoid generating a table if both immediates are constant. + if (intrin.op2->IsCnsIntOrI() && intrin.op3->IsCnsIntOrI()) + { + MakeSrcContained(node, intrin.op2); + MakeSrcContained(node, intrin.op3); + } break; default: diff --git a/src/coreclr/jit/lsraarm64.cpp b/src/coreclr/jit/lsraarm64.cpp index 346fa0aef0ea49..5d65d847a77f31 100644 --- a/src/coreclr/jit/lsraarm64.cpp +++ b/src/coreclr/jit/lsraarm64.cpp @@ -1485,8 +1485,9 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree, int* pDstCou case NI_Sve_SaturatingIncrementBy16BitElementCountScalar: case NI_Sve_SaturatingIncrementBy32BitElementCountScalar: case NI_Sve_SaturatingIncrementBy64BitElementCountScalar: - assert(intrin.op2->isContainedIntOrIImmed()); - assert(intrin.op4->isContainedIntOrIImmed()); + // Can only avoid generating a table if both immediates are constant. + assert(intrin.op2->isContainedIntOrIImmed() == intrin.op3->isContainedIntOrIImmed()); + needBranchTargetReg = !intrin.op2->isContainedIntOrIImmed(); break; default: From b79c21d6b5f891068a99e37ad7f6a33f434a217b Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Tue, 28 May 2024 09:51:43 +0100 Subject: [PATCH 11/29] Add special import --- src/coreclr/jit/hwintrinsicarm64.cpp | 53 ++++++++++++++++++++- src/coreclr/jit/hwintrinsiccodegenarm64.cpp | 3 +- 2 files changed, 54 insertions(+), 2 deletions(-) diff --git a/src/coreclr/jit/hwintrinsicarm64.cpp b/src/coreclr/jit/hwintrinsicarm64.cpp index 8c3769830ad32b..b2613be8a69dd7 100644 --- a/src/coreclr/jit/hwintrinsicarm64.cpp +++ b/src/coreclr/jit/hwintrinsicarm64.cpp @@ -558,7 +558,7 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, return gtNewScalarHWIntrinsicNode(TYP_VOID, intrinsic); } - assert(category != HW_Category_Scalar); + bool isScalar = (category == HW_Category_Scalar); assert(!HWIntrinsicInfo::isScalarIsa(HWIntrinsicInfo::lookupIsa(intrinsic))); assert(numArgs >= 0); @@ -2472,6 +2472,57 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } + case NI_Sve_SaturatingDecrementBy16BitElementCount: + case NI_Sve_SaturatingDecrementBy32BitElementCount: + case NI_Sve_SaturatingDecrementBy64BitElementCount: + case NI_Sve_SaturatingDecrementBy8BitElementCount: + case NI_Sve_SaturatingIncrementBy16BitElementCount: + case NI_Sve_SaturatingIncrementBy32BitElementCount: + case NI_Sve_SaturatingIncrementBy64BitElementCount: + case NI_Sve_SaturatingIncrementBy8BitElementCount: + case NI_Sve_SaturatingDecrementBy16BitElementCountScalar: + case NI_Sve_SaturatingDecrementBy32BitElementCountScalar: + case NI_Sve_SaturatingDecrementBy64BitElementCountScalar: + case NI_Sve_SaturatingIncrementBy16BitElementCountScalar: + case NI_Sve_SaturatingIncrementBy32BitElementCountScalar: + case NI_Sve_SaturatingIncrementBy64BitElementCountScalar: + { + assert(sig->numArgs == 3); + + CORINFO_ARG_LIST_HANDLE arg1 = sig->args; + CORINFO_ARG_LIST_HANDLE arg2 = info.compCompHnd->getArgNext(arg1); + CORINFO_ARG_LIST_HANDLE arg3 = info.compCompHnd->getArgNext(arg2); + var_types argType = TYP_UNKNOWN; + CORINFO_CLASS_HANDLE argClass = NO_CLASS_HANDLE; + int immLowerBound = 0; + int immUpperBound = 0; + + argType = JITtype2varType(strip(info.compCompHnd->getArgType(sig, arg3, &argClass))); + op3 = getArgForHWIntrinsic(argType, argClass); + argType = JITtype2varType(strip(info.compCompHnd->getArgType(sig, arg2, &argClass))); + op2 = getArgForHWIntrinsic(argType, argClass); + argType = JITtype2varType(strip(info.compCompHnd->getArgType(sig, arg1, &argClass))); + op1 = impPopStack().val; + + CorInfoType op1BaseJitType = getBaseJitTypeOfSIMDType(argClass); + + assert(HWIntrinsicInfo::isImmOp(intrinsic, op2)); + HWIntrinsicInfo::lookupImmBounds(intrinsic, simdSize, simdBaseType, 1, &immLowerBound, &immUpperBound); + op2 = addRangeCheckIfNeeded(intrinsic, op2, (!op2->IsCnsIntOrI()), immLowerBound, immUpperBound); + + assert(HWIntrinsicInfo::isImmOp(intrinsic, op3)); + HWIntrinsicInfo::lookupImmBounds(intrinsic, simdSize, simdBaseType, 2, &immLowerBound, &immUpperBound); + op3 = addRangeCheckIfNeeded(intrinsic, op3, (!op3->IsCnsIntOrI()), immLowerBound, immUpperBound); + + retNode = isScalar ? gtNewScalarHWIntrinsicNode(retType, op1, op2, op3, intrinsic) + : gtNewSimdHWIntrinsicNode(retType, op1, op2, op3, intrinsic, simdBaseJitType, + simdSize); + + retNode->AsHWIntrinsic()->SetSimdBaseJitType(simdBaseJitType); + + break; + } + default: { return nullptr; diff --git a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp index 29d3dd63d7c588..3321351f68f22c 100644 --- a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp +++ b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp @@ -1786,7 +1786,8 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) // Use the helper to generate a table. assert(!intrin.op2->isContainedIntOrIImmed() && !intrin.op3->isContainedIntOrIImmed()); - emitAttr scalarSize = emitActualTypeSize(node->gtType); + + emitAttr scalarSize = emitActualTypeSize(node->GetSimdBaseType()); // Combine the second immediate (pattern, op3) into the first (scale, op2). GetEmitter()->emitIns_R_R_I(INS_sub, scalarSize, op2Reg, op2Reg, 1); From ef74d46fb7a6aa22320bc5f1e29d5654270c359f Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Tue, 28 May 2024 13:33:58 +0100 Subject: [PATCH 12/29] Add out of range testing --- .../GenerateHWIntrinsicTests_Arm.cs | 102 +++++++++--------- .../Arm/Shared/ScalarImm2UnOpTest.template | 42 ++++++++ 2 files changed, 93 insertions(+), 51 deletions(-) diff --git a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs index 6d6527ef1ebe3d..a93b6fc9bcf327 100644 --- a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs +++ b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs @@ -3257,57 +3257,57 @@ ("SveVecReduceUnOpTest.template", new Dictionary { ["TestName"] = "Sve_OrAcross_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "OrAcross", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateReduceOpResult"] = "Helpers.OrAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), ("SveVecReduceUnOpTest.template", new Dictionary { ["TestName"] = "Sve_OrAcross_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "OrAcross", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateReduceOpResult"] = "Helpers.OrAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int16))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int16))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int16))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (ulong)(2 * Unsafe.SizeOf>() / sizeof(Int16))));",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_vector_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (2 * Unsafe.SizeOf>() / sizeof(Int16)))",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_vector_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (2 * Unsafe.SizeOf>() / sizeof(Int16)))",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int32))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int32))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int32))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (ulong)(2 * Unsafe.SizeOf>() / sizeof(Int32))));",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_vector_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (2 * Unsafe.SizeOf>() / sizeof(Int32)))",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_vector_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (2 * Unsafe.SizeOf>() / sizeof(Int32)))",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int64))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int64))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int64))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (ulong)(2 * Unsafe.SizeOf>() / sizeof(Int64))));",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_vector_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (2 * Unsafe.SizeOf>() / sizeof(Int64)))",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_vector_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (ulong)(2 * Unsafe.SizeOf>() / sizeof(Int64)))",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Byte))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Byte))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Byte))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (ulong)(2 * Unsafe.SizeOf>() / sizeof(Byte))));",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int16))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int16))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int16))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (ulong)(2 * Unsafe.SizeOf>() / sizeof(Int16))));",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_vector_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (2 * Unsafe.SizeOf>() / sizeof(Int16)))",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_vector_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (2 * Unsafe.SizeOf>() / sizeof(Int16)))",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int32))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int32))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int32))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (ulong)(2 * Unsafe.SizeOf>() / sizeof(Int32))));",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_vector_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (2 * Unsafe.SizeOf>() / sizeof(Int32)))",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_vector_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (2 * Unsafe.SizeOf>() / sizeof(Int32)))",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int64))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int64))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int64))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (ulong)(2 * Unsafe.SizeOf>() / sizeof(Int64))));",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_vector_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (2 * Unsafe.SizeOf>() / sizeof(Int64)))",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_vector_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (ulong)(2 * Unsafe.SizeOf>() / sizeof(Int64)))",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Byte))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Byte))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Byte))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (ulong)(2 * Unsafe.SizeOf>() / sizeof(Byte))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)18", ["InvalidImm2"] = "(SveMaskPattern)35", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int16))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)19", ["InvalidImm2"] = "(SveMaskPattern)3115",["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int16))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)25", ["InvalidImm2"] = "(SveMaskPattern)2000",["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int16))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)255", ["InvalidImm2"] = "(SveMaskPattern)2050",["ValidateResult"] = "isUnexpectedResult = (result != (data - (ulong)(2 * Unsafe.SizeOf>() / sizeof(Int16))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_vector_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)65", ["InvalidImm2"] = "(SveMaskPattern)90", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (2 * Unsafe.SizeOf>() / sizeof(Int16)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_vector_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)72", ["InvalidImm2"] = "(SveMaskPattern)35", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (2 * Unsafe.SizeOf>() / sizeof(Int16)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)17", ["InvalidImm2"] = "(SveMaskPattern)32", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int32))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)19", ["InvalidImm2"] = "(SveMaskPattern)33", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int32))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)25", ["InvalidImm2"] = "(SveMaskPattern)34", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int32))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)26", ["InvalidImm2"] = "(SveMaskPattern)35", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (ulong)(2 * Unsafe.SizeOf>() / sizeof(Int32))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_vector_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)27", ["InvalidImm2"] = "(SveMaskPattern)36", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (2 * Unsafe.SizeOf>() / sizeof(Int32)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_vector_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)18", ["InvalidImm2"] = "(SveMaskPattern)37", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (2 * Unsafe.SizeOf>() / sizeof(Int32)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)34", ["InvalidImm2"] = "(SveMaskPattern)135", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int64))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)35", ["InvalidImm2"] = "(SveMaskPattern)125", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int64))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)36", ["InvalidImm2"] = "(SveMaskPattern)115", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int64))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)37", ["InvalidImm2"] = "(SveMaskPattern)145", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (ulong)(2 * Unsafe.SizeOf>() / sizeof(Int64))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_vector_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)38", ["InvalidImm2"] = "(SveMaskPattern)155", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (2 * Unsafe.SizeOf>() / sizeof(Int64)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_vector_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)39", ["InvalidImm2"] = "(SveMaskPattern)165", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (ulong)(2 * Unsafe.SizeOf>() / sizeof(Int64)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)89", ["InvalidImm2"] = "(SveMaskPattern)2060",["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Byte))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)90", ["InvalidImm2"] = "(SveMaskPattern)2061",["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Byte))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)91", ["InvalidImm2"] = "(SveMaskPattern)2062",["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Byte))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)92", ["InvalidImm2"] = "(SveMaskPattern)2063",["ValidateResult"] = "isUnexpectedResult = (result != (data - (ulong)(2 * Unsafe.SizeOf>() / sizeof(Byte))));",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)98", ["InvalidImm2"] = "(SveMaskPattern)1040",["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int16))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)99", ["InvalidImm2"] = "(SveMaskPattern)2040",["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int16))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)101", ["InvalidImm2"] = "(SveMaskPattern)3040",["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int16))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)118", ["InvalidImm2"] = "(SveMaskPattern)3050",["ValidateResult"] = "isUnexpectedResult = (result != (data + (ulong)(2 * Unsafe.SizeOf>() / sizeof(Int16))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_vector_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)118", ["InvalidImm2"] = "(SveMaskPattern)3060",["ValidateIterResult"] = "result[i] != (firstOp[i] + (2 * Unsafe.SizeOf>() / sizeof(Int16)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_vector_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)123", ["InvalidImm2"] = "(SveMaskPattern)3070",["ValidateIterResult"] = "result[i] != (firstOp[i] + (2 * Unsafe.SizeOf>() / sizeof(Int16)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)201", ["InvalidImm2"] = "(SveMaskPattern)3080",["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int32))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)202", ["InvalidImm2"] = "(SveMaskPattern)5012",["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int32))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)207", ["InvalidImm2"] = "(SveMaskPattern)5013",["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int32))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)220", ["InvalidImm2"] = "(SveMaskPattern)9999",["ValidateResult"] = "isUnexpectedResult = (result != (data + (ulong)(2 * Unsafe.SizeOf>() / sizeof(Int32))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_vector_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)221", ["InvalidImm2"] = "(SveMaskPattern)9876",["ValidateIterResult"] = "result[i] != (firstOp[i] + (2 * Unsafe.SizeOf>() / sizeof(Int32)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_vector_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)240", ["InvalidImm2"] = "(SveMaskPattern)5432",["ValidateIterResult"] = "result[i] != (firstOp[i] + (2 * Unsafe.SizeOf>() / sizeof(Int32)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)241", ["InvalidImm2"] = "(SveMaskPattern)7005",["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int64))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)255", ["InvalidImm2"] = "(SveMaskPattern)7008",["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int64))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)243", ["InvalidImm2"] = "(SveMaskPattern)7009",["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int64))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)19", ["InvalidImm2"] = "(SveMaskPattern)7001",["ValidateResult"] = "isUnexpectedResult = (result != (data + (ulong)(2 * Unsafe.SizeOf>() / sizeof(Int64))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_vector_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)56", ["InvalidImm2"] = "(SveMaskPattern)7009",["ValidateIterResult"] = "result[i] != (firstOp[i] + (2 * Unsafe.SizeOf>() / sizeof(Int64)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_vector_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)75", ["InvalidImm2"] = "(SveMaskPattern)7654",["ValidateIterResult"] = "result[i] != (firstOp[i] + (ulong)(2 * Unsafe.SizeOf>() / sizeof(Int64)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)100", ["InvalidImm2"] = "(SveMaskPattern)8765",["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Byte))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)99", ["InvalidImm2"] = "(SveMaskPattern)8123",["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Byte))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)98", ["InvalidImm2"] = "(SveMaskPattern)8432",["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Byte))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)97", ["InvalidImm2"] = "(SveMaskPattern)8434",["ValidateResult"] = "isUnexpectedResult = (result != (data + (ulong)(2 * Unsafe.SizeOf>() / sizeof(Byte))));",}), ("SveSimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sve_SignExtend16_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SignExtend16", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "result[i] != Helpers.SignExtend(firstOp[i], 16, false)", ["GetIterResult"] = "Helpers.SignExtend(leftOp[i], 16, false)"}), ("SveSimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sve_SignExtend16_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SignExtend16", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "result[i] != Helpers.SignExtend(firstOp[i], 16, false)", ["GetIterResult"] = "Helpers.SignExtend(leftOp[i], 16, false)"}), diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/ScalarImm2UnOpTest.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/ScalarImm2UnOpTest.template index 83e3cf0428517c..ac3cfaaa4bc236 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/ScalarImm2UnOpTest.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/ScalarImm2UnOpTest.template @@ -44,6 +44,12 @@ namespace JIT.HardwareIntrinsics.Arm // Validates passing an instance member of a struct works test.RunStructFldScenario(); + + // Validates basic functionality fails with an invalid imm1, using Unsafe.ReadUnaligned + test.RunBasicScenario_UnsafeRead_InvalidImm1(); + + // Validates basic functionality fails with an invalid imm2, using Unsafe.ReadUnaligned + test.RunBasicScenario_UnsafeRead_InvalidImm2(); } else { @@ -157,6 +163,42 @@ namespace JIT.HardwareIntrinsics.Arm test.RunStructFldScenario(this); } + public void RunBasicScenario_UnsafeRead_InvalidImm1() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + bool succeeded = false; + + try + { + var result = {Isa}.{Method}( + Unsafe.ReadUnaligned<{Op1BaseType}>(ref Unsafe.As<{Op1BaseType}, byte>(ref _data)), {InvalidImm}, {Imm2} + ); + } + catch (ArgumentOutOfRangeException) + { + succeeded = true; + } + } + + public void RunBasicScenario_UnsafeRead_InvalidImm2() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + bool succeeded = false; + + try + { + var result = {Isa}.{Method}( + Unsafe.ReadUnaligned<{Op1BaseType}>(ref Unsafe.As<{Op1BaseType}, byte>(ref _data)), {Imm}, {InvalidImm2} + ); + } + catch (ArgumentOutOfRangeException) + { + succeeded = true; + } + } + public void RunUnsupportedScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); From 999b5e47af5daf9bce273e0848b20bdb30a62ffe Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Tue, 28 May 2024 14:20:02 +0100 Subject: [PATCH 13/29] Expand testing --- .../GenerateHWIntrinsicTests_Arm.cs | 103 +++++++++--------- .../Arm/Shared/ScalarImm2UnOpTest.template | 18 +-- .../_SveImm2UnaryOpTestTemplate.template | 67 ++++++++++-- 3 files changed, 116 insertions(+), 72 deletions(-) diff --git a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs index a93b6fc9bcf327..b76f9252ffa2ac 100644 --- a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs +++ b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs @@ -3257,57 +3257,58 @@ ("SveVecReduceUnOpTest.template", new Dictionary { ["TestName"] = "Sve_OrAcross_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "OrAcross", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateReduceOpResult"] = "Helpers.OrAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), ("SveVecReduceUnOpTest.template", new Dictionary { ["TestName"] = "Sve_OrAcross_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "OrAcross", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateReduceOpResult"] = "Helpers.OrAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)18", ["InvalidImm2"] = "(SveMaskPattern)35", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int16))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)19", ["InvalidImm2"] = "(SveMaskPattern)3115",["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int16))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)25", ["InvalidImm2"] = "(SveMaskPattern)2000",["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int16))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)255", ["InvalidImm2"] = "(SveMaskPattern)2050",["ValidateResult"] = "isUnexpectedResult = (result != (data - (ulong)(2 * Unsafe.SizeOf>() / sizeof(Int16))));",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_vector_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)65", ["InvalidImm2"] = "(SveMaskPattern)90", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (2 * Unsafe.SizeOf>() / sizeof(Int16)))",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_vector_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)72", ["InvalidImm2"] = "(SveMaskPattern)35", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (2 * Unsafe.SizeOf>() / sizeof(Int16)))",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)17", ["InvalidImm2"] = "(SveMaskPattern)32", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int32))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)19", ["InvalidImm2"] = "(SveMaskPattern)33", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int32))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)25", ["InvalidImm2"] = "(SveMaskPattern)34", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int32))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)26", ["InvalidImm2"] = "(SveMaskPattern)35", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (ulong)(2 * Unsafe.SizeOf>() / sizeof(Int32))));",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_vector_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)27", ["InvalidImm2"] = "(SveMaskPattern)36", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (2 * Unsafe.SizeOf>() / sizeof(Int32)))",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_vector_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)18", ["InvalidImm2"] = "(SveMaskPattern)37", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (2 * Unsafe.SizeOf>() / sizeof(Int32)))",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)34", ["InvalidImm2"] = "(SveMaskPattern)135", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int64))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)35", ["InvalidImm2"] = "(SveMaskPattern)125", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int64))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)36", ["InvalidImm2"] = "(SveMaskPattern)115", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Int64))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)37", ["InvalidImm2"] = "(SveMaskPattern)145", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (ulong)(2 * Unsafe.SizeOf>() / sizeof(Int64))));",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_vector_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)38", ["InvalidImm2"] = "(SveMaskPattern)155", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (2 * Unsafe.SizeOf>() / sizeof(Int64)))",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_vector_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)39", ["InvalidImm2"] = "(SveMaskPattern)165", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (ulong)(2 * Unsafe.SizeOf>() / sizeof(Int64)))",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)89", ["InvalidImm2"] = "(SveMaskPattern)2060",["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Byte))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)90", ["InvalidImm2"] = "(SveMaskPattern)2061",["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Byte))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)91", ["InvalidImm2"] = "(SveMaskPattern)2062",["ValidateResult"] = "isUnexpectedResult = (result != (data - (2 * Unsafe.SizeOf>() / sizeof(Byte))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)92", ["InvalidImm2"] = "(SveMaskPattern)2063",["ValidateResult"] = "isUnexpectedResult = (result != (data - (ulong)(2 * Unsafe.SizeOf>() / sizeof(Byte))));",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)98", ["InvalidImm2"] = "(SveMaskPattern)1040",["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int16))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)99", ["InvalidImm2"] = "(SveMaskPattern)2040",["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int16))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)101", ["InvalidImm2"] = "(SveMaskPattern)3040",["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int16))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)118", ["InvalidImm2"] = "(SveMaskPattern)3050",["ValidateResult"] = "isUnexpectedResult = (result != (data + (ulong)(2 * Unsafe.SizeOf>() / sizeof(Int16))));",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_vector_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)118", ["InvalidImm2"] = "(SveMaskPattern)3060",["ValidateIterResult"] = "result[i] != (firstOp[i] + (2 * Unsafe.SizeOf>() / sizeof(Int16)))",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_vector_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)123", ["InvalidImm2"] = "(SveMaskPattern)3070",["ValidateIterResult"] = "result[i] != (firstOp[i] + (2 * Unsafe.SizeOf>() / sizeof(Int16)))",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)201", ["InvalidImm2"] = "(SveMaskPattern)3080",["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int32))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)202", ["InvalidImm2"] = "(SveMaskPattern)5012",["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int32))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)207", ["InvalidImm2"] = "(SveMaskPattern)5013",["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int32))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)220", ["InvalidImm2"] = "(SveMaskPattern)9999",["ValidateResult"] = "isUnexpectedResult = (result != (data + (ulong)(2 * Unsafe.SizeOf>() / sizeof(Int32))));",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_vector_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)221", ["InvalidImm2"] = "(SveMaskPattern)9876",["ValidateIterResult"] = "result[i] != (firstOp[i] + (2 * Unsafe.SizeOf>() / sizeof(Int32)))",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_vector_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)240", ["InvalidImm2"] = "(SveMaskPattern)5432",["ValidateIterResult"] = "result[i] != (firstOp[i] + (2 * Unsafe.SizeOf>() / sizeof(Int32)))",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)241", ["InvalidImm2"] = "(SveMaskPattern)7005",["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int64))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)255", ["InvalidImm2"] = "(SveMaskPattern)7008",["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int64))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)243", ["InvalidImm2"] = "(SveMaskPattern)7009",["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Int64))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)19", ["InvalidImm2"] = "(SveMaskPattern)7001",["ValidateResult"] = "isUnexpectedResult = (result != (data + (ulong)(2 * Unsafe.SizeOf>() / sizeof(Int64))));",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_vector_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)56", ["InvalidImm2"] = "(SveMaskPattern)7009",["ValidateIterResult"] = "result[i] != (firstOp[i] + (2 * Unsafe.SizeOf>() / sizeof(Int64)))",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_vector_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)75", ["InvalidImm2"] = "(SveMaskPattern)7654",["ValidateIterResult"] = "result[i] != (firstOp[i] + (ulong)(2 * Unsafe.SizeOf>() / sizeof(Int64)))",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)100", ["InvalidImm2"] = "(SveMaskPattern)8765",["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Byte))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)99", ["InvalidImm2"] = "(SveMaskPattern)8123",["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Byte))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)98", ["InvalidImm2"] = "(SveMaskPattern)8432",["ValidateResult"] = "isUnexpectedResult = (result != (data + (2 * Unsafe.SizeOf>() / sizeof(Byte))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)97", ["InvalidImm2"] = "(SveMaskPattern)8434",["ValidateResult"] = "isUnexpectedResult = (result != (data + (ulong)(2 * Unsafe.SizeOf>() / sizeof(Byte))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)0", ["InvalidImm2"] = "(SveMaskPattern)35", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Unsafe.SizeOf>() / sizeof(Int16))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)12", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)19", ["InvalidImm2"] = "(SveMaskPattern)37", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Unsafe.SizeOf>() / sizeof(Int16))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)5", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)25", ["InvalidImm2"] = "(SveMaskPattern)46", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Unsafe.SizeOf>() / sizeof(Int16))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)7", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)255", ["InvalidImm2"] = "(SveMaskPattern)50", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (ulong)(imm1 * Unsafe.SizeOf>() / sizeof(Int16))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_vector_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "(Byte)10", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)65", ["InvalidImm2"] = "(SveMaskPattern)90", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (imm1 * Unsafe.SizeOf>() / sizeof(Int16)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_vector_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "(Byte)1", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)72", ["InvalidImm2"] = "(SveMaskPattern)35", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (imm1 * Unsafe.SizeOf>() / sizeof(Int16)))",}), + + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)1", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)17", ["InvalidImm2"] = "(SveMaskPattern)32", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Unsafe.SizeOf>() / sizeof(Int32))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)19", ["InvalidImm2"] = "(SveMaskPattern)33", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Unsafe.SizeOf>() / sizeof(Int32))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)3", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)25", ["InvalidImm2"] = "(SveMaskPattern)34", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Unsafe.SizeOf>() / sizeof(Int32))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)4", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)26", ["InvalidImm2"] = "(SveMaskPattern)35", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (ulong)(imm1 * Unsafe.SizeOf>() / sizeof(Int32))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_vector_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)5", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)27", ["InvalidImm2"] = "(SveMaskPattern)36", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (imm1 * Unsafe.SizeOf>() / sizeof(Int32)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_vector_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)6", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)18", ["InvalidImm2"] = "(SveMaskPattern)37", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (imm1 * Unsafe.SizeOf>() / sizeof(Int32)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)7", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)34", ["InvalidImm2"] = "(SveMaskPattern)135", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Unsafe.SizeOf>() / sizeof(Int64))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)8", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)35", ["InvalidImm2"] = "(SveMaskPattern)125", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Unsafe.SizeOf>() / sizeof(Int64))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)9", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)36", ["InvalidImm2"] = "(SveMaskPattern)115", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Unsafe.SizeOf>() / sizeof(Int64))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)10", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)37", ["InvalidImm2"] = "(SveMaskPattern)145", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (ulong)(imm1 * Unsafe.SizeOf>() / sizeof(Int64))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_vector_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)11", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)38", ["InvalidImm2"] = "(SveMaskPattern)155", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (imm1 * Unsafe.SizeOf>() / sizeof(Int64)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_vector_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)12", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)39", ["InvalidImm2"] = "(SveMaskPattern)165", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (ulong)(imm1 * Unsafe.SizeOf>() / sizeof(Int64)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)13", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)89", ["InvalidImm2"] = "(SveMaskPattern)206", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Unsafe.SizeOf>() / sizeof(Byte))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)14", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)0", ["InvalidImm2"] = "(SveMaskPattern)207", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Unsafe.SizeOf>() / sizeof(Byte))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)15", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)91", ["InvalidImm2"] = "(SveMaskPattern)208", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Unsafe.SizeOf>() / sizeof(Byte))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)16", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)92", ["InvalidImm2"] = "(SveMaskPattern)209", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (ulong)(imm1 * Unsafe.SizeOf>() / sizeof(Byte))));",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)15", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)98", ["InvalidImm2"] = "(SveMaskPattern)241", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Unsafe.SizeOf>() / sizeof(Int16))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)14", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)99", ["InvalidImm2"] = "(SveMaskPattern)242", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Unsafe.SizeOf>() / sizeof(Int16))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)13", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)101", ["InvalidImm2"] = "(SveMaskPattern)243", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Unsafe.SizeOf>() / sizeof(Int16))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)12", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)118", ["InvalidImm2"] = "(SveMaskPattern)50", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (ulong)(imm1 * Unsafe.SizeOf>() / sizeof(Int16))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_vector_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "(Byte)11", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)118", ["InvalidImm2"] = "(SveMaskPattern)60", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (imm1 * Unsafe.SizeOf>() / sizeof(Int16)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_vector_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "(Byte)10", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)123", ["InvalidImm2"] = "(SveMaskPattern)70", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (imm1 * Unsafe.SizeOf>() / sizeof(Int16)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)9", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)201", ["InvalidImm2"] = "(SveMaskPattern)80", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Unsafe.SizeOf>() / sizeof(Int32))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)8", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)202", ["InvalidImm2"] = "(SveMaskPattern)12", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Unsafe.SizeOf>() / sizeof(Int32))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)7", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)207", ["InvalidImm2"] = "(SveMaskPattern)13", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Unsafe.SizeOf>() / sizeof(Int32))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)6", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)220", ["InvalidImm2"] = "(SveMaskPattern)99", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (ulong)(imm1 * Unsafe.SizeOf>() / sizeof(Int32))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_vector_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)5", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)221", ["InvalidImm2"] = "(SveMaskPattern)76", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (imm1 * Unsafe.SizeOf>() / sizeof(Int32)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_vector_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)4", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)240", ["InvalidImm2"] = "(SveMaskPattern)32", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (imm1 * Unsafe.SizeOf>() / sizeof(Int32)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)3", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)241", ["InvalidImm2"] = "(SveMaskPattern)105", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Unsafe.SizeOf>() / sizeof(Int64))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)255", ["InvalidImm2"] = "(SveMaskPattern)108", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Unsafe.SizeOf>() / sizeof(Int64))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)1", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)243", ["InvalidImm2"] = "(SveMaskPattern)109", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Unsafe.SizeOf>() / sizeof(Int64))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)19", ["InvalidImm2"] = "(SveMaskPattern)101", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (ulong)(imm1 * Unsafe.SizeOf>() / sizeof(Int64))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_vector_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)56", ["InvalidImm2"] = "(SveMaskPattern)109", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (imm1 * Unsafe.SizeOf>() / sizeof(Int64)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_vector_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)75", ["InvalidImm2"] = "(SveMaskPattern)154", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (ulong)(imm1 * Unsafe.SizeOf>() / sizeof(Int64)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)100", ["InvalidImm2"] = "(SveMaskPattern)235", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Unsafe.SizeOf>() / sizeof(Byte))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)99", ["InvalidImm2"] = "(SveMaskPattern)123", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Unsafe.SizeOf>() / sizeof(Byte))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)98", ["InvalidImm2"] = "(SveMaskPattern)232", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Unsafe.SizeOf>() / sizeof(Byte))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)97", ["InvalidImm2"] = "(SveMaskPattern)234", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (ulong)(imm1 * Unsafe.SizeOf>() / sizeof(Byte))));",}), ("SveSimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sve_SignExtend16_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SignExtend16", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "result[i] != Helpers.SignExtend(firstOp[i], 16, false)", ["GetIterResult"] = "Helpers.SignExtend(leftOp[i], 16, false)"}), ("SveSimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sve_SignExtend16_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SignExtend16", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "result[i] != Helpers.SignExtend(firstOp[i], 16, false)", ["GetIterResult"] = "Helpers.SignExtend(leftOp[i], 16, false)"}), diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/ScalarImm2UnOpTest.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/ScalarImm2UnOpTest.template index ac3cfaaa4bc236..78afd8c2a52df2 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/ScalarImm2UnOpTest.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/ScalarImm2UnOpTest.template @@ -81,7 +81,7 @@ namespace JIT.HardwareIntrinsics.Arm public void RunStructFldScenario(ScalarImm2UnaryOpTest__{TestName} testClass) { var result = {Isa}.{Method}(_fld, {Imm}, {Imm2}); - testClass.ValidateResult(_fld, result); + testClass.ValidateResult(_fld, {Imm}, {Imm2}, result); } } @@ -110,7 +110,7 @@ namespace JIT.HardwareIntrinsics.Arm Unsafe.ReadUnaligned<{Op1BaseType}>(ref Unsafe.As<{Op1BaseType}, byte>(ref _data)), {Imm}, {Imm2} ); - ValidateResult(_data, result); + ValidateResult(_data, {Imm}, {Imm2}, result); } public void RunReflectionScenario_UnsafeRead() @@ -124,7 +124,7 @@ namespace JIT.HardwareIntrinsics.Arm {Imm2}, }); - ValidateResult(_data, ({RetBaseType})result); + ValidateResult(_data, {Imm}, {Imm2}, ({RetBaseType})result); } public void RunLclVarScenario_UnsafeRead() @@ -134,7 +134,7 @@ namespace JIT.HardwareIntrinsics.Arm var data = Unsafe.ReadUnaligned<{Op1BaseType}>(ref Unsafe.As<{Op1BaseType}, byte>(ref _data)); var result = {Isa}.{Method}(data, {Imm}, {Imm2}); - ValidateResult(data, result); + ValidateResult(data, {Imm}, {Imm2}, result); } public void RunClassFldScenario() @@ -142,7 +142,7 @@ namespace JIT.HardwareIntrinsics.Arm TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); var result = {Isa}.{Method}(_fld, {Imm}, {Imm2}); - ValidateResult(_fld, result); + ValidateResult(_fld, {Imm}, {Imm2}, result); } public void RunStructLclFldScenario() @@ -152,7 +152,7 @@ namespace JIT.HardwareIntrinsics.Arm var test = TestStruct.Create(); var result = {Isa}.{Method}(test._fld, {Imm}, {Imm2}); - ValidateResult(test._fld, result); + ValidateResult(test._fld, {Imm}, {Imm2}, result); } public void RunStructFldScenario() @@ -165,7 +165,7 @@ namespace JIT.HardwareIntrinsics.Arm public void RunBasicScenario_UnsafeRead_InvalidImm1() { - TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead_InvalidImm1)); bool succeeded = false; @@ -183,7 +183,7 @@ namespace JIT.HardwareIntrinsics.Arm public void RunBasicScenario_UnsafeRead_InvalidImm2() { - TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead_InvalidImm2)); bool succeeded = false; @@ -220,7 +220,7 @@ namespace JIT.HardwareIntrinsics.Arm } } - private void ValidateResult({Op1BaseType} data, {RetBaseType} result, [CallerMemberName] string method = "") + private void ValidateResult({Op1BaseType} data, {Op2BaseType} imm1, {Op3BaseType} imm2, {RetBaseType} result, [CallerMemberName] string method = "") { var isUnexpectedResult = false; diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveImm2UnaryOpTestTemplate.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveImm2UnaryOpTestTemplate.template index 7b711084591b98..37d3a025210fa0 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveImm2UnaryOpTestTemplate.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveImm2UnaryOpTestTemplate.template @@ -131,7 +131,7 @@ namespace JIT.HardwareIntrinsics.Arm var result = {Isa}.{Method}(_fld, {Imm}, {Imm2}); Unsafe.Write(testClass._dataTable.outArrayPtr, result); - testClass.ValidateResult(_fld, testClass._dataTable.outArrayPtr); + testClass.ValidateResult(_fld, {Imm}, {Imm2}, testClass._dataTable.outArrayPtr); } } @@ -174,7 +174,7 @@ namespace JIT.HardwareIntrinsics.Arm ); Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); + ValidateResult(_dataTable.inArrayPtr, {Imm}, {Imm2}, _dataTable.outArrayPtr); } public void RunBasicScenario_Load() @@ -191,7 +191,7 @@ namespace JIT.HardwareIntrinsics.Arm ); Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); + ValidateResult(_dataTable.inArrayPtr, {Imm}, {Imm2}, _dataTable.outArrayPtr); } public void RunReflectionScenario_UnsafeRead() @@ -206,7 +206,7 @@ namespace JIT.HardwareIntrinsics.Arm }); Unsafe.Write(_dataTable.outArrayPtr, ({RetVectorType}<{RetBaseType}>)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); + ValidateResult(_dataTable.inArrayPtr, {Imm}, {Imm2}, _dataTable.outArrayPtr); } public void RunLclVarScenario_UnsafeRead() @@ -217,7 +217,7 @@ namespace JIT.HardwareIntrinsics.Arm var result = {Isa}.{Method}(firstOp, {Imm}, {Imm2}); Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); + ValidateResult(firstOp, {Imm}, {Imm2}, _dataTable.outArrayPtr); } public void RunClassFldScenario() @@ -227,7 +227,7 @@ namespace JIT.HardwareIntrinsics.Arm var result = {Isa}.{Method}(_fld, {Imm}, {Imm2}); Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_fld, _dataTable.outArrayPtr); + ValidateResult(_fld, {Imm}, {Imm2}, _dataTable.outArrayPtr); } public void RunStructLclFldScenario() @@ -238,7 +238,7 @@ namespace JIT.HardwareIntrinsics.Arm var result = {Isa}.{Method}(test._fld, {Imm}, {Imm2}); Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(test._fld, _dataTable.outArrayPtr); + ValidateResult(test._fld, {Imm}, {Imm2}, _dataTable.outArrayPtr); } public void RunStructFldScenario() @@ -249,6 +249,49 @@ namespace JIT.HardwareIntrinsics.Arm test.RunStructFldScenario(this); } + + + public void RunBasicScenario_UnsafeRead_InvalidImm1() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + bool succeeded = false; + + try + { + var result = {Isa}.{Method}( + Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArrayPtr), + {InvalidImm}, + {Imm2} + ); + } + catch (ArgumentOutOfRangeException) + { + succeeded = true; + } + } + + public void RunBasicScenario_UnsafeRead_InvalidImm2() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + bool succeeded = false; + + try + { + var result = {Isa}.{Method}( + Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArrayPtr), + {Imm}, + {InvalidImm2} + ); + + } + catch (ArgumentOutOfRangeException) + { + succeeded = true; + } + } + public void RunUnsupportedScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); @@ -270,7 +313,7 @@ namespace JIT.HardwareIntrinsics.Arm } } - private void ValidateResult({Op1VectorType}<{Op1BaseType}> firstOp, void* result, [CallerMemberName] string method = "") + private void ValidateResult({Op1VectorType}<{Op1BaseType}> firstOp, {Op2BaseType} imm1, {Op3BaseType} imm2, void* result, [CallerMemberName] string method = "") { {Op1BaseType}[] inArray = new {Op1BaseType}[Op1ElementCount]; {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; @@ -278,10 +321,10 @@ namespace JIT.HardwareIntrinsics.Arm Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray[0]), firstOp); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>()); - ValidateResult(inArray, outArray, method); + ValidateResult(inArray, imm1, imm2, outArray, method); } - private void ValidateResult(void* firstOp, void* result, [CallerMemberName] string method = "") + private void ValidateResult(void* firstOp, {Op2BaseType} imm1, {Op3BaseType} imm2, void* result, [CallerMemberName] string method = "") { {Op1BaseType}[] inArray = new {Op1BaseType}[Op1ElementCount]; {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; @@ -289,10 +332,10 @@ namespace JIT.HardwareIntrinsics.Arm Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray[0]), ref Unsafe.AsRef(firstOp), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>()); - ValidateResult(inArray, outArray, method); + ValidateResult(inArray, imm1, imm2, outArray, method); } - private void ValidateResult({Op1BaseType}[] firstOp, {RetBaseType}[] result, [CallerMemberName] string method = "") + private void ValidateResult({Op1BaseType}[] firstOp, {Op2BaseType} imm1, {Op3BaseType} imm2, {RetBaseType}[] result, [CallerMemberName] string method = "") { bool succeeded = true; From e82dc4e1c2b3774ca0175da1e847f376dc0e0215 Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Tue, 28 May 2024 15:04:55 +0100 Subject: [PATCH 14/29] Add testing for different patterns Change-Id: I7fe4dc44c2dca9eb09e5b3540b89874001fb062a --- .../GenerateHWIntrinsicTests_Arm.cs | 103 +++++++++--------- .../HardwareIntrinsics/Arm/Shared/Helpers.cs | 76 +++++++++++++ 2 files changed, 127 insertions(+), 52 deletions(-) diff --git a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs index b76f9252ffa2ac..e70f863617e44c 100644 --- a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs +++ b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs @@ -3257,58 +3257,57 @@ ("SveVecReduceUnOpTest.template", new Dictionary { ["TestName"] = "Sve_OrAcross_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "OrAcross", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateReduceOpResult"] = "Helpers.OrAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), ("SveVecReduceUnOpTest.template", new Dictionary { ["TestName"] = "Sve_OrAcross_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "OrAcross", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateReduceOpResult"] = "Helpers.OrAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)0", ["InvalidImm2"] = "(SveMaskPattern)35", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Unsafe.SizeOf>() / sizeof(Int16))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)12", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)19", ["InvalidImm2"] = "(SveMaskPattern)37", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Unsafe.SizeOf>() / sizeof(Int16))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)5", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)25", ["InvalidImm2"] = "(SveMaskPattern)46", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Unsafe.SizeOf>() / sizeof(Int16))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)7", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)255", ["InvalidImm2"] = "(SveMaskPattern)50", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (ulong)(imm1 * Unsafe.SizeOf>() / sizeof(Int16))));",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_vector_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "(Byte)10", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)65", ["InvalidImm2"] = "(SveMaskPattern)90", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (imm1 * Unsafe.SizeOf>() / sizeof(Int16)))",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_vector_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "(Byte)1", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)72", ["InvalidImm2"] = "(SveMaskPattern)35", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (imm1 * Unsafe.SizeOf>() / sizeof(Int16)))",}), - - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)1", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)17", ["InvalidImm2"] = "(SveMaskPattern)32", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Unsafe.SizeOf>() / sizeof(Int32))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)19", ["InvalidImm2"] = "(SveMaskPattern)33", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Unsafe.SizeOf>() / sizeof(Int32))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)3", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)25", ["InvalidImm2"] = "(SveMaskPattern)34", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Unsafe.SizeOf>() / sizeof(Int32))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)4", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)26", ["InvalidImm2"] = "(SveMaskPattern)35", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (ulong)(imm1 * Unsafe.SizeOf>() / sizeof(Int32))));",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_vector_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)5", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)27", ["InvalidImm2"] = "(SveMaskPattern)36", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (imm1 * Unsafe.SizeOf>() / sizeof(Int32)))",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_vector_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)6", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)18", ["InvalidImm2"] = "(SveMaskPattern)37", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (imm1 * Unsafe.SizeOf>() / sizeof(Int32)))",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)7", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)34", ["InvalidImm2"] = "(SveMaskPattern)135", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Unsafe.SizeOf>() / sizeof(Int64))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)8", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)35", ["InvalidImm2"] = "(SveMaskPattern)125", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Unsafe.SizeOf>() / sizeof(Int64))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)9", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)36", ["InvalidImm2"] = "(SveMaskPattern)115", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Unsafe.SizeOf>() / sizeof(Int64))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)10", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)37", ["InvalidImm2"] = "(SveMaskPattern)145", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (ulong)(imm1 * Unsafe.SizeOf>() / sizeof(Int64))));",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_vector_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)11", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)38", ["InvalidImm2"] = "(SveMaskPattern)155", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (imm1 * Unsafe.SizeOf>() / sizeof(Int64)))",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_vector_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)12", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)39", ["InvalidImm2"] = "(SveMaskPattern)165", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (ulong)(imm1 * Unsafe.SizeOf>() / sizeof(Int64)))",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)13", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)89", ["InvalidImm2"] = "(SveMaskPattern)206", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Unsafe.SizeOf>() / sizeof(Byte))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)14", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)0", ["InvalidImm2"] = "(SveMaskPattern)207", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Unsafe.SizeOf>() / sizeof(Byte))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)15", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)91", ["InvalidImm2"] = "(SveMaskPattern)208", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Unsafe.SizeOf>() / sizeof(Byte))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)16", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)92", ["InvalidImm2"] = "(SveMaskPattern)209", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (ulong)(imm1 * Unsafe.SizeOf>() / sizeof(Byte))));",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)15", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)98", ["InvalidImm2"] = "(SveMaskPattern)241", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Unsafe.SizeOf>() / sizeof(Int16))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)14", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)99", ["InvalidImm2"] = "(SveMaskPattern)242", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Unsafe.SizeOf>() / sizeof(Int16))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)13", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)101", ["InvalidImm2"] = "(SveMaskPattern)243", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Unsafe.SizeOf>() / sizeof(Int16))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)12", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)118", ["InvalidImm2"] = "(SveMaskPattern)50", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (ulong)(imm1 * Unsafe.SizeOf>() / sizeof(Int16))));",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_vector_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "(Byte)11", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)118", ["InvalidImm2"] = "(SveMaskPattern)60", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (imm1 * Unsafe.SizeOf>() / sizeof(Int16)))",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_vector_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "(Byte)10", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)123", ["InvalidImm2"] = "(SveMaskPattern)70", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (imm1 * Unsafe.SizeOf>() / sizeof(Int16)))",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)9", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)201", ["InvalidImm2"] = "(SveMaskPattern)80", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Unsafe.SizeOf>() / sizeof(Int32))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)8", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)202", ["InvalidImm2"] = "(SveMaskPattern)12", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Unsafe.SizeOf>() / sizeof(Int32))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)7", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)207", ["InvalidImm2"] = "(SveMaskPattern)13", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Unsafe.SizeOf>() / sizeof(Int32))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)6", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)220", ["InvalidImm2"] = "(SveMaskPattern)99", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (ulong)(imm1 * Unsafe.SizeOf>() / sizeof(Int32))));",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_vector_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)5", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)221", ["InvalidImm2"] = "(SveMaskPattern)76", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (imm1 * Unsafe.SizeOf>() / sizeof(Int32)))",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_vector_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)4", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)240", ["InvalidImm2"] = "(SveMaskPattern)32", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (imm1 * Unsafe.SizeOf>() / sizeof(Int32)))",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)3", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)241", ["InvalidImm2"] = "(SveMaskPattern)105", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Unsafe.SizeOf>() / sizeof(Int64))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)255", ["InvalidImm2"] = "(SveMaskPattern)108", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Unsafe.SizeOf>() / sizeof(Int64))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)1", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)243", ["InvalidImm2"] = "(SveMaskPattern)109", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Unsafe.SizeOf>() / sizeof(Int64))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)19", ["InvalidImm2"] = "(SveMaskPattern)101", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (ulong)(imm1 * Unsafe.SizeOf>() / sizeof(Int64))));",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_vector_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)56", ["InvalidImm2"] = "(SveMaskPattern)109", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (imm1 * Unsafe.SizeOf>() / sizeof(Int64)))",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_vector_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)75", ["InvalidImm2"] = "(SveMaskPattern)154", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (ulong)(imm1 * Unsafe.SizeOf>() / sizeof(Int64)))",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)100", ["InvalidImm2"] = "(SveMaskPattern)235", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Unsafe.SizeOf>() / sizeof(Byte))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)99", ["InvalidImm2"] = "(SveMaskPattern)123", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Unsafe.SizeOf>() / sizeof(Byte))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)98", ["InvalidImm2"] = "(SveMaskPattern)232", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Unsafe.SizeOf>() / sizeof(Byte))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)97", ["InvalidImm2"] = "(SveMaskPattern)234", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (ulong)(imm1 * Unsafe.SizeOf>() / sizeof(Byte))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.LargestPowerOf2", ["InvalidImm"] = "(Byte)0", ["InvalidImm2"] = "(SveMaskPattern)35", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)12", ["Imm2"] = "SveMaskPattern.VectorCount1", ["InvalidImm"] = "(Byte)19", ["InvalidImm2"] = "(SveMaskPattern)37", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)5", ["Imm2"] = "SveMaskPattern.VectorCount2", ["InvalidImm"] = "(Byte)25", ["InvalidImm2"] = "(SveMaskPattern)46", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)7", ["Imm2"] = "SveMaskPattern.VectorCount3", ["InvalidImm"] = "(Byte)255", ["InvalidImm2"] = "(SveMaskPattern)50", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (ulong)(imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_vector_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "(Byte)10", ["Imm2"] = "SveMaskPattern.VectorCount4", ["InvalidImm"] = "(Byte)65", ["InvalidImm2"] = "(SveMaskPattern)90", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_vector_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "(Byte)1", ["Imm2"] = "SveMaskPattern.VectorCount5", ["InvalidImm"] = "(Byte)72", ["InvalidImm2"] = "(SveMaskPattern)35", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)1", ["Imm2"] = "SveMaskPattern.VectorCount6", ["InvalidImm"] = "(Byte)17", ["InvalidImm2"] = "(SveMaskPattern)32", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.VectorCount7", ["InvalidImm"] = "(Byte)19", ["InvalidImm2"] = "(SveMaskPattern)33", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)3", ["Imm2"] = "SveMaskPattern.VectorCount8", ["InvalidImm"] = "(Byte)25", ["InvalidImm2"] = "(SveMaskPattern)34", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)4", ["Imm2"] = "SveMaskPattern.VectorCount32", ["InvalidImm"] = "(Byte)26", ["InvalidImm2"] = "(SveMaskPattern)35", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (ulong)(imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_vector_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)5", ["Imm2"] = "SveMaskPattern.VectorCount64", ["InvalidImm"] = "(Byte)27", ["InvalidImm2"] = "(SveMaskPattern)36", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_vector_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)6", ["Imm2"] = "SveMaskPattern.VectorCount128", ["InvalidImm"] = "(Byte)18", ["InvalidImm2"] = "(SveMaskPattern)37", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)7", ["Imm2"] = "SveMaskPattern.VectorCount256", ["InvalidImm"] = "(Byte)34", ["InvalidImm2"] = "(SveMaskPattern)135", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)8", ["Imm2"] = "SveMaskPattern.LargestMultipleOf4", ["InvalidImm"] = "(Byte)35", ["InvalidImm2"] = "(SveMaskPattern)125", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)9", ["Imm2"] = "SveMaskPattern.LargestMultipleOf3", ["InvalidImm"] = "(Byte)36", ["InvalidImm2"] = "(SveMaskPattern)115", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)10", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)37", ["InvalidImm2"] = "(SveMaskPattern)145", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (ulong)(imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_vector_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)11", ["Imm2"] = "SveMaskPattern.VectorCount7", ["InvalidImm"] = "(Byte)38", ["InvalidImm2"] = "(SveMaskPattern)155", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_vector_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)12", ["Imm2"] = "SveMaskPattern.LargestPowerOf2", ["InvalidImm"] = "(Byte)39", ["InvalidImm2"] = "(SveMaskPattern)165", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (ulong)(imm1 * Helpers.NumberOfElementsInVectorInt64(imm2)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)13", ["Imm2"] = "SveMaskPattern.VectorCount4", ["InvalidImm"] = "(Byte)89", ["InvalidImm2"] = "(SveMaskPattern)206", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)14", ["Imm2"] = "SveMaskPattern.LargestPowerOf2", ["InvalidImm"] = "(Byte)0", ["InvalidImm2"] = "(SveMaskPattern)207", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)15", ["Imm2"] = "SveMaskPattern.VectorCount6", ["InvalidImm"] = "(Byte)91", ["InvalidImm2"] = "(SveMaskPattern)208", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)16", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)92", ["InvalidImm2"] = "(SveMaskPattern)209", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (ulong)(imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)15", ["Imm2"] = "SveMaskPattern.VectorCount4", ["InvalidImm"] = "(Byte)98", ["InvalidImm2"] = "(SveMaskPattern)241", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)14", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)99", ["InvalidImm2"] = "(SveMaskPattern)242", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)13", ["Imm2"] = "SveMaskPattern.VectorCount256", ["InvalidImm"] = "(Byte)101", ["InvalidImm2"] = "(SveMaskPattern)243", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)12", ["Imm2"] = "SveMaskPattern.VectorCount32", ["InvalidImm"] = "(Byte)118", ["InvalidImm2"] = "(SveMaskPattern)50", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (ulong)(imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_vector_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "(Byte)11", ["Imm2"] = "SveMaskPattern.VectorCount4", ["InvalidImm"] = "(Byte)118", ["InvalidImm2"] = "(SveMaskPattern)60", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_vector_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "(Byte)10", ["Imm2"] = "SveMaskPattern.VectorCount64", ["InvalidImm"] = "(Byte)123", ["InvalidImm2"] = "(SveMaskPattern)70", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)9", ["Imm2"] = "SveMaskPattern.VectorCount5", ["InvalidImm"] = "(Byte)201", ["InvalidImm2"] = "(SveMaskPattern)80", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)8", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)202", ["InvalidImm2"] = "(SveMaskPattern)12", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)7", ["Imm2"] = "SveMaskPattern.LargestPowerOf2", ["InvalidImm"] = "(Byte)207", ["InvalidImm2"] = "(SveMaskPattern)13", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)6", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)220", ["InvalidImm2"] = "(SveMaskPattern)99", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (ulong)(imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_vector_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)5", ["Imm2"] = "SveMaskPattern.LargestMultipleOf4", ["InvalidImm"] = "(Byte)221", ["InvalidImm2"] = "(SveMaskPattern)76", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_vector_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)4", ["Imm2"] = "SveMaskPattern.LargestMultipleOf3", ["InvalidImm"] = "(Byte)240", ["InvalidImm2"] = "(SveMaskPattern)32", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)3", ["Imm2"] = "SveMaskPattern.VectorCount64", ["InvalidImm"] = "(Byte)241", ["InvalidImm2"] = "(SveMaskPattern)105", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.VectorCount4", ["InvalidImm"] = "(Byte)255", ["InvalidImm2"] = "(SveMaskPattern)108", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)1", ["Imm2"] = "SveMaskPattern.VectorCount6", ["InvalidImm"] = "(Byte)243", ["InvalidImm2"] = "(SveMaskPattern)109", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.LargestMultipleOf3", ["InvalidImm"] = "(Byte)19", ["InvalidImm2"] = "(SveMaskPattern)101", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (ulong)(imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_vector_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.LargestPowerOf2", ["InvalidImm"] = "(Byte)56", ["InvalidImm2"] = "(SveMaskPattern)109", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_vector_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.VectorCount8", ["InvalidImm"] = "(Byte)75", ["InvalidImm2"] = "(SveMaskPattern)154", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (ulong)(imm1 * Helpers.NumberOfElementsInVectorInt64(imm2)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.VectorCount8", ["InvalidImm"] = "(Byte)100", ["InvalidImm2"] = "(SveMaskPattern)235", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.VectorCount4", ["InvalidImm"] = "(Byte)99", ["InvalidImm2"] = "(SveMaskPattern)123", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.VectorCount5", ["InvalidImm"] = "(Byte)98", ["InvalidImm2"] = "(SveMaskPattern)232", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)97", ["InvalidImm2"] = "(SveMaskPattern)234", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (ulong)(imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), ("SveSimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sve_SignExtend16_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SignExtend16", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "result[i] != Helpers.SignExtend(firstOp[i], 16, false)", ["GetIterResult"] = "Helpers.SignExtend(leftOp[i], 16, false)"}), ("SveSimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sve_SignExtend16_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SignExtend16", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "result[i] != Helpers.SignExtend(firstOp[i], 16, false)", ["GetIterResult"] = "Helpers.SignExtend(leftOp[i], 16, false)"}), diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs index d6b561bd0fab57..153e9df2a8c9a5 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs @@ -8,6 +8,10 @@ using System; using System.Linq; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics.Arm; namespace JIT.HardwareIntrinsics.Arm { @@ -6294,5 +6298,77 @@ public static ulong WhileLessThanOrEqualMask(ulong op1, ulong op2) { return (ulong)((op1 <= op2) ? 1 : 0); } + + public static int MaskNumberOfElementsVector(int elems, SveMaskPattern pattern) + { + + switch(pattern) + { + // Returns elems, as this is always a power of 2. + case SveMaskPattern.LargestPowerOf2: + return elems; + + // Returns N if N elements can fit in the vector. Otherwise 0. + case SveMaskPattern.VectorCount1: + return elems >= 1 ? 1 : 0; + case SveMaskPattern.VectorCount2: + return elems >= 2 ? 2 : 0; + case SveMaskPattern.VectorCount3: + return elems >= 3 ? 3 : 0; + case SveMaskPattern.VectorCount4: + return elems >= 4 ? 4 : 0; + case SveMaskPattern.VectorCount5: + return elems >= 5 ? 5 : 0; + case SveMaskPattern.VectorCount6: + return elems >= 6 ? 6 : 0; + case SveMaskPattern.VectorCount7: + return elems >= 7 ? 7 : 0; + case SveMaskPattern.VectorCount8: + return elems >= 8 ? 8 : 0; + case SveMaskPattern.VectorCount16: + return elems >= 16 ? 16 : 0; + case SveMaskPattern.VectorCount32: + return elems >= 32 ? 32 : 0; + case SveMaskPattern.VectorCount64: + return elems >= 64 ? 64 : 0; + case SveMaskPattern.VectorCount128: + return elems >= 128 ? 128 : 0; + case SveMaskPattern.VectorCount256: + return elems >= 256 ? 256 : 0; + + // Number of elems rounded down to nearest multiple of 4 + case SveMaskPattern.LargestMultipleOf4: + return elems - (elems % 4); + + // Number of elems rounded down to nearest multiple of 3 + case SveMaskPattern.LargestMultipleOf3: + return elems - (elems % 3); + + case SveMaskPattern.All: + default: + return elems; + } + } + + public static int NumberOfElementsInVectorInt8(SveMaskPattern pattern) + { + return MaskNumberOfElementsVector(Unsafe.SizeOf>() / sizeof(byte), pattern); + } + + public static int NumberOfElementsInVectorInt16(SveMaskPattern pattern) + { + return MaskNumberOfElementsVector(Unsafe.SizeOf>() / sizeof(short), pattern); + } + + public static int NumberOfElementsInVectorInt32(SveMaskPattern pattern) + { + return MaskNumberOfElementsVector(Unsafe.SizeOf>() / sizeof(int), pattern); + } + + public static int NumberOfElementsInVectorInt64(SveMaskPattern pattern) + { + return MaskNumberOfElementsVector(Unsafe.SizeOf>() / sizeof(long), pattern); + } + } } From 9780f7d44177a48f8ffa55e7021a43e9c4463b39 Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Tue, 28 May 2024 15:43:25 +0100 Subject: [PATCH 15/29] formatting --- src/coreclr/jit/codegen.h | 6 +++++- src/coreclr/jit/hwintrinsicarm64.cpp | 21 ++++++++++----------- src/coreclr/jit/hwintrinsiccodegenarm64.cpp | 15 ++++----------- 3 files changed, 19 insertions(+), 23 deletions(-) diff --git a/src/coreclr/jit/codegen.h b/src/coreclr/jit/codegen.h index 0fb903c3eb6b8d..f7a238f9271089 100644 --- a/src/coreclr/jit/codegen.h +++ b/src/coreclr/jit/codegen.h @@ -996,7 +996,11 @@ class CodeGen final : public CodeGenInterface public: HWIntrinsicImmOpHelper(CodeGen* codeGen, GenTree* immOp, GenTreeHWIntrinsic* intrin); - HWIntrinsicImmOpHelper(CodeGen* codeGen, regNumber nonConstImmReg, int immLowerBound, int immUpperBound, GenTreeHWIntrinsic* intrin); + HWIntrinsicImmOpHelper(CodeGen* codeGen, + regNumber nonConstImmReg, + int immLowerBound, + int immUpperBound, + GenTreeHWIntrinsic* intrin); void EmitBegin(); void EmitCaseEnd(); diff --git a/src/coreclr/jit/hwintrinsicarm64.cpp b/src/coreclr/jit/hwintrinsicarm64.cpp index e733ec531a9874..7cb92cfff5c69d 100644 --- a/src/coreclr/jit/hwintrinsicarm64.cpp +++ b/src/coreclr/jit/hwintrinsicarm64.cpp @@ -2571,13 +2571,13 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, { assert(sig->numArgs == 3); - CORINFO_ARG_LIST_HANDLE arg1 = sig->args; - CORINFO_ARG_LIST_HANDLE arg2 = info.compCompHnd->getArgNext(arg1); - CORINFO_ARG_LIST_HANDLE arg3 = info.compCompHnd->getArgNext(arg2); - var_types argType = TYP_UNKNOWN; - CORINFO_CLASS_HANDLE argClass = NO_CLASS_HANDLE; - int immLowerBound = 0; - int immUpperBound = 0; + CORINFO_ARG_LIST_HANDLE arg1 = sig->args; + CORINFO_ARG_LIST_HANDLE arg2 = info.compCompHnd->getArgNext(arg1); + CORINFO_ARG_LIST_HANDLE arg3 = info.compCompHnd->getArgNext(arg2); + var_types argType = TYP_UNKNOWN; + CORINFO_CLASS_HANDLE argClass = NO_CLASS_HANDLE; + int immLowerBound = 0; + int immUpperBound = 0; argType = JITtype2varType(strip(info.compCompHnd->getArgType(sig, arg3, &argClass))); op3 = getArgForHWIntrinsic(argType, argClass); @@ -2590,15 +2590,14 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, assert(HWIntrinsicInfo::isImmOp(intrinsic, op2)); HWIntrinsicInfo::lookupImmBounds(intrinsic, simdSize, simdBaseType, 1, &immLowerBound, &immUpperBound); - op2 = addRangeCheckIfNeeded(intrinsic, op2, (!op2->IsCnsIntOrI()), immLowerBound, immUpperBound); + op2 = addRangeCheckIfNeeded(intrinsic, op2, (!op2->IsCnsIntOrI()), immLowerBound, immUpperBound); assert(HWIntrinsicInfo::isImmOp(intrinsic, op3)); HWIntrinsicInfo::lookupImmBounds(intrinsic, simdSize, simdBaseType, 2, &immLowerBound, &immUpperBound); - op3 = addRangeCheckIfNeeded(intrinsic, op3, (!op3->IsCnsIntOrI()), immLowerBound, immUpperBound); + op3 = addRangeCheckIfNeeded(intrinsic, op3, (!op3->IsCnsIntOrI()), immLowerBound, immUpperBound); retNode = isScalar ? gtNewScalarHWIntrinsicNode(retType, op1, op2, op3, intrinsic) - : gtNewSimdHWIntrinsicNode(retType, op1, op2, op3, intrinsic, simdBaseJitType, - simdSize); + : gtNewSimdHWIntrinsicNode(retType, op1, op2, op3, intrinsic, simdBaseJitType, simdSize); retNode->AsHWIntrinsic()->SetSimdBaseJitType(simdBaseJitType); break; diff --git a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp index 2aa81bd084f57c..58208545c8420a 100644 --- a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp +++ b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp @@ -35,9 +35,7 @@ // This allows to combine logic for cases when immOp->isContainedIntOrIImmed() is either true or false in a form // of a for-loop. // -CodeGen::HWIntrinsicImmOpHelper::HWIntrinsicImmOpHelper(CodeGen* codeGen, - GenTree* immOp, - GenTreeHWIntrinsic* intrin) +CodeGen::HWIntrinsicImmOpHelper::HWIntrinsicImmOpHelper(CodeGen* codeGen, GenTree* immOp, GenTreeHWIntrinsic* intrin) : codeGen(codeGen) , endLabel(nullptr) , nonZeroLabel(nullptr) @@ -107,11 +105,8 @@ CodeGen::HWIntrinsicImmOpHelper::HWIntrinsicImmOpHelper(CodeGen* code } } -CodeGen::HWIntrinsicImmOpHelper::HWIntrinsicImmOpHelper(CodeGen* codeGen, - regNumber nonConstImmReg, - int immLowerBound, - int immUpperBound, - GenTreeHWIntrinsic* intrin) +CodeGen::HWIntrinsicImmOpHelper::HWIntrinsicImmOpHelper( + CodeGen* codeGen, regNumber nonConstImmReg, int immLowerBound, int immUpperBound, GenTreeHWIntrinsic* intrin) : codeGen(codeGen) , endLabel(nullptr) , nonZeroLabel(nullptr) @@ -1823,7 +1818,6 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) INS_SCALABLE_OPTS_UNPREDICATED); break; - case NI_Sve_SaturatingDecrementBy16BitElementCountScalar: case NI_Sve_SaturatingDecrementBy32BitElementCountScalar: case NI_Sve_SaturatingDecrementBy64BitElementCountScalar: @@ -1832,7 +1826,7 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) case NI_Sve_SaturatingIncrementBy64BitElementCountScalar: // Use scalar sizes. emitSize = emitActualTypeSize(node->gtType); - opt = INS_OPTS_NONE; + opt = INS_OPTS_NONE; FALLTHROUGH; case NI_Sve_SaturatingDecrementBy16BitElementCount: @@ -1890,7 +1884,6 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) break; } - default: unreached(); } From 646f03c3ed2972ecd9d5feb745b846361b144ce3 Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Tue, 28 May 2024 16:02:45 +0100 Subject: [PATCH 16/29] Fix merge failure --- .../GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs index 2b3bfb65ab93f6..8637dc9e6d4000 100644 --- a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs +++ b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs @@ -148,11 +148,8 @@ ("_SveImmTernOpTestTemplate.template", "SveVecImmTernOpTest.template", new Dictionary { ["TemplateName"] = "Simple", ["TemplateValidationLogic"] = SimpleVecOpTest_ValidationLogic, ["TemplateValidationLogicForCndSel"] = SimpleTernVecOpTest_ValidationLogicForCndSel }), ("_SveImmTernOpFirstArgTestTemplate.template", "SveVecImmTernOpFirstArgTest.template", new Dictionary { ["TemplateName"] = "Simple", ["TemplateValidationLogic"] = SimpleVecOpTest_ValidationLogic, ["TemplateValidationLogicForCndSel"] = SimpleTernVecOpTest_ValidationLogicForCndSel }), ("_SveMinimalUnaryOpTestTemplate.template", "SveVecReduceUnOpTest.template", new Dictionary { ["TemplateName"] = "Simple", ["TemplateValidationLogic"] = VecReduceOpTest_ValidationLogic }), -<<<<<<< HEAD - ("_SveImm2UnaryOpTestTemplate.template", "SveVecImm2UnOpTest.template", new Dictionary { ["TemplateName"] = "Imm", ["TemplateValidationLogic"] = SimpleVecOpTest_ValidationLogic }), -======= ("_SveMasklessUnaryOpTestTemplate.template","SveMasklessSimpleVecOpTest.template", new Dictionary { ["TemplateName"] = "Simple", ["TemplateValidationLogic"] = SimpleVecOpTest_ValidationLogic }), ->>>>>>> origin + ("_SveImm2UnaryOpTestTemplate.template", "SveVecImm2UnOpTest.template", new Dictionary { ["TemplateName"] = "Imm", ["TemplateValidationLogic"] = SimpleVecOpTest_ValidationLogic }), }; (string templateFileName, Dictionary templateData)[] AdvSimdInputs = new [] From 9c4bec72c9b8dcc52907e46215b0e6679d85ca47 Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Tue, 28 May 2024 10:12:08 -0700 Subject: [PATCH 17/29] Remove entries of SaturatingIncrementByActiveElementCount() --- .../ref/System.Runtime.Intrinsics.cs | 4 ---- 1 file changed, 4 deletions(-) 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 80a5c9f1cdbbd6..fcf47b26183e94 100644 --- a/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs +++ b/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs @@ -4578,10 +4578,6 @@ internal Arm64() { } public static long SaturatingIncrementBy8BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } public static uint SaturatingIncrementBy8BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } public static ulong SaturatingIncrementBy8BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } - public static int SaturatingIncrementByActiveElementCount(int value, System.Numerics.Vector from) { throw null; } - public static long SaturatingIncrementByActiveElementCount(long value, System.Numerics.Vector from) { throw null; } - public static uint SaturatingIncrementByActiveElementCount(uint value, System.Numerics.Vector from) { throw null; } - public static ulong SaturatingIncrementByActiveElementCount(ulong value, System.Numerics.Vector from) { throw null; } public static System.Numerics.Vector SignExtend16(System.Numerics.Vector value) { throw null; } public static System.Numerics.Vector SignExtend16(System.Numerics.Vector value) { throw null; } From cd779d550aae139ba6b6c862d3a869c8324b75c2 Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Wed, 29 May 2024 09:12:52 +0100 Subject: [PATCH 18/29] HW_Flag_HasScalarInputVariant --- src/coreclr/jit/hwintrinsic.cpp | 4 ++-- src/coreclr/jit/hwintrinsic.h | 10 ++++++---- src/coreclr/jit/hwintrinsiclistarm64sve.h | 12 ++++++------ 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/coreclr/jit/hwintrinsic.cpp b/src/coreclr/jit/hwintrinsic.cpp index 9fbc228628c68c..a0293cc1b141a3 100644 --- a/src/coreclr/jit/hwintrinsic.cpp +++ b/src/coreclr/jit/hwintrinsic.cpp @@ -1243,12 +1243,12 @@ GenTree* Compiler::impHWIntrinsic(NamedIntrinsic intrinsic, simdBaseJitType = getBaseJitTypeAndSizeOfSIMDType(clsHnd, &sizeBytes); #if defined(TARGET_ARM64) - if (simdBaseJitType == CORINFO_TYPE_UNDEF && HWIntrinsicInfo::HasScalarVariant(intrinsic)) + if (simdBaseJitType == CORINFO_TYPE_UNDEF && HWIntrinsicInfo::HasScalarInputVariant(intrinsic)) { // Did not find a valid vector type. The intrinsic has alternate scalar version. Switch to that. assert(sizeBytes == 0); - intrinsic = HWIntrinsicInfo::GetScalarVariant(intrinsic); + intrinsic = HWIntrinsicInfo::GetScalarInputVariant(intrinsic); category = HWIntrinsicInfo::lookupCategory(intrinsic); isa = HWIntrinsicInfo::lookupIsa(intrinsic); diff --git a/src/coreclr/jit/hwintrinsic.h b/src/coreclr/jit/hwintrinsic.h index 554e56228e777b..69788a3364ea6f 100644 --- a/src/coreclr/jit/hwintrinsic.h +++ b/src/coreclr/jit/hwintrinsic.h @@ -234,7 +234,7 @@ enum HWIntrinsicFlag : unsigned int // The intrinsic comes in both vector and scalar variants. During the import stage if the basetype is scalar, // then the intrinsic should be switched to a scalar only version. - HW_Flag_HasScalarVariant = 0x2000000, + HW_Flag_HasScalarInputVariant = 0x2000000, #endif // TARGET_XARCH @@ -930,14 +930,16 @@ struct HWIntrinsicInfo return (flags & HW_Flag_HasEnumOperand) != 0; } - static bool HasScalarVariant(NamedIntrinsic id) + static bool HasScalarInputVariant(NamedIntrinsic id) { const HWIntrinsicFlag flags = lookupFlags(id); - return (flags & HW_Flag_HasScalarVariant) != 0; + return (flags & HW_Flag_HasScalarInputVariant) != 0; } - static NamedIntrinsic GetScalarVariant(NamedIntrinsic id) + static NamedIntrinsic GetScalarInputVariant(NamedIntrinsic id) { + assert(HasScalarInputVariant(id)); + switch (id) { case NI_Sve_SaturatingDecrementBy16BitElementCount: diff --git a/src/coreclr/jit/hwintrinsiclistarm64sve.h b/src/coreclr/jit/hwintrinsiclistarm64sve.h index 3d13acfa6f4a68..59d05e4fb787ef 100644 --- a/src/coreclr/jit/hwintrinsiclistarm64sve.h +++ b/src/coreclr/jit/hwintrinsiclistarm64sve.h @@ -112,13 +112,13 @@ HARDWARE_INTRINSIC(Sve, Negate, HARDWARE_INTRINSIC(Sve, Or, -1, -1, false, {INS_sve_orr, INS_sve_orr, INS_sve_orr, INS_sve_orr, INS_sve_orr, INS_sve_orr, INS_sve_orr, INS_sve_orr, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_OptionalEmbeddedMaskedOperation|HW_Flag_HasRMWSemantics|HW_Flag_LowMaskedOperation) HARDWARE_INTRINSIC(Sve, OrAcross, -1, -1, false, {INS_sve_orv, INS_sve_orv, INS_sve_orv, INS_sve_orv, INS_sve_orv, INS_sve_orv, INS_sve_orv, INS_sve_orv, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation) HARDWARE_INTRINSIC(Sve, PopCount, -1, -1, false, {INS_sve_cnt, INS_sve_cnt, INS_sve_cnt, INS_sve_cnt, INS_sve_cnt, INS_sve_cnt, INS_sve_cnt, INS_sve_cnt, INS_sve_cnt, INS_sve_cnt}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_BaseTypeFromFirstArg|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation) -HARDWARE_INTRINSIC(Sve, SaturatingDecrementBy16BitElementCount, -1, 3, true, {INS_invalid, INS_invalid, INS_sve_sqdech, INS_sve_uqdech, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_HasScalarVariant|HW_Flag_SpecialImport|HW_Flag_HasRMWSemantics) -HARDWARE_INTRINSIC(Sve, SaturatingDecrementBy32BitElementCount, -1, 3, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqdecw, INS_sve_uqdecw, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_HasScalarVariant|HW_Flag_SpecialImport|HW_Flag_HasRMWSemantics) -HARDWARE_INTRINSIC(Sve, SaturatingDecrementBy64BitElementCount, -1, 3, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqdecd, INS_sve_uqdecd, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_HasScalarVariant|HW_Flag_SpecialImport|HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Sve, SaturatingDecrementBy16BitElementCount, -1, 3, true, {INS_invalid, INS_invalid, INS_sve_sqdech, INS_sve_uqdech, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_HasScalarInputVariant|HW_Flag_SpecialImport|HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Sve, SaturatingDecrementBy32BitElementCount, -1, 3, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqdecw, INS_sve_uqdecw, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_HasScalarInputVariant|HW_Flag_SpecialImport|HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Sve, SaturatingDecrementBy64BitElementCount, -1, 3, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqdecd, INS_sve_uqdecd, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_HasScalarInputVariant|HW_Flag_SpecialImport|HW_Flag_HasRMWSemantics) HARDWARE_INTRINSIC(Sve, SaturatingDecrementBy8BitElementCount, 0, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqdecb, INS_sve_uqdecb, INS_sve_sqdecb, INS_sve_uqdecb, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_SpecialImport|HW_Flag_HasRMWSemantics) -HARDWARE_INTRINSIC(Sve, SaturatingIncrementBy16BitElementCount, -1, 3, true, {INS_invalid, INS_invalid, INS_sve_sqinch, INS_sve_uqinch, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_HasScalarVariant|HW_Flag_SpecialImport|HW_Flag_HasRMWSemantics) -HARDWARE_INTRINSIC(Sve, SaturatingIncrementBy32BitElementCount, -1, 3, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqincw, INS_sve_uqincw, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_HasScalarVariant|HW_Flag_SpecialImport|HW_Flag_HasRMWSemantics) -HARDWARE_INTRINSIC(Sve, SaturatingIncrementBy64BitElementCount, -1, 3, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqincd, INS_sve_uqincd, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_HasScalarVariant|HW_Flag_SpecialImport|HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Sve, SaturatingIncrementBy16BitElementCount, -1, 3, true, {INS_invalid, INS_invalid, INS_sve_sqinch, INS_sve_uqinch, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_HasScalarInputVariant|HW_Flag_SpecialImport|HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Sve, SaturatingIncrementBy32BitElementCount, -1, 3, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqincw, INS_sve_uqincw, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_HasScalarInputVariant|HW_Flag_SpecialImport|HW_Flag_HasRMWSemantics) +HARDWARE_INTRINSIC(Sve, SaturatingIncrementBy64BitElementCount, -1, 3, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqincd, INS_sve_uqincd, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_HasScalarInputVariant|HW_Flag_SpecialImport|HW_Flag_HasRMWSemantics) HARDWARE_INTRINSIC(Sve, SaturatingIncrementBy8BitElementCount, 0, 3, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sqincb, INS_sve_uqincb, INS_sve_sqincb, INS_sve_uqincb, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_SpecialImport|HW_Flag_HasRMWSemantics) HARDWARE_INTRINSIC(Sve, SignExtend16, -1, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sxth, INS_invalid, INS_sve_sxth, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation) HARDWARE_INTRINSIC(Sve, SignExtend32, -1, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sxtw, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation) From c9569fc3f3dddf7843e1362757e358de60cea6e8 Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Wed, 29 May 2024 10:06:56 +0100 Subject: [PATCH 19/29] review cleanups --- src/coreclr/jit/codegen.h | 2 +- src/coreclr/jit/hwintrinsic.cpp | 1 + src/coreclr/jit/hwintrinsiccodegenarm64.cpp | 31 +++++++++++++++++---- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/src/coreclr/jit/codegen.h b/src/coreclr/jit/codegen.h index f7a238f9271089..9b5b610718f908 100644 --- a/src/coreclr/jit/codegen.h +++ b/src/coreclr/jit/codegen.h @@ -997,7 +997,7 @@ class CodeGen final : public CodeGenInterface HWIntrinsicImmOpHelper(CodeGen* codeGen, GenTree* immOp, GenTreeHWIntrinsic* intrin); HWIntrinsicImmOpHelper(CodeGen* codeGen, - regNumber nonConstImmReg, + regNumber immReg, int immLowerBound, int immUpperBound, GenTreeHWIntrinsic* intrin); diff --git a/src/coreclr/jit/hwintrinsic.cpp b/src/coreclr/jit/hwintrinsic.cpp index a0293cc1b141a3..367d0cc02e90bf 100644 --- a/src/coreclr/jit/hwintrinsic.cpp +++ b/src/coreclr/jit/hwintrinsic.cpp @@ -1255,6 +1255,7 @@ GenTree* Compiler::impHWIntrinsic(NamedIntrinsic intrinsic, simdBaseJitType = sig->retType; assert(simdBaseJitType != CORINFO_TYPE_VOID); assert(simdBaseJitType != CORINFO_TYPE_UNDEF); + assert(simdBaseJitType != CORINFO_TYPE_VALUECLASS); } else #endif diff --git a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp index 58208545c8420a..3869625d23ee3f 100644 --- a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp +++ b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp @@ -105,15 +105,28 @@ CodeGen::HWIntrinsicImmOpHelper::HWIntrinsicImmOpHelper(CodeGen* codeGen, GenTre } } +// HWIntrinsicImmOpHelper: Variant constructor of the helper class instance. +// This is used when the immediate does not exist in a GenTree. For example, the immediate has been created +// during codegen from other immediate values. +// +// Arguments: +// codeGen -- an instance of CodeGen class. +// immReg -- the register containing the immediate. +// immLowerBound -- the lower bound of the register. +// immUpperBound -- the lower bound of the register. +// intrin -- a hardware intrinsic tree node. +// +// Note: This instance is designed to be used via the same for loop as the standard constructor. +// CodeGen::HWIntrinsicImmOpHelper::HWIntrinsicImmOpHelper( - CodeGen* codeGen, regNumber nonConstImmReg, int immLowerBound, int immUpperBound, GenTreeHWIntrinsic* intrin) + CodeGen* codeGen, regNumber immReg, int immLowerBound, int immUpperBound, GenTreeHWIntrinsic* intrin) : codeGen(codeGen) , endLabel(nullptr) , nonZeroLabel(nullptr) , immValue(immLowerBound) , immLowerBound(immLowerBound) , immUpperBound(immUpperBound) - , nonConstImmReg(nonConstImmReg) + , nonConstImmReg(immReg) , branchTargetReg(REG_NA) { assert(codeGen != nullptr); @@ -1855,28 +1868,34 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) } else { - // Use the helper to generate a table. + // Use the helper to generate a table. The table can only use a single lookup value, therefore + // the two immediates scale (1 to 16, in op2Reg) and pattern (0 to 31, in op3reg) must be + // combined to a single value (0 to 511) assert(!intrin.op2->isContainedIntOrIImmed() && !intrin.op3->isContainedIntOrIImmed()); emitAttr scalarSize = emitActualTypeSize(node->GetSimdBaseType()); - // Combine the second immediate (pattern, op3) into the first (scale, op2). + // Combine the two immediates into op2Reg. + // Reduce scale to have a lower bound of 0. GetEmitter()->emitIns_R_R_I(INS_sub, scalarSize, op2Reg, op2Reg, 1); + // Shift pattern left to be out of range of scale. GetEmitter()->emitIns_R_R_I(INS_lsl, scalarSize, op3Reg, op3Reg, 4); + // Combine the two values by ORing. GetEmitter()->emitIns_R_R_R(INS_orr, scalarSize, op2Reg, op2Reg, op3Reg); - // Generate a table using the combined immediate. + // Generate the table using the combined immediate. HWIntrinsicImmOpHelper helper(this, op2Reg, 0, 511, node); for (helper.EmitBegin(); !helper.Done(); helper.EmitCaseEnd()) { + // Extract scale and pattern from the immediate const int value = helper.ImmValue(); const int scale = (value & 0xF) + 1; const insSvePattern pattern = (insSvePattern)(value >> 4); GetEmitter()->emitIns_R_PATTERN_I(ins, emitSize, targetReg, pattern, scale, opt); } - // Restore the immediates. + // Restore the original values in op2Reg and op3Reg. GetEmitter()->emitIns_R_R_I(INS_and, scalarSize, op2Reg, op2Reg, 0xF); GetEmitter()->emitIns_R_R_I(INS_lsr, scalarSize, op3Reg, op3Reg, 4); GetEmitter()->emitIns_R_R_I(INS_add, scalarSize, op2Reg, op2Reg, 1); From 38a56143ca15a64e0e1da51eaddc7eb7ffdbc9c0 Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Wed, 29 May 2024 10:09:09 +0100 Subject: [PATCH 20/29] Fix comments from X86 to Arm --- .../Arm/Shared/VectorLookupExtension_2Test.template | 2 +- .../Arm/Shared/VectorLookupExtension_3Test.template | 2 +- .../Arm/Shared/VectorLookupExtension_4Test.template | 2 +- .../HardwareIntrinsics/Arm/Shared/VectorLookup_2Test.template | 2 +- .../HardwareIntrinsics/Arm/Shared/VectorLookup_3Test.template | 2 +- .../HardwareIntrinsics/Arm/Shared/VectorLookup_4Test.template | 2 +- .../Arm/Shared/_ImmBinaryOpTestTemplate.template | 2 +- .../HardwareIntrinsics/Arm/Shared/_ImmOpTestTemplate.template | 2 +- .../Arm/Shared/_ImmUnaryOpTestTemplate.template | 2 +- .../Arm/Shared/_SveImm2UnaryOpTestTemplate.template | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/VectorLookupExtension_2Test.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/VectorLookupExtension_2Test.template index 95574352689e2b..34d7175a13bedd 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/VectorLookupExtension_2Test.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/VectorLookupExtension_2Test.template @@ -3,7 +3,7 @@ /****************************************************************************** * This file is auto-generated from a template file by the GenerateTests.csx * - * script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make * + * 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. * ******************************************************************************/ diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/VectorLookupExtension_3Test.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/VectorLookupExtension_3Test.template index 9fc5bed8818acc..fe010a1e4cf3e8 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/VectorLookupExtension_3Test.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/VectorLookupExtension_3Test.template @@ -3,7 +3,7 @@ /****************************************************************************** * This file is auto-generated from a template file by the GenerateTests.csx * - * script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make * + * 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. * ******************************************************************************/ diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/VectorLookupExtension_4Test.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/VectorLookupExtension_4Test.template index cf88f29ed5d9ad..df3d5d8eb84f60 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/VectorLookupExtension_4Test.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/VectorLookupExtension_4Test.template @@ -3,7 +3,7 @@ /****************************************************************************** * This file is auto-generated from a template file by the GenerateTests.csx * - * script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make * + * 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. * ******************************************************************************/ diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/VectorLookup_2Test.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/VectorLookup_2Test.template index 976885162379c9..ad3e6619a520c3 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/VectorLookup_2Test.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/VectorLookup_2Test.template @@ -3,7 +3,7 @@ /****************************************************************************** * This file is auto-generated from a template file by the GenerateTests.csx * - * script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make * + * 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. * ******************************************************************************/ diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/VectorLookup_3Test.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/VectorLookup_3Test.template index 1cf097dd61e24e..ef18afcf3b1462 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/VectorLookup_3Test.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/VectorLookup_3Test.template @@ -3,7 +3,7 @@ /****************************************************************************** * This file is auto-generated from a template file by the GenerateTests.csx * - * script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make * + * 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. * ******************************************************************************/ diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/VectorLookup_4Test.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/VectorLookup_4Test.template index d089eaf82365fe..925b31789ad014 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/VectorLookup_4Test.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/VectorLookup_4Test.template @@ -3,7 +3,7 @@ /****************************************************************************** * This file is auto-generated from a template file by the GenerateTests.csx * - * script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make * + * 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. * ******************************************************************************/ diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_ImmBinaryOpTestTemplate.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_ImmBinaryOpTestTemplate.template index 2563b1fd5c5e9f..e6386689e2e66f 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_ImmBinaryOpTestTemplate.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_ImmBinaryOpTestTemplate.template @@ -3,7 +3,7 @@ /****************************************************************************** * This file is auto-generated from a template file by the GenerateTests.csx * - * script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make * + * 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. * ******************************************************************************/ diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_ImmOpTestTemplate.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_ImmOpTestTemplate.template index c197df15cf2cd9..6c9455d61d3874 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_ImmOpTestTemplate.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_ImmOpTestTemplate.template @@ -3,7 +3,7 @@ /****************************************************************************** * This file is auto-generated from a template file by the GenerateTests.csx * - * script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make * + * 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. * ******************************************************************************/ diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_ImmUnaryOpTestTemplate.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_ImmUnaryOpTestTemplate.template index 71d1562a947b76..85fb5db27c2e6e 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_ImmUnaryOpTestTemplate.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_ImmUnaryOpTestTemplate.template @@ -3,7 +3,7 @@ /****************************************************************************** * This file is auto-generated from a template file by the GenerateTests.csx * - * script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make * + * 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. * ******************************************************************************/ diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveImm2UnaryOpTestTemplate.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveImm2UnaryOpTestTemplate.template index 37d3a025210fa0..090f93e9bb7f9c 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveImm2UnaryOpTestTemplate.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveImm2UnaryOpTestTemplate.template @@ -3,7 +3,7 @@ /****************************************************************************** * This file is auto-generated from a template file by the GenerateTests.csx * - * script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make * + * 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. * ******************************************************************************/ From b66bab74a71bba0f20ea0935f1bbfda508905c26 Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Wed, 29 May 2024 10:24:04 +0100 Subject: [PATCH 21/29] Add missing tests --- .../Arm/Shared/_SveImm2UnaryOpTestTemplate.template | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveImm2UnaryOpTestTemplate.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveImm2UnaryOpTestTemplate.template index 090f93e9bb7f9c..697b5a6a01f6ef 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveImm2UnaryOpTestTemplate.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/_SveImm2UnaryOpTestTemplate.template @@ -50,6 +50,12 @@ namespace JIT.HardwareIntrinsics.Arm // Validates passing an instance member of a struct works test.RunStructFldScenario(); + + // Validates basic functionality fails with an invalid imm1, using Unsafe.ReadUnaligned + test.RunBasicScenario_UnsafeRead_InvalidImm1(); + + // Validates basic functionality fails with an invalid imm2, using Unsafe.ReadUnaligned + test.RunBasicScenario_UnsafeRead_InvalidImm2(); } else { @@ -249,11 +255,9 @@ namespace JIT.HardwareIntrinsics.Arm test.RunStructFldScenario(this); } - - public void RunBasicScenario_UnsafeRead_InvalidImm1() { - TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead_InvalidImm1)); bool succeeded = false; @@ -273,7 +277,7 @@ namespace JIT.HardwareIntrinsics.Arm public void RunBasicScenario_UnsafeRead_InvalidImm2() { - TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead_InvalidImm2)); bool succeeded = false; From 4414b33b5602d29b65e65f5e3ddf703ba8b669e4 Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Wed, 29 May 2024 10:29:01 +0100 Subject: [PATCH 22/29] Add missing min/max for ConstantExpected --- .../src/System/Runtime/Intrinsics/Arm/Sve.cs | 88 +++++++++---------- 1 file changed, 44 insertions(+), 44 deletions(-) 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 a9e080bdc0f084..1945e0deef4dba 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 @@ -2737,37 +2737,37 @@ internal Arm64() { } /// int32_t svqdech_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECH Xtied, Wtied, pattern, MUL #imm_factor /// - public static unsafe int SaturatingDecrementBy16BitElementCount(int value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy16BitElementCount(value, scale, pattern); + public static unsafe int SaturatingDecrementBy16BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy16BitElementCount(value, scale, pattern); /// /// int64_t svqdech_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECH Xtied, pattern, MUL #imm_factor /// - public static unsafe long SaturatingDecrementBy16BitElementCount(long value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy16BitElementCount(value, scale, pattern); + public static unsafe long SaturatingDecrementBy16BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy16BitElementCount(value, scale, pattern); /// /// uint32_t svqdech_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECH Wtied, pattern, MUL #imm_factor /// - public static unsafe uint SaturatingDecrementBy16BitElementCount(uint value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy16BitElementCount(value, scale, pattern); + public static unsafe uint SaturatingDecrementBy16BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy16BitElementCount(value, scale, pattern); /// /// uint64_t svqdech_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECH Xtied, pattern, MUL #imm_factor /// - public static unsafe ulong SaturatingDecrementBy16BitElementCount(ulong value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy16BitElementCount(value, scale, pattern); + public static unsafe ulong SaturatingDecrementBy16BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy16BitElementCount(value, scale, pattern); /// /// svint16_t svqdech_pat[_s16](svint16_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECH Ztied.H, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingDecrementBy16BitElementCount(Vector value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy16BitElementCount(value, scale, pattern); + public static unsafe Vector SaturatingDecrementBy16BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy16BitElementCount(value, scale, pattern); /// /// svuint16_t svqdech_pat[_u16](svuint16_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECH Ztied.H, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingDecrementBy16BitElementCount(Vector value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy16BitElementCount(value, scale, pattern); + public static unsafe Vector SaturatingDecrementBy16BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy16BitElementCount(value, scale, pattern); /// Saturating decrement by number of word elements @@ -2776,37 +2776,37 @@ internal Arm64() { } /// int32_t svqdecw_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECW Xtied, Wtied, pattern, MUL #imm_factor /// - public static unsafe int SaturatingDecrementBy32BitElementCount(int value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy32BitElementCount(value, scale, pattern); + public static unsafe int SaturatingDecrementBy32BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy32BitElementCount(value, scale, pattern); /// /// int64_t svqdecw_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECW Xtied, pattern, MUL #imm_factor /// - public static unsafe long SaturatingDecrementBy32BitElementCount(long value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy32BitElementCount(value, scale, pattern); + public static unsafe long SaturatingDecrementBy32BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy32BitElementCount(value, scale, pattern); /// /// uint32_t svqdecw_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECW Wtied, pattern, MUL #imm_factor /// - public static unsafe uint SaturatingDecrementBy32BitElementCount(uint value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy32BitElementCount(value, scale, pattern); + public static unsafe uint SaturatingDecrementBy32BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy32BitElementCount(value, scale, pattern); /// /// uint64_t svqdecw_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECW Xtied, pattern, MUL #imm_factor /// - public static unsafe ulong SaturatingDecrementBy32BitElementCount(ulong value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy32BitElementCount(value, scale, pattern); + public static unsafe ulong SaturatingDecrementBy32BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy32BitElementCount(value, scale, pattern); /// /// svint32_t svqdecw_pat[_s32](svint32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECW Ztied.S, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingDecrementBy32BitElementCount(Vector value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy32BitElementCount(value, scale, pattern); + public static unsafe Vector SaturatingDecrementBy32BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy32BitElementCount(value, scale, pattern); /// /// svuint32_t svqdecw_pat[_u32](svuint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECW Ztied.S, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingDecrementBy32BitElementCount(Vector value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy32BitElementCount(value, scale, pattern); + public static unsafe Vector SaturatingDecrementBy32BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy32BitElementCount(value, scale, pattern); /// Saturating decrement by number of doubleword elements @@ -2815,37 +2815,37 @@ internal Arm64() { } /// int32_t svqdecd_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECD Xtied, Wtied, pattern, MUL #imm_factor /// - public static unsafe int SaturatingDecrementBy64BitElementCount(int value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy64BitElementCount(value, scale, pattern); + public static unsafe int SaturatingDecrementBy64BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy64BitElementCount(value, scale, pattern); /// /// int64_t svqdecd_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECD Xtied, pattern, MUL #imm_factor /// - public static unsafe long SaturatingDecrementBy64BitElementCount(long value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy64BitElementCount(value, scale, pattern); + public static unsafe long SaturatingDecrementBy64BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy64BitElementCount(value, scale, pattern); /// /// uint32_t svqdecd_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECD Wtied, pattern, MUL #imm_factor /// - public static unsafe uint SaturatingDecrementBy64BitElementCount(uint value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy64BitElementCount(value, scale, pattern); + public static unsafe uint SaturatingDecrementBy64BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy64BitElementCount(value, scale, pattern); /// /// uint64_t svqdecd_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECD Xtied, pattern, MUL #imm_factor /// - public static unsafe ulong SaturatingDecrementBy64BitElementCount(ulong value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy64BitElementCount(value, scale, pattern); + public static unsafe ulong SaturatingDecrementBy64BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy64BitElementCount(value, scale, pattern); /// /// svint64_t svqdecd_pat[_s64](svint64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECD Ztied.D, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingDecrementBy64BitElementCount(Vector value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy64BitElementCount(value, scale, pattern); + public static unsafe Vector SaturatingDecrementBy64BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy64BitElementCount(value, scale, pattern); /// /// svuint64_t svqdecd_pat[_u64](svuint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECD Ztied.D, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingDecrementBy64BitElementCount(Vector value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy64BitElementCount(value, scale, pattern); + public static unsafe Vector SaturatingDecrementBy64BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy64BitElementCount(value, scale, pattern); /// Saturating decrement by number of byte elements @@ -2854,25 +2854,25 @@ internal Arm64() { } /// int32_t svqdecb_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECB Xtied, Wtied, pattern, MUL #imm_factor /// - public static unsafe int SaturatingDecrementBy8BitElementCount(int value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy8BitElementCount(value, scale, pattern); + public static unsafe int SaturatingDecrementBy8BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy8BitElementCount(value, scale, pattern); /// /// int64_t svqdecb_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQDECB Xtied, pattern, MUL #imm_factor /// - public static unsafe long SaturatingDecrementBy8BitElementCount(long value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy8BitElementCount(value, scale, pattern); + public static unsafe long SaturatingDecrementBy8BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy8BitElementCount(value, scale, pattern); /// /// uint32_t svqdecb_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECB Wtied, pattern, MUL #imm_factor /// - public static unsafe uint SaturatingDecrementBy8BitElementCount(uint value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy8BitElementCount(value, scale, pattern); + public static unsafe uint SaturatingDecrementBy8BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy8BitElementCount(value, scale, pattern); /// /// uint64_t svqdecb_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQDECB Xtied, pattern, MUL #imm_factor /// - public static unsafe ulong SaturatingDecrementBy8BitElementCount(ulong value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy8BitElementCount(value, scale, pattern); + public static unsafe ulong SaturatingDecrementBy8BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingDecrementBy8BitElementCount(value, scale, pattern); /// Saturating increment by number of halfword elements @@ -2881,37 +2881,37 @@ internal Arm64() { } /// int32_t svqinch_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCH Xtied, Wtied, pattern, MUL #imm_factor /// - public static unsafe int SaturatingIncrementBy16BitElementCount(int value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy16BitElementCount(value, scale, pattern); + public static unsafe int SaturatingIncrementBy16BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy16BitElementCount(value, scale, pattern); /// /// int64_t svqinch_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCH Xtied, pattern, MUL #imm_factor /// - public static unsafe long SaturatingIncrementBy16BitElementCount(long value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy16BitElementCount(value, scale, pattern); + public static unsafe long SaturatingIncrementBy16BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy16BitElementCount(value, scale, pattern); /// /// uint32_t svqinch_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCH Wtied, pattern, MUL #imm_factor /// - public static unsafe uint SaturatingIncrementBy16BitElementCount(uint value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy16BitElementCount(value, scale, pattern); + public static unsafe uint SaturatingIncrementBy16BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy16BitElementCount(value, scale, pattern); /// /// uint64_t svqinch_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCH Xtied, pattern, MUL #imm_factor /// - public static unsafe ulong SaturatingIncrementBy16BitElementCount(ulong value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy16BitElementCount(value, scale, pattern); + public static unsafe ulong SaturatingIncrementBy16BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy16BitElementCount(value, scale, pattern); /// /// svint16_t svqinch_pat[_s16](svint16_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCH Ztied.H, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingIncrementBy16BitElementCount(Vector value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy16BitElementCount(value, scale, pattern); + public static unsafe Vector SaturatingIncrementBy16BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy16BitElementCount(value, scale, pattern); /// /// svuint16_t svqinch_pat[_u16](svuint16_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCH Ztied.H, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingIncrementBy16BitElementCount(Vector value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy16BitElementCount(value, scale, pattern); + public static unsafe Vector SaturatingIncrementBy16BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy16BitElementCount(value, scale, pattern); /// Saturating increment by number of word elements @@ -2920,37 +2920,37 @@ internal Arm64() { } /// int32_t svqincw_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCW Xtied, Wtied, pattern, MUL #imm_factor /// - public static unsafe int SaturatingIncrementBy32BitElementCount(int value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy32BitElementCount(value, scale, pattern); + public static unsafe int SaturatingIncrementBy32BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy32BitElementCount(value, scale, pattern); /// /// int64_t svqincw_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCW Xtied, pattern, MUL #imm_factor /// - public static unsafe long SaturatingIncrementBy32BitElementCount(long value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy32BitElementCount(value, scale, pattern); + public static unsafe long SaturatingIncrementBy32BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy32BitElementCount(value, scale, pattern); /// /// uint32_t svqincw_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCW Wtied, pattern, MUL #imm_factor /// - public static unsafe uint SaturatingIncrementBy32BitElementCount(uint value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy32BitElementCount(value, scale, pattern); + public static unsafe uint SaturatingIncrementBy32BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy32BitElementCount(value, scale, pattern); /// /// uint64_t svqincw_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCW Xtied, pattern, MUL #imm_factor /// - public static unsafe ulong SaturatingIncrementBy32BitElementCount(ulong value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy32BitElementCount(value, scale, pattern); + public static unsafe ulong SaturatingIncrementBy32BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy32BitElementCount(value, scale, pattern); /// /// svint32_t svqincw_pat[_s32](svint32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCW Ztied.S, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingIncrementBy32BitElementCount(Vector value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy32BitElementCount(value, scale, pattern); + public static unsafe Vector SaturatingIncrementBy32BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy32BitElementCount(value, scale, pattern); /// /// svuint32_t svqincw_pat[_u32](svuint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCW Ztied.S, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingIncrementBy32BitElementCount(Vector value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy32BitElementCount(value, scale, pattern); + public static unsafe Vector SaturatingIncrementBy32BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy32BitElementCount(value, scale, pattern); /// Saturating increment by number of doubleword elements @@ -2959,37 +2959,37 @@ internal Arm64() { } /// int32_t svqincd_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCD Xtied, Wtied, pattern, MUL #imm_factor /// - public static unsafe int SaturatingIncrementBy64BitElementCount(int value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy64BitElementCount(value, scale, pattern); + public static unsafe int SaturatingIncrementBy64BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy64BitElementCount(value, scale, pattern); /// /// int64_t svqincd_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCD Xtied, pattern, MUL #imm_factor /// - public static unsafe long SaturatingIncrementBy64BitElementCount(long value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy64BitElementCount(value, scale, pattern); + public static unsafe long SaturatingIncrementBy64BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy64BitElementCount(value, scale, pattern); /// /// uint32_t svqincd_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCD Wtied, pattern, MUL #imm_factor /// - public static unsafe uint SaturatingIncrementBy64BitElementCount(uint value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy64BitElementCount(value, scale, pattern); + public static unsafe uint SaturatingIncrementBy64BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy64BitElementCount(value, scale, pattern); /// /// uint64_t svqincd_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCD Xtied, pattern, MUL #imm_factor /// - public static unsafe ulong SaturatingIncrementBy64BitElementCount(ulong value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy64BitElementCount(value, scale, pattern); + public static unsafe ulong SaturatingIncrementBy64BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy64BitElementCount(value, scale, pattern); /// /// svint64_t svqincd_pat[_s64](svint64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCD Ztied.D, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingIncrementBy64BitElementCount(Vector value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy64BitElementCount(value, scale, pattern); + public static unsafe Vector SaturatingIncrementBy64BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy64BitElementCount(value, scale, pattern); /// /// svuint64_t svqincd_pat[_u64](svuint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCD Ztied.D, pattern, MUL #imm_factor /// - public static unsafe Vector SaturatingIncrementBy64BitElementCount(Vector value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy64BitElementCount(value, scale, pattern); + public static unsafe Vector SaturatingIncrementBy64BitElementCount(Vector value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy64BitElementCount(value, scale, pattern); /// Saturating increment by number of byte elements @@ -2998,25 +2998,25 @@ internal Arm64() { } /// int32_t svqincb_pat[_n_s32](int32_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCB Xtied, Wtied, pattern, MUL #imm_factor /// - public static unsafe int SaturatingIncrementBy8BitElementCount(int value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy8BitElementCount(value, scale, pattern); + public static unsafe int SaturatingIncrementBy8BitElementCount(int value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy8BitElementCount(value, scale, pattern); /// /// int64_t svqincb_pat[_n_s64](int64_t op, enum svpattern pattern, uint64_t imm_factor) /// SQINCB Xtied, pattern, MUL #imm_factor /// - public static unsafe long SaturatingIncrementBy8BitElementCount(long value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy8BitElementCount(value, scale, pattern); + public static unsafe long SaturatingIncrementBy8BitElementCount(long value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy8BitElementCount(value, scale, pattern); /// /// uint32_t svqincb_pat[_n_u32](uint32_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCB Wtied, pattern, MUL #imm_factor /// - public static unsafe uint SaturatingIncrementBy8BitElementCount(uint value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy8BitElementCount(value, scale, pattern); + public static unsafe uint SaturatingIncrementBy8BitElementCount(uint value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy8BitElementCount(value, scale, pattern); /// /// uint64_t svqincb_pat[_n_u64](uint64_t op, enum svpattern pattern, uint64_t imm_factor) /// UQINCB Xtied, pattern, MUL #imm_factor /// - public static unsafe ulong SaturatingIncrementBy8BitElementCount(ulong value, [ConstantExpected] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy8BitElementCount(value, scale, pattern); + public static unsafe ulong SaturatingIncrementBy8BitElementCount(ulong value, [ConstantExpected(Min = 1, Max = (byte)(16))] byte scale, [ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) => SaturatingIncrementBy8BitElementCount(value, scale, pattern); /// SignExtend16 : Sign-extend the low 16 bits From b034ea7a997d4739a45ee65d7fde5aa09e1cefcc Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Wed, 29 May 2024 11:10:02 +0100 Subject: [PATCH 23/29] formatting --- src/coreclr/jit/codegen.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/coreclr/jit/codegen.h b/src/coreclr/jit/codegen.h index 9b5b610718f908..5130c799832414 100644 --- a/src/coreclr/jit/codegen.h +++ b/src/coreclr/jit/codegen.h @@ -996,11 +996,8 @@ class CodeGen final : public CodeGenInterface public: HWIntrinsicImmOpHelper(CodeGen* codeGen, GenTree* immOp, GenTreeHWIntrinsic* intrin); - HWIntrinsicImmOpHelper(CodeGen* codeGen, - regNumber immReg, - int immLowerBound, - int immUpperBound, - GenTreeHWIntrinsic* intrin); + HWIntrinsicImmOpHelper( + CodeGen* codeGen, regNumber immReg, int immLowerBound, int immUpperBound, GenTreeHWIntrinsic* intrin); void EmitBegin(); void EmitCaseEnd(); From a536c016bea684a97b7184bd003985db7e1c05d6 Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Wed, 29 May 2024 17:39:54 +0100 Subject: [PATCH 24/29] Add isValidScalarIntrinsic check --- src/coreclr/jit/hwintrinsicarm64.cpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/coreclr/jit/hwintrinsicarm64.cpp b/src/coreclr/jit/hwintrinsicarm64.cpp index 7cb92cfff5c69d..b1e96eebeffaf7 100644 --- a/src/coreclr/jit/hwintrinsicarm64.cpp +++ b/src/coreclr/jit/hwintrinsicarm64.cpp @@ -572,6 +572,10 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, GenTree* op3 = nullptr; GenTree* op4 = nullptr; +#ifdef DEBUG + bool isValidScalarIntrinsic = false; +#endif + switch (intrinsic) { case NI_Vector64_Abs: @@ -2554,13 +2558,7 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Sve_SaturatingDecrementBy16BitElementCount: - case NI_Sve_SaturatingDecrementBy32BitElementCount: - case NI_Sve_SaturatingDecrementBy64BitElementCount: case NI_Sve_SaturatingDecrementBy8BitElementCount: - case NI_Sve_SaturatingIncrementBy16BitElementCount: - case NI_Sve_SaturatingIncrementBy32BitElementCount: - case NI_Sve_SaturatingIncrementBy64BitElementCount: case NI_Sve_SaturatingIncrementBy8BitElementCount: case NI_Sve_SaturatingDecrementBy16BitElementCountScalar: case NI_Sve_SaturatingDecrementBy32BitElementCountScalar: @@ -2568,6 +2566,17 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, case NI_Sve_SaturatingIncrementBy16BitElementCountScalar: case NI_Sve_SaturatingIncrementBy32BitElementCountScalar: case NI_Sve_SaturatingIncrementBy64BitElementCountScalar: +#ifdef DEBUG + isValidScalarIntrinsic = true; + FALLTHROUGH; +#endif + case NI_Sve_SaturatingDecrementBy16BitElementCount: + case NI_Sve_SaturatingDecrementBy32BitElementCount: + case NI_Sve_SaturatingDecrementBy64BitElementCount: + case NI_Sve_SaturatingIncrementBy16BitElementCount: + case NI_Sve_SaturatingIncrementBy32BitElementCount: + case NI_Sve_SaturatingIncrementBy64BitElementCount: + { assert(sig->numArgs == 3); @@ -2609,6 +2618,8 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, } } + assert(!isScalar || isValidScalarIntrinsic); + return retNode; } From 1c11ce25c716a7cf78ab81b1b6540ebe1a70dcba Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Thu, 30 May 2024 12:17:05 +0100 Subject: [PATCH 25/29] Add RMW asserts --- src/coreclr/jit/hwintrinsiccodegenarm64.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp index 3869625d23ee3f..abb8acabb7ac34 100644 --- a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp +++ b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp @@ -1854,6 +1854,8 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) assert(isRMW); if (targetReg != op1Reg) { + assert(targetReg != op2Reg); + assert(targetReg != op3Reg); GetEmitter()->emitIns_Mov(INS_mov, emitTypeSize(node), targetReg, op1Reg, /* canSkip */ true); } From 6a3dfea24e1180c0d8f1321507a4f0e29ef6eda0 Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Fri, 31 May 2024 11:12:12 +0100 Subject: [PATCH 26/29] Move internal register use after dest def --- src/coreclr/jit/lsraarm64.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coreclr/jit/lsraarm64.cpp b/src/coreclr/jit/lsraarm64.cpp index 7e3dd0826da672..e38301deb96d12 100644 --- a/src/coreclr/jit/lsraarm64.cpp +++ b/src/coreclr/jit/lsraarm64.cpp @@ -1983,8 +1983,6 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree, int* pDstCou } } - buildInternalRegisterUses(); - if ((dstCount == 1) || (dstCount == 2)) { BuildDef(intrinsicTree); @@ -1999,6 +1997,8 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree, int* pDstCou assert(dstCount == 0); } + buildInternalRegisterUses(); + *pDstCount = dstCount; return srcCount; } From e7047aee03a8aa8db8b06e7d9ae7f260e14720be Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Fri, 31 May 2024 12:17:14 +0100 Subject: [PATCH 27/29] Use Saturating helpers in testing --- .../GenerateHWIntrinsicTests_Arm.cs | 102 +++++++++--------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs index 588d4bd00c05c9..788ef3edfb56b5 100644 --- a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs +++ b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs @@ -3324,57 +3324,57 @@ ("SveSimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sve_PopCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "PopCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.BitCount(firstOp[i]) != result[i]", ["GetIterResult"] = "Helpers.BitCount(leftOp[i])"}), ("SveSimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sve_PopCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "PopCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.BitCount(firstOp[i]) != result[i]", ["GetIterResult"] = "Helpers.BitCount(leftOp[i])"}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.LargestPowerOf2", ["InvalidImm"] = "(Byte)0", ["InvalidImm2"] = "(SveMaskPattern)35", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)12", ["Imm2"] = "SveMaskPattern.VectorCount1", ["InvalidImm"] = "(Byte)19", ["InvalidImm2"] = "(SveMaskPattern)37", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)5", ["Imm2"] = "SveMaskPattern.VectorCount2", ["InvalidImm"] = "(Byte)25", ["InvalidImm2"] = "(SveMaskPattern)46", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)7", ["Imm2"] = "SveMaskPattern.VectorCount3", ["InvalidImm"] = "(Byte)255", ["InvalidImm2"] = "(SveMaskPattern)50", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (ulong)(imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_vector_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "(Byte)10", ["Imm2"] = "SveMaskPattern.VectorCount4", ["InvalidImm"] = "(Byte)65", ["InvalidImm2"] = "(SveMaskPattern)90", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2)))",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_vector_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "(Byte)1", ["Imm2"] = "SveMaskPattern.VectorCount5", ["InvalidImm"] = "(Byte)72", ["InvalidImm2"] = "(SveMaskPattern)35", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2)))",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)1", ["Imm2"] = "SveMaskPattern.VectorCount6", ["InvalidImm"] = "(Byte)17", ["InvalidImm2"] = "(SveMaskPattern)32", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.VectorCount7", ["InvalidImm"] = "(Byte)19", ["InvalidImm2"] = "(SveMaskPattern)33", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)3", ["Imm2"] = "SveMaskPattern.VectorCount8", ["InvalidImm"] = "(Byte)25", ["InvalidImm2"] = "(SveMaskPattern)34", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)4", ["Imm2"] = "SveMaskPattern.VectorCount32", ["InvalidImm"] = "(Byte)26", ["InvalidImm2"] = "(SveMaskPattern)35", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (ulong)(imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_vector_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)5", ["Imm2"] = "SveMaskPattern.VectorCount64", ["InvalidImm"] = "(Byte)27", ["InvalidImm2"] = "(SveMaskPattern)36", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2)))",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_vector_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)6", ["Imm2"] = "SveMaskPattern.VectorCount128", ["InvalidImm"] = "(Byte)18", ["InvalidImm2"] = "(SveMaskPattern)37", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2)))",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)7", ["Imm2"] = "SveMaskPattern.VectorCount256", ["InvalidImm"] = "(Byte)34", ["InvalidImm2"] = "(SveMaskPattern)135", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)8", ["Imm2"] = "SveMaskPattern.LargestMultipleOf4", ["InvalidImm"] = "(Byte)35", ["InvalidImm2"] = "(SveMaskPattern)125", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)9", ["Imm2"] = "SveMaskPattern.LargestMultipleOf3", ["InvalidImm"] = "(Byte)36", ["InvalidImm2"] = "(SveMaskPattern)115", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)10", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)37", ["InvalidImm2"] = "(SveMaskPattern)145", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (ulong)(imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_vector_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)11", ["Imm2"] = "SveMaskPattern.VectorCount7", ["InvalidImm"] = "(Byte)38", ["InvalidImm2"] = "(SveMaskPattern)155", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2)))",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_vector_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)12", ["Imm2"] = "SveMaskPattern.LargestPowerOf2", ["InvalidImm"] = "(Byte)39", ["InvalidImm2"] = "(SveMaskPattern)165", ["ValidateIterResult"] = "result[i] != (firstOp[i] - (ulong)(imm1 * Helpers.NumberOfElementsInVectorInt64(imm2)))",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)13", ["Imm2"] = "SveMaskPattern.VectorCount4", ["InvalidImm"] = "(Byte)89", ["InvalidImm2"] = "(SveMaskPattern)206", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)14", ["Imm2"] = "SveMaskPattern.LargestPowerOf2", ["InvalidImm"] = "(Byte)0", ["InvalidImm2"] = "(SveMaskPattern)207", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)15", ["Imm2"] = "SveMaskPattern.VectorCount6", ["InvalidImm"] = "(Byte)91", ["InvalidImm2"] = "(SveMaskPattern)208", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)16", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)92", ["InvalidImm2"] = "(SveMaskPattern)209", ["ValidateResult"] = "isUnexpectedResult = (result != (data - (ulong)(imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)15", ["Imm2"] = "SveMaskPattern.VectorCount4", ["InvalidImm"] = "(Byte)98", ["InvalidImm2"] = "(SveMaskPattern)241", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)14", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)99", ["InvalidImm2"] = "(SveMaskPattern)242", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)13", ["Imm2"] = "SveMaskPattern.VectorCount256", ["InvalidImm"] = "(Byte)101", ["InvalidImm2"] = "(SveMaskPattern)243", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)12", ["Imm2"] = "SveMaskPattern.VectorCount32", ["InvalidImm"] = "(Byte)118", ["InvalidImm2"] = "(SveMaskPattern)50", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (ulong)(imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_vector_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "(Byte)11", ["Imm2"] = "SveMaskPattern.VectorCount4", ["InvalidImm"] = "(Byte)118", ["InvalidImm2"] = "(SveMaskPattern)60", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2)))",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_vector_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "(Byte)10", ["Imm2"] = "SveMaskPattern.VectorCount64", ["InvalidImm"] = "(Byte)123", ["InvalidImm2"] = "(SveMaskPattern)70", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2)))",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)9", ["Imm2"] = "SveMaskPattern.VectorCount5", ["InvalidImm"] = "(Byte)201", ["InvalidImm2"] = "(SveMaskPattern)80", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)8", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)202", ["InvalidImm2"] = "(SveMaskPattern)12", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)7", ["Imm2"] = "SveMaskPattern.LargestPowerOf2", ["InvalidImm"] = "(Byte)207", ["InvalidImm2"] = "(SveMaskPattern)13", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)6", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)220", ["InvalidImm2"] = "(SveMaskPattern)99", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (ulong)(imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_vector_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)5", ["Imm2"] = "SveMaskPattern.LargestMultipleOf4", ["InvalidImm"] = "(Byte)221", ["InvalidImm2"] = "(SveMaskPattern)76", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2)))",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_vector_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)4", ["Imm2"] = "SveMaskPattern.LargestMultipleOf3", ["InvalidImm"] = "(Byte)240", ["InvalidImm2"] = "(SveMaskPattern)32", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2)))",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)3", ["Imm2"] = "SveMaskPattern.VectorCount64", ["InvalidImm"] = "(Byte)241", ["InvalidImm2"] = "(SveMaskPattern)105", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.VectorCount4", ["InvalidImm"] = "(Byte)255", ["InvalidImm2"] = "(SveMaskPattern)108", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)1", ["Imm2"] = "SveMaskPattern.VectorCount6", ["InvalidImm"] = "(Byte)243", ["InvalidImm2"] = "(SveMaskPattern)109", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.LargestMultipleOf3", ["InvalidImm"] = "(Byte)19", ["InvalidImm2"] = "(SveMaskPattern)101", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (ulong)(imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_vector_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.LargestPowerOf2", ["InvalidImm"] = "(Byte)56", ["InvalidImm2"] = "(SveMaskPattern)109", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2)))",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_vector_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.VectorCount8", ["InvalidImm"] = "(Byte)75", ["InvalidImm2"] = "(SveMaskPattern)154", ["ValidateIterResult"] = "result[i] != (firstOp[i] + (ulong)(imm1 * Helpers.NumberOfElementsInVectorInt64(imm2)))",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.VectorCount8", ["InvalidImm"] = "(Byte)100", ["InvalidImm2"] = "(SveMaskPattern)235", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.VectorCount4", ["InvalidImm"] = "(Byte)99", ["InvalidImm2"] = "(SveMaskPattern)123", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.VectorCount5", ["InvalidImm"] = "(Byte)98", ["InvalidImm2"] = "(SveMaskPattern)232", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)97", ["InvalidImm2"] = "(SveMaskPattern)234", ["ValidateResult"] = "isUnexpectedResult = (result != (data + (ulong)(imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.LargestPowerOf2", ["InvalidImm"] = "(Byte)0", ["InvalidImm2"] = "(SveMaskPattern)35", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)12", ["Imm2"] = "SveMaskPattern.VectorCount1", ["InvalidImm"] = "(Byte)19", ["InvalidImm2"] = "(SveMaskPattern)37", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)5", ["Imm2"] = "SveMaskPattern.VectorCount2", ["InvalidImm"] = "(Byte)25", ["InvalidImm2"] = "(SveMaskPattern)46", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)7", ["Imm2"] = "SveMaskPattern.VectorCount3", ["InvalidImm"] = "(Byte)255", ["InvalidImm2"] = "(SveMaskPattern)50", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate(data, ((ulong)imm1 * (ulong)Helpers.NumberOfElementsInVectorInt16(imm2))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_vector_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "(Byte)10", ["Imm2"] = "SveMaskPattern.VectorCount4", ["InvalidImm"] = "(Byte)65", ["InvalidImm2"] = "(SveMaskPattern)90", ["ValidateIterResult"] = "result[i] != Helpers.SubtractSaturate(firstOp[i], (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_vector_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "(Byte)1", ["Imm2"] = "SveMaskPattern.VectorCount5", ["InvalidImm"] = "(Byte)72", ["InvalidImm2"] = "(SveMaskPattern)35", ["ValidateIterResult"] = "result[i] != Helpers.SubtractSaturate(firstOp[i], (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)1", ["Imm2"] = "SveMaskPattern.VectorCount6", ["InvalidImm"] = "(Byte)17", ["InvalidImm2"] = "(SveMaskPattern)32", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.VectorCount7", ["InvalidImm"] = "(Byte)19", ["InvalidImm2"] = "(SveMaskPattern)33", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)3", ["Imm2"] = "SveMaskPattern.VectorCount8", ["InvalidImm"] = "(Byte)25", ["InvalidImm2"] = "(SveMaskPattern)34", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)4", ["Imm2"] = "SveMaskPattern.VectorCount32", ["InvalidImm"] = "(Byte)26", ["InvalidImm2"] = "(SveMaskPattern)35", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate(data, ((ulong)imm1 * (ulong)Helpers.NumberOfElementsInVectorInt16(imm2))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_vector_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)5", ["Imm2"] = "SveMaskPattern.VectorCount64", ["InvalidImm"] = "(Byte)27", ["InvalidImm2"] = "(SveMaskPattern)36", ["ValidateIterResult"] = "result[i] != Helpers.SubtractSaturate(firstOp[i], (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_vector_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)6", ["Imm2"] = "SveMaskPattern.VectorCount128", ["InvalidImm"] = "(Byte)18", ["InvalidImm2"] = "(SveMaskPattern)37", ["ValidateIterResult"] = "result[i] != Helpers.SubtractSaturate(firstOp[i], (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)7", ["Imm2"] = "SveMaskPattern.VectorCount256", ["InvalidImm"] = "(Byte)34", ["InvalidImm2"] = "(SveMaskPattern)135", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)8", ["Imm2"] = "SveMaskPattern.LargestMultipleOf4", ["InvalidImm"] = "(Byte)35", ["InvalidImm2"] = "(SveMaskPattern)125", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)9", ["Imm2"] = "SveMaskPattern.LargestMultipleOf3", ["InvalidImm"] = "(Byte)36", ["InvalidImm2"] = "(SveMaskPattern)115", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)10", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)37", ["InvalidImm2"] = "(SveMaskPattern)145", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate(data, ((ulong)imm1 * (ulong)Helpers.NumberOfElementsInVectorInt64(imm2))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_vector_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)11", ["Imm2"] = "SveMaskPattern.VectorCount7", ["InvalidImm"] = "(Byte)38", ["InvalidImm2"] = "(SveMaskPattern)155", ["ValidateIterResult"] = "result[i] != Helpers.SubtractSaturate(firstOp[i], (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_vector_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)12", ["Imm2"] = "SveMaskPattern.LargestPowerOf2", ["InvalidImm"] = "(Byte)39", ["InvalidImm2"] = "(SveMaskPattern)165", ["ValidateIterResult"] = "result[i] != Helpers.SubtractSaturate(firstOp[i], ((ulong)imm1 * (ulong)Helpers.NumberOfElementsInVectorInt64(imm2)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)13", ["Imm2"] = "SveMaskPattern.VectorCount4", ["InvalidImm"] = "(Byte)89", ["InvalidImm2"] = "(SveMaskPattern)206", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)14", ["Imm2"] = "SveMaskPattern.LargestPowerOf2", ["InvalidImm"] = "(Byte)0", ["InvalidImm2"] = "(SveMaskPattern)207", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)15", ["Imm2"] = "SveMaskPattern.VectorCount6", ["InvalidImm"] = "(Byte)91", ["InvalidImm2"] = "(SveMaskPattern)208", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)16", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)92", ["InvalidImm2"] = "(SveMaskPattern)209", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate(data, ((ulong)imm1 * (ulong)Helpers.NumberOfElementsInVectorInt8(imm2))));",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)15", ["Imm2"] = "SveMaskPattern.VectorCount4", ["InvalidImm"] = "(Byte)98", ["InvalidImm2"] = "(SveMaskPattern)241", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)14", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)99", ["InvalidImm2"] = "(SveMaskPattern)242", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)13", ["Imm2"] = "SveMaskPattern.VectorCount256", ["InvalidImm"] = "(Byte)101", ["InvalidImm2"] = "(SveMaskPattern)243", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)12", ["Imm2"] = "SveMaskPattern.VectorCount32", ["InvalidImm"] = "(Byte)118", ["InvalidImm2"] = "(SveMaskPattern)50", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate(data, ((ulong)imm1 * (ulong)Helpers.NumberOfElementsInVectorInt16(imm2))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_vector_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "(Byte)11", ["Imm2"] = "SveMaskPattern.VectorCount4", ["InvalidImm"] = "(Byte)118", ["InvalidImm2"] = "(SveMaskPattern)60", ["ValidateIterResult"] = "result[i] != Helpers.AddSaturate(firstOp[i], (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_vector_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "(Byte)10", ["Imm2"] = "SveMaskPattern.VectorCount64", ["InvalidImm"] = "(Byte)123", ["InvalidImm2"] = "(SveMaskPattern)70", ["ValidateIterResult"] = "result[i] != Helpers.AddSaturate(firstOp[i], (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)9", ["Imm2"] = "SveMaskPattern.VectorCount5", ["InvalidImm"] = "(Byte)201", ["InvalidImm2"] = "(SveMaskPattern)80", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)8", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)202", ["InvalidImm2"] = "(SveMaskPattern)12", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)7", ["Imm2"] = "SveMaskPattern.LargestPowerOf2", ["InvalidImm"] = "(Byte)207", ["InvalidImm2"] = "(SveMaskPattern)13", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)6", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)220", ["InvalidImm2"] = "(SveMaskPattern)99", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate(data, ((ulong)imm1 * (ulong)Helpers.NumberOfElementsInVectorInt32(imm2))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_vector_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)5", ["Imm2"] = "SveMaskPattern.LargestMultipleOf4", ["InvalidImm"] = "(Byte)221", ["InvalidImm2"] = "(SveMaskPattern)76", ["ValidateIterResult"] = "result[i] != Helpers.AddSaturate(firstOp[i], (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_vector_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)4", ["Imm2"] = "SveMaskPattern.LargestMultipleOf3", ["InvalidImm"] = "(Byte)240", ["InvalidImm2"] = "(SveMaskPattern)32", ["ValidateIterResult"] = "result[i] != Helpers.AddSaturate(firstOp[i], (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)3", ["Imm2"] = "SveMaskPattern.VectorCount64", ["InvalidImm"] = "(Byte)241", ["InvalidImm2"] = "(SveMaskPattern)105", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.VectorCount4", ["InvalidImm"] = "(Byte)255", ["InvalidImm2"] = "(SveMaskPattern)108", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)1", ["Imm2"] = "SveMaskPattern.VectorCount6", ["InvalidImm"] = "(Byte)243", ["InvalidImm2"] = "(SveMaskPattern)109", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.LargestMultipleOf3", ["InvalidImm"] = "(Byte)19", ["InvalidImm2"] = "(SveMaskPattern)101", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate(data, ((ulong)imm1 * (ulong)Helpers.NumberOfElementsInVectorInt64(imm2))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_vector_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.LargestPowerOf2", ["InvalidImm"] = "(Byte)56", ["InvalidImm2"] = "(SveMaskPattern)109", ["ValidateIterResult"] = "result[i] != Helpers.AddSaturate(firstOp[i], (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_vector_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.VectorCount8", ["InvalidImm"] = "(Byte)75", ["InvalidImm2"] = "(SveMaskPattern)154", ["ValidateIterResult"] = "result[i] != Helpers.AddSaturate(firstOp[i], (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.VectorCount8", ["InvalidImm"] = "(Byte)100", ["InvalidImm2"] = "(SveMaskPattern)235", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.VectorCount4", ["InvalidImm"] = "(Byte)99", ["InvalidImm2"] = "(SveMaskPattern)123", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.VectorCount5", ["InvalidImm"] = "(Byte)98", ["InvalidImm2"] = "(SveMaskPattern)232", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)97", ["InvalidImm2"] = "(SveMaskPattern)234", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate(data, ((ulong)imm1 * (ulong)Helpers.NumberOfElementsInVectorInt8(imm2))));",}), ("SveSimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sve_SignExtend16_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SignExtend16", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "result[i] != Helpers.SignExtend(firstOp[i], 16, false)", ["GetIterResult"] = "Helpers.SignExtend(leftOp[i], 16, false)"}), ("SveSimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sve_SignExtend16_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SignExtend16", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "result[i] != Helpers.SignExtend(firstOp[i], 16, false)", ["GetIterResult"] = "Helpers.SignExtend(leftOp[i], 16, false)"}), From 975eb1e2f08d715d5b68060f525873ec17bac08b Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Fri, 31 May 2024 13:20:07 +0100 Subject: [PATCH 28/29] Ensure Saturating helpers use the correct size --- .../GenerateHWIntrinsicTests_Arm.cs | 102 +++++++++--------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs index 788ef3edfb56b5..79bf3ede90d5d0 100644 --- a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs +++ b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs @@ -3324,57 +3324,57 @@ ("SveSimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sve_PopCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "PopCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.BitCount(firstOp[i]) != result[i]", ["GetIterResult"] = "Helpers.BitCount(leftOp[i])"}), ("SveSimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sve_PopCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "PopCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.BitCount(firstOp[i]) != result[i]", ["GetIterResult"] = "Helpers.BitCount(leftOp[i])"}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.LargestPowerOf2", ["InvalidImm"] = "(Byte)0", ["InvalidImm2"] = "(SveMaskPattern)35", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)12", ["Imm2"] = "SveMaskPattern.VectorCount1", ["InvalidImm"] = "(Byte)19", ["InvalidImm2"] = "(SveMaskPattern)37", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)5", ["Imm2"] = "SveMaskPattern.VectorCount2", ["InvalidImm"] = "(Byte)25", ["InvalidImm2"] = "(SveMaskPattern)46", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)7", ["Imm2"] = "SveMaskPattern.VectorCount3", ["InvalidImm"] = "(Byte)255", ["InvalidImm2"] = "(SveMaskPattern)50", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate(data, ((ulong)imm1 * (ulong)Helpers.NumberOfElementsInVectorInt16(imm2))));",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_vector_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "(Byte)10", ["Imm2"] = "SveMaskPattern.VectorCount4", ["InvalidImm"] = "(Byte)65", ["InvalidImm2"] = "(SveMaskPattern)90", ["ValidateIterResult"] = "result[i] != Helpers.SubtractSaturate(firstOp[i], (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2)))",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_vector_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "(Byte)1", ["Imm2"] = "SveMaskPattern.VectorCount5", ["InvalidImm"] = "(Byte)72", ["InvalidImm2"] = "(SveMaskPattern)35", ["ValidateIterResult"] = "result[i] != Helpers.SubtractSaturate(firstOp[i], (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2)))",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)1", ["Imm2"] = "SveMaskPattern.VectorCount6", ["InvalidImm"] = "(Byte)17", ["InvalidImm2"] = "(SveMaskPattern)32", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.VectorCount7", ["InvalidImm"] = "(Byte)19", ["InvalidImm2"] = "(SveMaskPattern)33", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)3", ["Imm2"] = "SveMaskPattern.VectorCount8", ["InvalidImm"] = "(Byte)25", ["InvalidImm2"] = "(SveMaskPattern)34", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)4", ["Imm2"] = "SveMaskPattern.VectorCount32", ["InvalidImm"] = "(Byte)26", ["InvalidImm2"] = "(SveMaskPattern)35", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate(data, ((ulong)imm1 * (ulong)Helpers.NumberOfElementsInVectorInt16(imm2))));",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_vector_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)5", ["Imm2"] = "SveMaskPattern.VectorCount64", ["InvalidImm"] = "(Byte)27", ["InvalidImm2"] = "(SveMaskPattern)36", ["ValidateIterResult"] = "result[i] != Helpers.SubtractSaturate(firstOp[i], (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2)))",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_vector_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)6", ["Imm2"] = "SveMaskPattern.VectorCount128", ["InvalidImm"] = "(Byte)18", ["InvalidImm2"] = "(SveMaskPattern)37", ["ValidateIterResult"] = "result[i] != Helpers.SubtractSaturate(firstOp[i], (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2)))",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)7", ["Imm2"] = "SveMaskPattern.VectorCount256", ["InvalidImm"] = "(Byte)34", ["InvalidImm2"] = "(SveMaskPattern)135", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)8", ["Imm2"] = "SveMaskPattern.LargestMultipleOf4", ["InvalidImm"] = "(Byte)35", ["InvalidImm2"] = "(SveMaskPattern)125", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)9", ["Imm2"] = "SveMaskPattern.LargestMultipleOf3", ["InvalidImm"] = "(Byte)36", ["InvalidImm2"] = "(SveMaskPattern)115", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)10", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)37", ["InvalidImm2"] = "(SveMaskPattern)145", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate(data, ((ulong)imm1 * (ulong)Helpers.NumberOfElementsInVectorInt64(imm2))));",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_vector_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)11", ["Imm2"] = "SveMaskPattern.VectorCount7", ["InvalidImm"] = "(Byte)38", ["InvalidImm2"] = "(SveMaskPattern)155", ["ValidateIterResult"] = "result[i] != Helpers.SubtractSaturate(firstOp[i], (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2)))",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_vector_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)12", ["Imm2"] = "SveMaskPattern.LargestPowerOf2", ["InvalidImm"] = "(Byte)39", ["InvalidImm2"] = "(SveMaskPattern)165", ["ValidateIterResult"] = "result[i] != Helpers.SubtractSaturate(firstOp[i], ((ulong)imm1 * (ulong)Helpers.NumberOfElementsInVectorInt64(imm2)))",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)13", ["Imm2"] = "SveMaskPattern.VectorCount4", ["InvalidImm"] = "(Byte)89", ["InvalidImm2"] = "(SveMaskPattern)206", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)14", ["Imm2"] = "SveMaskPattern.LargestPowerOf2", ["InvalidImm"] = "(Byte)0", ["InvalidImm2"] = "(SveMaskPattern)207", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)15", ["Imm2"] = "SveMaskPattern.VectorCount6", ["InvalidImm"] = "(Byte)91", ["InvalidImm2"] = "(SveMaskPattern)208", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)16", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)92", ["InvalidImm2"] = "(SveMaskPattern)209", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate(data, ((ulong)imm1 * (ulong)Helpers.NumberOfElementsInVectorInt8(imm2))));",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)15", ["Imm2"] = "SveMaskPattern.VectorCount4", ["InvalidImm"] = "(Byte)98", ["InvalidImm2"] = "(SveMaskPattern)241", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)14", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)99", ["InvalidImm2"] = "(SveMaskPattern)242", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)13", ["Imm2"] = "SveMaskPattern.VectorCount256", ["InvalidImm"] = "(Byte)101", ["InvalidImm2"] = "(SveMaskPattern)243", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)12", ["Imm2"] = "SveMaskPattern.VectorCount32", ["InvalidImm"] = "(Byte)118", ["InvalidImm2"] = "(SveMaskPattern)50", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate(data, ((ulong)imm1 * (ulong)Helpers.NumberOfElementsInVectorInt16(imm2))));",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_vector_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "(Byte)11", ["Imm2"] = "SveMaskPattern.VectorCount4", ["InvalidImm"] = "(Byte)118", ["InvalidImm2"] = "(SveMaskPattern)60", ["ValidateIterResult"] = "result[i] != Helpers.AddSaturate(firstOp[i], (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2)))",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_vector_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "(Byte)10", ["Imm2"] = "SveMaskPattern.VectorCount64", ["InvalidImm"] = "(Byte)123", ["InvalidImm2"] = "(SveMaskPattern)70", ["ValidateIterResult"] = "result[i] != Helpers.AddSaturate(firstOp[i], (imm1 * Helpers.NumberOfElementsInVectorInt16(imm2)))",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)9", ["Imm2"] = "SveMaskPattern.VectorCount5", ["InvalidImm"] = "(Byte)201", ["InvalidImm2"] = "(SveMaskPattern)80", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)8", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)202", ["InvalidImm2"] = "(SveMaskPattern)12", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)7", ["Imm2"] = "SveMaskPattern.LargestPowerOf2", ["InvalidImm"] = "(Byte)207", ["InvalidImm2"] = "(SveMaskPattern)13", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)6", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)220", ["InvalidImm2"] = "(SveMaskPattern)99", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate(data, ((ulong)imm1 * (ulong)Helpers.NumberOfElementsInVectorInt32(imm2))));",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_vector_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)5", ["Imm2"] = "SveMaskPattern.LargestMultipleOf4", ["InvalidImm"] = "(Byte)221", ["InvalidImm2"] = "(SveMaskPattern)76", ["ValidateIterResult"] = "result[i] != Helpers.AddSaturate(firstOp[i], (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2)))",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_vector_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)4", ["Imm2"] = "SveMaskPattern.LargestMultipleOf3", ["InvalidImm"] = "(Byte)240", ["InvalidImm2"] = "(SveMaskPattern)32", ["ValidateIterResult"] = "result[i] != Helpers.AddSaturate(firstOp[i], (imm1 * Helpers.NumberOfElementsInVectorInt32(imm2)))",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)3", ["Imm2"] = "SveMaskPattern.VectorCount64", ["InvalidImm"] = "(Byte)241", ["InvalidImm2"] = "(SveMaskPattern)105", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.VectorCount4", ["InvalidImm"] = "(Byte)255", ["InvalidImm2"] = "(SveMaskPattern)108", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)1", ["Imm2"] = "SveMaskPattern.VectorCount6", ["InvalidImm"] = "(Byte)243", ["InvalidImm2"] = "(SveMaskPattern)109", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.LargestMultipleOf3", ["InvalidImm"] = "(Byte)19", ["InvalidImm2"] = "(SveMaskPattern)101", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate(data, ((ulong)imm1 * (ulong)Helpers.NumberOfElementsInVectorInt64(imm2))));",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_vector_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.LargestPowerOf2", ["InvalidImm"] = "(Byte)56", ["InvalidImm2"] = "(SveMaskPattern)109", ["ValidateIterResult"] = "result[i] != Helpers.AddSaturate(firstOp[i], (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2)))",}), - ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_vector_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.VectorCount8", ["InvalidImm"] = "(Byte)75", ["InvalidImm2"] = "(SveMaskPattern)154", ["ValidateIterResult"] = "result[i] != Helpers.AddSaturate(firstOp[i], (imm1 * Helpers.NumberOfElementsInVectorInt64(imm2)))",}), - - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.VectorCount8", ["InvalidImm"] = "(Byte)100", ["InvalidImm2"] = "(SveMaskPattern)235", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.VectorCount4", ["InvalidImm"] = "(Byte)99", ["InvalidImm2"] = "(SveMaskPattern)123", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.VectorCount5", ["InvalidImm"] = "(Byte)98", ["InvalidImm2"] = "(SveMaskPattern)232", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate(data, (imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), - ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)97", ["InvalidImm2"] = "(SveMaskPattern)234", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate(data, ((ulong)imm1 * (ulong)Helpers.NumberOfElementsInVectorInt8(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.LargestPowerOf2", ["InvalidImm"] = "(Byte)0", ["InvalidImm2"] = "(SveMaskPattern)35", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate((int)data, (int)(imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)12", ["Imm2"] = "SveMaskPattern.VectorCount1", ["InvalidImm"] = "(Byte)19", ["InvalidImm2"] = "(SveMaskPattern)37", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate((long)data, (long)(imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)5", ["Imm2"] = "SveMaskPattern.VectorCount2", ["InvalidImm"] = "(Byte)25", ["InvalidImm2"] = "(SveMaskPattern)46", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate((uint)data, (uint)(imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)7", ["Imm2"] = "SveMaskPattern.VectorCount3", ["InvalidImm"] = "(Byte)255", ["InvalidImm2"] = "(SveMaskPattern)50", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate((ulong)data, (ulong)(imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_vector_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "(Byte)10", ["Imm2"] = "SveMaskPattern.VectorCount4", ["InvalidImm"] = "(Byte)65", ["InvalidImm2"] = "(SveMaskPattern)90", ["ValidateIterResult"] = "result[i] != Helpers.SubtractSaturate((short)firstOp[i], (short)(imm1 * Helpers.NumberOfElementsInVectorInt16(imm2)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy16BitElementCount_vector_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "(Byte)1", ["Imm2"] = "SveMaskPattern.VectorCount5", ["InvalidImm"] = "(Byte)72", ["InvalidImm2"] = "(SveMaskPattern)35", ["ValidateIterResult"] = "result[i] != Helpers.SubtractSaturate((ushort)firstOp[i], (ushort)(imm1 * Helpers.NumberOfElementsInVectorInt16(imm2)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)1", ["Imm2"] = "SveMaskPattern.VectorCount6", ["InvalidImm"] = "(Byte)17", ["InvalidImm2"] = "(SveMaskPattern)32", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate((int)data, (int)(imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.VectorCount7", ["InvalidImm"] = "(Byte)19", ["InvalidImm2"] = "(SveMaskPattern)33", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate((long)data, (long)(imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)3", ["Imm2"] = "SveMaskPattern.VectorCount8", ["InvalidImm"] = "(Byte)25", ["InvalidImm2"] = "(SveMaskPattern)34", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate((uint)data, (uint)(imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)4", ["Imm2"] = "SveMaskPattern.VectorCount32", ["InvalidImm"] = "(Byte)26", ["InvalidImm2"] = "(SveMaskPattern)35", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate((ulong)data, (ulong)(imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_vector_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)5", ["Imm2"] = "SveMaskPattern.VectorCount64", ["InvalidImm"] = "(Byte)27", ["InvalidImm2"] = "(SveMaskPattern)36", ["ValidateIterResult"] = "result[i] != Helpers.SubtractSaturate((int)firstOp[i], (int)(imm1 * Helpers.NumberOfElementsInVectorInt32(imm2)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy32BitElementCount_vector_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)6", ["Imm2"] = "SveMaskPattern.VectorCount128", ["InvalidImm"] = "(Byte)18", ["InvalidImm2"] = "(SveMaskPattern)37", ["ValidateIterResult"] = "result[i] != Helpers.SubtractSaturate((uint)firstOp[i], (uint)(imm1 * Helpers.NumberOfElementsInVectorInt32(imm2)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)7", ["Imm2"] = "SveMaskPattern.VectorCount256", ["InvalidImm"] = "(Byte)34", ["InvalidImm2"] = "(SveMaskPattern)135", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate((int)data, (int)(imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)8", ["Imm2"] = "SveMaskPattern.LargestMultipleOf4", ["InvalidImm"] = "(Byte)35", ["InvalidImm2"] = "(SveMaskPattern)125", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate((long)data, (long)(imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)9", ["Imm2"] = "SveMaskPattern.LargestMultipleOf3", ["InvalidImm"] = "(Byte)36", ["InvalidImm2"] = "(SveMaskPattern)115", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate((uint)data, (uint)(imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)10", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)37", ["InvalidImm2"] = "(SveMaskPattern)145", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate((ulong)data, (ulong)(imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_vector_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)11", ["Imm2"] = "SveMaskPattern.VectorCount7", ["InvalidImm"] = "(Byte)38", ["InvalidImm2"] = "(SveMaskPattern)155", ["ValidateIterResult"] = "result[i] != Helpers.SubtractSaturate((long)firstOp[i], (long)(imm1 * Helpers.NumberOfElementsInVectorInt64(imm2)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy64BitElementCount_vector_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)12", ["Imm2"] = "SveMaskPattern.LargestPowerOf2", ["InvalidImm"] = "(Byte)39", ["InvalidImm2"] = "(SveMaskPattern)165", ["ValidateIterResult"] = "result[i] != Helpers.SubtractSaturate((ulong)firstOp[i], (ulong)(imm1 * Helpers.NumberOfElementsInVectorInt64(imm2)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)13", ["Imm2"] = "SveMaskPattern.VectorCount4", ["InvalidImm"] = "(Byte)89", ["InvalidImm2"] = "(SveMaskPattern)206", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate((int)data, (int)(imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)14", ["Imm2"] = "SveMaskPattern.LargestPowerOf2", ["InvalidImm"] = "(Byte)0", ["InvalidImm2"] = "(SveMaskPattern)207", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate((long)data, (long)(imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)15", ["Imm2"] = "SveMaskPattern.VectorCount6", ["InvalidImm"] = "(Byte)91", ["InvalidImm2"] = "(SveMaskPattern)208", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate((uint)data, (uint)(imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingDecrementBy8BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingDecrementBy8BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)16", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)92", ["InvalidImm2"] = "(SveMaskPattern)209", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.SubtractSaturate((ulong)data, (ulong)(imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)15", ["Imm2"] = "SveMaskPattern.VectorCount4", ["InvalidImm"] = "(Byte)98", ["InvalidImm2"] = "(SveMaskPattern)241", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate((int)data, (int)(imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)14", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)99", ["InvalidImm2"] = "(SveMaskPattern)242", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate((long)data, (long)(imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)13", ["Imm2"] = "SveMaskPattern.VectorCount256", ["InvalidImm"] = "(Byte)101", ["InvalidImm2"] = "(SveMaskPattern)243", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate((uint)data, (uint)(imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)12", ["Imm2"] = "SveMaskPattern.VectorCount32", ["InvalidImm"] = "(Byte)118", ["InvalidImm2"] = "(SveMaskPattern)50", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate((ulong)data, (ulong)(imm1 * Helpers.NumberOfElementsInVectorInt16(imm2))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_vector_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["Imm"] = "(Byte)11", ["Imm2"] = "SveMaskPattern.VectorCount4", ["InvalidImm"] = "(Byte)118", ["InvalidImm2"] = "(SveMaskPattern)60", ["ValidateIterResult"] = "result[i] != Helpers.AddSaturate((short)firstOp[i], (short)(imm1 * Helpers.NumberOfElementsInVectorInt16(imm2)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy16BitElementCount_vector_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy16BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["Imm"] = "(Byte)10", ["Imm2"] = "SveMaskPattern.VectorCount64", ["InvalidImm"] = "(Byte)123", ["InvalidImm2"] = "(SveMaskPattern)70", ["ValidateIterResult"] = "result[i] != Helpers.AddSaturate((ushort)firstOp[i], (ushort)(imm1 * Helpers.NumberOfElementsInVectorInt16(imm2)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)9", ["Imm2"] = "SveMaskPattern.VectorCount5", ["InvalidImm"] = "(Byte)201", ["InvalidImm2"] = "(SveMaskPattern)80", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate((int)data, (int)(imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)8", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)202", ["InvalidImm2"] = "(SveMaskPattern)12", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate((long)data, (long)(imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)7", ["Imm2"] = "SveMaskPattern.LargestPowerOf2", ["InvalidImm"] = "(Byte)207", ["InvalidImm2"] = "(SveMaskPattern)13", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate((uint)data, (uint)(imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)6", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)220", ["InvalidImm2"] = "(SveMaskPattern)99", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate((ulong)data, (ulong)(imm1 * Helpers.NumberOfElementsInVectorInt32(imm2))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_vector_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)5", ["Imm2"] = "SveMaskPattern.LargestMultipleOf4", ["InvalidImm"] = "(Byte)221", ["InvalidImm2"] = "(SveMaskPattern)76", ["ValidateIterResult"] = "result[i] != Helpers.AddSaturate((int)firstOp[i], (int)(imm1 * Helpers.NumberOfElementsInVectorInt32(imm2)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy32BitElementCount_vector_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy32BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)4", ["Imm2"] = "SveMaskPattern.LargestMultipleOf3", ["InvalidImm"] = "(Byte)240", ["InvalidImm2"] = "(SveMaskPattern)32", ["ValidateIterResult"] = "result[i] != Helpers.AddSaturate((uint)firstOp[i], (uint)(imm1 * Helpers.NumberOfElementsInVectorInt32(imm2)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)3", ["Imm2"] = "SveMaskPattern.VectorCount64", ["InvalidImm"] = "(Byte)241", ["InvalidImm2"] = "(SveMaskPattern)105", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate((int)data, (int)(imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.VectorCount4", ["InvalidImm"] = "(Byte)255", ["InvalidImm2"] = "(SveMaskPattern)108", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate((long)data, (long)(imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)1", ["Imm2"] = "SveMaskPattern.VectorCount6", ["InvalidImm"] = "(Byte)243", ["InvalidImm2"] = "(SveMaskPattern)109", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate((uint)data, (uint)(imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.LargestMultipleOf3", ["InvalidImm"] = "(Byte)19", ["InvalidImm2"] = "(SveMaskPattern)101", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate((ulong)data, (ulong)(imm1 * Helpers.NumberOfElementsInVectorInt64(imm2))));",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_vector_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.LargestPowerOf2", ["InvalidImm"] = "(Byte)56", ["InvalidImm2"] = "(SveMaskPattern)109", ["ValidateIterResult"] = "result[i] != Helpers.AddSaturate((long)firstOp[i], (long)(imm1 * Helpers.NumberOfElementsInVectorInt64(imm2)))",}), + ("SveVecImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy64BitElementCount_vector_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy64BitElementCount", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.VectorCount8", ["InvalidImm"] = "(Byte)75", ["InvalidImm2"] = "(SveMaskPattern)154", ["ValidateIterResult"] = "result[i] != Helpers.AddSaturate((ulong)firstOp[i], (ulong)(imm1 * Helpers.NumberOfElementsInVectorInt64(imm2)))",}), + + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "Int32", ["Op1BaseType"] = "Int32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.VectorCount8", ["InvalidImm"] = "(Byte)100", ["InvalidImm2"] = "(SveMaskPattern)235", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate((int)data, (int)(imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "Int64", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.VectorCount4", ["InvalidImm"] = "(Byte)99", ["InvalidImm2"] = "(SveMaskPattern)123", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate((long)data, (long)(imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "UInt32", ["Op1BaseType"] = "UInt32", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.VectorCount5", ["InvalidImm"] = "(Byte)98", ["InvalidImm2"] = "(SveMaskPattern)232", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate((uint)data, (uint)(imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), + ("ScalarImm2UnOpTest.template", new Dictionary {["TestName"] = "Sve_SaturatingIncrementBy8BitElementCount_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SaturatingIncrementBy8BitElementCount", ["RetBaseType"] = "UInt64", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "Byte", ["Op3BaseType"] = "SveMaskPattern", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["Imm"] = "(Byte)2", ["Imm2"] = "SveMaskPattern.All", ["InvalidImm"] = "(Byte)97", ["InvalidImm2"] = "(SveMaskPattern)234", ["ValidateResult"] = "isUnexpectedResult = (result != Helpers.AddSaturate((ulong)data, (ulong)(imm1 * Helpers.NumberOfElementsInVectorInt8(imm2))));",}), ("SveSimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sve_SignExtend16_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SignExtend16", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "result[i] != Helpers.SignExtend(firstOp[i], 16, false)", ["GetIterResult"] = "Helpers.SignExtend(leftOp[i], 16, false)"}), ("SveSimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sve_SignExtend16_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "SignExtend16", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "result[i] != Helpers.SignExtend(firstOp[i], 16, false)", ["GetIterResult"] = "Helpers.SignExtend(leftOp[i], 16, false)"}), From f6a232e4db14a14f02a178a62f083cfdb4f505bc Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Fri, 31 May 2024 14:48:05 +0100 Subject: [PATCH 29/29] Set internal register as delay for Saturating --- src/coreclr/jit/lsraarm64.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/coreclr/jit/lsraarm64.cpp b/src/coreclr/jit/lsraarm64.cpp index 17378d093e90f1..a63b9dd3d86e5a 100644 --- a/src/coreclr/jit/lsraarm64.cpp +++ b/src/coreclr/jit/lsraarm64.cpp @@ -1489,6 +1489,8 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree, int* pDstCou // Can only avoid generating a table if both immediates are constant. assert(intrin.op2->isContainedIntOrIImmed() == intrin.op3->isContainedIntOrIImmed()); needBranchTargetReg = !intrin.op2->isContainedIntOrIImmed(); + // Ensure that internal does not collide with desination. + setInternalRegsDelayFree = true; break; default: @@ -1996,6 +1998,8 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree, int* pDstCou } } + buildInternalRegisterUses(); + if ((dstCount == 1) || (dstCount == 2)) { BuildDef(intrinsicTree); @@ -2010,8 +2014,6 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree, int* pDstCou assert(dstCount == 0); } - buildInternalRegisterUses(); - *pDstCount = dstCount; return srcCount; }