From 5f0fe2364272e7ee5152357ca48d4e488287976f Mon Sep 17 00:00:00 2001 From: Swapnil Gaikwad Date: Tue, 14 May 2024 16:01:13 +0100 Subject: [PATCH 1/5] Add support for Sve.Store() --- src/coreclr/jit/gentree.cpp | 9 +- src/coreclr/jit/hwintrinsicarm64.cpp | 53 +++ src/coreclr/jit/hwintrinsiccodegenarm64.cpp | 61 +++ src/coreclr/jit/hwintrinsiclistarm64sve.h | 4 + src/coreclr/jit/lsraarm64.cpp | 21 +- .../Arm/Sve.PlatformNotSupported.cs | 284 +++++++++++++ .../src/System/Runtime/Intrinsics/Arm/Sve.cs | 284 +++++++++++++ .../ref/System.Runtime.Intrinsics.cs | 43 +- .../GenerateHWIntrinsicTests_Arm.cs | 41 ++ .../Arm/Shared/SveStoreTest.template | 309 ++++++++++++++ .../Arm/Shared/SveStoreTestx2.template | 342 +++++++++++++++ .../Arm/Shared/SveStoreTestx3.template | 369 ++++++++++++++++ .../Arm/Shared/SveStoreTestx4.template | 396 ++++++++++++++++++ 13 files changed, 2212 insertions(+), 4 deletions(-) create mode 100644 src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreTest.template create mode 100644 src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreTestx2.template create mode 100644 src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreTestx3.template create mode 100644 src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreTestx4.template diff --git a/src/coreclr/jit/gentree.cpp b/src/coreclr/jit/gentree.cpp index 21d8349ef81e77..477aa4ccbfe222 100644 --- a/src/coreclr/jit/gentree.cpp +++ b/src/coreclr/jit/gentree.cpp @@ -26652,7 +26652,14 @@ bool GenTreeHWIntrinsic::OperIsMemoryStore(GenTree** pAddr) const case NI_SSE2_MaskMove: addr = Op(3); break; -#endif // TARGET_XARCH +#elif defined(TARGET_ARM64) + case NI_Sve_Store: + case NI_Sve_Storex2: + case NI_Sve_Storex3: + case NI_Sve_Storex4: + addr = Op(2); + break; +#endif // TARGET_ARM64 default: addr = Op(1); diff --git a/src/coreclr/jit/hwintrinsicarm64.cpp b/src/coreclr/jit/hwintrinsicarm64.cpp index ce3d6e5e69fa2d..099e83dd9e35a5 100644 --- a/src/coreclr/jit/hwintrinsicarm64.cpp +++ b/src/coreclr/jit/hwintrinsicarm64.cpp @@ -2370,6 +2370,59 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } + case NI_Sve_Store: + { + assert(sig->numArgs == 3); + assert(retType == TYP_VOID); + + 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; + argType = JITtype2varType(strip(info.compCompHnd->getArgType(sig, arg3, &argClass))); + op3 = impPopStack().val; + unsigned fieldCount = info.compCompHnd->getClassNumInstanceFields(argClass); + + if (op3->TypeGet() == TYP_STRUCT) + { + info.compNeedsConsecutiveRegisters = true; + switch (fieldCount) + { + case 2: + intrinsic = NI_Sve_Storex2; + break; + + case 3: + intrinsic = NI_Sve_Storex3; + break; + + case 4: + intrinsic = NI_Sve_Storex4; + break; + + default: + assert("unsupported"); + } + + if (!op3->OperIs(GT_LCL_VAR)) + { + unsigned tmp = lvaGrabTemp(true DEBUGARG("SveStoreN")); + + impStoreToTemp(tmp, op3, CHECK_SPILL_NONE); + op3 = gtNewLclvNode(tmp, argType); + } + op3 = gtConvertTableOpToFieldList(op3, fieldCount); + } + + argType = JITtype2varType(strip(info.compCompHnd->getArgType(sig, arg2, &argClass))); + op2 = getArgForHWIntrinsic(argType, argClass); + argType = JITtype2varType(strip(info.compCompHnd->getArgType(sig, arg1, &argClass))); + op1 = getArgForHWIntrinsic(argType, argClass); + retNode = gtNewSimdHWIntrinsicNode(retType, op1, op2, op3, intrinsic, simdBaseJitType, simdSize); + break; + } + default: { return nullptr; diff --git a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp index c0dcd95b5b1b9e..91aef61ea7267a 100644 --- a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp +++ b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp @@ -1348,6 +1348,67 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) } break; + case NI_Sve_Storex2: + case NI_Sve_Storex3: + case NI_Sve_Storex4: + { + assert(intrin.op3->OperIsFieldList()); + GenTreeFieldList* fieldList = intrin.op3->AsFieldList(); + GenTree* firstField = fieldList->Uses().GetHead()->GetNode(); + op3Reg = firstField->GetRegNum(); + +#ifdef DEBUG + unsigned regCount = 0; + regNumber argReg = op3Reg; + for (GenTreeFieldList::Use& use : fieldList->Uses()) + { + regCount++; + + GenTree* argNode = use.GetNode(); + assert(argReg == argNode->GetRegNum()); + argReg = getNextSIMDRegWithWraparound(argReg); + } + + switch (ins) + { + case INS_sve_st2b: + case INS_sve_st2d: + case INS_sve_st2h: + case INS_sve_st2w: + case INS_sve_st2q: + assert(regCount == 2); + break; + + case INS_sve_st3b: + case INS_sve_st3d: + case INS_sve_st3h: + case INS_sve_st3w: + case INS_sve_st3q: + assert(regCount == 3); + break; + + case INS_sve_st4b: + case INS_sve_st4d: + case INS_sve_st4h: + case INS_sve_st4w: + case INS_sve_st4q: + assert(regCount == 4); + break; + + default: + unreached(); + } +#endif + GetEmitter()->emitIns_R_R_R_I(ins, emitSize, op3Reg, op1Reg, op2Reg, 0, opt); + break; + } + + case NI_Sve_Store: + { + GetEmitter()->emitIns_R_R_R_I(ins, emitSize, op3Reg, op1Reg, op2Reg, 0, opt); + break; + } + case NI_Vector64_ToVector128: GetEmitter()->emitIns_Mov(ins, emitSize, targetReg, op1Reg, /* canSkip */ false); break; diff --git a/src/coreclr/jit/hwintrinsiclistarm64sve.h b/src/coreclr/jit/hwintrinsiclistarm64sve.h index 3e70c507d015a2..b853c65a551a8c 100644 --- a/src/coreclr/jit/hwintrinsiclistarm64sve.h +++ b/src/coreclr/jit/hwintrinsiclistarm64sve.h @@ -112,6 +112,7 @@ HARDWARE_INTRINSIC(Sve, SignExtend32, 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) HARDWARE_INTRINSIC(Sve, SignExtendWideningLower, -1, 1, true, {INS_sve_sunpklo, INS_invalid, INS_sve_sunpklo, INS_invalid, INS_sve_sunpklo, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Sve, SignExtendWideningUpper, -1, 1, true, {INS_sve_sunpkhi, INS_invalid, INS_sve_sunpkhi, INS_invalid, INS_sve_sunpkhi, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_BaseTypeFromFirstArg) +HARDWARE_INTRINSIC(Sve, Store, -1, 3, true, {INS_sve_st1b, INS_sve_st1b, INS_sve_st1h, INS_sve_st1h, INS_sve_st1w, INS_sve_st1w, INS_sve_st1d, INS_sve_st1d, INS_sve_st1w, INS_sve_st1d}, HW_Category_MemoryStore, HW_Flag_Scalable|HW_Flag_BaseTypeFromFirstArg|HW_Flag_ExplicitMaskedOperation|HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen|HW_Flag_LowMaskedOperation) HARDWARE_INTRINSIC(Sve, Subtract, -1, 2, true, {INS_sve_sub, INS_sve_sub, INS_sve_sub, INS_sve_sub, INS_sve_sub, INS_sve_sub, INS_sve_sub, INS_sve_sub, INS_sve_fsub, INS_sve_fsub}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_OptionalEmbeddedMaskedOperation|HW_Flag_HasRMWSemantics|HW_Flag_LowMaskedOperation) HARDWARE_INTRINSIC(Sve, SubtractSaturate, -1, 2, true, {INS_sve_sqsub, INS_sve_uqsub, INS_sve_sqsub, INS_sve_uqsub, INS_sve_sqsub, INS_sve_uqsub, INS_sve_sqsub, INS_sve_uqsub, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_OptionalEmbeddedMaskedOperation|HW_Flag_HasRMWSemantics|HW_Flag_LowMaskedOperation) HARDWARE_INTRINSIC(Sve, UnzipEven, -1, 2, true, {INS_sve_uzp1, INS_sve_uzp1, INS_sve_uzp1, INS_sve_uzp1, INS_sve_uzp1, INS_sve_uzp1, INS_sve_uzp1, INS_sve_uzp1, INS_sve_uzp1, INS_sve_uzp1}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_SpecialCodeGen) @@ -136,6 +137,9 @@ HARDWARE_INTRINSIC(Sve, ZipLow, HARDWARE_INTRINSIC(Sve, ConvertMaskToVector, -1, 1, true, {INS_sve_mov, INS_sve_mov, INS_sve_mov, INS_sve_mov, INS_sve_mov, INS_sve_mov, INS_sve_mov, INS_sve_mov, INS_sve_mov, INS_sve_mov}, HW_Category_Helper, HW_Flag_Scalable|HW_Flag_ExplicitMaskedOperation) 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) +HARDWARE_INTRINSIC(Sve, Storex2, -1, 3, true, {INS_sve_st2b, INS_sve_st2b, INS_sve_st2h, INS_sve_st2h, INS_sve_st2w, INS_sve_st2w, INS_sve_st2d, INS_sve_st2d, INS_sve_st2w, INS_sve_st2d}, HW_Category_MemoryStore, HW_Flag_Scalable|HW_Flag_SpecialCodeGen|HW_Flag_ExplicitMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_NeedsConsecutiveRegisters) +HARDWARE_INTRINSIC(Sve, Storex3, -1, 3, true, {INS_sve_st3b, INS_sve_st3b, INS_sve_st3h, INS_sve_st3h, INS_sve_st3w, INS_sve_st3w, INS_sve_st3d, INS_sve_st3d, INS_sve_st3w, INS_sve_st3d}, HW_Category_MemoryStore, HW_Flag_Scalable|HW_Flag_SpecialCodeGen|HW_Flag_ExplicitMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_NeedsConsecutiveRegisters) +HARDWARE_INTRINSIC(Sve, Storex4, -1, 3, true, {INS_sve_st4b, INS_sve_st4b, INS_sve_st4h, INS_sve_st4h, INS_sve_st4w, INS_sve_st4w, INS_sve_st4d, INS_sve_st4d, INS_sve_st4w, INS_sve_st4d}, HW_Category_MemoryStore, HW_Flag_Scalable|HW_Flag_SpecialCodeGen|HW_Flag_ExplicitMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_NeedsConsecutiveRegisters) #endif // FEATURE_HW_INTRINSIC diff --git a/src/coreclr/jit/lsraarm64.cpp b/src/coreclr/jit/lsraarm64.cpp index 264bc70b0a74de..0c771774a5c590 100644 --- a/src/coreclr/jit/lsraarm64.cpp +++ b/src/coreclr/jit/lsraarm64.cpp @@ -1758,6 +1758,20 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree, int* pDstCou break; } + case NI_Sve_Storex2: + case NI_Sve_Storex3: + case NI_Sve_Storex4: + { + assert(intrin.op2 != nullptr); + assert(intrin.op3 != nullptr); + srcCount += BuildAddrUses(intrin.op2); + srcCount += BuildConsecutiveRegistersForUse(intrin.op3); + assert(dstCount == 0); + buildInternalRegisterUses(); + *pDstCount = 0; + break; + } + default: noway_assert(!"Not a supported as multiple consecutive register intrinsic"); } @@ -1865,8 +1879,7 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree, int* pDstCou compiler->getSIMDInitTempVarNum(requiredSimdTempType); } } - - if ((intrin.id == NI_Sve_FusedMultiplyAddBySelectedScalar) || + else if ((intrin.id == NI_Sve_FusedMultiplyAddBySelectedScalar) || (intrin.id == NI_Sve_FusedMultiplySubtractBySelectedScalar)) { // If this is common pattern, then we will add a flag in the table, but for now, just check for specific @@ -1898,6 +1911,10 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree, int* pDstCou srcCount += BuildDelayFreeUses(intrinEmbOp2->Op(argNum), intrinEmbOp2->Op(1)); } } + else if (intrin.id == NI_Sve_Store) + { + srcCount += BuildAddrUses(intrin.op2); + } else { if (forceOp2DelayFree) 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..ef45c5a0947679 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 @@ -2516,6 +2516,290 @@ internal Arm64() { } /// public static unsafe Vector SignExtend8(Vector value) { throw new PlatformNotSupportedException(); } + + /// Non-truncating store + + /// + /// void svst1[_u8](svbool_t pg, uint8_t *base, svuint8_t data) + /// ST1B Zdata.B, Pg, [Xarray, Xindex] + /// ST1B Zdata.B, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, byte* address, Vector data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst2[_u8](svbool_t pg, uint8_t *base, svuint8x2_t data) + /// ST2B {Zdata0.B, Zdata1.B}, Pg, [Xarray, Xindex] + /// ST2B {Zdata0.B, Zdata1.B}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, byte* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst3[_u8](svbool_t pg, uint8_t *base, svuint8x3_t data) + /// ST3B {Zdata0.B - Zdata2.B}, Pg, [Xarray, Xindex] + /// ST3B {Zdata0.B - Zdata2.B}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, byte* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst4[_u8](svbool_t pg, uint8_t *base, svuint8x4_t data) + /// ST4B {Zdata0.B - Zdata3.B}, Pg, [Xarray, Xindex] + /// ST4B {Zdata0.B - Zdata3.B}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, byte* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst1[_f64](svbool_t pg, float64_t *base, svfloat64_t data) + /// ST1D Zdata.D, Pg, [Xarray, Xindex, LSL #3] + /// ST1D Zdata.D, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, double* address, Vector data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst2[_f64](svbool_t pg, float64_t *base, svfloat64x2_t data) + /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xarray, Xindex, LSL #3] + /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, double* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst3[_f64](svbool_t pg, float64_t *base, svfloat64x3_t data) + /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xarray, Xindex, LSL #3] + /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, double* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst4[_f64](svbool_t pg, float64_t *base, svfloat64x4_t data) + /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xarray, Xindex, LSL #3] + /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, double* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst1[_s16](svbool_t pg, int16_t *base, svint16_t data) + /// ST1H Zdata.H, Pg, [Xarray, Xindex, LSL #1] + /// ST1H Zdata.H, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, short* address, Vector data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst2[_s16](svbool_t pg, int16_t *base, svint16x2_t data) + /// ST2H {Zdata0.H, Zdata1.H}, Pg, [Xarray, Xindex, LSL #1] + /// ST2H {Zdata0.H, Zdata1.H}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, short* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst3[_s16](svbool_t pg, int16_t *base, svint16x3_t data) + /// ST3H {Zdata0.H - Zdata2.H}, Pg, [Xarray, Xindex, LSL #1] + /// ST3H {Zdata0.H - Zdata2.H}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, short* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst4[_s16](svbool_t pg, int16_t *base, svint16x4_t data) + /// ST4H {Zdata0.H - Zdata3.H}, Pg, [Xarray, Xindex, LSL #1] + /// ST4H {Zdata0.H - Zdata3.H}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, short* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst1[_s32](svbool_t pg, int32_t *base, svint32_t data) + /// ST1W Zdata.S, Pg, [Xarray, Xindex, LSL #2] + /// ST1W Zdata.S, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, int* address, Vector data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst2[_s32](svbool_t pg, int32_t *base, svint32x2_t data) + /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xarray, Xindex, LSL #2] + /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, int* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst3[_s32](svbool_t pg, int32_t *base, svint32x3_t data) + /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xarray, Xindex, LSL #2] + /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, int* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst4[_s32](svbool_t pg, int32_t *base, svint32x4_t data) + /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xarray, Xindex, LSL #2] + /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, int* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst1[_s64](svbool_t pg, int64_t *base, svint64_t data) + /// ST1D Zdata.D, Pg, [Xarray, Xindex, LSL #3] + /// ST1D Zdata.D, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, long* address, Vector data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst2[_s64](svbool_t pg, int64_t *base, svint64x2_t data) + /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xarray, Xindex, LSL #3] + /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, long* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst3[_s64](svbool_t pg, int64_t *base, svint64x3_t data) + /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xarray, Xindex, LSL #3] + /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, long* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst4[_s64](svbool_t pg, int64_t *base, svint64x4_t data) + /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xarray, Xindex, LSL #3] + /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, long* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst1[_s8](svbool_t pg, int8_t *base, svint8_t data) + /// ST1B Zdata.B, Pg, [Xarray, Xindex] + /// ST1B Zdata.B, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, sbyte* address, Vector data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst2[_s8](svbool_t pg, int8_t *base, svint8x2_t data) + /// ST2B {Zdata0.B, Zdata1.B}, Pg, [Xarray, Xindex] + /// ST2B {Zdata0.B, Zdata1.B}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, sbyte* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst3[_s8](svbool_t pg, int8_t *base, svint8x3_t data) + /// ST3B {Zdata0.B - Zdata2.B}, Pg, [Xarray, Xindex] + /// ST3B {Zdata0.B - Zdata2.B}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, sbyte* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst4[_s8](svbool_t pg, int8_t *base, svint8x4_t data) + /// ST4B {Zdata0.B - Zdata3.B}, Pg, [Xarray, Xindex] + /// ST4B {Zdata0.B - Zdata3.B}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, sbyte* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst1[_f32](svbool_t pg, float32_t *base, svfloat32_t data) + /// ST1W Zdata.S, Pg, [Xarray, Xindex, LSL #2] + /// ST1W Zdata.S, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, float* address, Vector data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst2[_f32](svbool_t pg, float32_t *base, svfloat32x2_t data) + /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xarray, Xindex, LSL #2] + /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, float* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst3[_f32](svbool_t pg, float32_t *base, svfloat32x3_t data) + /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xarray, Xindex, LSL #2] + /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, float* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst4[_f32](svbool_t pg, float32_t *base, svfloat32x4_t data) + /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xarray, Xindex, LSL #2] + /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, float* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst1[_u16](svbool_t pg, uint16_t *base, svuint16_t data) + /// ST1H Zdata.H, Pg, [Xarray, Xindex, LSL #1] + /// ST1H Zdata.H, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, ushort* address, Vector data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst2[_u16](svbool_t pg, uint16_t *base, svuint16x2_t data) + /// ST2H {Zdata0.H, Zdata1.H}, Pg, [Xarray, Xindex, LSL #1] + /// ST2H {Zdata0.H, Zdata1.H}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, ushort* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst3[_u16](svbool_t pg, uint16_t *base, svuint16x3_t data) + /// ST3H {Zdata0.H - Zdata2.H}, Pg, [Xarray, Xindex, LSL #1] + /// ST3H {Zdata0.H - Zdata2.H}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, ushort* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst4[_u16](svbool_t pg, uint16_t *base, svuint16x4_t data) + /// ST4H {Zdata0.H - Zdata3.H}, Pg, [Xarray, Xindex, LSL #1] + /// ST4H {Zdata0.H - Zdata3.H}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, ushort* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst1[_u32](svbool_t pg, uint32_t *base, svuint32_t data) + /// ST1W Zdata.S, Pg, [Xarray, Xindex, LSL #2] + /// ST1W Zdata.S, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, uint* address, Vector data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst2[_u32](svbool_t pg, uint32_t *base, svuint32x2_t data) + /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xarray, Xindex, LSL #2] + /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, uint* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst3[_u32](svbool_t pg, uint32_t *base, svuint32x3_t data) + /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xarray, Xindex, LSL #2] + /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, uint* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst4[_u32](svbool_t pg, uint32_t *base, svuint32x4_t data) + /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xarray, Xindex, LSL #2] + /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, uint* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst1[_u64](svbool_t pg, uint64_t *base, svuint64_t data) + /// ST1D Zdata.D, Pg, [Xarray, Xindex, LSL #3] + /// ST1D Zdata.D, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, ulong* address, Vector data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst2[_u64](svbool_t pg, uint64_t *base, svuint64x2_t data) + /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xarray, Xindex, LSL #3] + /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, ulong* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst3[_u64](svbool_t pg, uint64_t *base, svuint64x3_t data) + /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xarray, Xindex, LSL #3] + /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, ulong* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } + + /// + /// void svst4[_u64](svbool_t pg, uint64_t *base, svuint64x4_t data) + /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xarray, Xindex, LSL #3] + /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, ulong* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } + + /// Subtract : Subtract /// 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..4d39460b0639a5 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 @@ -2613,6 +2613,290 @@ internal Arm64() { } /// public static unsafe Vector SignExtendWideningUpper(Vector value) => SignExtendWideningUpper(value); + + /// Non-truncating store + + /// + /// void svst1[_u8](svbool_t pg, uint8_t *base, svuint8_t data) + /// ST1B Zdata.B, Pg, [Xarray, Xindex] + /// ST1B Zdata.B, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, byte* address, Vector data) => Store(mask, address, data); + + /// + /// void svst2[_u8](svbool_t pg, uint8_t *base, svuint8x2_t data) + /// ST2B {Zdata0.B, Zdata1.B}, Pg, [Xarray, Xindex] + /// ST2B {Zdata0.B, Zdata1.B}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, byte* address, (Vector Value1, Vector Value2) data) => Store(mask, address, data); + + /// + /// void svst3[_u8](svbool_t pg, uint8_t *base, svuint8x3_t data) + /// ST3B {Zdata0.B - Zdata2.B}, Pg, [Xarray, Xindex] + /// ST3B {Zdata0.B - Zdata2.B}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, byte* address, (Vector Value1, Vector Value2, Vector Value3) data) => Store(mask, address, data); + + /// + /// void svst4[_u8](svbool_t pg, uint8_t *base, svuint8x4_t data) + /// ST4B {Zdata0.B - Zdata3.B}, Pg, [Xarray, Xindex] + /// ST4B {Zdata0.B - Zdata3.B}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, byte* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => Store(mask, address, data); + + /// + /// void svst1[_f64](svbool_t pg, float64_t *base, svfloat64_t data) + /// ST1D Zdata.D, Pg, [Xarray, Xindex, LSL #3] + /// ST1D Zdata.D, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, double* address, Vector data) => Store(mask, address, data); + + /// + /// void svst2[_f64](svbool_t pg, float64_t *base, svfloat64x2_t data) + /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xarray, Xindex, LSL #3] + /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, double* address, (Vector Value1, Vector Value2) data) => Store(mask, address, data); + + /// + /// void svst3[_f64](svbool_t pg, float64_t *base, svfloat64x3_t data) + /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xarray, Xindex, LSL #3] + /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, double* address, (Vector Value1, Vector Value2, Vector Value3) data) => Store(mask, address, data); + + /// + /// void svst4[_f64](svbool_t pg, float64_t *base, svfloat64x4_t data) + /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xarray, Xindex, LSL #3] + /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, double* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => Store(mask, address, data); + + /// + /// void svst1[_s16](svbool_t pg, int16_t *base, svint16_t data) + /// ST1H Zdata.H, Pg, [Xarray, Xindex, LSL #1] + /// ST1H Zdata.H, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, short* address, Vector data) => Store(mask, address, data); + + /// + /// void svst2[_s16](svbool_t pg, int16_t *base, svint16x2_t data) + /// ST2H {Zdata0.H, Zdata1.H}, Pg, [Xarray, Xindex, LSL #1] + /// ST2H {Zdata0.H, Zdata1.H}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, short* address, (Vector Value1, Vector Value2) data) => Store(mask, address, data); + + /// + /// void svst3[_s16](svbool_t pg, int16_t *base, svint16x3_t data) + /// ST3H {Zdata0.H - Zdata2.H}, Pg, [Xarray, Xindex, LSL #1] + /// ST3H {Zdata0.H - Zdata2.H}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, short* address, (Vector Value1, Vector Value2, Vector Value3) data) => Store(mask, address, data); + + /// + /// void svst4[_s16](svbool_t pg, int16_t *base, svint16x4_t data) + /// ST4H {Zdata0.H - Zdata3.H}, Pg, [Xarray, Xindex, LSL #1] + /// ST4H {Zdata0.H - Zdata3.H}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, short* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => Store(mask, address, data); + + /// + /// void svst1[_s32](svbool_t pg, int32_t *base, svint32_t data) + /// ST1W Zdata.S, Pg, [Xarray, Xindex, LSL #2] + /// ST1W Zdata.S, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, int* address, Vector data) => Store(mask, address, data); + + /// + /// void svst2[_s32](svbool_t pg, int32_t *base, svint32x2_t data) + /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xarray, Xindex, LSL #2] + /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, int* address, (Vector Value1, Vector Value2) data) => Store(mask, address, data); + + /// + /// void svst3[_s32](svbool_t pg, int32_t *base, svint32x3_t data) + /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xarray, Xindex, LSL #2] + /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, int* address, (Vector Value1, Vector Value2, Vector Value3) data) => Store(mask, address, data); + + /// + /// void svst4[_s32](svbool_t pg, int32_t *base, svint32x4_t data) + /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xarray, Xindex, LSL #2] + /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, int* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => Store(mask, address, data); + + /// + /// void svst1[_s64](svbool_t pg, int64_t *base, svint64_t data) + /// ST1D Zdata.D, Pg, [Xarray, Xindex, LSL #3] + /// ST1D Zdata.D, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, long* address, Vector data) => Store(mask, address, data); + + /// + /// void svst2[_s64](svbool_t pg, int64_t *base, svint64x2_t data) + /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xarray, Xindex, LSL #3] + /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, long* address, (Vector Value1, Vector Value2) data) => Store(mask, address, data); + + /// + /// void svst3[_s64](svbool_t pg, int64_t *base, svint64x3_t data) + /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xarray, Xindex, LSL #3] + /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, long* address, (Vector Value1, Vector Value2, Vector Value3) data) => Store(mask, address, data); + + /// + /// void svst4[_s64](svbool_t pg, int64_t *base, svint64x4_t data) + /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xarray, Xindex, LSL #3] + /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, long* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => Store(mask, address, data); + + /// + /// void svst1[_s8](svbool_t pg, int8_t *base, svint8_t data) + /// ST1B Zdata.B, Pg, [Xarray, Xindex] + /// ST1B Zdata.B, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, sbyte* address, Vector data) => Store(mask, address, data); + + /// + /// void svst2[_s8](svbool_t pg, int8_t *base, svint8x2_t data) + /// ST2B {Zdata0.B, Zdata1.B}, Pg, [Xarray, Xindex] + /// ST2B {Zdata0.B, Zdata1.B}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, sbyte* address, (Vector Value1, Vector Value2) data) => Store(mask, address, data); + + /// + /// void svst3[_s8](svbool_t pg, int8_t *base, svint8x3_t data) + /// ST3B {Zdata0.B - Zdata2.B}, Pg, [Xarray, Xindex] + /// ST3B {Zdata0.B - Zdata2.B}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, sbyte* address, (Vector Value1, Vector Value2, Vector Value3) data) => Store(mask, address, data); + + /// + /// void svst4[_s8](svbool_t pg, int8_t *base, svint8x4_t data) + /// ST4B {Zdata0.B - Zdata3.B}, Pg, [Xarray, Xindex] + /// ST4B {Zdata0.B - Zdata3.B}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, sbyte* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => Store(mask, address, data); + + /// + /// void svst1[_f32](svbool_t pg, float32_t *base, svfloat32_t data) + /// ST1W Zdata.S, Pg, [Xarray, Xindex, LSL #2] + /// ST1W Zdata.S, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, float* address, Vector data) => Store(mask, address, data); + + /// + /// void svst2[_f32](svbool_t pg, float32_t *base, svfloat32x2_t data) + /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xarray, Xindex, LSL #2] + /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, float* address, (Vector Value1, Vector Value2) data) => Store(mask, address, data); + + /// + /// void svst3[_f32](svbool_t pg, float32_t *base, svfloat32x3_t data) + /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xarray, Xindex, LSL #2] + /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, float* address, (Vector Value1, Vector Value2, Vector Value3) data) => Store(mask, address, data); + + /// + /// void svst4[_f32](svbool_t pg, float32_t *base, svfloat32x4_t data) + /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xarray, Xindex, LSL #2] + /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, float* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => Store(mask, address, data); + + /// + /// void svst1[_u16](svbool_t pg, uint16_t *base, svuint16_t data) + /// ST1H Zdata.H, Pg, [Xarray, Xindex, LSL #1] + /// ST1H Zdata.H, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, ushort* address, Vector data) => Store(mask, address, data); + + /// + /// void svst2[_u16](svbool_t pg, uint16_t *base, svuint16x2_t data) + /// ST2H {Zdata0.H, Zdata1.H}, Pg, [Xarray, Xindex, LSL #1] + /// ST2H {Zdata0.H, Zdata1.H}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, ushort* address, (Vector Value1, Vector Value2) data) => Store(mask, address, data); + + /// + /// void svst3[_u16](svbool_t pg, uint16_t *base, svuint16x3_t data) + /// ST3H {Zdata0.H - Zdata2.H}, Pg, [Xarray, Xindex, LSL #1] + /// ST3H {Zdata0.H - Zdata2.H}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, ushort* address, (Vector Value1, Vector Value2, Vector Value3) data) => Store(mask, address, data); + + /// + /// void svst4[_u16](svbool_t pg, uint16_t *base, svuint16x4_t data) + /// ST4H {Zdata0.H - Zdata3.H}, Pg, [Xarray, Xindex, LSL #1] + /// ST4H {Zdata0.H - Zdata3.H}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, ushort* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => Store(mask, address, data); + + /// + /// void svst1[_u32](svbool_t pg, uint32_t *base, svuint32_t data) + /// ST1W Zdata.S, Pg, [Xarray, Xindex, LSL #2] + /// ST1W Zdata.S, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, uint* address, Vector data) => Store(mask, address, data); + + /// + /// void svst2[_u32](svbool_t pg, uint32_t *base, svuint32x2_t data) + /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xarray, Xindex, LSL #2] + /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, uint* address, (Vector Value1, Vector Value2) data) => Store(mask, address, data); + + /// + /// void svst3[_u32](svbool_t pg, uint32_t *base, svuint32x3_t data) + /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xarray, Xindex, LSL #2] + /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, uint* address, (Vector Value1, Vector Value2, Vector Value3) data) => Store(mask, address, data); + + /// + /// void svst4[_u32](svbool_t pg, uint32_t *base, svuint32x4_t data) + /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xarray, Xindex, LSL #2] + /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, uint* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => Store(mask, address, data); + + /// + /// void svst1[_u64](svbool_t pg, uint64_t *base, svuint64_t data) + /// ST1D Zdata.D, Pg, [Xarray, Xindex, LSL #3] + /// ST1D Zdata.D, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, ulong* address, Vector data) => Store(mask, address, data); + + /// + /// void svst2[_u64](svbool_t pg, uint64_t *base, svuint64x2_t data) + /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xarray, Xindex, LSL #3] + /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, ulong* address, (Vector Value1, Vector Value2) data) => Store(mask, address, data); + + /// + /// void svst3[_u64](svbool_t pg, uint64_t *base, svuint64x3_t data) + /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xarray, Xindex, LSL #3] + /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, ulong* address, (Vector Value1, Vector Value2, Vector Value3) data) => Store(mask, address, data); + + /// + /// void svst4[_u64](svbool_t pg, uint64_t *base, svuint64x4_t data) + /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xarray, Xindex, LSL #3] + /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xbase, #0, MUL VL] + /// + public static unsafe void Store(Vector mask, ulong* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => Store(mask, address, data); + + /// Subtract : Subtract /// 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..ea211f2b91cd71 100644 --- a/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs +++ b/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs @@ -4494,7 +4494,48 @@ internal Arm64() { } public static System.Numerics.Vector SignExtendWideningLower(System.Numerics.Vector value) { throw null; } public static System.Numerics.Vector SignExtendWideningUpper(System.Numerics.Vector value) { throw null; } public static System.Numerics.Vector SignExtendWideningUpper(System.Numerics.Vector value) { throw null; } - public static System.Numerics.Vector SignExtendWideningUpper(System.Numerics.Vector value) { throw null; } + public static System.Numerics.Vector SignExtendWideningUpper(System.Numerics.Vector value) { throw null; } + + public static unsafe void Store(System.Numerics.Vector mask, byte* address, System.Numerics.Vector data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, byte* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, byte* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, byte* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, double* address, System.Numerics.Vector data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, double* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, double* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, double* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, short* address, System.Numerics.Vector data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, short* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, short* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, short* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, int* address, System.Numerics.Vector data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, int* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, int* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, int* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, long* address, System.Numerics.Vector data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, long* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, long* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, long* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, sbyte* address, System.Numerics.Vector data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, sbyte* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, sbyte* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, sbyte* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, float* address, System.Numerics.Vector data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, float* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, float* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, float* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, ushort* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, ushort* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, ushort* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, uint* address, System.Numerics.Vector data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, uint* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, uint* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, uint* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, ulong* address, System.Numerics.Vector data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, ulong* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, ulong* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } + public static unsafe void Store(System.Numerics.Vector mask, ulong* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } public static System.Numerics.Vector Subtract(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } public static System.Numerics.Vector Subtract(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } diff --git a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs index 70fd2c920586d6..7a35c0054771b2 100644 --- a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs +++ b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs @@ -3351,6 +3351,47 @@ ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveZipLow_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "result[i] != left[index] || result[i + 1] != right[index]"}), ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveZipLow_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[i] != left[index] || result[i + 1] != right[index]"}), ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveZipLow_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateEntry"] = "result[i] != left[index] || result[i + 1] != right[index]"}), + + ("SveStoreTest.template", new Dictionary { ["TestName"] = "SveStore_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[i] != first[i]"}), + ("SveStoreTest.template", new Dictionary { ["TestName"] = "SveStore_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateEntry"] = "result[i] != first[i]"}), + ("SveStoreTest.template", new Dictionary { ["TestName"] = "SveStore_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[i] != first[i]"}), + ("SveStoreTest.template", new Dictionary { ["TestName"] = "SveStore_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[i] != first[i]"}), + ("SveStoreTest.template", new Dictionary { ["TestName"] = "SveStore_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[i] != first[i]"}), + ("SveStoreTest.template", new Dictionary { ["TestName"] = "SveStore_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateEntry"] = "result[i] != first[i]"}), + ("SveStoreTest.template", new Dictionary { ["TestName"] = "SveStore_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[i] != first[i]"}), + ("SveStoreTest.template", new Dictionary { ["TestName"] = "SveStore_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "result[i] != first[i]"}), + ("SveStoreTest.template", new Dictionary { ["TestName"] = "SveStore_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[i] != first[i]"}), + ("SveStoreTest.template", new Dictionary { ["TestName"] = "SveStore_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateEntry"] = "result[i] != first[i]"}), + ("SveStoreTestx2.template", new Dictionary { ["TestName"] = "SveStorex2_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i]"}), + ("SveStoreTestx2.template", new Dictionary { ["TestName"] = "SveStorex2_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i]"}), + ("SveStoreTestx2.template", new Dictionary { ["TestName"] = "SveStorex2_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i]"}), + ("SveStoreTestx2.template", new Dictionary { ["TestName"] = "SveStorex2_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i]"}), + ("SveStoreTestx2.template", new Dictionary { ["TestName"] = "SveStorex2_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i]"}), + ("SveStoreTestx2.template", new Dictionary { ["TestName"] = "SveStorex2_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i]"}), + ("SveStoreTestx2.template", new Dictionary { ["TestName"] = "SveStorex2_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i]"}), + ("SveStoreTestx2.template", new Dictionary { ["TestName"] = "SveStorex2_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i]"}), + ("SveStoreTestx2.template", new Dictionary { ["TestName"] = "SveStorex2_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i]"}), + ("SveStoreTestx2.template", new Dictionary { ["TestName"] = "SveStorex2_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i]"}), + ("SveStoreTestx3.template", new Dictionary { ["TestName"] = "SveStorex3_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i]"}), + ("SveStoreTestx3.template", new Dictionary { ["TestName"] = "SveStorex3_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i]"}), + ("SveStoreTestx3.template", new Dictionary { ["TestName"] = "SveStorex3_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i]"}), + ("SveStoreTestx3.template", new Dictionary { ["TestName"] = "SveStorex3_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i]"}), + ("SveStoreTestx3.template", new Dictionary { ["TestName"] = "SveStorex3_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i]"}), + ("SveStoreTestx3.template", new Dictionary { ["TestName"] = "SveStorex3_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i]"}), + ("SveStoreTestx3.template", new Dictionary { ["TestName"] = "SveStorex3_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i]"}), + ("SveStoreTestx3.template", new Dictionary { ["TestName"] = "SveStorex3_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i]"}), + ("SveStoreTestx3.template", new Dictionary { ["TestName"] = "SveStorex3_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i]"}), + ("SveStoreTestx3.template", new Dictionary { ["TestName"] = "SveStorex3_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i]"}), + ("SveStoreTestx4.template", new Dictionary { ["TestName"] = "SveStorex4_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i] || result[index + 3] != fourth[i]"}), + ("SveStoreTestx4.template", new Dictionary { ["TestName"] = "SveStorex4_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i] || result[index + 3] != fourth[i]"}), + ("SveStoreTestx4.template", new Dictionary { ["TestName"] = "SveStorex4_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i] || result[index + 3] != fourth[i]"}), + ("SveStoreTestx4.template", new Dictionary { ["TestName"] = "SveStorex4_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i] || result[index + 3] != fourth[i]"}), + ("SveStoreTestx4.template", new Dictionary { ["TestName"] = "SveStorex4_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i] || result[index + 3] != fourth[i]"}), + ("SveStoreTestx4.template", new Dictionary { ["TestName"] = "SveStorex4_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i] || result[index + 3] != fourth[i]"}), + ("SveStoreTestx4.template", new Dictionary { ["TestName"] = "SveStorex4_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i] || result[index + 3] != fourth[i]"}), + ("SveStoreTestx4.template", new Dictionary { ["TestName"] = "SveStorex4_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i] || result[index + 3] != fourth[i]"}), + ("SveStoreTestx4.template", new Dictionary { ["TestName"] = "SveStorex4_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i] || result[index + 3] != fourth[i]"}), + ("SveStoreTestx4.template", new Dictionary { ["TestName"] = "SveStorex4_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i] || result[index + 3] != fourth[i]"}), }; diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreTest.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreTest.template new file mode 100644 index 00000000000000..4a985c60ce57e3 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreTest.template @@ -0,0 +1,309 @@ +// 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.Reflection; +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 StoreTest__{TestName}(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (Sve.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 StoreTest__{TestName} + { + private struct DataTable + { + private byte[] inArray1; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable({Op1BaseType}[] inArray1, {RetBaseType}[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<{RetBaseType}>(); + if ((alignment != 64 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), (uint)sizeOfinArray1); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + + private struct TestStruct + { + public {Op1VectorType}<{Op1BaseType}> _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld1), ref Unsafe.As<{Op1BaseType}, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + + return testStruct; + } + + public void RunStructFldScenario(StoreTest__{TestName} testClass) + { + {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + + Sve.Store(storeMask, ({Op1BaseType}*)testClass._dataTable.outArrayPtr, _fld1); + + testClass.ValidateResult(_fld1, 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 {Op1BaseType}[] _data1 = new {Op1BaseType}[Op1ElementCount]; + + private {Op1VectorType}<{Op1BaseType}> _fld1; + + private DataTable _dataTable; + + public StoreTest__{TestName}() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref _fld1), ref Unsafe.As<{Op1BaseType}, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } + _dataTable = new DataTable(_data1, new {RetBaseType}[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Sve.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + + Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr)); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + {Op1VectorType}<{Op1BaseType}> loadMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + {Op1VectorType}<{Op1BaseType}> storeMask = loadMask; + + Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.inArray1Ptr))); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + typeof(Sve).GetMethod(nameof(Sve.Store), new Type[] { typeof({Op1VectorType}<{Op1BaseType}>), typeof({Op1BaseType} *), typeof({Op1VectorType}<{Op1BaseType}>) }) + .Invoke(null, new object[] { storeMask, + Pointer.Box(_dataTable.outArrayPtr, typeof({Op1BaseType}*)), Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + {Op1VectorType}<{Op1BaseType}> op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr); + {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + + Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, op1); + + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + {Op1VectorType}<{Op1BaseType}> op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr); + {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + + Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, op1); + + ValidateResult(op1, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, test._fld1); + + ValidateResult(test._fld1, _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}> op1, void* result, [CallerMemberName] string method = "") + { + {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; + {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), op1); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + { + {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; + {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>()); + + ValidateResult(inArray1, outArray, method); + } + + private void ValidateResult({Op1BaseType}[] first, {RetBaseType}[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) + { + if ({ValidateEntry}) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Sve)}.{nameof(Sve.Store)}<{Op1BaseType}>({Op1VectorType}<{Op1BaseType}>, {Op1BaseType}*, {Op1VectorType}<{Op1BaseType}>): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" first: ({string.Join(", ", first)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreTestx2.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreTestx2.template new file mode 100644 index 00000000000000..511fdba2c312f8 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreTestx2.template @@ -0,0 +1,342 @@ +// 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.Reflection; +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 Storex2Test__{TestName}(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (Sve.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 Storex2Test__{TestName} + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable({Op1BaseType}[] inArray1, {Op1BaseType}[] inArray2, {RetBaseType}[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<{Op1BaseType}>(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<{RetBaseType}>(); + if ((alignment != 64 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 4) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 4]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As<{Op1BaseType}, byte>(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + + private struct TestStruct + { + public {Op1VectorType}<{Op1BaseType}> _fld1; + public {Op1VectorType}<{Op1BaseType}> _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld1), ref Unsafe.As<{Op1BaseType}, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp1}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld2), ref Unsafe.As<{Op1BaseType}, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + + return testStruct; + } + + public void RunStructFldScenario(Storex2Test__{TestName} testClass) + { + {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + + Sve.Store(storeMask, ({Op1BaseType}*)testClass._dataTable.outArrayPtr, (_fld1, _fld2)); + + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = {LargestVectorSize}; + + private static readonly int Op1ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); + private static readonly int Op2ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); + private static readonly int RetElementCount = Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>() / sizeof({RetBaseType}) * 2; + + private static {Op1BaseType}[] _data1 = new {Op1BaseType}[Op1ElementCount]; + private static {Op1BaseType}[] _data2 = new {Op1BaseType}[Op2ElementCount]; + + private {Op1VectorType}<{Op1BaseType}> _fld1; + private {Op1VectorType}<{Op1BaseType}> _fld2; + + private DataTable _dataTable; + + public Storex2Test__{TestName}() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref _fld1), ref Unsafe.As<{Op1BaseType}, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp1}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref _fld2), ref Unsafe.As<{Op1BaseType}, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp1}; } + _dataTable = new DataTable(_data1, _data2, new {RetBaseType}[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Sve.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + + Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, + (Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr), + Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + {Op1VectorType}<{Op1BaseType}> loadMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + {Op1VectorType}<{Op1BaseType}> storeMask = loadMask; + + Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, + (Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.inArray1Ptr)), + Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.inArray2Ptr))) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + typeof(Sve).GetMethod(nameof(Sve.Store), new Type[] { typeof({Op1VectorType}<{Op1BaseType}>), typeof({Op1BaseType} *), typeof(({Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>)) }) + .Invoke(null, new object[] { storeMask, + Pointer.Box(_dataTable.outArrayPtr, typeof({Op1BaseType}*)), + (Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr), + Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + {Op1VectorType}<{Op1BaseType}> op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr); + {Op1VectorType}<{Op1BaseType}> op2 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr); + {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + + Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (op1, op2)); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + {Op1VectorType}<{Op1BaseType}> op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr); + {Op1VectorType}<{Op1BaseType}> op2 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr); + {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + + Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (op1, op2)); + + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (test._fld1, test._fld2)); + + ValidateResult(test._fld1, test._fld2, _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}> op1, {Op1VectorType}<{Op1BaseType}> op2, void* result, [CallerMemberName] string method = "") + { + {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; + {Op1BaseType}[] inArray2 = new {Op1BaseType}[Op2ElementCount]; + {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>() * 2); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; + {Op1BaseType}[] inArray2 = new {Op1BaseType}[Op2ElementCount]; + {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>() * 2); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult({Op1BaseType}[] first, {Op1BaseType}[] second, {RetBaseType}[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + int index = 0; + for (var i = 0; i < Op1ElementCount; i++, index+=2) + { + if ({ValidateEntry}) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Sve)}.{nameof(Sve.Store)}<{Op1BaseType}>({Op1VectorType}<{Op1BaseType}>, {Op1BaseType}*, ({Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>)): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" first: ({string.Join(", ", first)})"); + TestLibrary.TestFramework.LogInformation($" second: ({string.Join(", ", second)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreTestx3.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreTestx3.template new file mode 100644 index 00000000000000..5067a2422152f4 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreTestx3.template @@ -0,0 +1,369 @@ +// 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.Reflection; +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 Storex3Test__{TestName}(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (Sve.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 Storex3Test__{TestName} + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable({Op1BaseType}[] inArray1, {Op1BaseType}[] inArray2, {Op1BaseType}[] inArray3, {RetBaseType}[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<{Op1BaseType}>(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf<{Op1BaseType}>(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<{RetBaseType}>(); + if ((alignment != 64 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 6) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 6]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As<{Op1BaseType}, byte>(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As<{Op1BaseType}, byte>(ref inArray3[0]), (uint)sizeOfinArray3); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + + private struct TestStruct + { + public {Op1VectorType}<{Op1BaseType}> _fld1; + public {Op1VectorType}<{Op1BaseType}> _fld2; + public {Op1VectorType}<{Op1BaseType}> _fld3; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld1), ref Unsafe.As<{Op1BaseType}, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp1}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld2), ref Unsafe.As<{Op1BaseType}, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = {NextValueOp1}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld3), ref Unsafe.As<{Op1BaseType}, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + + return testStruct; + } + + public void RunStructFldScenario(Storex3Test__{TestName} testClass) + { + {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + + Sve.Store(storeMask, ({Op1BaseType}*)testClass._dataTable.outArrayPtr, (_fld1, _fld2, _fld3)); + + testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = {LargestVectorSize}; + + private static readonly int Op1ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); + private static readonly int Op2ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); + private static readonly int Op3ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); + private static readonly int RetElementCount = Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>() / sizeof({RetBaseType}) * 3; + + private static {Op1BaseType}[] _data1 = new {Op1BaseType}[Op1ElementCount]; + private static {Op1BaseType}[] _data2 = new {Op1BaseType}[Op2ElementCount]; + private static {Op1BaseType}[] _data3 = new {Op1BaseType}[Op3ElementCount]; + + private {Op1VectorType}<{Op1BaseType}> _fld1; + private {Op1VectorType}<{Op1BaseType}> _fld2; + private {Op1VectorType}<{Op1BaseType}> _fld3; + + private DataTable _dataTable; + + public Storex3Test__{TestName}() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref _fld1), ref Unsafe.As<{Op1BaseType}, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp1}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref _fld2), ref Unsafe.As<{Op1BaseType}, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = {NextValueOp1}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref _fld3), ref Unsafe.As<{Op1BaseType}, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp1}; } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = {NextValueOp1}; } + _dataTable = new DataTable(_data1, _data2, _data3, new {RetBaseType}[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Sve.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + + Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, + (Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr), + Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr), + Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray3Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + {Op1VectorType}<{Op1BaseType}> loadMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + {Op1VectorType}<{Op1BaseType}> storeMask = loadMask; + + Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, + (Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.inArray1Ptr)), + Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.inArray2Ptr)), + Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.inArray3Ptr))) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + typeof(Sve).GetMethod(nameof(Sve.Store), new Type[] { typeof({Op1VectorType}<{Op1BaseType}>), typeof({Op1BaseType} *), typeof(({Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>)) }) + .Invoke(null, new object[] { storeMask, + Pointer.Box(_dataTable.outArrayPtr, typeof({Op1BaseType}*)), + (Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr), + Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr), + Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray3Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + {Op1VectorType}<{Op1BaseType}> op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr); + {Op1VectorType}<{Op1BaseType}> op2 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr); + {Op1VectorType}<{Op1BaseType}> op3 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray3Ptr); + {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + + Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (op1, op2, op3)); + + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + {Op1VectorType}<{Op1BaseType}> op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr); + {Op1VectorType}<{Op1BaseType}> op2 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr); + {Op1VectorType}<{Op1BaseType}> op3 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray3Ptr); + {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + + Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (op1, op2, op3)); + + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (test._fld1, test._fld2, test._fld3)); + + ValidateResult(test._fld1, test._fld2, test._fld3, _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}> op1, {Op1VectorType}<{Op1BaseType}> op2, {Op1VectorType}<{Op1BaseType}> op3, void* result, [CallerMemberName] string method = "") + { + {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; + {Op1BaseType}[] inArray2 = new {Op1BaseType}[Op2ElementCount]; + {Op1BaseType}[] inArray3 = new {Op1BaseType}[Op3ElementCount]; + {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray3[0]), op3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>() * 3); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + { + {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; + {Op1BaseType}[] inArray2 = new {Op1BaseType}[Op2ElementCount]; + {Op1BaseType}[] inArray3 = new {Op1BaseType}[Op3ElementCount]; + {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>() * 3); + + ValidateResult(inArray1, inArray2, inArray3, outArray, method); + } + + private void ValidateResult({Op1BaseType}[] first, {Op1BaseType}[] second, {Op1BaseType}[] third, {RetBaseType}[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + int index = 0; + for (var i = 0; i < Op1ElementCount; i++, index+=3) + { + if ({ValidateEntry}) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Sve)}.{nameof(Sve.Store)}<{Op1BaseType}>({Op1VectorType}<{Op1BaseType}>, {Op1BaseType}*, ({Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>)): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" first: ({string.Join(", ", first)})"); + TestLibrary.TestFramework.LogInformation($" second: ({string.Join(", ", second)})"); + TestLibrary.TestFramework.LogInformation($" third: ({string.Join(", ", third)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreTestx4.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreTestx4.template new file mode 100644 index 00000000000000..1232df1c24963f --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreTestx4.template @@ -0,0 +1,396 @@ +// 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.Reflection; +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 Storex4Test__{TestName}(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if (Sve.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 Storex4Test__{TestName} + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] inArray3; + private byte[] inArray4; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle inHandle3; + private GCHandle inHandle4; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable({Op1BaseType}[] inArray1, {Op1BaseType}[] inArray2, {Op1BaseType}[] inArray3, {Op1BaseType}[] inArray4, {RetBaseType}[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<{Op1BaseType}>(); + int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf<{Op1BaseType}>(); + int sizeOfinArray4 = inArray4.Length * Unsafe.SizeOf<{Op1BaseType}>(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<{RetBaseType}>(); + if ((alignment != 64 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfinArray4 || (alignment * 8) < sizeOfoutArray) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.inArray4 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 8]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.inHandle4 = GCHandle.Alloc(this.inArray4, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As<{Op1BaseType}, byte>(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As<{Op1BaseType}, byte>(ref inArray3[0]), (uint)sizeOfinArray3); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray4Ptr), ref Unsafe.As<{Op1BaseType}, byte>(ref inArray4[0]), (uint)sizeOfinArray4); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray4Ptr => Align((byte*)(inHandle4.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + inHandle3.Free(); + inHandle4.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + + private struct TestStruct + { + public {Op1VectorType}<{Op1BaseType}> _fld1; + public {Op1VectorType}<{Op1BaseType}> _fld2; + public {Op1VectorType}<{Op1BaseType}> _fld3; + public {Op1VectorType}<{Op1BaseType}> _fld4; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld1), ref Unsafe.As<{Op1BaseType}, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp1}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld2), ref Unsafe.As<{Op1BaseType}, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = {NextValueOp1}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld3), ref Unsafe.As<{Op1BaseType}, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + for (var i = 0; i < Op4ElementCount; i++) { _data4[i] = {NextValueOp1}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld4), ref Unsafe.As<{Op1BaseType}, byte>(ref _data4[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + + return testStruct; + } + + public void RunStructFldScenario(Storex4Test__{TestName} testClass) + { + {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + + Sve.Store(storeMask, ({Op1BaseType}*)testClass._dataTable.outArrayPtr, (_fld1, _fld2, _fld3, _fld4)); + + testClass.ValidateResult(_fld1, _fld2, _fld3, _fld4, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = {LargestVectorSize}; + + private static readonly int Op1ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); + private static readonly int Op2ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); + private static readonly int Op3ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); + private static readonly int Op4ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); + private static readonly int RetElementCount = Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>() / sizeof({RetBaseType}) * 4; + + private static {Op1BaseType}[] _data1 = new {Op1BaseType}[Op1ElementCount]; + private static {Op1BaseType}[] _data2 = new {Op1BaseType}[Op2ElementCount]; + private static {Op1BaseType}[] _data3 = new {Op1BaseType}[Op3ElementCount]; + private static {Op1BaseType}[] _data4 = new {Op1BaseType}[Op4ElementCount]; + + private {Op1VectorType}<{Op1BaseType}> _fld1; + private {Op1VectorType}<{Op1BaseType}> _fld2; + private {Op1VectorType}<{Op1BaseType}> _fld3; + private {Op1VectorType}<{Op1BaseType}> _fld4; + + private DataTable _dataTable; + + public Storex4Test__{TestName}() + { + Succeeded = true; + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref _fld1), ref Unsafe.As<{Op1BaseType}, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp1}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref _fld2), ref Unsafe.As<{Op1BaseType}, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = {NextValueOp1}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref _fld3), ref Unsafe.As<{Op1BaseType}, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + for (var i = 0; i < Op4ElementCount; i++) { _data3[i] = {NextValueOp1}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref _fld4), ref Unsafe.As<{Op1BaseType}, byte>(ref _data4[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp1}; } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = {NextValueOp1}; } + for (var i = 0; i < Op4ElementCount; i++) { _data4[i] = {NextValueOp1}; } + _dataTable = new DataTable(_data1, _data2, _data3, _data4, new {RetBaseType}[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => Sve.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + + Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, + (Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr), + Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr), + Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray3Ptr), + Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray4Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.inArray4Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + {Op1VectorType}<{Op1BaseType}> loadMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + {Op1VectorType}<{Op1BaseType}> storeMask = loadMask; + + Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, + (Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.inArray1Ptr)), + Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.inArray2Ptr)), + Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.inArray3Ptr)), + Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.inArray4Ptr))) + ); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.inArray4Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + typeof(Sve).GetMethod(nameof(Sve.Store), new Type[] { typeof({Op1VectorType}<{Op1BaseType}>), typeof({Op1BaseType} *), typeof(({Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>)) }) + .Invoke(null, new object[] { storeMask, + Pointer.Box(_dataTable.outArrayPtr, typeof({Op1BaseType}*)), + (Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr), + Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr), + Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray3Ptr), + Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray4Ptr)) + }); + + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.inArray4Ptr, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + {Op1VectorType}<{Op1BaseType}> op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr); + {Op1VectorType}<{Op1BaseType}> op2 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr); + {Op1VectorType}<{Op1BaseType}> op3 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray3Ptr); + {Op1VectorType}<{Op1BaseType}> op4 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray4Ptr); + {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + + Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (op1, op2, op3, op4)); + + ValidateResult(op1, op2, op3, op4, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + {Op1VectorType}<{Op1BaseType}> op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr); + {Op1VectorType}<{Op1BaseType}> op2 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr); + {Op1VectorType}<{Op1BaseType}> op3 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray3Ptr); + {Op1VectorType}<{Op1BaseType}> op4 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray4Ptr); + {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + + Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (op1, op2, op3, op4)); + + ValidateResult(op1, op2, op3, op4, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (test._fld1, test._fld2, test._fld3, test._fld4)); + + ValidateResult(test._fld1, test._fld2, test._fld3, test._fld4, _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}> op1, {Op1VectorType}<{Op1BaseType}> op2, {Op1VectorType}<{Op1BaseType}> op3, {Op1VectorType}<{Op1BaseType}> op4, void* result, [CallerMemberName] string method = "") + { + {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; + {Op1BaseType}[] inArray2 = new {Op1BaseType}[Op2ElementCount]; + {Op1BaseType}[] inArray3 = new {Op1BaseType}[Op3ElementCount]; + {Op1BaseType}[] inArray4 = new {Op1BaseType}[Op4ElementCount]; + {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray3[0]), op3); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray4[0]), op4); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>() * 4); + + ValidateResult(inArray1, inArray2, inArray3, inArray4, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* op3, void* op4, void* result, [CallerMemberName] string method = "") + { + {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; + {Op1BaseType}[] inArray2 = new {Op1BaseType}[Op2ElementCount]; + {Op1BaseType}[] inArray3 = new {Op1BaseType}[Op3ElementCount]; + {Op1BaseType}[] inArray4 = new {Op1BaseType}[Op4ElementCount]; + {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray4[0]), ref Unsafe.AsRef(op4), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>() * 4); + + ValidateResult(inArray1, inArray2, inArray3, inArray4, outArray, method); + } + + private void ValidateResult({Op1BaseType}[] first, {Op1BaseType}[] second, {Op1BaseType}[] third, {Op1BaseType}[] fourth, {RetBaseType}[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + int index = 0; + for (var i = 0; i < Op1ElementCount; i++, index+=4) + { + if ({ValidateEntry}) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof(Sve)}.{nameof(Sve.Store)}<{Op1BaseType}>({Op1VectorType}<{Op1BaseType}>, {Op1BaseType}*, ({Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>)): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" first: ({string.Join(", ", first)})"); + TestLibrary.TestFramework.LogInformation($" second: ({string.Join(", ", second)})"); + TestLibrary.TestFramework.LogInformation($" third: ({string.Join(", ", third)})"); + TestLibrary.TestFramework.LogInformation($" fourth: ({string.Join(", ", fourth)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} From 9ed628fd172567c92f57d0634594511910a14f17 Mon Sep 17 00:00:00 2001 From: Swapnil Gaikwad Date: Wed, 15 May 2024 17:17:18 +0100 Subject: [PATCH 2/5] Fix formatting issues --- src/coreclr/jit/hwintrinsicarm64.cpp | 6 +++--- src/coreclr/jit/lsraarm64.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/coreclr/jit/hwintrinsicarm64.cpp b/src/coreclr/jit/hwintrinsicarm64.cpp index 099e83dd9e35a5..3f368e46487377 100644 --- a/src/coreclr/jit/hwintrinsicarm64.cpp +++ b/src/coreclr/jit/hwintrinsicarm64.cpp @@ -2380,9 +2380,9 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, CORINFO_ARG_LIST_HANDLE arg3 = info.compCompHnd->getArgNext(arg2); var_types argType = TYP_UNKNOWN; CORINFO_CLASS_HANDLE argClass = NO_CLASS_HANDLE; - argType = JITtype2varType(strip(info.compCompHnd->getArgType(sig, arg3, &argClass))); - op3 = impPopStack().val; - unsigned fieldCount = info.compCompHnd->getClassNumInstanceFields(argClass); + argType = JITtype2varType(strip(info.compCompHnd->getArgType(sig, arg3, &argClass))); + op3 = impPopStack().val; + unsigned fieldCount = info.compCompHnd->getClassNumInstanceFields(argClass); if (op3->TypeGet() == TYP_STRUCT) { diff --git a/src/coreclr/jit/lsraarm64.cpp b/src/coreclr/jit/lsraarm64.cpp index 0c771774a5c590..e83a4bbf55322c 100644 --- a/src/coreclr/jit/lsraarm64.cpp +++ b/src/coreclr/jit/lsraarm64.cpp @@ -1880,7 +1880,7 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree, int* pDstCou } } else if ((intrin.id == NI_Sve_FusedMultiplyAddBySelectedScalar) || - (intrin.id == NI_Sve_FusedMultiplySubtractBySelectedScalar)) + (intrin.id == NI_Sve_FusedMultiplySubtractBySelectedScalar)) { // If this is common pattern, then we will add a flag in the table, but for now, just check for specific // intrinsics From 348421f6795e185c33cf3c82174ecd32e18e16c3 Mon Sep 17 00:00:00 2001 From: Swapnil Gaikwad Date: Thu, 16 May 2024 13:45:05 +0100 Subject: [PATCH 3/5] Remove incorrect instructions from comment --- .../Arm/Sve.PlatformNotSupported.cs | 40 ------------------- .../src/System/Runtime/Intrinsics/Arm/Sve.cs | 40 ------------------- 2 files changed, 80 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 427b97162c08ee..df129fd66558df 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 @@ -2575,280 +2575,240 @@ internal Arm64() { } /// /// void svst1[_u8](svbool_t pg, uint8_t *base, svuint8_t data) - /// ST1B Zdata.B, Pg, [Xarray, Xindex] /// ST1B Zdata.B, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, byte* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_u8](svbool_t pg, uint8_t *base, svuint8x2_t data) - /// ST2B {Zdata0.B, Zdata1.B}, Pg, [Xarray, Xindex] /// ST2B {Zdata0.B, Zdata1.B}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, byte* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_u8](svbool_t pg, uint8_t *base, svuint8x3_t data) - /// ST3B {Zdata0.B - Zdata2.B}, Pg, [Xarray, Xindex] /// ST3B {Zdata0.B - Zdata2.B}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, byte* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_u8](svbool_t pg, uint8_t *base, svuint8x4_t data) - /// ST4B {Zdata0.B - Zdata3.B}, Pg, [Xarray, Xindex] /// ST4B {Zdata0.B - Zdata3.B}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, byte* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_f64](svbool_t pg, float64_t *base, svfloat64_t data) - /// ST1D Zdata.D, Pg, [Xarray, Xindex, LSL #3] /// ST1D Zdata.D, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, double* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_f64](svbool_t pg, float64_t *base, svfloat64x2_t data) - /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xarray, Xindex, LSL #3] /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, double* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_f64](svbool_t pg, float64_t *base, svfloat64x3_t data) - /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xarray, Xindex, LSL #3] /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, double* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_f64](svbool_t pg, float64_t *base, svfloat64x4_t data) - /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xarray, Xindex, LSL #3] /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, double* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_s16](svbool_t pg, int16_t *base, svint16_t data) - /// ST1H Zdata.H, Pg, [Xarray, Xindex, LSL #1] /// ST1H Zdata.H, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, short* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_s16](svbool_t pg, int16_t *base, svint16x2_t data) - /// ST2H {Zdata0.H, Zdata1.H}, Pg, [Xarray, Xindex, LSL #1] /// ST2H {Zdata0.H, Zdata1.H}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, short* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_s16](svbool_t pg, int16_t *base, svint16x3_t data) - /// ST3H {Zdata0.H - Zdata2.H}, Pg, [Xarray, Xindex, LSL #1] /// ST3H {Zdata0.H - Zdata2.H}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, short* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_s16](svbool_t pg, int16_t *base, svint16x4_t data) - /// ST4H {Zdata0.H - Zdata3.H}, Pg, [Xarray, Xindex, LSL #1] /// ST4H {Zdata0.H - Zdata3.H}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, short* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_s32](svbool_t pg, int32_t *base, svint32_t data) - /// ST1W Zdata.S, Pg, [Xarray, Xindex, LSL #2] /// ST1W Zdata.S, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, int* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_s32](svbool_t pg, int32_t *base, svint32x2_t data) - /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xarray, Xindex, LSL #2] /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, int* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_s32](svbool_t pg, int32_t *base, svint32x3_t data) - /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xarray, Xindex, LSL #2] /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, int* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_s32](svbool_t pg, int32_t *base, svint32x4_t data) - /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xarray, Xindex, LSL #2] /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, int* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_s64](svbool_t pg, int64_t *base, svint64_t data) - /// ST1D Zdata.D, Pg, [Xarray, Xindex, LSL #3] /// ST1D Zdata.D, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, long* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_s64](svbool_t pg, int64_t *base, svint64x2_t data) - /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xarray, Xindex, LSL #3] /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, long* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_s64](svbool_t pg, int64_t *base, svint64x3_t data) - /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xarray, Xindex, LSL #3] /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, long* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_s64](svbool_t pg, int64_t *base, svint64x4_t data) - /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xarray, Xindex, LSL #3] /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, long* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_s8](svbool_t pg, int8_t *base, svint8_t data) - /// ST1B Zdata.B, Pg, [Xarray, Xindex] /// ST1B Zdata.B, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, sbyte* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_s8](svbool_t pg, int8_t *base, svint8x2_t data) - /// ST2B {Zdata0.B, Zdata1.B}, Pg, [Xarray, Xindex] /// ST2B {Zdata0.B, Zdata1.B}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, sbyte* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_s8](svbool_t pg, int8_t *base, svint8x3_t data) - /// ST3B {Zdata0.B - Zdata2.B}, Pg, [Xarray, Xindex] /// ST3B {Zdata0.B - Zdata2.B}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, sbyte* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_s8](svbool_t pg, int8_t *base, svint8x4_t data) - /// ST4B {Zdata0.B - Zdata3.B}, Pg, [Xarray, Xindex] /// ST4B {Zdata0.B - Zdata3.B}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, sbyte* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_f32](svbool_t pg, float32_t *base, svfloat32_t data) - /// ST1W Zdata.S, Pg, [Xarray, Xindex, LSL #2] /// ST1W Zdata.S, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, float* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_f32](svbool_t pg, float32_t *base, svfloat32x2_t data) - /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xarray, Xindex, LSL #2] /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, float* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_f32](svbool_t pg, float32_t *base, svfloat32x3_t data) - /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xarray, Xindex, LSL #2] /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, float* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_f32](svbool_t pg, float32_t *base, svfloat32x4_t data) - /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xarray, Xindex, LSL #2] /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, float* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_u16](svbool_t pg, uint16_t *base, svuint16_t data) - /// ST1H Zdata.H, Pg, [Xarray, Xindex, LSL #1] /// ST1H Zdata.H, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, ushort* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_u16](svbool_t pg, uint16_t *base, svuint16x2_t data) - /// ST2H {Zdata0.H, Zdata1.H}, Pg, [Xarray, Xindex, LSL #1] /// ST2H {Zdata0.H, Zdata1.H}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, ushort* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_u16](svbool_t pg, uint16_t *base, svuint16x3_t data) - /// ST3H {Zdata0.H - Zdata2.H}, Pg, [Xarray, Xindex, LSL #1] /// ST3H {Zdata0.H - Zdata2.H}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, ushort* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_u16](svbool_t pg, uint16_t *base, svuint16x4_t data) - /// ST4H {Zdata0.H - Zdata3.H}, Pg, [Xarray, Xindex, LSL #1] /// ST4H {Zdata0.H - Zdata3.H}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, ushort* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_u32](svbool_t pg, uint32_t *base, svuint32_t data) - /// ST1W Zdata.S, Pg, [Xarray, Xindex, LSL #2] /// ST1W Zdata.S, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, uint* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_u32](svbool_t pg, uint32_t *base, svuint32x2_t data) - /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xarray, Xindex, LSL #2] /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, uint* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_u32](svbool_t pg, uint32_t *base, svuint32x3_t data) - /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xarray, Xindex, LSL #2] /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, uint* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_u32](svbool_t pg, uint32_t *base, svuint32x4_t data) - /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xarray, Xindex, LSL #2] /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, uint* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_u64](svbool_t pg, uint64_t *base, svuint64_t data) - /// ST1D Zdata.D, Pg, [Xarray, Xindex, LSL #3] /// ST1D Zdata.D, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, ulong* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_u64](svbool_t pg, uint64_t *base, svuint64x2_t data) - /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xarray, Xindex, LSL #3] /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, ulong* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_u64](svbool_t pg, uint64_t *base, svuint64x3_t data) - /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xarray, Xindex, LSL #3] /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, ulong* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_u64](svbool_t pg, uint64_t *base, svuint64x4_t data) - /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xarray, Xindex, LSL #3] /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, ulong* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } 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 0b8a55e7cbd1d7..840a14edcc055c 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 @@ -2671,280 +2671,240 @@ internal Arm64() { } /// /// void svst1[_u8](svbool_t pg, uint8_t *base, svuint8_t data) - /// ST1B Zdata.B, Pg, [Xarray, Xindex] /// ST1B Zdata.B, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, byte* address, Vector data) => Store(mask, address, data); /// /// void svst2[_u8](svbool_t pg, uint8_t *base, svuint8x2_t data) - /// ST2B {Zdata0.B, Zdata1.B}, Pg, [Xarray, Xindex] /// ST2B {Zdata0.B, Zdata1.B}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, byte* address, (Vector Value1, Vector Value2) data) => Store(mask, address, data); /// /// void svst3[_u8](svbool_t pg, uint8_t *base, svuint8x3_t data) - /// ST3B {Zdata0.B - Zdata2.B}, Pg, [Xarray, Xindex] /// ST3B {Zdata0.B - Zdata2.B}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, byte* address, (Vector Value1, Vector Value2, Vector Value3) data) => Store(mask, address, data); /// /// void svst4[_u8](svbool_t pg, uint8_t *base, svuint8x4_t data) - /// ST4B {Zdata0.B - Zdata3.B}, Pg, [Xarray, Xindex] /// ST4B {Zdata0.B - Zdata3.B}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, byte* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => Store(mask, address, data); /// /// void svst1[_f64](svbool_t pg, float64_t *base, svfloat64_t data) - /// ST1D Zdata.D, Pg, [Xarray, Xindex, LSL #3] /// ST1D Zdata.D, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, double* address, Vector data) => Store(mask, address, data); /// /// void svst2[_f64](svbool_t pg, float64_t *base, svfloat64x2_t data) - /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xarray, Xindex, LSL #3] /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, double* address, (Vector Value1, Vector Value2) data) => Store(mask, address, data); /// /// void svst3[_f64](svbool_t pg, float64_t *base, svfloat64x3_t data) - /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xarray, Xindex, LSL #3] /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, double* address, (Vector Value1, Vector Value2, Vector Value3) data) => Store(mask, address, data); /// /// void svst4[_f64](svbool_t pg, float64_t *base, svfloat64x4_t data) - /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xarray, Xindex, LSL #3] /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, double* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => Store(mask, address, data); /// /// void svst1[_s16](svbool_t pg, int16_t *base, svint16_t data) - /// ST1H Zdata.H, Pg, [Xarray, Xindex, LSL #1] /// ST1H Zdata.H, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, short* address, Vector data) => Store(mask, address, data); /// /// void svst2[_s16](svbool_t pg, int16_t *base, svint16x2_t data) - /// ST2H {Zdata0.H, Zdata1.H}, Pg, [Xarray, Xindex, LSL #1] /// ST2H {Zdata0.H, Zdata1.H}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, short* address, (Vector Value1, Vector Value2) data) => Store(mask, address, data); /// /// void svst3[_s16](svbool_t pg, int16_t *base, svint16x3_t data) - /// ST3H {Zdata0.H - Zdata2.H}, Pg, [Xarray, Xindex, LSL #1] /// ST3H {Zdata0.H - Zdata2.H}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, short* address, (Vector Value1, Vector Value2, Vector Value3) data) => Store(mask, address, data); /// /// void svst4[_s16](svbool_t pg, int16_t *base, svint16x4_t data) - /// ST4H {Zdata0.H - Zdata3.H}, Pg, [Xarray, Xindex, LSL #1] /// ST4H {Zdata0.H - Zdata3.H}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, short* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => Store(mask, address, data); /// /// void svst1[_s32](svbool_t pg, int32_t *base, svint32_t data) - /// ST1W Zdata.S, Pg, [Xarray, Xindex, LSL #2] /// ST1W Zdata.S, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, int* address, Vector data) => Store(mask, address, data); /// /// void svst2[_s32](svbool_t pg, int32_t *base, svint32x2_t data) - /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xarray, Xindex, LSL #2] /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, int* address, (Vector Value1, Vector Value2) data) => Store(mask, address, data); /// /// void svst3[_s32](svbool_t pg, int32_t *base, svint32x3_t data) - /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xarray, Xindex, LSL #2] /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, int* address, (Vector Value1, Vector Value2, Vector Value3) data) => Store(mask, address, data); /// /// void svst4[_s32](svbool_t pg, int32_t *base, svint32x4_t data) - /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xarray, Xindex, LSL #2] /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, int* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => Store(mask, address, data); /// /// void svst1[_s64](svbool_t pg, int64_t *base, svint64_t data) - /// ST1D Zdata.D, Pg, [Xarray, Xindex, LSL #3] /// ST1D Zdata.D, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, long* address, Vector data) => Store(mask, address, data); /// /// void svst2[_s64](svbool_t pg, int64_t *base, svint64x2_t data) - /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xarray, Xindex, LSL #3] /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, long* address, (Vector Value1, Vector Value2) data) => Store(mask, address, data); /// /// void svst3[_s64](svbool_t pg, int64_t *base, svint64x3_t data) - /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xarray, Xindex, LSL #3] /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, long* address, (Vector Value1, Vector Value2, Vector Value3) data) => Store(mask, address, data); /// /// void svst4[_s64](svbool_t pg, int64_t *base, svint64x4_t data) - /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xarray, Xindex, LSL #3] /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, long* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => Store(mask, address, data); /// /// void svst1[_s8](svbool_t pg, int8_t *base, svint8_t data) - /// ST1B Zdata.B, Pg, [Xarray, Xindex] /// ST1B Zdata.B, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, sbyte* address, Vector data) => Store(mask, address, data); /// /// void svst2[_s8](svbool_t pg, int8_t *base, svint8x2_t data) - /// ST2B {Zdata0.B, Zdata1.B}, Pg, [Xarray, Xindex] /// ST2B {Zdata0.B, Zdata1.B}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, sbyte* address, (Vector Value1, Vector Value2) data) => Store(mask, address, data); /// /// void svst3[_s8](svbool_t pg, int8_t *base, svint8x3_t data) - /// ST3B {Zdata0.B - Zdata2.B}, Pg, [Xarray, Xindex] /// ST3B {Zdata0.B - Zdata2.B}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, sbyte* address, (Vector Value1, Vector Value2, Vector Value3) data) => Store(mask, address, data); /// /// void svst4[_s8](svbool_t pg, int8_t *base, svint8x4_t data) - /// ST4B {Zdata0.B - Zdata3.B}, Pg, [Xarray, Xindex] /// ST4B {Zdata0.B - Zdata3.B}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, sbyte* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => Store(mask, address, data); /// /// void svst1[_f32](svbool_t pg, float32_t *base, svfloat32_t data) - /// ST1W Zdata.S, Pg, [Xarray, Xindex, LSL #2] /// ST1W Zdata.S, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, float* address, Vector data) => Store(mask, address, data); /// /// void svst2[_f32](svbool_t pg, float32_t *base, svfloat32x2_t data) - /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xarray, Xindex, LSL #2] /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, float* address, (Vector Value1, Vector Value2) data) => Store(mask, address, data); /// /// void svst3[_f32](svbool_t pg, float32_t *base, svfloat32x3_t data) - /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xarray, Xindex, LSL #2] /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, float* address, (Vector Value1, Vector Value2, Vector Value3) data) => Store(mask, address, data); /// /// void svst4[_f32](svbool_t pg, float32_t *base, svfloat32x4_t data) - /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xarray, Xindex, LSL #2] /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, float* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => Store(mask, address, data); /// /// void svst1[_u16](svbool_t pg, uint16_t *base, svuint16_t data) - /// ST1H Zdata.H, Pg, [Xarray, Xindex, LSL #1] /// ST1H Zdata.H, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, ushort* address, Vector data) => Store(mask, address, data); /// /// void svst2[_u16](svbool_t pg, uint16_t *base, svuint16x2_t data) - /// ST2H {Zdata0.H, Zdata1.H}, Pg, [Xarray, Xindex, LSL #1] /// ST2H {Zdata0.H, Zdata1.H}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, ushort* address, (Vector Value1, Vector Value2) data) => Store(mask, address, data); /// /// void svst3[_u16](svbool_t pg, uint16_t *base, svuint16x3_t data) - /// ST3H {Zdata0.H - Zdata2.H}, Pg, [Xarray, Xindex, LSL #1] /// ST3H {Zdata0.H - Zdata2.H}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, ushort* address, (Vector Value1, Vector Value2, Vector Value3) data) => Store(mask, address, data); /// /// void svst4[_u16](svbool_t pg, uint16_t *base, svuint16x4_t data) - /// ST4H {Zdata0.H - Zdata3.H}, Pg, [Xarray, Xindex, LSL #1] /// ST4H {Zdata0.H - Zdata3.H}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, ushort* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => Store(mask, address, data); /// /// void svst1[_u32](svbool_t pg, uint32_t *base, svuint32_t data) - /// ST1W Zdata.S, Pg, [Xarray, Xindex, LSL #2] /// ST1W Zdata.S, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, uint* address, Vector data) => Store(mask, address, data); /// /// void svst2[_u32](svbool_t pg, uint32_t *base, svuint32x2_t data) - /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xarray, Xindex, LSL #2] /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, uint* address, (Vector Value1, Vector Value2) data) => Store(mask, address, data); /// /// void svst3[_u32](svbool_t pg, uint32_t *base, svuint32x3_t data) - /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xarray, Xindex, LSL #2] /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, uint* address, (Vector Value1, Vector Value2, Vector Value3) data) => Store(mask, address, data); /// /// void svst4[_u32](svbool_t pg, uint32_t *base, svuint32x4_t data) - /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xarray, Xindex, LSL #2] /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, uint* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => Store(mask, address, data); /// /// void svst1[_u64](svbool_t pg, uint64_t *base, svuint64_t data) - /// ST1D Zdata.D, Pg, [Xarray, Xindex, LSL #3] /// ST1D Zdata.D, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, ulong* address, Vector data) => Store(mask, address, data); /// /// void svst2[_u64](svbool_t pg, uint64_t *base, svuint64x2_t data) - /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xarray, Xindex, LSL #3] /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, ulong* address, (Vector Value1, Vector Value2) data) => Store(mask, address, data); /// /// void svst3[_u64](svbool_t pg, uint64_t *base, svuint64x3_t data) - /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xarray, Xindex, LSL #3] /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, ulong* address, (Vector Value1, Vector Value2, Vector Value3) data) => Store(mask, address, data); /// /// void svst4[_u64](svbool_t pg, uint64_t *base, svuint64x4_t data) - /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xarray, Xindex, LSL #3] /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xbase, #0, MUL VL] /// public static unsafe void Store(Vector mask, ulong* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => Store(mask, address, data); From 9d55cd4b4b7531afd21bca587c708a48316e2dd4 Mon Sep 17 00:00:00 2001 From: Swapnil Gaikwad Date: Tue, 21 May 2024 15:34:51 +0100 Subject: [PATCH 4/5] Rename Sve.Store() -> Sve.StoreAndZip() --- src/coreclr/jit/gentree.cpp | 8 +- src/coreclr/jit/hwintrinsicarm64.cpp | 8 +- src/coreclr/jit/hwintrinsiccodegenarm64.cpp | 8 +- src/coreclr/jit/hwintrinsiclistarm64sve.h | 8 +- src/coreclr/jit/lsraarm64.cpp | 8 +- .../Arm/Sve.PlatformNotSupported.cs | 80 ++++---- .../src/System/Runtime/Intrinsics/Arm/Sve.cs | 80 ++++---- .../ref/System.Runtime.Intrinsics.cs | 80 ++++---- .../GenerateHWIntrinsicTests_Arm.cs | 80 ++++---- ...t.template => SveStoreAndZipTest.template} | 127 +++++++----- ...template => SveStoreAndZipTestx2.template} | 146 ++++++++------ ...template => SveStoreAndZipTestx3.template} | 165 +++++++++------- ...template => SveStoreAndZipTestx4.template} | 186 ++++++++++-------- 13 files changed, 537 insertions(+), 447 deletions(-) rename src/tests/JIT/HardwareIntrinsics/Arm/Shared/{SveStoreTest.template => SveStoreAndZipTest.template} (58%) rename src/tests/JIT/HardwareIntrinsics/Arm/Shared/{SveStoreTestx2.template => SveStoreAndZipTestx2.template} (59%) rename src/tests/JIT/HardwareIntrinsics/Arm/Shared/{SveStoreTestx3.template => SveStoreAndZipTestx3.template} (62%) rename src/tests/JIT/HardwareIntrinsics/Arm/Shared/{SveStoreTestx4.template => SveStoreAndZipTestx4.template} (63%) diff --git a/src/coreclr/jit/gentree.cpp b/src/coreclr/jit/gentree.cpp index f8246b592e9a6f..2b9ec27eb8228c 100644 --- a/src/coreclr/jit/gentree.cpp +++ b/src/coreclr/jit/gentree.cpp @@ -26707,10 +26707,10 @@ bool GenTreeHWIntrinsic::OperIsMemoryStore(GenTree** pAddr) const addr = Op(3); break; #elif defined(TARGET_ARM64) - case NI_Sve_Store: - case NI_Sve_Storex2: - case NI_Sve_Storex3: - case NI_Sve_Storex4: + case NI_Sve_StoreAndZip: + case NI_Sve_StoreAndZipx2: + case NI_Sve_StoreAndZipx3: + case NI_Sve_StoreAndZipx4: addr = Op(2); break; #endif // TARGET_ARM64 diff --git a/src/coreclr/jit/hwintrinsicarm64.cpp b/src/coreclr/jit/hwintrinsicarm64.cpp index 8a0ffb326a7d5b..5a30c54fe78f55 100644 --- a/src/coreclr/jit/hwintrinsicarm64.cpp +++ b/src/coreclr/jit/hwintrinsicarm64.cpp @@ -2426,7 +2426,7 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } - case NI_Sve_Store: + case NI_Sve_StoreAndZip: { assert(sig->numArgs == 3); assert(retType == TYP_VOID); @@ -2446,15 +2446,15 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, switch (fieldCount) { case 2: - intrinsic = NI_Sve_Storex2; + intrinsic = NI_Sve_StoreAndZipx2; break; case 3: - intrinsic = NI_Sve_Storex3; + intrinsic = NI_Sve_StoreAndZipx3; break; case 4: - intrinsic = NI_Sve_Storex4; + intrinsic = NI_Sve_StoreAndZipx4; break; default: diff --git a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp index 91aef61ea7267a..5a4c5abdb76015 100644 --- a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp +++ b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp @@ -1348,9 +1348,9 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) } break; - case NI_Sve_Storex2: - case NI_Sve_Storex3: - case NI_Sve_Storex4: + case NI_Sve_StoreAndZipx2: + case NI_Sve_StoreAndZipx3: + case NI_Sve_StoreAndZipx4: { assert(intrin.op3->OperIsFieldList()); GenTreeFieldList* fieldList = intrin.op3->AsFieldList(); @@ -1403,7 +1403,7 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) break; } - case NI_Sve_Store: + case NI_Sve_StoreAndZip: { GetEmitter()->emitIns_R_R_R_I(ins, emitSize, op3Reg, op1Reg, op2Reg, 0, opt); break; diff --git a/src/coreclr/jit/hwintrinsiclistarm64sve.h b/src/coreclr/jit/hwintrinsiclistarm64sve.h index b3b7214fb83e73..b8750fd90ad76b 100644 --- a/src/coreclr/jit/hwintrinsiclistarm64sve.h +++ b/src/coreclr/jit/hwintrinsiclistarm64sve.h @@ -114,7 +114,7 @@ HARDWARE_INTRINSIC(Sve, SignExtend32, 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) HARDWARE_INTRINSIC(Sve, SignExtendWideningLower, -1, 1, true, {INS_sve_sunpklo, INS_invalid, INS_sve_sunpklo, INS_invalid, INS_sve_sunpklo, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Sve, SignExtendWideningUpper, -1, 1, true, {INS_sve_sunpkhi, INS_invalid, INS_sve_sunpkhi, INS_invalid, INS_sve_sunpkhi, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_BaseTypeFromFirstArg) -HARDWARE_INTRINSIC(Sve, Store, -1, 3, true, {INS_sve_st1b, INS_sve_st1b, INS_sve_st1h, INS_sve_st1h, INS_sve_st1w, INS_sve_st1w, INS_sve_st1d, INS_sve_st1d, INS_sve_st1w, INS_sve_st1d}, HW_Category_MemoryStore, HW_Flag_Scalable|HW_Flag_BaseTypeFromFirstArg|HW_Flag_ExplicitMaskedOperation|HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen|HW_Flag_LowMaskedOperation) +HARDWARE_INTRINSIC(Sve, StoreAndZip, -1, 3, true, {INS_sve_st1b, INS_sve_st1b, INS_sve_st1h, INS_sve_st1h, INS_sve_st1w, INS_sve_st1w, INS_sve_st1d, INS_sve_st1d, INS_sve_st1w, INS_sve_st1d}, HW_Category_MemoryStore, HW_Flag_Scalable|HW_Flag_BaseTypeFromFirstArg|HW_Flag_ExplicitMaskedOperation|HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen|HW_Flag_LowMaskedOperation) HARDWARE_INTRINSIC(Sve, Subtract, -1, 2, true, {INS_sve_sub, INS_sve_sub, INS_sve_sub, INS_sve_sub, INS_sve_sub, INS_sve_sub, INS_sve_sub, INS_sve_sub, INS_sve_fsub, INS_sve_fsub}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_OptionalEmbeddedMaskedOperation|HW_Flag_HasRMWSemantics|HW_Flag_LowMaskedOperation) HARDWARE_INTRINSIC(Sve, SubtractSaturate, -1, 2, true, {INS_sve_sqsub, INS_sve_uqsub, INS_sve_sqsub, INS_sve_uqsub, INS_sve_sqsub, INS_sve_uqsub, INS_sve_sqsub, INS_sve_uqsub, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_OptionalEmbeddedMaskedOperation|HW_Flag_HasRMWSemantics|HW_Flag_LowMaskedOperation) HARDWARE_INTRINSIC(Sve, UnzipEven, -1, 2, true, {INS_sve_uzp1, INS_sve_uzp1, INS_sve_uzp1, INS_sve_uzp1, INS_sve_uzp1, INS_sve_uzp1, INS_sve_uzp1, INS_sve_uzp1, INS_sve_uzp1, INS_sve_uzp1}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_SpecialCodeGen) @@ -139,9 +139,9 @@ HARDWARE_INTRINSIC(Sve, ZipLow, HARDWARE_INTRINSIC(Sve, ConvertMaskToVector, -1, 1, true, {INS_sve_mov, INS_sve_mov, INS_sve_mov, INS_sve_mov, INS_sve_mov, INS_sve_mov, INS_sve_mov, INS_sve_mov, INS_sve_mov, INS_sve_mov}, HW_Category_Helper, HW_Flag_Scalable|HW_Flag_ExplicitMaskedOperation) 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) -HARDWARE_INTRINSIC(Sve, Storex2, -1, 3, true, {INS_sve_st2b, INS_sve_st2b, INS_sve_st2h, INS_sve_st2h, INS_sve_st2w, INS_sve_st2w, INS_sve_st2d, INS_sve_st2d, INS_sve_st2w, INS_sve_st2d}, HW_Category_MemoryStore, HW_Flag_Scalable|HW_Flag_SpecialCodeGen|HW_Flag_ExplicitMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_NeedsConsecutiveRegisters) -HARDWARE_INTRINSIC(Sve, Storex3, -1, 3, true, {INS_sve_st3b, INS_sve_st3b, INS_sve_st3h, INS_sve_st3h, INS_sve_st3w, INS_sve_st3w, INS_sve_st3d, INS_sve_st3d, INS_sve_st3w, INS_sve_st3d}, HW_Category_MemoryStore, HW_Flag_Scalable|HW_Flag_SpecialCodeGen|HW_Flag_ExplicitMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_NeedsConsecutiveRegisters) -HARDWARE_INTRINSIC(Sve, Storex4, -1, 3, true, {INS_sve_st4b, INS_sve_st4b, INS_sve_st4h, INS_sve_st4h, INS_sve_st4w, INS_sve_st4w, INS_sve_st4d, INS_sve_st4d, INS_sve_st4w, INS_sve_st4d}, HW_Category_MemoryStore, HW_Flag_Scalable|HW_Flag_SpecialCodeGen|HW_Flag_ExplicitMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_NeedsConsecutiveRegisters) +HARDWARE_INTRINSIC(Sve, StoreAndZipx2, -1, 3, true, {INS_sve_st2b, INS_sve_st2b, INS_sve_st2h, INS_sve_st2h, INS_sve_st2w, INS_sve_st2w, INS_sve_st2d, INS_sve_st2d, INS_sve_st2w, INS_sve_st2d}, HW_Category_MemoryStore, HW_Flag_Scalable|HW_Flag_SpecialCodeGen|HW_Flag_ExplicitMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_NeedsConsecutiveRegisters) +HARDWARE_INTRINSIC(Sve, StoreAndZipx3, -1, 3, true, {INS_sve_st3b, INS_sve_st3b, INS_sve_st3h, INS_sve_st3h, INS_sve_st3w, INS_sve_st3w, INS_sve_st3d, INS_sve_st3d, INS_sve_st3w, INS_sve_st3d}, HW_Category_MemoryStore, HW_Flag_Scalable|HW_Flag_SpecialCodeGen|HW_Flag_ExplicitMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_NeedsConsecutiveRegisters) +HARDWARE_INTRINSIC(Sve, StoreAndZipx4, -1, 3, true, {INS_sve_st4b, INS_sve_st4b, INS_sve_st4h, INS_sve_st4h, INS_sve_st4w, INS_sve_st4w, INS_sve_st4d, INS_sve_st4d, INS_sve_st4w, INS_sve_st4d}, HW_Category_MemoryStore, HW_Flag_Scalable|HW_Flag_SpecialCodeGen|HW_Flag_ExplicitMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_NeedsConsecutiveRegisters) #endif // FEATURE_HW_INTRINSIC diff --git a/src/coreclr/jit/lsraarm64.cpp b/src/coreclr/jit/lsraarm64.cpp index 6ca7dc94f3f9c4..cc3e6fae655c3e 100644 --- a/src/coreclr/jit/lsraarm64.cpp +++ b/src/coreclr/jit/lsraarm64.cpp @@ -1758,9 +1758,9 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree, int* pDstCou break; } - case NI_Sve_Storex2: - case NI_Sve_Storex3: - case NI_Sve_Storex4: + case NI_Sve_StoreAndZipx2: + case NI_Sve_StoreAndZipx3: + case NI_Sve_StoreAndZipx4: { assert(intrin.op2 != nullptr); assert(intrin.op3 != nullptr); @@ -1908,7 +1908,7 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree, int* pDstCou (argNum == lowVectorOperandNum) ? lowVectorCandidates : RBM_NONE); } } - else if (intrin.id == NI_Sve_Store) + else if (intrin.id == NI_Sve_StoreAndZip) { srcCount += BuildAddrUses(intrin.op2); } 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 df129fd66558df..9be0014bd9ecb7 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 @@ -2577,241 +2577,241 @@ internal Arm64() { } /// void svst1[_u8](svbool_t pg, uint8_t *base, svuint8_t data) /// ST1B Zdata.B, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, byte* address, Vector data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, byte* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_u8](svbool_t pg, uint8_t *base, svuint8x2_t data) /// ST2B {Zdata0.B, Zdata1.B}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, byte* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, byte* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_u8](svbool_t pg, uint8_t *base, svuint8x3_t data) /// ST3B {Zdata0.B - Zdata2.B}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, byte* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, byte* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_u8](svbool_t pg, uint8_t *base, svuint8x4_t data) /// ST4B {Zdata0.B - Zdata3.B}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, byte* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, byte* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_f64](svbool_t pg, float64_t *base, svfloat64_t data) /// ST1D Zdata.D, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, double* address, Vector data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, double* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_f64](svbool_t pg, float64_t *base, svfloat64x2_t data) /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, double* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, double* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_f64](svbool_t pg, float64_t *base, svfloat64x3_t data) /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, double* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, double* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_f64](svbool_t pg, float64_t *base, svfloat64x4_t data) /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, double* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, double* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_s16](svbool_t pg, int16_t *base, svint16_t data) /// ST1H Zdata.H, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, short* address, Vector data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, short* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_s16](svbool_t pg, int16_t *base, svint16x2_t data) /// ST2H {Zdata0.H, Zdata1.H}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, short* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, short* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_s16](svbool_t pg, int16_t *base, svint16x3_t data) /// ST3H {Zdata0.H - Zdata2.H}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, short* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, short* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_s16](svbool_t pg, int16_t *base, svint16x4_t data) /// ST4H {Zdata0.H - Zdata3.H}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, short* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, short* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_s32](svbool_t pg, int32_t *base, svint32_t data) /// ST1W Zdata.S, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, int* address, Vector data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, int* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_s32](svbool_t pg, int32_t *base, svint32x2_t data) /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, int* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, int* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_s32](svbool_t pg, int32_t *base, svint32x3_t data) /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, int* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, int* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_s32](svbool_t pg, int32_t *base, svint32x4_t data) /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, int* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, int* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_s64](svbool_t pg, int64_t *base, svint64_t data) /// ST1D Zdata.D, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, long* address, Vector data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, long* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_s64](svbool_t pg, int64_t *base, svint64x2_t data) /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, long* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, long* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_s64](svbool_t pg, int64_t *base, svint64x3_t data) /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, long* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, long* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_s64](svbool_t pg, int64_t *base, svint64x4_t data) /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, long* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, long* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_s8](svbool_t pg, int8_t *base, svint8_t data) /// ST1B Zdata.B, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, sbyte* address, Vector data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, sbyte* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_s8](svbool_t pg, int8_t *base, svint8x2_t data) /// ST2B {Zdata0.B, Zdata1.B}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, sbyte* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, sbyte* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_s8](svbool_t pg, int8_t *base, svint8x3_t data) /// ST3B {Zdata0.B - Zdata2.B}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, sbyte* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, sbyte* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_s8](svbool_t pg, int8_t *base, svint8x4_t data) /// ST4B {Zdata0.B - Zdata3.B}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, sbyte* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, sbyte* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_f32](svbool_t pg, float32_t *base, svfloat32_t data) /// ST1W Zdata.S, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, float* address, Vector data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, float* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_f32](svbool_t pg, float32_t *base, svfloat32x2_t data) /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, float* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, float* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_f32](svbool_t pg, float32_t *base, svfloat32x3_t data) /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, float* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, float* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_f32](svbool_t pg, float32_t *base, svfloat32x4_t data) /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, float* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, float* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_u16](svbool_t pg, uint16_t *base, svuint16_t data) /// ST1H Zdata.H, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, ushort* address, Vector data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, ushort* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_u16](svbool_t pg, uint16_t *base, svuint16x2_t data) /// ST2H {Zdata0.H, Zdata1.H}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, ushort* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, ushort* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_u16](svbool_t pg, uint16_t *base, svuint16x3_t data) /// ST3H {Zdata0.H - Zdata2.H}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, ushort* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, ushort* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_u16](svbool_t pg, uint16_t *base, svuint16x4_t data) /// ST4H {Zdata0.H - Zdata3.H}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, ushort* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, ushort* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_u32](svbool_t pg, uint32_t *base, svuint32_t data) /// ST1W Zdata.S, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, uint* address, Vector data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, uint* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_u32](svbool_t pg, uint32_t *base, svuint32x2_t data) /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, uint* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, uint* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_u32](svbool_t pg, uint32_t *base, svuint32x3_t data) /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, uint* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, uint* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_u32](svbool_t pg, uint32_t *base, svuint32x4_t data) /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, uint* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, uint* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_u64](svbool_t pg, uint64_t *base, svuint64_t data) /// ST1D Zdata.D, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, ulong* address, Vector data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, ulong* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_u64](svbool_t pg, uint64_t *base, svuint64x2_t data) /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, ulong* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, ulong* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_u64](svbool_t pg, uint64_t *base, svuint64x3_t data) /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, ulong* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, ulong* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_u64](svbool_t pg, uint64_t *base, svuint64x4_t data) /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, ulong* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } + public static unsafe void StoreAndZip(Vector mask, ulong* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// Subtract : Subtract 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 840a14edcc055c..120dcd1177531e 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 @@ -2673,241 +2673,241 @@ internal Arm64() { } /// void svst1[_u8](svbool_t pg, uint8_t *base, svuint8_t data) /// ST1B Zdata.B, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, byte* address, Vector data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, byte* address, Vector data) => StoreAndZip(mask, address, data); /// /// void svst2[_u8](svbool_t pg, uint8_t *base, svuint8x2_t data) /// ST2B {Zdata0.B, Zdata1.B}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, byte* address, (Vector Value1, Vector Value2) data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, byte* address, (Vector Value1, Vector Value2) data) => StoreAndZip(mask, address, data); /// /// void svst3[_u8](svbool_t pg, uint8_t *base, svuint8x3_t data) /// ST3B {Zdata0.B - Zdata2.B}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, byte* address, (Vector Value1, Vector Value2, Vector Value3) data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, byte* address, (Vector Value1, Vector Value2, Vector Value3) data) => StoreAndZip(mask, address, data); /// /// void svst4[_u8](svbool_t pg, uint8_t *base, svuint8x4_t data) /// ST4B {Zdata0.B - Zdata3.B}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, byte* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, byte* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => StoreAndZip(mask, address, data); /// /// void svst1[_f64](svbool_t pg, float64_t *base, svfloat64_t data) /// ST1D Zdata.D, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, double* address, Vector data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, double* address, Vector data) => StoreAndZip(mask, address, data); /// /// void svst2[_f64](svbool_t pg, float64_t *base, svfloat64x2_t data) /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, double* address, (Vector Value1, Vector Value2) data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, double* address, (Vector Value1, Vector Value2) data) => StoreAndZip(mask, address, data); /// /// void svst3[_f64](svbool_t pg, float64_t *base, svfloat64x3_t data) /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, double* address, (Vector Value1, Vector Value2, Vector Value3) data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, double* address, (Vector Value1, Vector Value2, Vector Value3) data) => StoreAndZip(mask, address, data); /// /// void svst4[_f64](svbool_t pg, float64_t *base, svfloat64x4_t data) /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, double* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, double* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => StoreAndZip(mask, address, data); /// /// void svst1[_s16](svbool_t pg, int16_t *base, svint16_t data) /// ST1H Zdata.H, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, short* address, Vector data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, short* address, Vector data) => StoreAndZip(mask, address, data); /// /// void svst2[_s16](svbool_t pg, int16_t *base, svint16x2_t data) /// ST2H {Zdata0.H, Zdata1.H}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, short* address, (Vector Value1, Vector Value2) data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, short* address, (Vector Value1, Vector Value2) data) => StoreAndZip(mask, address, data); /// /// void svst3[_s16](svbool_t pg, int16_t *base, svint16x3_t data) /// ST3H {Zdata0.H - Zdata2.H}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, short* address, (Vector Value1, Vector Value2, Vector Value3) data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, short* address, (Vector Value1, Vector Value2, Vector Value3) data) => StoreAndZip(mask, address, data); /// /// void svst4[_s16](svbool_t pg, int16_t *base, svint16x4_t data) /// ST4H {Zdata0.H - Zdata3.H}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, short* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, short* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => StoreAndZip(mask, address, data); /// /// void svst1[_s32](svbool_t pg, int32_t *base, svint32_t data) /// ST1W Zdata.S, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, int* address, Vector data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, int* address, Vector data) => StoreAndZip(mask, address, data); /// /// void svst2[_s32](svbool_t pg, int32_t *base, svint32x2_t data) /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, int* address, (Vector Value1, Vector Value2) data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, int* address, (Vector Value1, Vector Value2) data) => StoreAndZip(mask, address, data); /// /// void svst3[_s32](svbool_t pg, int32_t *base, svint32x3_t data) /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, int* address, (Vector Value1, Vector Value2, Vector Value3) data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, int* address, (Vector Value1, Vector Value2, Vector Value3) data) => StoreAndZip(mask, address, data); /// /// void svst4[_s32](svbool_t pg, int32_t *base, svint32x4_t data) /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, int* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, int* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => StoreAndZip(mask, address, data); /// /// void svst1[_s64](svbool_t pg, int64_t *base, svint64_t data) /// ST1D Zdata.D, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, long* address, Vector data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, long* address, Vector data) => StoreAndZip(mask, address, data); /// /// void svst2[_s64](svbool_t pg, int64_t *base, svint64x2_t data) /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, long* address, (Vector Value1, Vector Value2) data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, long* address, (Vector Value1, Vector Value2) data) => StoreAndZip(mask, address, data); /// /// void svst3[_s64](svbool_t pg, int64_t *base, svint64x3_t data) /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, long* address, (Vector Value1, Vector Value2, Vector Value3) data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, long* address, (Vector Value1, Vector Value2, Vector Value3) data) => StoreAndZip(mask, address, data); /// /// void svst4[_s64](svbool_t pg, int64_t *base, svint64x4_t data) /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, long* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, long* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => StoreAndZip(mask, address, data); /// /// void svst1[_s8](svbool_t pg, int8_t *base, svint8_t data) /// ST1B Zdata.B, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, sbyte* address, Vector data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, sbyte* address, Vector data) => StoreAndZip(mask, address, data); /// /// void svst2[_s8](svbool_t pg, int8_t *base, svint8x2_t data) /// ST2B {Zdata0.B, Zdata1.B}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, sbyte* address, (Vector Value1, Vector Value2) data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, sbyte* address, (Vector Value1, Vector Value2) data) => StoreAndZip(mask, address, data); /// /// void svst3[_s8](svbool_t pg, int8_t *base, svint8x3_t data) /// ST3B {Zdata0.B - Zdata2.B}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, sbyte* address, (Vector Value1, Vector Value2, Vector Value3) data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, sbyte* address, (Vector Value1, Vector Value2, Vector Value3) data) => StoreAndZip(mask, address, data); /// /// void svst4[_s8](svbool_t pg, int8_t *base, svint8x4_t data) /// ST4B {Zdata0.B - Zdata3.B}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, sbyte* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, sbyte* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => StoreAndZip(mask, address, data); /// /// void svst1[_f32](svbool_t pg, float32_t *base, svfloat32_t data) /// ST1W Zdata.S, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, float* address, Vector data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, float* address, Vector data) => StoreAndZip(mask, address, data); /// /// void svst2[_f32](svbool_t pg, float32_t *base, svfloat32x2_t data) /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, float* address, (Vector Value1, Vector Value2) data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, float* address, (Vector Value1, Vector Value2) data) => StoreAndZip(mask, address, data); /// /// void svst3[_f32](svbool_t pg, float32_t *base, svfloat32x3_t data) /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, float* address, (Vector Value1, Vector Value2, Vector Value3) data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, float* address, (Vector Value1, Vector Value2, Vector Value3) data) => StoreAndZip(mask, address, data); /// /// void svst4[_f32](svbool_t pg, float32_t *base, svfloat32x4_t data) /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, float* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, float* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => StoreAndZip(mask, address, data); /// /// void svst1[_u16](svbool_t pg, uint16_t *base, svuint16_t data) /// ST1H Zdata.H, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, ushort* address, Vector data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, ushort* address, Vector data) => StoreAndZip(mask, address, data); /// /// void svst2[_u16](svbool_t pg, uint16_t *base, svuint16x2_t data) /// ST2H {Zdata0.H, Zdata1.H}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, ushort* address, (Vector Value1, Vector Value2) data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, ushort* address, (Vector Value1, Vector Value2) data) => StoreAndZip(mask, address, data); /// /// void svst3[_u16](svbool_t pg, uint16_t *base, svuint16x3_t data) /// ST3H {Zdata0.H - Zdata2.H}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, ushort* address, (Vector Value1, Vector Value2, Vector Value3) data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, ushort* address, (Vector Value1, Vector Value2, Vector Value3) data) => StoreAndZip(mask, address, data); /// /// void svst4[_u16](svbool_t pg, uint16_t *base, svuint16x4_t data) /// ST4H {Zdata0.H - Zdata3.H}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, ushort* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, ushort* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => StoreAndZip(mask, address, data); /// /// void svst1[_u32](svbool_t pg, uint32_t *base, svuint32_t data) /// ST1W Zdata.S, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, uint* address, Vector data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, uint* address, Vector data) => StoreAndZip(mask, address, data); /// /// void svst2[_u32](svbool_t pg, uint32_t *base, svuint32x2_t data) /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, uint* address, (Vector Value1, Vector Value2) data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, uint* address, (Vector Value1, Vector Value2) data) => StoreAndZip(mask, address, data); /// /// void svst3[_u32](svbool_t pg, uint32_t *base, svuint32x3_t data) /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, uint* address, (Vector Value1, Vector Value2, Vector Value3) data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, uint* address, (Vector Value1, Vector Value2, Vector Value3) data) => StoreAndZip(mask, address, data); /// /// void svst4[_u32](svbool_t pg, uint32_t *base, svuint32x4_t data) /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, uint* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, uint* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => StoreAndZip(mask, address, data); /// /// void svst1[_u64](svbool_t pg, uint64_t *base, svuint64_t data) /// ST1D Zdata.D, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, ulong* address, Vector data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, ulong* address, Vector data) => StoreAndZip(mask, address, data); /// /// void svst2[_u64](svbool_t pg, uint64_t *base, svuint64x2_t data) /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, ulong* address, (Vector Value1, Vector Value2) data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, ulong* address, (Vector Value1, Vector Value2) data) => StoreAndZip(mask, address, data); /// /// void svst3[_u64](svbool_t pg, uint64_t *base, svuint64x3_t data) /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, ulong* address, (Vector Value1, Vector Value2, Vector Value3) data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, ulong* address, (Vector Value1, Vector Value2, Vector Value3) data) => StoreAndZip(mask, address, data); /// /// void svst4[_u64](svbool_t pg, uint64_t *base, svuint64x4_t data) /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xbase, #0, MUL VL] /// - public static unsafe void Store(Vector mask, ulong* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => Store(mask, address, data); + public static unsafe void StoreAndZip(Vector mask, ulong* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) => StoreAndZip(mask, address, data); /// Subtract : Subtract 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 53f02ec92028e2..418ba79428bf9f 100644 --- a/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs +++ b/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs @@ -4523,46 +4523,46 @@ internal Arm64() { } public static System.Numerics.Vector SignExtendWideningUpper(System.Numerics.Vector value) { throw null; } public static System.Numerics.Vector SignExtendWideningUpper(System.Numerics.Vector value) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, byte* address, System.Numerics.Vector data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, byte* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, byte* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, byte* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, double* address, System.Numerics.Vector data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, double* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, double* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, double* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, short* address, System.Numerics.Vector data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, short* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, short* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, short* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, int* address, System.Numerics.Vector data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, int* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, int* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, int* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, long* address, System.Numerics.Vector data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, long* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, long* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, long* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, sbyte* address, System.Numerics.Vector data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, sbyte* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, sbyte* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, sbyte* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, float* address, System.Numerics.Vector data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, float* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, float* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, float* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, ushort* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, ushort* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, ushort* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, uint* address, System.Numerics.Vector data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, uint* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, uint* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, uint* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, ulong* address, System.Numerics.Vector data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, ulong* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, ulong* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } - public static unsafe void Store(System.Numerics.Vector mask, ulong* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, byte* address, System.Numerics.Vector data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, byte* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, byte* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, byte* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, double* address, System.Numerics.Vector data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, double* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, double* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, double* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, short* address, System.Numerics.Vector data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, short* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, short* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, short* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, int* address, System.Numerics.Vector data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, int* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, int* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, int* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, long* address, System.Numerics.Vector data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, long* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, long* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, long* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, sbyte* address, System.Numerics.Vector data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, sbyte* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, sbyte* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, sbyte* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, float* address, System.Numerics.Vector data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, float* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, float* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, float* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, ushort* address, System.Numerics.Vector data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, ushort* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, ushort* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, ushort* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, uint* address, System.Numerics.Vector data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, uint* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, uint* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, uint* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, ulong* address, System.Numerics.Vector data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, ulong* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2) data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, ulong* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3) data) { throw null; } + public static unsafe void StoreAndZip(System.Numerics.Vector mask, ulong* address, (System.Numerics.Vector Value1, System.Numerics.Vector Value2, System.Numerics.Vector Value3, System.Numerics.Vector Value4) data) { throw null; } public static System.Numerics.Vector Subtract(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } public static System.Numerics.Vector Subtract(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } diff --git a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs index 5eceed88f1bab4..e9cce1a4564469 100644 --- a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs +++ b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs @@ -3364,46 +3364,46 @@ ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveZipLow_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[i] != left[index] || result[i + 1] != right[index]"}), ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveZipLow_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ZipLow", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateEntry"] = "result[i] != left[index] || result[i + 1] != right[index]"}), - ("SveStoreTest.template", new Dictionary { ["TestName"] = "SveStore_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[i] != first[i]"}), - ("SveStoreTest.template", new Dictionary { ["TestName"] = "SveStore_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateEntry"] = "result[i] != first[i]"}), - ("SveStoreTest.template", new Dictionary { ["TestName"] = "SveStore_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[i] != first[i]"}), - ("SveStoreTest.template", new Dictionary { ["TestName"] = "SveStore_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[i] != first[i]"}), - ("SveStoreTest.template", new Dictionary { ["TestName"] = "SveStore_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[i] != first[i]"}), - ("SveStoreTest.template", new Dictionary { ["TestName"] = "SveStore_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateEntry"] = "result[i] != first[i]"}), - ("SveStoreTest.template", new Dictionary { ["TestName"] = "SveStore_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[i] != first[i]"}), - ("SveStoreTest.template", new Dictionary { ["TestName"] = "SveStore_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "result[i] != first[i]"}), - ("SveStoreTest.template", new Dictionary { ["TestName"] = "SveStore_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[i] != first[i]"}), - ("SveStoreTest.template", new Dictionary { ["TestName"] = "SveStore_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateEntry"] = "result[i] != first[i]"}), - ("SveStoreTestx2.template", new Dictionary { ["TestName"] = "SveStorex2_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i]"}), - ("SveStoreTestx2.template", new Dictionary { ["TestName"] = "SveStorex2_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i]"}), - ("SveStoreTestx2.template", new Dictionary { ["TestName"] = "SveStorex2_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i]"}), - ("SveStoreTestx2.template", new Dictionary { ["TestName"] = "SveStorex2_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i]"}), - ("SveStoreTestx2.template", new Dictionary { ["TestName"] = "SveStorex2_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i]"}), - ("SveStoreTestx2.template", new Dictionary { ["TestName"] = "SveStorex2_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i]"}), - ("SveStoreTestx2.template", new Dictionary { ["TestName"] = "SveStorex2_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i]"}), - ("SveStoreTestx2.template", new Dictionary { ["TestName"] = "SveStorex2_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i]"}), - ("SveStoreTestx2.template", new Dictionary { ["TestName"] = "SveStorex2_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i]"}), - ("SveStoreTestx2.template", new Dictionary { ["TestName"] = "SveStorex2_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i]"}), - ("SveStoreTestx3.template", new Dictionary { ["TestName"] = "SveStorex3_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i]"}), - ("SveStoreTestx3.template", new Dictionary { ["TestName"] = "SveStorex3_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i]"}), - ("SveStoreTestx3.template", new Dictionary { ["TestName"] = "SveStorex3_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i]"}), - ("SveStoreTestx3.template", new Dictionary { ["TestName"] = "SveStorex3_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i]"}), - ("SveStoreTestx3.template", new Dictionary { ["TestName"] = "SveStorex3_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i]"}), - ("SveStoreTestx3.template", new Dictionary { ["TestName"] = "SveStorex3_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i]"}), - ("SveStoreTestx3.template", new Dictionary { ["TestName"] = "SveStorex3_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i]"}), - ("SveStoreTestx3.template", new Dictionary { ["TestName"] = "SveStorex3_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i]"}), - ("SveStoreTestx3.template", new Dictionary { ["TestName"] = "SveStorex3_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i]"}), - ("SveStoreTestx3.template", new Dictionary { ["TestName"] = "SveStorex3_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i]"}), - ("SveStoreTestx4.template", new Dictionary { ["TestName"] = "SveStorex4_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i] || result[index + 3] != fourth[i]"}), - ("SveStoreTestx4.template", new Dictionary { ["TestName"] = "SveStorex4_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i] || result[index + 3] != fourth[i]"}), - ("SveStoreTestx4.template", new Dictionary { ["TestName"] = "SveStorex4_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i] || result[index + 3] != fourth[i]"}), - ("SveStoreTestx4.template", new Dictionary { ["TestName"] = "SveStorex4_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i] || result[index + 3] != fourth[i]"}), - ("SveStoreTestx4.template", new Dictionary { ["TestName"] = "SveStorex4_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i] || result[index + 3] != fourth[i]"}), - ("SveStoreTestx4.template", new Dictionary { ["TestName"] = "SveStorex4_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i] || result[index + 3] != fourth[i]"}), - ("SveStoreTestx4.template", new Dictionary { ["TestName"] = "SveStorex4_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i] || result[index + 3] != fourth[i]"}), - ("SveStoreTestx4.template", new Dictionary { ["TestName"] = "SveStorex4_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i] || result[index + 3] != fourth[i]"}), - ("SveStoreTestx4.template", new Dictionary { ["TestName"] = "SveStorex4_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i] || result[index + 3] != fourth[i]"}), - ("SveStoreTestx4.template", new Dictionary { ["TestName"] = "SveStorex4_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "Store", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateEntry"] = "result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i] || result[index + 3] != fourth[i]"}), + ("SveStoreAndZipTest.template", new Dictionary { ["TestName"] = "SveStoreAndZip_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "(maskArray[i] == 0 && result[i] != 0) || (maskArray[i] == 1 && result[i] != first[i])"}), + ("SveStoreAndZipTest.template", new Dictionary { ["TestName"] = "SveStoreAndZip_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateEntry"] = "(maskArray[i] == 0 && result[i] != 0) || (maskArray[i] == 1 && result[i] != first[i])"}), + ("SveStoreAndZipTest.template", new Dictionary { ["TestName"] = "SveStoreAndZip_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "(maskArray[i] == 0 && result[i] != 0) || (maskArray[i] == 1 && result[i] != first[i])"}), + ("SveStoreAndZipTest.template", new Dictionary { ["TestName"] = "SveStoreAndZip_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "(maskArray[i] == 0 && result[i] != 0) || (maskArray[i] == 1 && result[i] != first[i])"}), + ("SveStoreAndZipTest.template", new Dictionary { ["TestName"] = "SveStoreAndZip_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "(maskArray[i] == 0 && result[i] != 0) || (maskArray[i] == 1 && result[i] != first[i])"}), + ("SveStoreAndZipTest.template", new Dictionary { ["TestName"] = "SveStoreAndZip_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateEntry"] = "(maskArray[i] == 0 && result[i] != 0) || (maskArray[i] == 1 && result[i] != first[i])"}), + ("SveStoreAndZipTest.template", new Dictionary { ["TestName"] = "SveStoreAndZip_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "(maskArray[i] == 0 && result[i] != 0) || (maskArray[i] == 1 && result[i] != first[i])"}), + ("SveStoreAndZipTest.template", new Dictionary { ["TestName"] = "SveStoreAndZip_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "(maskArray[i] == 0 && result[i] != 0) || (maskArray[i] == 1 && result[i] != first[i])"}), + ("SveStoreAndZipTest.template", new Dictionary { ["TestName"] = "SveStoreAndZip_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "(maskArray[i] == 0 && result[i] != 0) || (maskArray[i] == 1 && result[i] != first[i])"}), + ("SveStoreAndZipTest.template", new Dictionary { ["TestName"] = "SveStoreAndZip_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateEntry"] = "(maskArray[i] == 0 && result[i] != 0) || (maskArray[i] == 1 && result[i] != first[i])"}), + ("SveStoreAndZipTestx2.template", new Dictionary { ["TestName"] = "SveStoreAndZipx2_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "(maskArray[i] == 0 && (result[index] != 0 || result[index + 1] != 0)) || (maskArray[i] == 1 && (result[index] != first[i] || result[index + 1] != second[i]))"}), + ("SveStoreAndZipTestx2.template", new Dictionary { ["TestName"] = "SveStoreAndZipx2_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateEntry"] = "(maskArray[i] == 0 && (result[index] != 0 || result[index + 1] != 0)) || (maskArray[i] == 1 && (result[index] != first[i] || result[index + 1] != second[i]))"}), + ("SveStoreAndZipTestx2.template", new Dictionary { ["TestName"] = "SveStoreAndZipx2_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "(maskArray[i] == 0 && (result[index] != 0 || result[index + 1] != 0)) || (maskArray[i] == 1 && (result[index] != first[i] || result[index + 1] != second[i]))"}), + ("SveStoreAndZipTestx2.template", new Dictionary { ["TestName"] = "SveStoreAndZipx2_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "(maskArray[i] == 0 && (result[index] != 0 || result[index + 1] != 0)) || (maskArray[i] == 1 && (result[index] != first[i] || result[index + 1] != second[i]))"}), + ("SveStoreAndZipTestx2.template", new Dictionary { ["TestName"] = "SveStoreAndZipx2_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "(maskArray[i] == 0 && (result[index] != 0 || result[index + 1] != 0)) || (maskArray[i] == 1 && (result[index] != first[i] || result[index + 1] != second[i]))"}), + ("SveStoreAndZipTestx2.template", new Dictionary { ["TestName"] = "SveStoreAndZipx2_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateEntry"] = "(maskArray[i] == 0 && (result[index] != 0 || result[index + 1] != 0)) || (maskArray[i] == 1 && (result[index] != first[i] || result[index + 1] != second[i]))"}), + ("SveStoreAndZipTestx2.template", new Dictionary { ["TestName"] = "SveStoreAndZipx2_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "(maskArray[i] == 0 && (result[index] != 0 || result[index + 1] != 0)) || (maskArray[i] == 1 && (result[index] != first[i] || result[index + 1] != second[i]))"}), + ("SveStoreAndZipTestx2.template", new Dictionary { ["TestName"] = "SveStoreAndZipx2_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "(maskArray[i] == 0 && (result[index] != 0 || result[index + 1] != 0)) || (maskArray[i] == 1 && (result[index] != first[i] || result[index + 1] != second[i]))"}), + ("SveStoreAndZipTestx2.template", new Dictionary { ["TestName"] = "SveStoreAndZipx2_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "(maskArray[i] == 0 && (result[index] != 0 || result[index + 1] != 0)) || (maskArray[i] == 1 && (result[index] != first[i] || result[index + 1] != second[i]))"}), + ("SveStoreAndZipTestx2.template", new Dictionary { ["TestName"] = "SveStoreAndZipx2_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateEntry"] = "(maskArray[i] == 0 && (result[index] != 0 || result[index + 1] != 0)) || (maskArray[i] == 1 && (result[index] != first[i] || result[index + 1] != second[i]))"}), + ("SveStoreAndZipTestx3.template", new Dictionary { ["TestName"] = "SveStoreAndZipx3_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "(maskArray[i] == 0 && (result[index] != 0 || result[index + 1] != 0 || result[index + 2] != 0)) || (maskArray[i] == 1 && (result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i]))"}), + ("SveStoreAndZipTestx3.template", new Dictionary { ["TestName"] = "SveStoreAndZipx3_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateEntry"] = "(maskArray[i] == 0 && (result[index] != 0 || result[index + 1] != 0 || result[index + 2] != 0)) || (maskArray[i] == 1 && (result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i]))"}), + ("SveStoreAndZipTestx3.template", new Dictionary { ["TestName"] = "SveStoreAndZipx3_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "(maskArray[i] == 0 && (result[index] != 0 || result[index + 1] != 0 || result[index + 2] != 0)) || (maskArray[i] == 1 && (result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i]))"}), + ("SveStoreAndZipTestx3.template", new Dictionary { ["TestName"] = "SveStoreAndZipx3_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "(maskArray[i] == 0 && (result[index] != 0 || result[index + 1] != 0 || result[index + 2] != 0)) || (maskArray[i] == 1 && (result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i]))"}), + ("SveStoreAndZipTestx3.template", new Dictionary { ["TestName"] = "SveStoreAndZipx3_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "(maskArray[i] == 0 && (result[index] != 0 || result[index + 1] != 0 || result[index + 2] != 0)) || (maskArray[i] == 1 && (result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i]))"}), + ("SveStoreAndZipTestx3.template", new Dictionary { ["TestName"] = "SveStoreAndZipx3_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateEntry"] = "(maskArray[i] == 0 && (result[index] != 0 || result[index + 1] != 0 || result[index + 2] != 0)) || (maskArray[i] == 1 && (result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i]))"}), + ("SveStoreAndZipTestx3.template", new Dictionary { ["TestName"] = "SveStoreAndZipx3_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "(maskArray[i] == 0 && (result[index] != 0 || result[index + 1] != 0 || result[index + 2] != 0)) || (maskArray[i] == 1 && (result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i]))"}), + ("SveStoreAndZipTestx3.template", new Dictionary { ["TestName"] = "SveStoreAndZipx3_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "(maskArray[i] == 0 && (result[index] != 0 || result[index + 1] != 0 || result[index + 2] != 0)) || (maskArray[i] == 1 && (result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i]))"}), + ("SveStoreAndZipTestx3.template", new Dictionary { ["TestName"] = "SveStoreAndZipx3_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "(maskArray[i] == 0 && (result[index] != 0 || result[index + 1] != 0 || result[index + 2] != 0)) || (maskArray[i] == 1 && (result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i]))"}), + ("SveStoreAndZipTestx3.template", new Dictionary { ["TestName"] = "SveStoreAndZipx3_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateEntry"] = "(maskArray[i] == 0 && (result[index] != 0 || result[index + 1] != 0 || result[index + 2] != 0)) || (maskArray[i] == 1 && (result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i]))"}), + ("SveStoreAndZipTestx4.template", new Dictionary { ["TestName"] = "SveStoreAndZipx4_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "(maskArray[i] == 0 && (result[index] != 0 || result[index + 1] != 0 || result[index + 2] != 0 || result[index + 3] != 0)) || (maskArray[i] == 1 && (result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i] || result[index + 3] != fourth[i]))"}), + ("SveStoreAndZipTestx4.template", new Dictionary { ["TestName"] = "SveStoreAndZipx4_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateEntry"] = "(maskArray[i] == 0 && (result[index] != 0 || result[index + 1] != 0 || result[index + 2] != 0 || result[index + 3] != 0)) || (maskArray[i] == 1 && (result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i] || result[index + 3] != fourth[i]))"}), + ("SveStoreAndZipTestx4.template", new Dictionary { ["TestName"] = "SveStoreAndZipx4_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "(maskArray[i] == 0 && (result[index] != 0 || result[index + 1] != 0 || result[index + 2] != 0 || result[index + 3] != 0)) || (maskArray[i] == 1 && (result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i] || result[index + 3] != fourth[i]))"}), + ("SveStoreAndZipTestx4.template", new Dictionary { ["TestName"] = "SveStoreAndZipx4_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "(maskArray[i] == 0 && (result[index] != 0 || result[index + 1] != 0 || result[index + 2] != 0 || result[index + 3] != 0)) || (maskArray[i] == 1 && (result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i] || result[index + 3] != fourth[i]))"}), + ("SveStoreAndZipTestx4.template", new Dictionary { ["TestName"] = "SveStoreAndZipx4_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "(maskArray[i] == 0 && (result[index] != 0 || result[index + 1] != 0 || result[index + 2] != 0 || result[index + 3] != 0)) || (maskArray[i] == 1 && (result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i] || result[index + 3] != fourth[i]))"}), + ("SveStoreAndZipTestx4.template", new Dictionary { ["TestName"] = "SveStoreAndZipx4_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateEntry"] = "(maskArray[i] == 0 && (result[index] != 0 || result[index + 1] != 0 || result[index + 2] != 0 || result[index + 3] != 0)) || (maskArray[i] == 1 && (result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i] || result[index + 3] != fourth[i]))"}), + ("SveStoreAndZipTestx4.template", new Dictionary { ["TestName"] = "SveStoreAndZipx4_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "(maskArray[i] == 0 && (result[index] != 0 || result[index + 1] != 0 || result[index + 2] != 0 || result[index + 3] != 0)) || (maskArray[i] == 1 && (result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i] || result[index + 3] != fourth[i]))"}), + ("SveStoreAndZipTestx4.template", new Dictionary { ["TestName"] = "SveStoreAndZipx4_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateEntry"] = "(maskArray[i] == 0 && (result[index] != 0 || result[index + 1] != 0 || result[index + 2] != 0 || result[index + 3] != 0)) || (maskArray[i] == 1 && (result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i] || result[index + 3] != fourth[i]))"}), + ("SveStoreAndZipTestx4.template", new Dictionary { ["TestName"] = "SveStoreAndZipx4_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateEntry"] = "(maskArray[i] == 0 && (result[index] != 0 || result[index + 1] != 0 || result[index + 2] != 0 || result[index + 3] != 0)) || (maskArray[i] == 1 && (result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i] || result[index + 3] != fourth[i]))"}), + ("SveStoreAndZipTestx4.template", new Dictionary { ["TestName"] = "SveStoreAndZipx4_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "StoreAndZip", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateEntry"] = "(maskArray[i] == 0 && (result[index] != 0 || result[index + 1] != 0 || result[index + 2] != 0 || result[index + 3] != 0)) || (maskArray[i] == 1 && (result[index] != first[i] || result[index + 1] != second[i] || result[index + 2] != third[i] || result[index + 3] != fourth[i]))"}), }; diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreTest.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreAndZipTest.template similarity index 58% rename from src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreTest.template rename to src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreAndZipTest.template index 4a985c60ce57e3..41a2f8a86beea3 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreTest.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreAndZipTest.template @@ -71,42 +71,51 @@ namespace JIT.HardwareIntrinsics.Arm { private byte[] inArray1; private byte[] outArray; + private byte[] maskArray; private GCHandle inHandle1; private GCHandle outHandle; + private GCHandle maskHandle; private ulong alignment; - public DataTable({Op1BaseType}[] inArray1, {RetBaseType}[] outArray, int alignment) + public DataTable({Op1BaseType}[] inArray1, {RetBaseType}[] outArray, {Op1BaseType}[] maskArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<{RetBaseType}>(); - if ((alignment != 64 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) + int sizeOfmaskArray = maskArray.Length * Unsafe.SizeOf<{Op1BaseType}>(); + + if ((alignment != 64 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray || (alignment * 2) < sizeOfmaskArray) { throw new ArgumentException("Invalid value of alignment"); } - this.inArray1 = new byte[alignment * 2]; - this.outArray = new byte[alignment * 2]; + this.inArray1 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 2]; + this.maskArray = new byte[alignment * 2]; - this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); - this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + this.maskHandle = GCHandle.Alloc(this.maskArray, GCHandleType.Pinned); this.alignment = (ulong)alignment; Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(maskArrayPtr), ref Unsafe.As<{Op1BaseType}, byte>(ref maskArray[0]), (uint)sizeOfmaskArray); } public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + public void* maskArrayPtr => Align((byte*)(maskHandle.AddrOfPinnedObject().ToPointer()), alignment); public void Dispose() { inHandle1.Free(); outHandle.Free(); + maskHandle.Free(); } - private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + public static unsafe void* Align(byte* buffer, ulong expectedAlignment) { return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); } @@ -116,46 +125,63 @@ namespace JIT.HardwareIntrinsics.Arm private struct TestStruct { public {Op1VectorType}<{Op1BaseType}> _fld1; + public {Op1VectorType}<{Op1BaseType}> _storeMask; + private GCHandle _outHandle; public static TestStruct Create() { var testStruct = new TestStruct(); + var rnd = new Random(); + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld1), ref Unsafe.As<{Op1BaseType}, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + for (var i = 0; i < maskElementCount; i++) { _maskData[i] = ({Op1BaseType})1; } + for (var i = 0; i < maskElementCount / 2; i++) { _maskData[rnd.Next(maskElementCount)] = ({Op1BaseType})0; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._storeMask), ref Unsafe.As<{Op1BaseType}, byte>(ref _maskData[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + + ulong alignment = (ulong)LargestVectorSize; + byte[] _outArray = new byte[alignment * 2]; + testStruct._outHandle = GCHandle.Alloc(_outArray, GCHandleType.Pinned); return testStruct; } - public void RunStructFldScenario(StoreTest__{TestName} testClass) + public void* _outArrayPtr => DataTable.Align((byte*)(_outHandle.AddrOfPinnedObject().ToPointer()), (ulong)LargestVectorSize); + + public void Dispose() { - {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + _outHandle.Free(); + } - Sve.Store(storeMask, ({Op1BaseType}*)testClass._dataTable.outArrayPtr, _fld1); + public void RunStructFldScenario(StoreTest__{TestName} testClass) + { + Sve.StoreAndZip(_storeMask, ({Op1BaseType}*) _outArrayPtr, _fld1); - testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); + testClass.ValidateResult(_fld1, _outArrayPtr, _storeMask); } } 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 int Op1ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); + private static readonly int RetElementCount = Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>() / sizeof({RetBaseType}); + private static readonly int maskElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); - private static {Op1BaseType}[] _data1 = new {Op1BaseType}[Op1ElementCount]; - - private {Op1VectorType}<{Op1BaseType}> _fld1; + private static {Op1BaseType}[] _data1 = new {Op1BaseType}[Op1ElementCount]; + private static {Op1BaseType}[] _maskData = new {Op1BaseType}[maskElementCount]; private DataTable _dataTable; public StoreTest__{TestName}() { Succeeded = true; + var rnd = new Random(); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } - Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref _fld1), ref Unsafe.As<{Op1BaseType}, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + for (var i = 0; i < maskElementCount; i++) { _maskData[i] = ({Op1BaseType})1; } + for (var i = 0; i < maskElementCount / 2; i++) { _maskData[rnd.Next(maskElementCount)] = ({Op1BaseType})0; } - for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } - _dataTable = new DataTable(_data1, new {RetBaseType}[RetElementCount], LargestVectorSize); + _dataTable = new DataTable(_data1, new {RetBaseType}[RetElementCount], _maskData, LargestVectorSize); } public bool IsSupported => Sve.IsSupported; @@ -165,59 +191,56 @@ namespace JIT.HardwareIntrinsics.Arm public void RunBasicScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); - {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); - Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr)); + Sve.StoreAndZip(Unsafe.Read>(_dataTable.maskArrayPtr), ({Op1BaseType} *)_dataTable.outArrayPtr, Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr)); - ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr, _dataTable.maskArrayPtr); } public void RunBasicScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); {Op1VectorType}<{Op1BaseType}> loadMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); - {Op1VectorType}<{Op1BaseType}> storeMask = loadMask; - Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.inArray1Ptr))); + Sve.StoreAndZip(Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.maskArrayPtr)), ({Op1BaseType} *)_dataTable.outArrayPtr, Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.inArray1Ptr))); - ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr, _dataTable.maskArrayPtr); } public void RunReflectionScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); - {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); - typeof(Sve).GetMethod(nameof(Sve.Store), new Type[] { typeof({Op1VectorType}<{Op1BaseType}>), typeof({Op1BaseType} *), typeof({Op1VectorType}<{Op1BaseType}>) }) - .Invoke(null, new object[] { storeMask, + typeof(Sve).GetMethod(nameof(Sve.StoreAndZip), new Type[] { typeof({Op1VectorType}<{Op1BaseType}>), typeof({Op1BaseType} *), typeof({Op1VectorType}<{Op1BaseType}>) }) + .Invoke(null, new object[] { Unsafe.Read>(_dataTable.maskArrayPtr), Pointer.Box(_dataTable.outArrayPtr, typeof({Op1BaseType}*)), Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr) }); - ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr, _dataTable.maskArrayPtr); } public void RunLclVarScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); - {Op1VectorType}<{Op1BaseType}> op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr); - {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + {Op1VectorType}<{Op1BaseType}> op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr); + {Op1VectorType}<{Op1BaseType}> storeMask = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.maskArrayPtr); - Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, op1); + Sve.StoreAndZip(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, op1); - ValidateResult(op1, _dataTable.outArrayPtr); + ValidateResult(op1, _dataTable.outArrayPtr, storeMask); } public void RunClassFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); - {Op1VectorType}<{Op1BaseType}> op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr); - {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + {Op1VectorType}<{Op1BaseType}> op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr); + {Op1VectorType}<{Op1BaseType}> storeMask = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.maskArrayPtr); - Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, op1); + Sve.StoreAndZip(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, op1); - ValidateResult(op1, _dataTable.outArrayPtr); + ValidateResult(op1, _dataTable.outArrayPtr, storeMask); } public void RunStructLclFldScenario() @@ -225,10 +248,9 @@ namespace JIT.HardwareIntrinsics.Arm TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); var test = TestStruct.Create(); - {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); - Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, test._fld1); + Sve.StoreAndZip(test._storeMask, ({Op1BaseType} *)test._outArrayPtr, test._fld1); - ValidateResult(test._fld1, _dataTable.outArrayPtr); + ValidateResult(test._fld1, test._outArrayPtr, test._storeMask); } public void RunStructFldScenario() @@ -260,29 +282,33 @@ namespace JIT.HardwareIntrinsics.Arm } } - private void ValidateResult({Op1VectorType}<{Op1BaseType}> op1, void* result, [CallerMemberName] string method = "") + private void ValidateResult({Op1VectorType}<{Op1BaseType}> op1, void* result, {Op1VectorType}<{Op1BaseType}> storeMask, [CallerMemberName] string method = "") { - {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; - {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; + {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; + {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; + {Op1BaseType}[] maskArray = new {Op1BaseType}[maskElementCount]; Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref maskArray[0]), storeMask); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>()); - ValidateResult(inArray1, outArray, method); + ValidateResult(inArray1, outArray, maskArray, method); } - private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") + private void ValidateResult(void* op1, void* result, void* mask, [CallerMemberName] string method = "") { - {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; - {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; + {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; + {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; + {Op1BaseType}[] maskArray = new {Op1BaseType}[maskElementCount]; Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref maskArray[0]), ref Unsafe.AsRef(mask), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); - ValidateResult(inArray1, outArray, method); + ValidateResult(inArray1, outArray, maskArray, method); } - private void ValidateResult({Op1BaseType}[] first, {RetBaseType}[] result, [CallerMemberName] string method = "") + private void ValidateResult({Op1BaseType}[] first, {RetBaseType}[] result, {Op1BaseType}[] maskArray, [CallerMemberName] string method = "") { bool succeeded = true; @@ -297,8 +323,9 @@ namespace JIT.HardwareIntrinsics.Arm if (!succeeded) { - TestLibrary.TestFramework.LogInformation($"{nameof(Sve)}.{nameof(Sve.Store)}<{Op1BaseType}>({Op1VectorType}<{Op1BaseType}>, {Op1BaseType}*, {Op1VectorType}<{Op1BaseType}>): {method} failed:"); + TestLibrary.TestFramework.LogInformation($"{nameof(Sve)}.{nameof(Sve.StoreAndZip)}<{Op1BaseType}>({Op1VectorType}<{Op1BaseType}>, {Op1BaseType}*, {Op1VectorType}<{Op1BaseType}>): {method} failed:"); TestLibrary.TestFramework.LogInformation($" first: ({string.Join(", ", first)})"); + TestLibrary.TestFramework.LogInformation($" mask: ({string.Join(", ", maskArray)})"); TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); TestLibrary.TestFramework.LogInformation(string.Empty); diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreTestx2.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreAndZipTestx2.template similarity index 59% rename from src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreTestx2.template rename to src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreAndZipTestx2.template index 511fdba2c312f8..ddb753c6c53509 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreTestx2.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreAndZipTestx2.template @@ -72,49 +72,58 @@ namespace JIT.HardwareIntrinsics.Arm private byte[] inArray1; private byte[] inArray2; private byte[] outArray; + private byte[] maskArray; private GCHandle inHandle1; private GCHandle inHandle2; private GCHandle outHandle; + private GCHandle maskHandle; private ulong alignment; - public DataTable({Op1BaseType}[] inArray1, {Op1BaseType}[] inArray2, {RetBaseType}[] outArray, int alignment) + public DataTable({Op1BaseType}[] inArray1, {Op1BaseType}[] inArray2, {RetBaseType}[] outArray, {Op1BaseType}[] maskArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<{RetBaseType}>(); - if ((alignment != 64 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 4) < sizeOfoutArray) + int sizeOfmaskArray = maskArray.Length * Unsafe.SizeOf<{Op1BaseType}>(); + + if ((alignment != 64 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 4) < sizeOfoutArray || (alignment * 2) < sizeOfmaskArray) { throw new ArgumentException("Invalid value of alignment"); } - this.inArray1 = new byte[alignment * 2]; - this.inArray2 = new byte[alignment * 2]; - this.outArray = new byte[alignment * 4]; + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 4]; + this.maskArray = new byte[alignment * 2]; - this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); - this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); - this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + this.maskHandle = GCHandle.Alloc(this.maskArray, GCHandleType.Pinned); this.alignment = (ulong)alignment; Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), (uint)sizeOfinArray1); Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As<{Op1BaseType}, byte>(ref inArray2[0]), (uint)sizeOfinArray2); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(maskArrayPtr), ref Unsafe.As<{Op1BaseType}, byte>(ref maskArray[0]), (uint)sizeOfmaskArray); } public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + public void* maskArrayPtr => Align((byte*)(maskHandle.AddrOfPinnedObject().ToPointer()), alignment); public void Dispose() { inHandle1.Free(); inHandle2.Free(); outHandle.Free(); + maskHandle.Free(); } - private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + public static unsafe void* Align(byte* buffer, ulong expectedAlignment) { return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); } @@ -125,54 +134,68 @@ namespace JIT.HardwareIntrinsics.Arm { public {Op1VectorType}<{Op1BaseType}> _fld1; public {Op1VectorType}<{Op1BaseType}> _fld2; + public {Op1VectorType}<{Op1BaseType}> _storeMask; + private GCHandle _outHandle; public static TestStruct Create() { var testStruct = new TestStruct(); + var rnd = new Random(); + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld1), ref Unsafe.As<{Op1BaseType}, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp1}; } Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld2), ref Unsafe.As<{Op1BaseType}, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + for (var i = 0; i < maskElementCount; i++) { _maskData[i] = ({Op1BaseType})1; } + for (var i = 0; i < maskElementCount / 2; i++) { _maskData[rnd.Next(maskElementCount)] = ({Op1BaseType})0; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._storeMask), ref Unsafe.As<{Op1BaseType}, byte>(ref _maskData[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + + ulong alignment = (ulong)LargestVectorSize; + byte[] _outArray = new byte[alignment * 4]; + testStruct._outHandle = GCHandle.Alloc(_outArray, GCHandleType.Pinned); return testStruct; } - public void RunStructFldScenario(Storex2Test__{TestName} testClass) + public void* _outArrayPtr => DataTable.Align((byte*)(_outHandle.AddrOfPinnedObject().ToPointer()), (ulong)LargestVectorSize); + + public void Dispose() { - {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + _outHandle.Free(); + } - Sve.Store(storeMask, ({Op1BaseType}*)testClass._dataTable.outArrayPtr, (_fld1, _fld2)); + public void RunStructFldScenario(Storex2Test__{TestName} testClass) + { + Sve.StoreAndZip(_storeMask, ({Op1BaseType}*) _outArrayPtr, (_fld1, _fld2)); - testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + testClass.ValidateResult(_fld1, _fld2, _outArrayPtr, _storeMask); } } private static readonly int LargestVectorSize = {LargestVectorSize}; - private static readonly int Op1ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); - private static readonly int Op2ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); - private static readonly int RetElementCount = Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>() / sizeof({RetBaseType}) * 2; + private static readonly int Op1ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); + private static readonly int Op2ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); + private static readonly int RetElementCount = Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>() / sizeof({RetBaseType}) * 2; + private static readonly int maskElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); - private static {Op1BaseType}[] _data1 = new {Op1BaseType}[Op1ElementCount]; - private static {Op1BaseType}[] _data2 = new {Op1BaseType}[Op2ElementCount]; - - private {Op1VectorType}<{Op1BaseType}> _fld1; - private {Op1VectorType}<{Op1BaseType}> _fld2; + private static {Op1BaseType}[] _data1 = new {Op1BaseType}[Op1ElementCount]; + private static {Op1BaseType}[] _data2 = new {Op1BaseType}[Op2ElementCount]; + private static {Op1BaseType}[] _maskData = new {Op1BaseType}[maskElementCount]; private DataTable _dataTable; public Storex2Test__{TestName}() { Succeeded = true; + var rnd = new Random(); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } - Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref _fld1), ref Unsafe.As<{Op1BaseType}, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp1}; } - Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref _fld2), ref Unsafe.As<{Op1BaseType}, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + for (var i = 0; i < maskElementCount; i++) { _maskData[i] = ({Op1BaseType})1; } + for (var i = 0; i < maskElementCount / 2; i++) { _maskData[rnd.Next(maskElementCount)] = ({Op1BaseType})0; } - for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } - for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp1}; } - _dataTable = new DataTable(_data1, _data2, new {RetBaseType}[RetElementCount], LargestVectorSize); + _dataTable = new DataTable(_data1, _data2, new {RetBaseType}[RetElementCount], _maskData, LargestVectorSize); } public bool IsSupported => Sve.IsSupported; @@ -182,69 +205,66 @@ namespace JIT.HardwareIntrinsics.Arm public void RunBasicScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); - {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); - Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, + Sve.StoreAndZip(Unsafe.Read>(_dataTable.maskArrayPtr), ({Op1BaseType} *)_dataTable.outArrayPtr, (Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr), Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr)) ); - ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr, _dataTable.maskArrayPtr); } public void RunBasicScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); {Op1VectorType}<{Op1BaseType}> loadMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); - {Op1VectorType}<{Op1BaseType}> storeMask = loadMask; - Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, + Sve.StoreAndZip(Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.maskArrayPtr)), ({Op1BaseType} *)_dataTable.outArrayPtr, (Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.inArray1Ptr)), Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.inArray2Ptr))) ); - ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr, _dataTable.maskArrayPtr); } public void RunReflectionScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); - {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); - typeof(Sve).GetMethod(nameof(Sve.Store), new Type[] { typeof({Op1VectorType}<{Op1BaseType}>), typeof({Op1BaseType} *), typeof(({Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>)) }) - .Invoke(null, new object[] { storeMask, + typeof(Sve).GetMethod(nameof(Sve.StoreAndZip), new Type[] { typeof({Op1VectorType}<{Op1BaseType}>), typeof({Op1BaseType} *), typeof(({Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>)) }) + .Invoke(null, new object[] { Unsafe.Read>(_dataTable.maskArrayPtr), Pointer.Box(_dataTable.outArrayPtr, typeof({Op1BaseType}*)), (Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr), Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr)) }); - ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr, _dataTable.maskArrayPtr); } public void RunLclVarScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); - {Op1VectorType}<{Op1BaseType}> op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr); - {Op1VectorType}<{Op1BaseType}> op2 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr); - {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + {Op1VectorType}<{Op1BaseType}> op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr); + {Op1VectorType}<{Op1BaseType}> op2 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr); + {Op1VectorType}<{Op1BaseType}> storeMask = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.maskArrayPtr); - Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (op1, op2)); + Sve.StoreAndZip(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (op1, op2)); - ValidateResult(op1, op2, _dataTable.outArrayPtr); + ValidateResult(op1, op2, _dataTable.outArrayPtr, storeMask); } public void RunClassFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); - {Op1VectorType}<{Op1BaseType}> op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr); - {Op1VectorType}<{Op1BaseType}> op2 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr); - {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + {Op1VectorType}<{Op1BaseType}> op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr); + {Op1VectorType}<{Op1BaseType}> op2 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr); + {Op1VectorType}<{Op1BaseType}> storeMask = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.maskArrayPtr); - Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (op1, op2)); + Sve.StoreAndZip(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (op1, op2)); - ValidateResult(op1, op2, _dataTable.outArrayPtr); + ValidateResult(op1, op2, _dataTable.outArrayPtr, storeMask); } public void RunStructLclFldScenario() @@ -252,10 +272,9 @@ namespace JIT.HardwareIntrinsics.Arm TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); var test = TestStruct.Create(); - {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); - Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (test._fld1, test._fld2)); + Sve.StoreAndZip(test._storeMask, ({Op1BaseType} *)test._outArrayPtr, (test._fld1, test._fld2)); - ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + ValidateResult(test._fld1, test._fld2, test._outArrayPtr, test._storeMask); } public void RunStructFldScenario() @@ -287,33 +306,37 @@ namespace JIT.HardwareIntrinsics.Arm } } - private void ValidateResult({Op1VectorType}<{Op1BaseType}> op1, {Op1VectorType}<{Op1BaseType}> op2, void* result, [CallerMemberName] string method = "") + private void ValidateResult({Op1VectorType}<{Op1BaseType}> op1, {Op1VectorType}<{Op1BaseType}> op2, void* result, {Op1VectorType}<{Op1BaseType}> storeMask, [CallerMemberName] string method = "") { - {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; - {Op1BaseType}[] inArray2 = new {Op1BaseType}[Op2ElementCount]; - {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; + {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; + {Op1BaseType}[] inArray2 = new {Op1BaseType}[Op2ElementCount]; + {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; + {Op1BaseType}[] maskArray = new {Op1BaseType}[maskElementCount]; Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), op1); Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray2[0]), op2); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref maskArray[0]), storeMask); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>() * 2); - ValidateResult(inArray1, inArray2, outArray, method); + ValidateResult(inArray1, inArray2, outArray, maskArray, method); } - private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + private void ValidateResult(void* op1, void* op2, void* result, void* mask, [CallerMemberName] string method = "") { - {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; - {Op1BaseType}[] inArray2 = new {Op1BaseType}[Op2ElementCount]; - {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; + {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; + {Op1BaseType}[] inArray2 = new {Op1BaseType}[Op2ElementCount]; + {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; + {Op1BaseType}[] maskArray = new {Op1BaseType}[maskElementCount]; Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>() * 2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref maskArray[0]), ref Unsafe.AsRef(mask), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); - ValidateResult(inArray1, inArray2, outArray, method); + ValidateResult(inArray1, inArray2, outArray, maskArray, method); } - private void ValidateResult({Op1BaseType}[] first, {Op1BaseType}[] second, {RetBaseType}[] result, [CallerMemberName] string method = "") + private void ValidateResult({Op1BaseType}[] first, {Op1BaseType}[] second, {RetBaseType}[] result, {Op1BaseType}[] maskArray, [CallerMemberName] string method = "") { bool succeeded = true; @@ -329,9 +352,10 @@ namespace JIT.HardwareIntrinsics.Arm if (!succeeded) { - TestLibrary.TestFramework.LogInformation($"{nameof(Sve)}.{nameof(Sve.Store)}<{Op1BaseType}>({Op1VectorType}<{Op1BaseType}>, {Op1BaseType}*, ({Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>)): {method} failed:"); + TestLibrary.TestFramework.LogInformation($"{nameof(Sve)}.{nameof(Sve.StoreAndZip)}<{Op1BaseType}>({Op1VectorType}<{Op1BaseType}>, {Op1BaseType}*, ({Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>)): {method} failed:"); TestLibrary.TestFramework.LogInformation($" first: ({string.Join(", ", first)})"); TestLibrary.TestFramework.LogInformation($" second: ({string.Join(", ", second)})"); + TestLibrary.TestFramework.LogInformation($" mask: ({string.Join(", ", maskArray)})"); TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); TestLibrary.TestFramework.LogInformation(string.Empty); diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreTestx3.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreAndZipTestx3.template similarity index 62% rename from src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreTestx3.template rename to src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreAndZipTestx3.template index 5067a2422152f4..2f3b7aca446b78 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreTestx3.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreAndZipTestx3.template @@ -73,46 +73,54 @@ namespace JIT.HardwareIntrinsics.Arm private byte[] inArray2; private byte[] inArray3; private byte[] outArray; + private byte[] maskArray; private GCHandle inHandle1; private GCHandle inHandle2; private GCHandle inHandle3; private GCHandle outHandle; + private GCHandle maskHandle; private ulong alignment; - public DataTable({Op1BaseType}[] inArray1, {Op1BaseType}[] inArray2, {Op1BaseType}[] inArray3, {RetBaseType}[] outArray, int alignment) + public DataTable({Op1BaseType}[] inArray1, {Op1BaseType}[] inArray2, {Op1BaseType}[] inArray3, {RetBaseType}[] outArray, {Op1BaseType}[] maskArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<{RetBaseType}>(); - if ((alignment != 64 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 6) < sizeOfoutArray) + int sizeOfmaskArray = maskArray.Length * Unsafe.SizeOf<{Op1BaseType}>(); + + if ((alignment != 64 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 6) < sizeOfoutArray || (alignment * 2) < sizeOfmaskArray) { throw new ArgumentException("Invalid value of alignment"); } - this.inArray1 = new byte[alignment * 2]; - this.inArray2 = new byte[alignment * 2]; - this.inArray3 = new byte[alignment * 2]; - this.outArray = new byte[alignment * 6]; + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 6]; + this.maskArray = new byte[alignment * 2]; - this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); - this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); - this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); - this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + this.maskHandle = GCHandle.Alloc(this.maskArray, GCHandleType.Pinned); this.alignment = (ulong)alignment; Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), (uint)sizeOfinArray1); Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As<{Op1BaseType}, byte>(ref inArray2[0]), (uint)sizeOfinArray2); Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As<{Op1BaseType}, byte>(ref inArray3[0]), (uint)sizeOfinArray3); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(maskArrayPtr), ref Unsafe.As<{Op1BaseType}, byte>(ref maskArray[0]), (uint)sizeOfmaskArray); } public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + public void* maskArrayPtr => Align((byte*)(maskHandle.AddrOfPinnedObject().ToPointer()), alignment); public void Dispose() { @@ -120,9 +128,10 @@ namespace JIT.HardwareIntrinsics.Arm inHandle2.Free(); inHandle3.Free(); outHandle.Free(); + maskHandle.Free(); } - private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + public static unsafe void* Align(byte* buffer, ulong expectedAlignment) { return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); } @@ -134,62 +143,73 @@ namespace JIT.HardwareIntrinsics.Arm public {Op1VectorType}<{Op1BaseType}> _fld1; public {Op1VectorType}<{Op1BaseType}> _fld2; public {Op1VectorType}<{Op1BaseType}> _fld3; + public {Op1VectorType}<{Op1BaseType}> _storeMask; + private GCHandle _outHandle; public static TestStruct Create() { var testStruct = new TestStruct(); + var rnd = new Random(); + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld1), ref Unsafe.As<{Op1BaseType}, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp1}; } Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld2), ref Unsafe.As<{Op1BaseType}, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = {NextValueOp1}; } Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld3), ref Unsafe.As<{Op1BaseType}, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + for (var i = 0; i < maskElementCount; i++) { _maskData[i] = ({Op1BaseType})1; } + for (var i = 0; i < maskElementCount / 2; i++) { _maskData[rnd.Next(maskElementCount)] = ({Op1BaseType})0; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._storeMask), ref Unsafe.As<{Op1BaseType}, byte>(ref _maskData[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + + ulong alignment = (ulong)LargestVectorSize; + byte[] _outArray = new byte[alignment * 6]; + testStruct._outHandle = GCHandle.Alloc(_outArray, GCHandleType.Pinned); return testStruct; } - public void RunStructFldScenario(Storex3Test__{TestName} testClass) + public void* _outArrayPtr => DataTable.Align((byte*)(_outHandle.AddrOfPinnedObject().ToPointer()), (ulong)LargestVectorSize); + + public void Dispose() { - {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + _outHandle.Free(); + } - Sve.Store(storeMask, ({Op1BaseType}*)testClass._dataTable.outArrayPtr, (_fld1, _fld2, _fld3)); + public void RunStructFldScenario(Storex3Test__{TestName} testClass) + { + Sve.StoreAndZip(_storeMask, ({Op1BaseType}*)_outArrayPtr, (_fld1, _fld2, _fld3)); - testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); + testClass.ValidateResult(_fld1, _fld2, _fld3, _outArrayPtr, _storeMask); } } private static readonly int LargestVectorSize = {LargestVectorSize}; - private static readonly int Op1ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); - private static readonly int Op2ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); - private static readonly int Op3ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); - private static readonly int RetElementCount = Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>() / sizeof({RetBaseType}) * 3; - - private static {Op1BaseType}[] _data1 = new {Op1BaseType}[Op1ElementCount]; - private static {Op1BaseType}[] _data2 = new {Op1BaseType}[Op2ElementCount]; - private static {Op1BaseType}[] _data3 = new {Op1BaseType}[Op3ElementCount]; + private static readonly int Op1ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); + private static readonly int Op2ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); + private static readonly int Op3ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); + private static readonly int RetElementCount = Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>() / sizeof({RetBaseType}) * 3; + private static readonly int maskElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); - private {Op1VectorType}<{Op1BaseType}> _fld1; - private {Op1VectorType}<{Op1BaseType}> _fld2; - private {Op1VectorType}<{Op1BaseType}> _fld3; + private static {Op1BaseType}[] _data1 = new {Op1BaseType}[Op1ElementCount]; + private static {Op1BaseType}[] _data2 = new {Op1BaseType}[Op2ElementCount]; + private static {Op1BaseType}[] _data3 = new {Op1BaseType}[Op3ElementCount]; + private static {Op1BaseType}[] _maskData = new {Op1BaseType}[maskElementCount]; private DataTable _dataTable; public Storex3Test__{TestName}() { Succeeded = true; + var rnd = new Random(); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } - Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref _fld1), ref Unsafe.As<{Op1BaseType}, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp1}; } - Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref _fld2), ref Unsafe.As<{Op1BaseType}, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = {NextValueOp1}; } - Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref _fld3), ref Unsafe.As<{Op1BaseType}, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + for (var i = 0; i < maskElementCount; i++) { _maskData[i] = ({Op1BaseType})1; } + for (var i = 0; i < maskElementCount / 2; i++) { _maskData[rnd.Next(maskElementCount)] = ({Op1BaseType})0; } - for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } - for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp1}; } - for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = {NextValueOp1}; } - _dataTable = new DataTable(_data1, _data2, _data3, new {RetBaseType}[RetElementCount], LargestVectorSize); + _dataTable = new DataTable(_data1, _data2, _data3, new {RetBaseType}[RetElementCount], _maskData, LargestVectorSize); } public bool IsSupported => Sve.IsSupported; @@ -199,74 +219,71 @@ namespace JIT.HardwareIntrinsics.Arm public void RunBasicScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); - {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); - Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, + Sve.StoreAndZip(Unsafe.Read>(_dataTable.maskArrayPtr), ({Op1BaseType} *)_dataTable.outArrayPtr, (Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr), Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr), Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray3Ptr)) ); - ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr, _dataTable.maskArrayPtr); } public void RunBasicScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); {Op1VectorType}<{Op1BaseType}> loadMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); - {Op1VectorType}<{Op1BaseType}> storeMask = loadMask; - Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, + Sve.StoreAndZip(Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.maskArrayPtr)), ({Op1BaseType} *)_dataTable.outArrayPtr, (Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.inArray1Ptr)), Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.inArray2Ptr)), Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.inArray3Ptr))) ); - ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr, _dataTable.maskArrayPtr); } public void RunReflectionScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); - {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); - typeof(Sve).GetMethod(nameof(Sve.Store), new Type[] { typeof({Op1VectorType}<{Op1BaseType}>), typeof({Op1BaseType} *), typeof(({Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>)) }) - .Invoke(null, new object[] { storeMask, + typeof(Sve).GetMethod(nameof(Sve.StoreAndZip), new Type[] { typeof({Op1VectorType}<{Op1BaseType}>), typeof({Op1BaseType} *), typeof(({Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>)) }) + .Invoke(null, new object[] { Unsafe.Read>(_dataTable.maskArrayPtr), Pointer.Box(_dataTable.outArrayPtr, typeof({Op1BaseType}*)), (Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr), Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr), Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray3Ptr)) }); - ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr, _dataTable.maskArrayPtr); } public void RunLclVarScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); - {Op1VectorType}<{Op1BaseType}> op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr); - {Op1VectorType}<{Op1BaseType}> op2 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr); - {Op1VectorType}<{Op1BaseType}> op3 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray3Ptr); - {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + {Op1VectorType}<{Op1BaseType}> op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr); + {Op1VectorType}<{Op1BaseType}> op2 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr); + {Op1VectorType}<{Op1BaseType}> op3 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray3Ptr); + {Op1VectorType}<{Op1BaseType}> storeMask = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.maskArrayPtr); - Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (op1, op2, op3)); + Sve.StoreAndZip(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (op1, op2, op3)); - ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr, storeMask); } public void RunClassFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); - {Op1VectorType}<{Op1BaseType}> op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr); - {Op1VectorType}<{Op1BaseType}> op2 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr); - {Op1VectorType}<{Op1BaseType}> op3 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray3Ptr); - {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + {Op1VectorType}<{Op1BaseType}> op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr); + {Op1VectorType}<{Op1BaseType}> op2 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr); + {Op1VectorType}<{Op1BaseType}> op3 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray3Ptr); + {Op1VectorType}<{Op1BaseType}> storeMask = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.maskArrayPtr); - Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (op1, op2, op3)); + Sve.StoreAndZip(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (op1, op2, op3)); - ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); + ValidateResult(op1, op2, op3, _dataTable.outArrayPtr, storeMask); } public void RunStructLclFldScenario() @@ -274,10 +291,9 @@ namespace JIT.HardwareIntrinsics.Arm TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); var test = TestStruct.Create(); - {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); - Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (test._fld1, test._fld2, test._fld3)); + Sve.StoreAndZip(test._storeMask, ({Op1BaseType} *)test._outArrayPtr, (test._fld1, test._fld2, test._fld3)); - ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); + ValidateResult(test._fld1, test._fld2, test._fld3, test._outArrayPtr, test._storeMask); } public void RunStructFldScenario() @@ -309,37 +325,41 @@ namespace JIT.HardwareIntrinsics.Arm } } - private void ValidateResult({Op1VectorType}<{Op1BaseType}> op1, {Op1VectorType}<{Op1BaseType}> op2, {Op1VectorType}<{Op1BaseType}> op3, void* result, [CallerMemberName] string method = "") + private void ValidateResult({Op1VectorType}<{Op1BaseType}> op1, {Op1VectorType}<{Op1BaseType}> op2, {Op1VectorType}<{Op1BaseType}> op3, void* result, {Op1VectorType}<{Op1BaseType}> storeMask, [CallerMemberName] string method = "") { - {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; - {Op1BaseType}[] inArray2 = new {Op1BaseType}[Op2ElementCount]; - {Op1BaseType}[] inArray3 = new {Op1BaseType}[Op3ElementCount]; - {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; + {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; + {Op1BaseType}[] inArray2 = new {Op1BaseType}[Op2ElementCount]; + {Op1BaseType}[] inArray3 = new {Op1BaseType}[Op3ElementCount]; + {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; + {Op1BaseType}[] maskArray = new {Op1BaseType}[maskElementCount]; Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), op1); Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray2[0]), op2); Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray3[0]), op3); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref maskArray[0]), storeMask); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>() * 3); - ValidateResult(inArray1, inArray2, inArray3, outArray, method); + ValidateResult(inArray1, inArray2, inArray3, outArray, maskArray, method); } - private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") + private void ValidateResult(void* op1, void* op2, void* op3, void* result, void* mask, [CallerMemberName] string method = "") { - {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; - {Op1BaseType}[] inArray2 = new {Op1BaseType}[Op2ElementCount]; - {Op1BaseType}[] inArray3 = new {Op1BaseType}[Op3ElementCount]; - {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; + {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; + {Op1BaseType}[] inArray2 = new {Op1BaseType}[Op2ElementCount]; + {Op1BaseType}[] inArray3 = new {Op1BaseType}[Op3ElementCount]; + {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; + {Op1BaseType}[] maskArray = new {Op1BaseType}[maskElementCount]; Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>() * 3); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref maskArray[0]), ref Unsafe.AsRef(mask), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); - ValidateResult(inArray1, inArray2, inArray3, outArray, method); + ValidateResult(inArray1, inArray2, inArray3, outArray, maskArray, method); } - private void ValidateResult({Op1BaseType}[] first, {Op1BaseType}[] second, {Op1BaseType}[] third, {RetBaseType}[] result, [CallerMemberName] string method = "") + private void ValidateResult({Op1BaseType}[] first, {Op1BaseType}[] second, {Op1BaseType}[] third, {RetBaseType}[] result, {Op1BaseType}[] maskArray, [CallerMemberName] string method = "") { bool succeeded = true; @@ -355,10 +375,11 @@ namespace JIT.HardwareIntrinsics.Arm if (!succeeded) { - TestLibrary.TestFramework.LogInformation($"{nameof(Sve)}.{nameof(Sve.Store)}<{Op1BaseType}>({Op1VectorType}<{Op1BaseType}>, {Op1BaseType}*, ({Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>)): {method} failed:"); + TestLibrary.TestFramework.LogInformation($"{nameof(Sve)}.{nameof(Sve.StoreAndZip)}<{Op1BaseType}>({Op1VectorType}<{Op1BaseType}>, {Op1BaseType}*, ({Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>)): {method} failed:"); TestLibrary.TestFramework.LogInformation($" first: ({string.Join(", ", first)})"); TestLibrary.TestFramework.LogInformation($" second: ({string.Join(", ", second)})"); TestLibrary.TestFramework.LogInformation($" third: ({string.Join(", ", third)})"); + TestLibrary.TestFramework.LogInformation($" mask: ({string.Join(", ", maskArray)})"); TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); TestLibrary.TestFramework.LogInformation(string.Empty); diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreTestx4.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreAndZipTestx4.template similarity index 63% rename from src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreTestx4.template rename to src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreAndZipTestx4.template index 1232df1c24963f..6b6a40ebd08d98 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreTestx4.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreAndZipTestx4.template @@ -74,38 +74,44 @@ namespace JIT.HardwareIntrinsics.Arm private byte[] inArray3; private byte[] inArray4; private byte[] outArray; + private byte[] maskArray; private GCHandle inHandle1; private GCHandle inHandle2; private GCHandle inHandle3; private GCHandle inHandle4; private GCHandle outHandle; + private GCHandle maskHandle; private ulong alignment; - public DataTable({Op1BaseType}[] inArray1, {Op1BaseType}[] inArray2, {Op1BaseType}[] inArray3, {Op1BaseType}[] inArray4, {RetBaseType}[] outArray, int alignment) + public DataTable({Op1BaseType}[] inArray1, {Op1BaseType}[] inArray2, {Op1BaseType}[] inArray3, {Op1BaseType}[] inArray4, {RetBaseType}[] outArray, {Op1BaseType}[] maskArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfinArray4 = inArray4.Length * Unsafe.SizeOf<{Op1BaseType}>(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<{RetBaseType}>(); - if ((alignment != 64 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfinArray4 || (alignment * 8) < sizeOfoutArray) + int sizeOfmaskArray = maskArray.Length * Unsafe.SizeOf<{Op1BaseType}>(); + + if ((alignment != 64 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfinArray4 || (alignment * 8) < sizeOfoutArray || (alignment * 2) < sizeOfmaskArray) { throw new ArgumentException("Invalid value of alignment"); } - this.inArray1 = new byte[alignment * 2]; - this.inArray2 = new byte[alignment * 2]; - this.inArray3 = new byte[alignment * 2]; - this.inArray4 = new byte[alignment * 2]; - this.outArray = new byte[alignment * 8]; + this.inArray1 = new byte[alignment * 2]; + this.inArray2 = new byte[alignment * 2]; + this.inArray3 = new byte[alignment * 2]; + this.inArray4 = new byte[alignment * 2]; + this.outArray = new byte[alignment * 8]; + this.maskArray = new byte[alignment * 2]; - this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); - this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); - this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); - this.inHandle4 = GCHandle.Alloc(this.inArray4, GCHandleType.Pinned); - this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); + this.inHandle4 = GCHandle.Alloc(this.inArray4, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + this.maskHandle = GCHandle.Alloc(this.maskArray, GCHandleType.Pinned); this.alignment = (ulong)alignment; @@ -113,6 +119,7 @@ namespace JIT.HardwareIntrinsics.Arm Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As<{Op1BaseType}, byte>(ref inArray2[0]), (uint)sizeOfinArray2); Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray3Ptr), ref Unsafe.As<{Op1BaseType}, byte>(ref inArray3[0]), (uint)sizeOfinArray3); Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray4Ptr), ref Unsafe.As<{Op1BaseType}, byte>(ref inArray4[0]), (uint)sizeOfinArray4); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(maskArrayPtr), ref Unsafe.As<{Op1BaseType}, byte>(ref maskArray[0]), (uint)sizeOfmaskArray); } public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); @@ -120,6 +127,7 @@ namespace JIT.HardwareIntrinsics.Arm public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); public void* inArray4Ptr => Align((byte*)(inHandle4.AddrOfPinnedObject().ToPointer()), alignment); public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + public void* maskArrayPtr => Align((byte*)(maskHandle.AddrOfPinnedObject().ToPointer()), alignment); public void Dispose() { @@ -128,9 +136,10 @@ namespace JIT.HardwareIntrinsics.Arm inHandle3.Free(); inHandle4.Free(); outHandle.Free(); + maskHandle.Free(); } - private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + public static unsafe void* Align(byte* buffer, ulong expectedAlignment) { return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); } @@ -143,10 +152,14 @@ namespace JIT.HardwareIntrinsics.Arm public {Op1VectorType}<{Op1BaseType}> _fld2; public {Op1VectorType}<{Op1BaseType}> _fld3; public {Op1VectorType}<{Op1BaseType}> _fld4; + public {Op1VectorType}<{Op1BaseType}> _storeMask; + private GCHandle _outHandle; public static TestStruct Create() { var testStruct = new TestStruct(); + var rnd = new Random(); + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld1), ref Unsafe.As<{Op1BaseType}, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp1}; } @@ -155,58 +168,62 @@ namespace JIT.HardwareIntrinsics.Arm Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld3), ref Unsafe.As<{Op1BaseType}, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); for (var i = 0; i < Op4ElementCount; i++) { _data4[i] = {NextValueOp1}; } Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld4), ref Unsafe.As<{Op1BaseType}, byte>(ref _data4[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + for (var i = 0; i < maskElementCount; i++) { _maskData[i] = ({Op1BaseType})1; } + for (var i = 0; i < maskElementCount / 2; i++) { _maskData[rnd.Next(maskElementCount)] = ({Op1BaseType})0; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._storeMask), ref Unsafe.As<{Op1BaseType}, byte>(ref _maskData[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + + ulong alignment = (ulong)LargestVectorSize; + byte[] _outArray = new byte[alignment * 8]; + testStruct._outHandle = GCHandle.Alloc(_outArray, GCHandleType.Pinned); return testStruct; } - public void RunStructFldScenario(Storex4Test__{TestName} testClass) + public void* _outArrayPtr => DataTable.Align((byte*)(_outHandle.AddrOfPinnedObject().ToPointer()), (ulong)LargestVectorSize); + + public void Dispose() { - {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + _outHandle.Free(); + } - Sve.Store(storeMask, ({Op1BaseType}*)testClass._dataTable.outArrayPtr, (_fld1, _fld2, _fld3, _fld4)); + public void RunStructFldScenario(Storex4Test__{TestName} testClass) + { + Sve.StoreAndZip(_storeMask, ({Op1BaseType}*)_outArrayPtr, (_fld1, _fld2, _fld3, _fld4)); - testClass.ValidateResult(_fld1, _fld2, _fld3, _fld4, testClass._dataTable.outArrayPtr); + testClass.ValidateResult(_fld1, _fld2, _fld3, _fld4, _outArrayPtr, _storeMask); } } private static readonly int LargestVectorSize = {LargestVectorSize}; - private static readonly int Op1ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); - private static readonly int Op2ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); - private static readonly int Op3ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); - private static readonly int Op4ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); - private static readonly int RetElementCount = Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>() / sizeof({RetBaseType}) * 4; - - private static {Op1BaseType}[] _data1 = new {Op1BaseType}[Op1ElementCount]; - private static {Op1BaseType}[] _data2 = new {Op1BaseType}[Op2ElementCount]; - private static {Op1BaseType}[] _data3 = new {Op1BaseType}[Op3ElementCount]; - private static {Op1BaseType}[] _data4 = new {Op1BaseType}[Op4ElementCount]; + private static readonly int Op1ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); + private static readonly int Op2ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); + private static readonly int Op3ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); + private static readonly int Op4ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); + private static readonly int RetElementCount = Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>() / sizeof({RetBaseType}) * 4; + private static readonly int maskElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); - private {Op1VectorType}<{Op1BaseType}> _fld1; - private {Op1VectorType}<{Op1BaseType}> _fld2; - private {Op1VectorType}<{Op1BaseType}> _fld3; - private {Op1VectorType}<{Op1BaseType}> _fld4; + private static {Op1BaseType}[] _data1 = new {Op1BaseType}[Op1ElementCount]; + private static {Op1BaseType}[] _data2 = new {Op1BaseType}[Op2ElementCount]; + private static {Op1BaseType}[] _data3 = new {Op1BaseType}[Op3ElementCount]; + private static {Op1BaseType}[] _data4 = new {Op1BaseType}[Op4ElementCount]; + private static {Op1BaseType}[] _maskData = new {Op1BaseType}[maskElementCount]; private DataTable _dataTable; public Storex4Test__{TestName}() { Succeeded = true; - - for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } - Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref _fld1), ref Unsafe.As<{Op1BaseType}, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); - for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp1}; } - Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref _fld2), ref Unsafe.As<{Op1BaseType}, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); - for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = {NextValueOp1}; } - Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref _fld3), ref Unsafe.As<{Op1BaseType}, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); - for (var i = 0; i < Op4ElementCount; i++) { _data3[i] = {NextValueOp1}; } - Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref _fld4), ref Unsafe.As<{Op1BaseType}, byte>(ref _data4[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + var rnd = new Random(); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp1}; } for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = {NextValueOp1}; } for (var i = 0; i < Op4ElementCount; i++) { _data4[i] = {NextValueOp1}; } - _dataTable = new DataTable(_data1, _data2, _data3, _data4, new {RetBaseType}[RetElementCount], LargestVectorSize); + for (var i = 0; i < maskElementCount; i++) { _maskData[i] = ({Op1BaseType})1; } + for (var i = 0; i < maskElementCount / 2; i++) { _maskData[rnd.Next(maskElementCount)] = ({Op1BaseType})0; } + + _dataTable = new DataTable(_data1, _data2, _data3, _data4, new {RetBaseType}[RetElementCount], _maskData, LargestVectorSize); } public bool IsSupported => Sve.IsSupported; @@ -216,41 +233,38 @@ namespace JIT.HardwareIntrinsics.Arm public void RunBasicScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); - {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); - Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, + Sve.StoreAndZip(Unsafe.Read>(_dataTable.maskArrayPtr), ({Op1BaseType} *)_dataTable.outArrayPtr, (Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr), Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr), Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray3Ptr), Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray4Ptr)) ); - ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.inArray4Ptr, _dataTable.outArrayPtr); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.inArray4Ptr, _dataTable.outArrayPtr, _dataTable.maskArrayPtr); } public void RunBasicScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); {Op1VectorType}<{Op1BaseType}> loadMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); - {Op1VectorType}<{Op1BaseType}> storeMask = loadMask; - Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, + Sve.StoreAndZip(Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.maskArrayPtr)), ({Op1BaseType} *)_dataTable.outArrayPtr, (Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.inArray1Ptr)), Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.inArray2Ptr)), Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.inArray3Ptr)), Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.inArray4Ptr))) ); - ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.inArray4Ptr, _dataTable.outArrayPtr); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.inArray4Ptr, _dataTable.outArrayPtr, _dataTable.maskArrayPtr); } public void RunReflectionScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); - {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); - typeof(Sve).GetMethod(nameof(Sve.Store), new Type[] { typeof({Op1VectorType}<{Op1BaseType}>), typeof({Op1BaseType} *), typeof(({Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>)) }) - .Invoke(null, new object[] { storeMask, + typeof(Sve).GetMethod(nameof(Sve.StoreAndZip), new Type[] { typeof({Op1VectorType}<{Op1BaseType}>), typeof({Op1BaseType} *), typeof(({Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>)) }) + .Invoke(null, new object[] { Unsafe.Read>(_dataTable.maskArrayPtr), Pointer.Box(_dataTable.outArrayPtr, typeof({Op1BaseType}*)), (Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr), Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr), @@ -258,37 +272,37 @@ namespace JIT.HardwareIntrinsics.Arm Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray4Ptr)) }); - ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.inArray4Ptr, _dataTable.outArrayPtr); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.inArray4Ptr, _dataTable.outArrayPtr, _dataTable.maskArrayPtr); } public void RunLclVarScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); - {Op1VectorType}<{Op1BaseType}> op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr); - {Op1VectorType}<{Op1BaseType}> op2 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr); - {Op1VectorType}<{Op1BaseType}> op3 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray3Ptr); - {Op1VectorType}<{Op1BaseType}> op4 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray4Ptr); - {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + {Op1VectorType}<{Op1BaseType}> op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr); + {Op1VectorType}<{Op1BaseType}> op2 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr); + {Op1VectorType}<{Op1BaseType}> op3 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray3Ptr); + {Op1VectorType}<{Op1BaseType}> op4 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray4Ptr); + {Op1VectorType}<{Op1BaseType}> storeMask = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.maskArrayPtr); - Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (op1, op2, op3, op4)); + Sve.StoreAndZip(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (op1, op2, op3, op4)); - ValidateResult(op1, op2, op3, op4, _dataTable.outArrayPtr); + ValidateResult(op1, op2, op3, op4, _dataTable.outArrayPtr, storeMask); } public void RunClassFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); - {Op1VectorType}<{Op1BaseType}> op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr); - {Op1VectorType}<{Op1BaseType}> op2 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr); - {Op1VectorType}<{Op1BaseType}> op3 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray3Ptr); - {Op1VectorType}<{Op1BaseType}> op4 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray4Ptr); - {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); + {Op1VectorType}<{Op1BaseType}> op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr); + {Op1VectorType}<{Op1BaseType}> op2 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr); + {Op1VectorType}<{Op1BaseType}> op3 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray3Ptr); + {Op1VectorType}<{Op1BaseType}> op4 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray4Ptr); + {Op1VectorType}<{Op1BaseType}> storeMask = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.maskArrayPtr); - Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (op1, op2, op3, op4)); + Sve.StoreAndZip(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (op1, op2, op3, op4)); - ValidateResult(op1, op2, op3, op4, _dataTable.outArrayPtr); + ValidateResult(op1, op2, op3, op4, _dataTable.outArrayPtr, storeMask); } public void RunStructLclFldScenario() @@ -296,10 +310,9 @@ namespace JIT.HardwareIntrinsics.Arm TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); var test = TestStruct.Create(); - {Op1VectorType}<{Op1BaseType}> storeMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); - Sve.Store(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (test._fld1, test._fld2, test._fld3, test._fld4)); + Sve.StoreAndZip(test._storeMask, ({Op1BaseType} *)test._outArrayPtr, (test._fld1, test._fld2, test._fld3, test._fld4)); - ValidateResult(test._fld1, test._fld2, test._fld3, test._fld4, _dataTable.outArrayPtr); + ValidateResult(test._fld1, test._fld2, test._fld3, test._fld4, test._outArrayPtr, test._storeMask); } public void RunStructFldScenario() @@ -331,41 +344,45 @@ namespace JIT.HardwareIntrinsics.Arm } } - private void ValidateResult({Op1VectorType}<{Op1BaseType}> op1, {Op1VectorType}<{Op1BaseType}> op2, {Op1VectorType}<{Op1BaseType}> op3, {Op1VectorType}<{Op1BaseType}> op4, void* result, [CallerMemberName] string method = "") + private void ValidateResult({Op1VectorType}<{Op1BaseType}> op1, {Op1VectorType}<{Op1BaseType}> op2, {Op1VectorType}<{Op1BaseType}> op3, {Op1VectorType}<{Op1BaseType}> op4, void* result, {Op1VectorType}<{Op1BaseType}> storeMask, [CallerMemberName] string method = "") { - {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; - {Op1BaseType}[] inArray2 = new {Op1BaseType}[Op2ElementCount]; - {Op1BaseType}[] inArray3 = new {Op1BaseType}[Op3ElementCount]; - {Op1BaseType}[] inArray4 = new {Op1BaseType}[Op4ElementCount]; - {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; + {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; + {Op1BaseType}[] inArray2 = new {Op1BaseType}[Op2ElementCount]; + {Op1BaseType}[] inArray3 = new {Op1BaseType}[Op3ElementCount]; + {Op1BaseType}[] inArray4 = new {Op1BaseType}[Op4ElementCount]; + {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; + {Op1BaseType}[] maskArray = new {Op1BaseType}[maskElementCount]; Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), op1); Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray2[0]), op2); Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray3[0]), op3); Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray4[0]), op4); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref maskArray[0]), storeMask); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>() * 4); - ValidateResult(inArray1, inArray2, inArray3, inArray4, outArray, method); + ValidateResult(inArray1, inArray2, inArray3, inArray4, outArray, maskArray, method); } - private void ValidateResult(void* op1, void* op2, void* op3, void* op4, void* result, [CallerMemberName] string method = "") + private void ValidateResult(void* op1, void* op2, void* op3, void* op4, void* result, void* mask, [CallerMemberName] string method = "") { - {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; - {Op1BaseType}[] inArray2 = new {Op1BaseType}[Op2ElementCount]; - {Op1BaseType}[] inArray3 = new {Op1BaseType}[Op3ElementCount]; - {Op1BaseType}[] inArray4 = new {Op1BaseType}[Op4ElementCount]; - {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; + {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; + {Op1BaseType}[] inArray2 = new {Op1BaseType}[Op2ElementCount]; + {Op1BaseType}[] inArray3 = new {Op1BaseType}[Op3ElementCount]; + {Op1BaseType}[] inArray4 = new {Op1BaseType}[Op4ElementCount]; + {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; + {Op1BaseType}[] maskArray = new {Op1BaseType}[maskElementCount]; Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray3[0]), ref Unsafe.AsRef(op3), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray4[0]), ref Unsafe.AsRef(op4), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>() * 4); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref maskArray[0]), ref Unsafe.AsRef(mask), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); - ValidateResult(inArray1, inArray2, inArray3, inArray4, outArray, method); + ValidateResult(inArray1, inArray2, inArray3, inArray4, outArray, maskArray, method); } - private void ValidateResult({Op1BaseType}[] first, {Op1BaseType}[] second, {Op1BaseType}[] third, {Op1BaseType}[] fourth, {RetBaseType}[] result, [CallerMemberName] string method = "") + private void ValidateResult({Op1BaseType}[] first, {Op1BaseType}[] second, {Op1BaseType}[] third, {Op1BaseType}[] fourth, {RetBaseType}[] result, {Op1BaseType}[] maskArray, [CallerMemberName] string method = "") { bool succeeded = true; @@ -381,11 +398,12 @@ namespace JIT.HardwareIntrinsics.Arm if (!succeeded) { - TestLibrary.TestFramework.LogInformation($"{nameof(Sve)}.{nameof(Sve.Store)}<{Op1BaseType}>({Op1VectorType}<{Op1BaseType}>, {Op1BaseType}*, ({Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>)): {method} failed:"); + TestLibrary.TestFramework.LogInformation($"{nameof(Sve)}.{nameof(Sve.StoreAndZip)}<{Op1BaseType}>({Op1VectorType}<{Op1BaseType}>, {Op1BaseType}*, ({Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>)): {method} failed:"); TestLibrary.TestFramework.LogInformation($" first: ({string.Join(", ", first)})"); TestLibrary.TestFramework.LogInformation($" second: ({string.Join(", ", second)})"); TestLibrary.TestFramework.LogInformation($" third: ({string.Join(", ", third)})"); TestLibrary.TestFramework.LogInformation($" fourth: ({string.Join(", ", fourth)})"); + TestLibrary.TestFramework.LogInformation($" mask: ({string.Join(", ", maskArray)})"); TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); TestLibrary.TestFramework.LogInformation(string.Empty); From 7aa7eee85d778842cdf9b1856fc55443029816b9 Mon Sep 17 00:00:00 2001 From: Swapnil Gaikwad Date: Wed, 22 May 2024 16:13:02 +0100 Subject: [PATCH 5/5] Refactor test templates --- .../Arm/Shared/SveStoreAndZipTest.template | 32 +++++++++---------- .../Arm/Shared/SveStoreAndZipTestx2.template | 32 +++++++++---------- .../Arm/Shared/SveStoreAndZipTestx3.template | 32 +++++++++---------- .../Arm/Shared/SveStoreAndZipTestx4.template | 32 +++++++++---------- 4 files changed, 64 insertions(+), 64 deletions(-) diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreAndZipTest.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreAndZipTest.template index 41a2f8a86beea3..d8294856452ac2 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreAndZipTest.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreAndZipTest.template @@ -135,8 +135,8 @@ namespace JIT.HardwareIntrinsics.Arm for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld1), ref Unsafe.As<{Op1BaseType}, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); - for (var i = 0; i < maskElementCount; i++) { _maskData[i] = ({Op1BaseType})1; } - for (var i = 0; i < maskElementCount / 2; i++) { _maskData[rnd.Next(maskElementCount)] = ({Op1BaseType})0; } + for (var i = 0; i < MaskElementCount; i++) { _maskData[i] = ({Op1BaseType})1; } + for (var i = 0; i < MaskElementCount / 2; i++) { _maskData[rnd.Next(MaskElementCount)] = ({Op1BaseType})0; } Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._storeMask), ref Unsafe.As<{Op1BaseType}, byte>(ref _maskData[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); ulong alignment = (ulong)LargestVectorSize; @@ -155,7 +155,7 @@ namespace JIT.HardwareIntrinsics.Arm public void RunStructFldScenario(StoreTest__{TestName} testClass) { - Sve.StoreAndZip(_storeMask, ({Op1BaseType}*) _outArrayPtr, _fld1); + Sve.{Method}(_storeMask, ({Op1BaseType}*) _outArrayPtr, _fld1); testClass.ValidateResult(_fld1, _outArrayPtr, _storeMask); } @@ -165,10 +165,10 @@ namespace JIT.HardwareIntrinsics.Arm private static readonly int Op1ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); private static readonly int RetElementCount = Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>() / sizeof({RetBaseType}); - private static readonly int maskElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); + private static readonly int MaskElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); private static {Op1BaseType}[] _data1 = new {Op1BaseType}[Op1ElementCount]; - private static {Op1BaseType}[] _maskData = new {Op1BaseType}[maskElementCount]; + private static {Op1BaseType}[] _maskData = new {Op1BaseType}[MaskElementCount]; private DataTable _dataTable; @@ -178,8 +178,8 @@ namespace JIT.HardwareIntrinsics.Arm var rnd = new Random(); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } - for (var i = 0; i < maskElementCount; i++) { _maskData[i] = ({Op1BaseType})1; } - for (var i = 0; i < maskElementCount / 2; i++) { _maskData[rnd.Next(maskElementCount)] = ({Op1BaseType})0; } + for (var i = 0; i < MaskElementCount; i++) { _maskData[i] = ({Op1BaseType})1; } + for (var i = 0; i < MaskElementCount / 2; i++) { _maskData[rnd.Next(MaskElementCount)] = ({Op1BaseType})0; } _dataTable = new DataTable(_data1, new {RetBaseType}[RetElementCount], _maskData, LargestVectorSize); } @@ -192,7 +192,7 @@ namespace JIT.HardwareIntrinsics.Arm { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); - Sve.StoreAndZip(Unsafe.Read>(_dataTable.maskArrayPtr), ({Op1BaseType} *)_dataTable.outArrayPtr, Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr)); + Sve.{Method}(Unsafe.Read>(_dataTable.maskArrayPtr), ({Op1BaseType} *)_dataTable.outArrayPtr, Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr)); ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr, _dataTable.maskArrayPtr); } @@ -202,7 +202,7 @@ namespace JIT.HardwareIntrinsics.Arm TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); {Op1VectorType}<{Op1BaseType}> loadMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); - Sve.StoreAndZip(Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.maskArrayPtr)), ({Op1BaseType} *)_dataTable.outArrayPtr, Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.inArray1Ptr))); + Sve.{Method}(Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.maskArrayPtr)), ({Op1BaseType} *)_dataTable.outArrayPtr, Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.inArray1Ptr))); ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr, _dataTable.maskArrayPtr); } @@ -211,7 +211,7 @@ namespace JIT.HardwareIntrinsics.Arm { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); - typeof(Sve).GetMethod(nameof(Sve.StoreAndZip), new Type[] { typeof({Op1VectorType}<{Op1BaseType}>), typeof({Op1BaseType} *), typeof({Op1VectorType}<{Op1BaseType}>) }) + typeof(Sve).GetMethod(nameof(Sve.{Method}), new Type[] { typeof({Op1VectorType}<{Op1BaseType}>), typeof({Op1BaseType} *), typeof({Op1VectorType}<{Op1BaseType}>) }) .Invoke(null, new object[] { Unsafe.Read>(_dataTable.maskArrayPtr), Pointer.Box(_dataTable.outArrayPtr, typeof({Op1BaseType}*)), Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr) }); @@ -226,7 +226,7 @@ namespace JIT.HardwareIntrinsics.Arm {Op1VectorType}<{Op1BaseType}> op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr); {Op1VectorType}<{Op1BaseType}> storeMask = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.maskArrayPtr); - Sve.StoreAndZip(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, op1); + Sve.{Method}(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, op1); ValidateResult(op1, _dataTable.outArrayPtr, storeMask); } @@ -238,7 +238,7 @@ namespace JIT.HardwareIntrinsics.Arm {Op1VectorType}<{Op1BaseType}> op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr); {Op1VectorType}<{Op1BaseType}> storeMask = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.maskArrayPtr); - Sve.StoreAndZip(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, op1); + Sve.{Method}(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, op1); ValidateResult(op1, _dataTable.outArrayPtr, storeMask); } @@ -248,7 +248,7 @@ namespace JIT.HardwareIntrinsics.Arm TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); var test = TestStruct.Create(); - Sve.StoreAndZip(test._storeMask, ({Op1BaseType} *)test._outArrayPtr, test._fld1); + Sve.{Method}(test._storeMask, ({Op1BaseType} *)test._outArrayPtr, test._fld1); ValidateResult(test._fld1, test._outArrayPtr, test._storeMask); } @@ -286,7 +286,7 @@ namespace JIT.HardwareIntrinsics.Arm { {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; - {Op1BaseType}[] maskArray = new {Op1BaseType}[maskElementCount]; + {Op1BaseType}[] maskArray = new {Op1BaseType}[MaskElementCount]; Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), op1); Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref maskArray[0]), storeMask); @@ -299,7 +299,7 @@ namespace JIT.HardwareIntrinsics.Arm { {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; - {Op1BaseType}[] maskArray = new {Op1BaseType}[maskElementCount]; + {Op1BaseType}[] maskArray = new {Op1BaseType}[MaskElementCount]; Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>()); @@ -323,7 +323,7 @@ namespace JIT.HardwareIntrinsics.Arm if (!succeeded) { - TestLibrary.TestFramework.LogInformation($"{nameof(Sve)}.{nameof(Sve.StoreAndZip)}<{Op1BaseType}>({Op1VectorType}<{Op1BaseType}>, {Op1BaseType}*, {Op1VectorType}<{Op1BaseType}>): {method} failed:"); + TestLibrary.TestFramework.LogInformation($"{nameof(Sve)}.{nameof(Sve.{Method})}<{Op1BaseType}>({Op1VectorType}<{Op1BaseType}>, {Op1BaseType}*, {Op1VectorType}<{Op1BaseType}>): {method} failed:"); TestLibrary.TestFramework.LogInformation($" first: ({string.Join(", ", first)})"); TestLibrary.TestFramework.LogInformation($" mask: ({string.Join(", ", maskArray)})"); TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreAndZipTestx2.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreAndZipTestx2.template index ddb753c6c53509..992d253246492b 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreAndZipTestx2.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreAndZipTestx2.template @@ -146,8 +146,8 @@ namespace JIT.HardwareIntrinsics.Arm Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld1), ref Unsafe.As<{Op1BaseType}, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp1}; } Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld2), ref Unsafe.As<{Op1BaseType}, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); - for (var i = 0; i < maskElementCount; i++) { _maskData[i] = ({Op1BaseType})1; } - for (var i = 0; i < maskElementCount / 2; i++) { _maskData[rnd.Next(maskElementCount)] = ({Op1BaseType})0; } + for (var i = 0; i < MaskElementCount; i++) { _maskData[i] = ({Op1BaseType})1; } + for (var i = 0; i < MaskElementCount / 2; i++) { _maskData[rnd.Next(MaskElementCount)] = ({Op1BaseType})0; } Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._storeMask), ref Unsafe.As<{Op1BaseType}, byte>(ref _maskData[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); ulong alignment = (ulong)LargestVectorSize; @@ -166,7 +166,7 @@ namespace JIT.HardwareIntrinsics.Arm public void RunStructFldScenario(Storex2Test__{TestName} testClass) { - Sve.StoreAndZip(_storeMask, ({Op1BaseType}*) _outArrayPtr, (_fld1, _fld2)); + Sve.{Method}(_storeMask, ({Op1BaseType}*) _outArrayPtr, (_fld1, _fld2)); testClass.ValidateResult(_fld1, _fld2, _outArrayPtr, _storeMask); } @@ -177,11 +177,11 @@ namespace JIT.HardwareIntrinsics.Arm private static readonly int Op1ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); private static readonly int Op2ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); private static readonly int RetElementCount = Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>() / sizeof({RetBaseType}) * 2; - private static readonly int maskElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); + private static readonly int MaskElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); private static {Op1BaseType}[] _data1 = new {Op1BaseType}[Op1ElementCount]; private static {Op1BaseType}[] _data2 = new {Op1BaseType}[Op2ElementCount]; - private static {Op1BaseType}[] _maskData = new {Op1BaseType}[maskElementCount]; + private static {Op1BaseType}[] _maskData = new {Op1BaseType}[MaskElementCount]; private DataTable _dataTable; @@ -192,8 +192,8 @@ namespace JIT.HardwareIntrinsics.Arm for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp1}; } - for (var i = 0; i < maskElementCount; i++) { _maskData[i] = ({Op1BaseType})1; } - for (var i = 0; i < maskElementCount / 2; i++) { _maskData[rnd.Next(maskElementCount)] = ({Op1BaseType})0; } + for (var i = 0; i < MaskElementCount; i++) { _maskData[i] = ({Op1BaseType})1; } + for (var i = 0; i < MaskElementCount / 2; i++) { _maskData[rnd.Next(MaskElementCount)] = ({Op1BaseType})0; } _dataTable = new DataTable(_data1, _data2, new {RetBaseType}[RetElementCount], _maskData, LargestVectorSize); } @@ -206,7 +206,7 @@ namespace JIT.HardwareIntrinsics.Arm { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); - Sve.StoreAndZip(Unsafe.Read>(_dataTable.maskArrayPtr), ({Op1BaseType} *)_dataTable.outArrayPtr, + Sve.{Method}(Unsafe.Read>(_dataTable.maskArrayPtr), ({Op1BaseType} *)_dataTable.outArrayPtr, (Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr), Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr)) ); @@ -219,7 +219,7 @@ namespace JIT.HardwareIntrinsics.Arm TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); {Op1VectorType}<{Op1BaseType}> loadMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); - Sve.StoreAndZip(Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.maskArrayPtr)), ({Op1BaseType} *)_dataTable.outArrayPtr, + Sve.{Method}(Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.maskArrayPtr)), ({Op1BaseType} *)_dataTable.outArrayPtr, (Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.inArray1Ptr)), Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.inArray2Ptr))) ); @@ -231,7 +231,7 @@ namespace JIT.HardwareIntrinsics.Arm { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); - typeof(Sve).GetMethod(nameof(Sve.StoreAndZip), new Type[] { typeof({Op1VectorType}<{Op1BaseType}>), typeof({Op1BaseType} *), typeof(({Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>)) }) + typeof(Sve).GetMethod(nameof(Sve.{Method}), new Type[] { typeof({Op1VectorType}<{Op1BaseType}>), typeof({Op1BaseType} *), typeof(({Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>)) }) .Invoke(null, new object[] { Unsafe.Read>(_dataTable.maskArrayPtr), Pointer.Box(_dataTable.outArrayPtr, typeof({Op1BaseType}*)), (Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr), @@ -249,7 +249,7 @@ namespace JIT.HardwareIntrinsics.Arm {Op1VectorType}<{Op1BaseType}> op2 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr); {Op1VectorType}<{Op1BaseType}> storeMask = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.maskArrayPtr); - Sve.StoreAndZip(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (op1, op2)); + Sve.{Method}(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (op1, op2)); ValidateResult(op1, op2, _dataTable.outArrayPtr, storeMask); } @@ -262,7 +262,7 @@ namespace JIT.HardwareIntrinsics.Arm {Op1VectorType}<{Op1BaseType}> op2 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr); {Op1VectorType}<{Op1BaseType}> storeMask = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.maskArrayPtr); - Sve.StoreAndZip(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (op1, op2)); + Sve.{Method}(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (op1, op2)); ValidateResult(op1, op2, _dataTable.outArrayPtr, storeMask); } @@ -272,7 +272,7 @@ namespace JIT.HardwareIntrinsics.Arm TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); var test = TestStruct.Create(); - Sve.StoreAndZip(test._storeMask, ({Op1BaseType} *)test._outArrayPtr, (test._fld1, test._fld2)); + Sve.{Method}(test._storeMask, ({Op1BaseType} *)test._outArrayPtr, (test._fld1, test._fld2)); ValidateResult(test._fld1, test._fld2, test._outArrayPtr, test._storeMask); } @@ -311,7 +311,7 @@ namespace JIT.HardwareIntrinsics.Arm {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; {Op1BaseType}[] inArray2 = new {Op1BaseType}[Op2ElementCount]; {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; - {Op1BaseType}[] maskArray = new {Op1BaseType}[maskElementCount]; + {Op1BaseType}[] maskArray = new {Op1BaseType}[MaskElementCount]; Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), op1); Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray2[0]), op2); @@ -326,7 +326,7 @@ namespace JIT.HardwareIntrinsics.Arm {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; {Op1BaseType}[] inArray2 = new {Op1BaseType}[Op2ElementCount]; {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; - {Op1BaseType}[] maskArray = new {Op1BaseType}[maskElementCount]; + {Op1BaseType}[] maskArray = new {Op1BaseType}[MaskElementCount]; Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); @@ -352,7 +352,7 @@ namespace JIT.HardwareIntrinsics.Arm if (!succeeded) { - TestLibrary.TestFramework.LogInformation($"{nameof(Sve)}.{nameof(Sve.StoreAndZip)}<{Op1BaseType}>({Op1VectorType}<{Op1BaseType}>, {Op1BaseType}*, ({Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>)): {method} failed:"); + TestLibrary.TestFramework.LogInformation($"{nameof(Sve)}.{nameof(Sve.{Method})}<{Op1BaseType}>({Op1VectorType}<{Op1BaseType}>, {Op1BaseType}*, ({Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>)): {method} failed:"); TestLibrary.TestFramework.LogInformation($" first: ({string.Join(", ", first)})"); TestLibrary.TestFramework.LogInformation($" second: ({string.Join(", ", second)})"); TestLibrary.TestFramework.LogInformation($" mask: ({string.Join(", ", maskArray)})"); diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreAndZipTestx3.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreAndZipTestx3.template index 2f3b7aca446b78..cac8a3a542c29d 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreAndZipTestx3.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreAndZipTestx3.template @@ -157,8 +157,8 @@ namespace JIT.HardwareIntrinsics.Arm Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld2), ref Unsafe.As<{Op1BaseType}, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = {NextValueOp1}; } Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld3), ref Unsafe.As<{Op1BaseType}, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); - for (var i = 0; i < maskElementCount; i++) { _maskData[i] = ({Op1BaseType})1; } - for (var i = 0; i < maskElementCount / 2; i++) { _maskData[rnd.Next(maskElementCount)] = ({Op1BaseType})0; } + for (var i = 0; i < MaskElementCount; i++) { _maskData[i] = ({Op1BaseType})1; } + for (var i = 0; i < MaskElementCount / 2; i++) { _maskData[rnd.Next(MaskElementCount)] = ({Op1BaseType})0; } Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._storeMask), ref Unsafe.As<{Op1BaseType}, byte>(ref _maskData[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); ulong alignment = (ulong)LargestVectorSize; @@ -177,7 +177,7 @@ namespace JIT.HardwareIntrinsics.Arm public void RunStructFldScenario(Storex3Test__{TestName} testClass) { - Sve.StoreAndZip(_storeMask, ({Op1BaseType}*)_outArrayPtr, (_fld1, _fld2, _fld3)); + Sve.{Method}(_storeMask, ({Op1BaseType}*)_outArrayPtr, (_fld1, _fld2, _fld3)); testClass.ValidateResult(_fld1, _fld2, _fld3, _outArrayPtr, _storeMask); } @@ -189,12 +189,12 @@ namespace JIT.HardwareIntrinsics.Arm private static readonly int Op2ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); private static readonly int Op3ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); private static readonly int RetElementCount = Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>() / sizeof({RetBaseType}) * 3; - private static readonly int maskElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); + private static readonly int MaskElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); private static {Op1BaseType}[] _data1 = new {Op1BaseType}[Op1ElementCount]; private static {Op1BaseType}[] _data2 = new {Op1BaseType}[Op2ElementCount]; private static {Op1BaseType}[] _data3 = new {Op1BaseType}[Op3ElementCount]; - private static {Op1BaseType}[] _maskData = new {Op1BaseType}[maskElementCount]; + private static {Op1BaseType}[] _maskData = new {Op1BaseType}[MaskElementCount]; private DataTable _dataTable; @@ -206,8 +206,8 @@ namespace JIT.HardwareIntrinsics.Arm for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp1}; } for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = {NextValueOp1}; } - for (var i = 0; i < maskElementCount; i++) { _maskData[i] = ({Op1BaseType})1; } - for (var i = 0; i < maskElementCount / 2; i++) { _maskData[rnd.Next(maskElementCount)] = ({Op1BaseType})0; } + for (var i = 0; i < MaskElementCount; i++) { _maskData[i] = ({Op1BaseType})1; } + for (var i = 0; i < MaskElementCount / 2; i++) { _maskData[rnd.Next(MaskElementCount)] = ({Op1BaseType})0; } _dataTable = new DataTable(_data1, _data2, _data3, new {RetBaseType}[RetElementCount], _maskData, LargestVectorSize); } @@ -220,7 +220,7 @@ namespace JIT.HardwareIntrinsics.Arm { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); - Sve.StoreAndZip(Unsafe.Read>(_dataTable.maskArrayPtr), ({Op1BaseType} *)_dataTable.outArrayPtr, + Sve.{Method}(Unsafe.Read>(_dataTable.maskArrayPtr), ({Op1BaseType} *)_dataTable.outArrayPtr, (Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr), Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr), Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray3Ptr)) @@ -234,7 +234,7 @@ namespace JIT.HardwareIntrinsics.Arm TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); {Op1VectorType}<{Op1BaseType}> loadMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); - Sve.StoreAndZip(Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.maskArrayPtr)), ({Op1BaseType} *)_dataTable.outArrayPtr, + Sve.{Method}(Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.maskArrayPtr)), ({Op1BaseType} *)_dataTable.outArrayPtr, (Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.inArray1Ptr)), Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.inArray2Ptr)), Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.inArray3Ptr))) @@ -247,7 +247,7 @@ namespace JIT.HardwareIntrinsics.Arm { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); - typeof(Sve).GetMethod(nameof(Sve.StoreAndZip), new Type[] { typeof({Op1VectorType}<{Op1BaseType}>), typeof({Op1BaseType} *), typeof(({Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>)) }) + typeof(Sve).GetMethod(nameof(Sve.{Method}), new Type[] { typeof({Op1VectorType}<{Op1BaseType}>), typeof({Op1BaseType} *), typeof(({Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>)) }) .Invoke(null, new object[] { Unsafe.Read>(_dataTable.maskArrayPtr), Pointer.Box(_dataTable.outArrayPtr, typeof({Op1BaseType}*)), (Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr), @@ -267,7 +267,7 @@ namespace JIT.HardwareIntrinsics.Arm {Op1VectorType}<{Op1BaseType}> op3 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray3Ptr); {Op1VectorType}<{Op1BaseType}> storeMask = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.maskArrayPtr); - Sve.StoreAndZip(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (op1, op2, op3)); + Sve.{Method}(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (op1, op2, op3)); ValidateResult(op1, op2, op3, _dataTable.outArrayPtr, storeMask); } @@ -281,7 +281,7 @@ namespace JIT.HardwareIntrinsics.Arm {Op1VectorType}<{Op1BaseType}> op3 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray3Ptr); {Op1VectorType}<{Op1BaseType}> storeMask = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.maskArrayPtr); - Sve.StoreAndZip(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (op1, op2, op3)); + Sve.{Method}(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (op1, op2, op3)); ValidateResult(op1, op2, op3, _dataTable.outArrayPtr, storeMask); } @@ -291,7 +291,7 @@ namespace JIT.HardwareIntrinsics.Arm TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); var test = TestStruct.Create(); - Sve.StoreAndZip(test._storeMask, ({Op1BaseType} *)test._outArrayPtr, (test._fld1, test._fld2, test._fld3)); + Sve.{Method}(test._storeMask, ({Op1BaseType} *)test._outArrayPtr, (test._fld1, test._fld2, test._fld3)); ValidateResult(test._fld1, test._fld2, test._fld3, test._outArrayPtr, test._storeMask); } @@ -331,7 +331,7 @@ namespace JIT.HardwareIntrinsics.Arm {Op1BaseType}[] inArray2 = new {Op1BaseType}[Op2ElementCount]; {Op1BaseType}[] inArray3 = new {Op1BaseType}[Op3ElementCount]; {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; - {Op1BaseType}[] maskArray = new {Op1BaseType}[maskElementCount]; + {Op1BaseType}[] maskArray = new {Op1BaseType}[MaskElementCount]; Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), op1); Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray2[0]), op2); @@ -348,7 +348,7 @@ namespace JIT.HardwareIntrinsics.Arm {Op1BaseType}[] inArray2 = new {Op1BaseType}[Op2ElementCount]; {Op1BaseType}[] inArray3 = new {Op1BaseType}[Op3ElementCount]; {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; - {Op1BaseType}[] maskArray = new {Op1BaseType}[maskElementCount]; + {Op1BaseType}[] maskArray = new {Op1BaseType}[MaskElementCount]; Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); @@ -375,7 +375,7 @@ namespace JIT.HardwareIntrinsics.Arm if (!succeeded) { - TestLibrary.TestFramework.LogInformation($"{nameof(Sve)}.{nameof(Sve.StoreAndZip)}<{Op1BaseType}>({Op1VectorType}<{Op1BaseType}>, {Op1BaseType}*, ({Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>)): {method} failed:"); + TestLibrary.TestFramework.LogInformation($"{nameof(Sve)}.{nameof(Sve.{Method})}<{Op1BaseType}>({Op1VectorType}<{Op1BaseType}>, {Op1BaseType}*, ({Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>)): {method} failed:"); TestLibrary.TestFramework.LogInformation($" first: ({string.Join(", ", first)})"); TestLibrary.TestFramework.LogInformation($" second: ({string.Join(", ", second)})"); TestLibrary.TestFramework.LogInformation($" third: ({string.Join(", ", third)})"); diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreAndZipTestx4.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreAndZipTestx4.template index 6b6a40ebd08d98..81b13f0a5e3ab5 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreAndZipTestx4.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveStoreAndZipTestx4.template @@ -168,8 +168,8 @@ namespace JIT.HardwareIntrinsics.Arm Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld3), ref Unsafe.As<{Op1BaseType}, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); for (var i = 0; i < Op4ElementCount; i++) { _data4[i] = {NextValueOp1}; } Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld4), ref Unsafe.As<{Op1BaseType}, byte>(ref _data4[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); - for (var i = 0; i < maskElementCount; i++) { _maskData[i] = ({Op1BaseType})1; } - for (var i = 0; i < maskElementCount / 2; i++) { _maskData[rnd.Next(maskElementCount)] = ({Op1BaseType})0; } + for (var i = 0; i < MaskElementCount; i++) { _maskData[i] = ({Op1BaseType})1; } + for (var i = 0; i < MaskElementCount / 2; i++) { _maskData[rnd.Next(MaskElementCount)] = ({Op1BaseType})0; } Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._storeMask), ref Unsafe.As<{Op1BaseType}, byte>(ref _maskData[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); ulong alignment = (ulong)LargestVectorSize; @@ -188,7 +188,7 @@ namespace JIT.HardwareIntrinsics.Arm public void RunStructFldScenario(Storex4Test__{TestName} testClass) { - Sve.StoreAndZip(_storeMask, ({Op1BaseType}*)_outArrayPtr, (_fld1, _fld2, _fld3, _fld4)); + Sve.{Method}(_storeMask, ({Op1BaseType}*)_outArrayPtr, (_fld1, _fld2, _fld3, _fld4)); testClass.ValidateResult(_fld1, _fld2, _fld3, _fld4, _outArrayPtr, _storeMask); } @@ -201,13 +201,13 @@ namespace JIT.HardwareIntrinsics.Arm private static readonly int Op3ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); private static readonly int Op4ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); private static readonly int RetElementCount = Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>() / sizeof({RetBaseType}) * 4; - private static readonly int maskElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); + private static readonly int MaskElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); private static {Op1BaseType}[] _data1 = new {Op1BaseType}[Op1ElementCount]; private static {Op1BaseType}[] _data2 = new {Op1BaseType}[Op2ElementCount]; private static {Op1BaseType}[] _data3 = new {Op1BaseType}[Op3ElementCount]; private static {Op1BaseType}[] _data4 = new {Op1BaseType}[Op4ElementCount]; - private static {Op1BaseType}[] _maskData = new {Op1BaseType}[maskElementCount]; + private static {Op1BaseType}[] _maskData = new {Op1BaseType}[MaskElementCount]; private DataTable _dataTable; @@ -220,8 +220,8 @@ namespace JIT.HardwareIntrinsics.Arm for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp1}; } for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = {NextValueOp1}; } for (var i = 0; i < Op4ElementCount; i++) { _data4[i] = {NextValueOp1}; } - for (var i = 0; i < maskElementCount; i++) { _maskData[i] = ({Op1BaseType})1; } - for (var i = 0; i < maskElementCount / 2; i++) { _maskData[rnd.Next(maskElementCount)] = ({Op1BaseType})0; } + for (var i = 0; i < MaskElementCount; i++) { _maskData[i] = ({Op1BaseType})1; } + for (var i = 0; i < MaskElementCount / 2; i++) { _maskData[rnd.Next(MaskElementCount)] = ({Op1BaseType})0; } _dataTable = new DataTable(_data1, _data2, _data3, _data4, new {RetBaseType}[RetElementCount], _maskData, LargestVectorSize); } @@ -234,7 +234,7 @@ namespace JIT.HardwareIntrinsics.Arm { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); - Sve.StoreAndZip(Unsafe.Read>(_dataTable.maskArrayPtr), ({Op1BaseType} *)_dataTable.outArrayPtr, + Sve.{Method}(Unsafe.Read>(_dataTable.maskArrayPtr), ({Op1BaseType} *)_dataTable.outArrayPtr, (Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr), Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray2Ptr), Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray3Ptr), @@ -249,7 +249,7 @@ namespace JIT.HardwareIntrinsics.Arm TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); {Op1VectorType}<{Op1BaseType}> loadMask = Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All); - Sve.StoreAndZip(Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.maskArrayPtr)), ({Op1BaseType} *)_dataTable.outArrayPtr, + Sve.{Method}(Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.maskArrayPtr)), ({Op1BaseType} *)_dataTable.outArrayPtr, (Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.inArray1Ptr)), Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.inArray2Ptr)), Sve.LoadVector(loadMask, ({Op1BaseType}*)(_dataTable.inArray3Ptr)), @@ -263,7 +263,7 @@ namespace JIT.HardwareIntrinsics.Arm { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); - typeof(Sve).GetMethod(nameof(Sve.StoreAndZip), new Type[] { typeof({Op1VectorType}<{Op1BaseType}>), typeof({Op1BaseType} *), typeof(({Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>)) }) + typeof(Sve).GetMethod(nameof(Sve.{Method}), new Type[] { typeof({Op1VectorType}<{Op1BaseType}>), typeof({Op1BaseType} *), typeof(({Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>)) }) .Invoke(null, new object[] { Unsafe.Read>(_dataTable.maskArrayPtr), Pointer.Box(_dataTable.outArrayPtr, typeof({Op1BaseType}*)), (Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr), @@ -285,7 +285,7 @@ namespace JIT.HardwareIntrinsics.Arm {Op1VectorType}<{Op1BaseType}> op4 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray4Ptr); {Op1VectorType}<{Op1BaseType}> storeMask = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.maskArrayPtr); - Sve.StoreAndZip(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (op1, op2, op3, op4)); + Sve.{Method}(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (op1, op2, op3, op4)); ValidateResult(op1, op2, op3, op4, _dataTable.outArrayPtr, storeMask); } @@ -300,7 +300,7 @@ namespace JIT.HardwareIntrinsics.Arm {Op1VectorType}<{Op1BaseType}> op4 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray4Ptr); {Op1VectorType}<{Op1BaseType}> storeMask = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.maskArrayPtr); - Sve.StoreAndZip(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (op1, op2, op3, op4)); + Sve.{Method}(storeMask, ({Op1BaseType} *)_dataTable.outArrayPtr, (op1, op2, op3, op4)); ValidateResult(op1, op2, op3, op4, _dataTable.outArrayPtr, storeMask); } @@ -310,7 +310,7 @@ namespace JIT.HardwareIntrinsics.Arm TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); var test = TestStruct.Create(); - Sve.StoreAndZip(test._storeMask, ({Op1BaseType} *)test._outArrayPtr, (test._fld1, test._fld2, test._fld3, test._fld4)); + Sve.{Method}(test._storeMask, ({Op1BaseType} *)test._outArrayPtr, (test._fld1, test._fld2, test._fld3, test._fld4)); ValidateResult(test._fld1, test._fld2, test._fld3, test._fld4, test._outArrayPtr, test._storeMask); } @@ -351,7 +351,7 @@ namespace JIT.HardwareIntrinsics.Arm {Op1BaseType}[] inArray3 = new {Op1BaseType}[Op3ElementCount]; {Op1BaseType}[] inArray4 = new {Op1BaseType}[Op4ElementCount]; {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; - {Op1BaseType}[] maskArray = new {Op1BaseType}[maskElementCount]; + {Op1BaseType}[] maskArray = new {Op1BaseType}[MaskElementCount]; Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), op1); Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray2[0]), op2); @@ -370,7 +370,7 @@ namespace JIT.HardwareIntrinsics.Arm {Op1BaseType}[] inArray3 = new {Op1BaseType}[Op3ElementCount]; {Op1BaseType}[] inArray4 = new {Op1BaseType}[Op4ElementCount]; {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; - {Op1BaseType}[] maskArray = new {Op1BaseType}[maskElementCount]; + {Op1BaseType}[] maskArray = new {Op1BaseType}[MaskElementCount]; Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); @@ -398,7 +398,7 @@ namespace JIT.HardwareIntrinsics.Arm if (!succeeded) { - TestLibrary.TestFramework.LogInformation($"{nameof(Sve)}.{nameof(Sve.StoreAndZip)}<{Op1BaseType}>({Op1VectorType}<{Op1BaseType}>, {Op1BaseType}*, ({Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>)): {method} failed:"); + TestLibrary.TestFramework.LogInformation($"{nameof(Sve)}.{nameof(Sve.{Method})}<{Op1BaseType}>({Op1VectorType}<{Op1BaseType}>, {Op1BaseType}*, ({Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>, {Op1VectorType}<{Op1BaseType}>)): {method} failed:"); TestLibrary.TestFramework.LogInformation($" first: ({string.Join(", ", first)})"); TestLibrary.TestFramework.LogInformation($" second: ({string.Join(", ", second)})"); TestLibrary.TestFramework.LogInformation($" third: ({string.Join(", ", third)})");