From e78e4dfa04af456d7172101e8d85ed0766ceb533 Mon Sep 17 00:00:00 2001 From: TIHan Date: Mon, 17 Jun 2024 19:14:08 -0700 Subject: [PATCH 01/10] Initial work for Test* and Extract* SVE apis --- src/coreclr/jit/hwintrinsic.cpp | 43 +- src/coreclr/jit/hwintrinsiccodegenarm64.cpp | 6 + src/coreclr/jit/hwintrinsiclistarm64sve.h | 8 + .../Arm/Sve.PlatformNotSupported.cs | 486 +++++++++++++++++ .../src/System/Runtime/Intrinsics/Arm/Sve.cs | 487 ++++++++++++++++++ .../ref/System.Runtime.Intrinsics.cs | 76 +++ .../GenerateHWIntrinsicTests_Arm.cs | 9 + .../Arm/Shared/SveTestTest.template | 125 +++++ 8 files changed, 1225 insertions(+), 15 deletions(-) create mode 100644 src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveTestTest.template diff --git a/src/coreclr/jit/hwintrinsic.cpp b/src/coreclr/jit/hwintrinsic.cpp index f2f04b4a820a6..56b65ecb3d6ad 100644 --- a/src/coreclr/jit/hwintrinsic.cpp +++ b/src/coreclr/jit/hwintrinsic.cpp @@ -1638,27 +1638,40 @@ GenTree* Compiler::impHWIntrinsic(NamedIntrinsic intrinsic, { assert(numArgs > 0); GenTree* op1 = retNode->AsHWIntrinsic()->Op(1); - if (intrinsic == NI_Sve_ConditionalSelect) + + switch (intrinsic) { - if (op1->IsVectorAllBitsSet() || op1->IsMaskAllBitsSet()) - { - return retNode->AsHWIntrinsic()->Op(2); - } - else if (op1->IsVectorZero()) + case NI_Sve_ConditionalSelect: { - return retNode->AsHWIntrinsic()->Op(3); + if (op1->IsVectorAllBitsSet() || op1->IsMaskAllBitsSet()) + { + return retNode->AsHWIntrinsic()->Op(2); + } + else if (op1->IsVectorZero()) + { + return retNode->AsHWIntrinsic()->Op(3); + } + break; } - } - else if (intrinsic == NI_Sve_GetActiveElementCount) - { - GenTree* op2 = retNode->AsHWIntrinsic()->Op(2); - // HWInstrinsic requires a mask for op2 - if (!varTypeIsMask(op2)) + case NI_Sve_GetActiveElementCount: + case NI_Sve_TestAnyTrue: + case NI_Sve_TestFirstTrue: + case NI_Sve_TestLastTrue: { - retNode->AsHWIntrinsic()->Op(2) = - gtNewSimdCvtVectorToMaskNode(TYP_MASK, op2, simdBaseJitType, simdSize); + GenTree* op2 = retNode->AsHWIntrinsic()->Op(2); + + // HWInstrinsic requires a mask for op2 + if (!varTypeIsMask(op2)) + { + retNode->AsHWIntrinsic()->Op(2) = + gtNewSimdCvtVectorToMaskNode(TYP_MASK, op2, simdBaseJitType, simdSize); + } + break; } + + default: + break; } if (!varTypeIsMask(op1)) diff --git a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp index 38a480ae77ef5..e36ff199aa9d4 100644 --- a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp +++ b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp @@ -2056,6 +2056,12 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) INS_SCALABLE_OPTS_LSL_N); break; } + + case NI_Sve_TestAnyTrue: + GetEmitter()->emitIns_R_R(INS_sve_ptest, EA_SCALABLE, op1Reg, op2Reg, INS_OPTS_SCALABLE_B); + GetEmitter()->emitIns_R_COND(INS_cset, EA_8BYTE, targetReg, INS_COND_EQ); // TODO + break; + default: unreached(); } diff --git a/src/coreclr/jit/hwintrinsiclistarm64sve.h b/src/coreclr/jit/hwintrinsiclistarm64sve.h index 600c1c7d9eaaa..85c90df8671cf 100644 --- a/src/coreclr/jit/hwintrinsiclistarm64sve.h +++ b/src/coreclr/jit/hwintrinsiclistarm64sve.h @@ -69,6 +69,11 @@ HARDWARE_INTRINSIC(Sve, CreateWhileLessThanOrEqualMask8Bit, HARDWARE_INTRINSIC(Sve, Divide, -1, 2, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sdiv, INS_sve_udiv, INS_sve_sdiv, INS_sve_udiv, INS_sve_fdiv, INS_sve_fdiv}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_HasRMWSemantics|HW_Flag_LowMaskedOperation) HARDWARE_INTRINSIC(Sve, DotProduct, -1, 3, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sdot, INS_sve_udot, INS_sve_sdot, INS_sve_udot, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasRMWSemantics) HARDWARE_INTRINSIC(Sve, DotProductBySelectedScalar, -1, 4, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sdot, INS_sve_udot, INS_sve_sdot, INS_sve_udot, INS_invalid, INS_invalid}, HW_Category_SIMDByIndexedElement, HW_Flag_Scalable|HW_Flag_BaseTypeFromFirstArg|HW_Flag_HasImmediateOperand|HW_Flag_HasRMWSemantics|HW_Flag_LowVectorOperation) +HARDWARE_INTRINSIC(Sve, ExtractAfterLastScalar, -1, -1, false, {INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation) +HARDWARE_INTRINSIC(Sve, ExtractAfterLastVector, -1, -1, false, {INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation) +HARDWARE_INTRINSIC(Sve, ExtractLastScalar, -1, -1, false, {INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation) +HARDWARE_INTRINSIC(Sve, ExtractLastVector, -1, -1, false, {INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation) +HARDWARE_INTRINSIC(Sve, ExtractVector, -1, 3, true, {INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext}, HW_Category_SIMD, HW_Flag_Scalable) HARDWARE_INTRINSIC(Sve, FusedMultiplyAdd, -1, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_fmla, INS_sve_fmla}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_HasRMWSemantics|HW_Flag_LowMaskedOperation|HW_Flag_FmaIntrinsic|HW_Flag_SpecialCodeGen) HARDWARE_INTRINSIC(Sve, FusedMultiplyAddBySelectedScalar, -1, 4, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_fmla, INS_sve_fmla}, HW_Category_SIMDByIndexedElement, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasRMWSemantics|HW_Flag_FmaIntrinsic|HW_Flag_LowVectorOperation) HARDWARE_INTRINSIC(Sve, FusedMultiplyAddNegated, -1, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_fnmla, INS_sve_fnmla}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_HasRMWSemantics|HW_Flag_LowMaskedOperation|HW_Flag_FmaIntrinsic|HW_Flag_SpecialCodeGen) @@ -189,6 +194,9 @@ HARDWARE_INTRINSIC(Sve, StoreNarrowing, HARDWARE_INTRINSIC(Sve, StoreNonTemporal, -1, 3, true, {INS_sve_stnt1b, INS_sve_stnt1b, INS_sve_stnt1h, INS_sve_stnt1h, INS_sve_stnt1w, INS_sve_stnt1w, INS_sve_stnt1d, INS_sve_stnt1d, INS_sve_stnt1w, INS_sve_stnt1d}, HW_Category_MemoryStore, HW_Flag_Scalable|HW_Flag_BaseTypeFromFirstArg|HW_Flag_ExplicitMaskedOperation|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, TestAnyTrue, -1, 2, true, {INS_sve_ptest, INS_sve_ptest, INS_sve_ptest, INS_sve_ptest, INS_sve_ptest, INS_sve_ptest, INS_sve_ptest, INS_sve_ptest, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_ExplicitMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_BaseTypeFromFirstArg|HW_Flag_SpecialCodeGen) +HARDWARE_INTRINSIC(Sve, TestFirstTrue, -1, 2, true, {INS_sve_ptest, INS_sve_ptest, INS_sve_ptest, INS_sve_ptest, INS_sve_ptest, INS_sve_ptest, INS_sve_ptest, INS_sve_ptest, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_ExplicitMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_BaseTypeFromFirstArg|HW_Flag_SpecialCodeGen) +HARDWARE_INTRINSIC(Sve, TestLastTrue, -1, 2, true, {INS_sve_ptest, INS_sve_ptest, INS_sve_ptest, INS_sve_ptest, INS_sve_ptest, INS_sve_ptest, INS_sve_ptest, INS_sve_ptest, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_ExplicitMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_BaseTypeFromFirstArg|HW_Flag_SpecialCodeGen) HARDWARE_INTRINSIC(Sve, TransposeEven, -1, 2, true, {INS_sve_trn1, INS_sve_trn1, INS_sve_trn1, INS_sve_trn1, INS_sve_trn1, INS_sve_trn1, INS_sve_trn1, INS_sve_trn1, INS_sve_trn1, INS_sve_trn1}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_SpecialCodeGen) HARDWARE_INTRINSIC(Sve, TransposeOdd, -1, 2, true, {INS_sve_trn2, INS_sve_trn2, INS_sve_trn2, INS_sve_trn2, INS_sve_trn2, INS_sve_trn2, INS_sve_trn2, INS_sve_trn2, INS_sve_trn2, INS_sve_trn2}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_SpecialCodeGen) 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) 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 493afebaab801..71a4becb052a3 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 @@ -1402,6 +1402,348 @@ internal Arm64() { } /// public static unsafe Vector DotProductBySelectedScalar(Vector addend, Vector left, Vector right, [ConstantExpected] byte rightIndex) { throw new PlatformNotSupportedException(); } + + /// + /// uint8_t svlasta[_u8](svbool_t pg, svuint8_t op) + /// LASTA Wresult, Pg, Zop.B + /// LASTA Bresult, Pg, Zop.B + /// + public static unsafe byte ExtractAfterLastScalar(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// float64_t svlasta[_f64](svbool_t pg, svfloat64_t op) + /// LASTA Xresult, Pg, Zop.D + /// LASTA Dresult, Pg, Zop.D + /// + public static unsafe double ExtractAfterLastScalar(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// int16_t svlasta[_s16](svbool_t pg, svint16_t op) + /// LASTA Wresult, Pg, Zop.H + /// LASTA Hresult, Pg, Zop.H + /// + public static unsafe short ExtractAfterLastScalar(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// int32_t svlasta[_s32](svbool_t pg, svint32_t op) + /// LASTA Wresult, Pg, Zop.S + /// LASTA Sresult, Pg, Zop.S + /// + public static unsafe int ExtractAfterLastScalar(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// int64_t svlasta[_s64](svbool_t pg, svint64_t op) + /// LASTA Xresult, Pg, Zop.D + /// LASTA Dresult, Pg, Zop.D + /// + public static unsafe long ExtractAfterLastScalar(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// int8_t svlasta[_s8](svbool_t pg, svint8_t op) + /// LASTA Wresult, Pg, Zop.B + /// LASTA Bresult, Pg, Zop.B + /// + public static unsafe sbyte ExtractAfterLastScalar(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// float32_t svlasta[_f32](svbool_t pg, svfloat32_t op) + /// LASTA Wresult, Pg, Zop.S + /// LASTA Sresult, Pg, Zop.S + /// + public static unsafe float ExtractAfterLastScalar(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// uint16_t svlasta[_u16](svbool_t pg, svuint16_t op) + /// LASTA Wresult, Pg, Zop.H + /// LASTA Hresult, Pg, Zop.H + /// + public static unsafe ushort ExtractAfterLastScalar(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// uint32_t svlasta[_u32](svbool_t pg, svuint32_t op) + /// LASTA Wresult, Pg, Zop.S + /// LASTA Sresult, Pg, Zop.S + /// + public static unsafe uint ExtractAfterLastScalar(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// uint64_t svlasta[_u64](svbool_t pg, svuint64_t op) + /// LASTA Xresult, Pg, Zop.D + /// LASTA Dresult, Pg, Zop.D + /// + public static unsafe ulong ExtractAfterLastScalar(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// uint8_t svlasta[_u8](svbool_t pg, svuint8_t op) + /// LASTA Wresult, Pg, Zop.B + /// LASTA Bresult, Pg, Zop.B + /// + public static unsafe Vector ExtractAfterLastVector(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// float64_t svlasta[_f64](svbool_t pg, svfloat64_t op) + /// LASTA Xresult, Pg, Zop.D + /// LASTA Dresult, Pg, Zop.D + /// + public static unsafe Vector ExtractAfterLastVector(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// int16_t svlasta[_s16](svbool_t pg, svint16_t op) + /// LASTA Wresult, Pg, Zop.H + /// LASTA Hresult, Pg, Zop.H + /// + public static unsafe Vector ExtractAfterLastVector(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// int32_t svlasta[_s32](svbool_t pg, svint32_t op) + /// LASTA Wresult, Pg, Zop.S + /// LASTA Sresult, Pg, Zop.S + /// + public static unsafe Vector ExtractAfterLastVector(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// int64_t svlasta[_s64](svbool_t pg, svint64_t op) + /// LASTA Xresult, Pg, Zop.D + /// LASTA Dresult, Pg, Zop.D + /// + public static unsafe Vector ExtractAfterLastVector(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// int8_t svlasta[_s8](svbool_t pg, svint8_t op) + /// LASTA Wresult, Pg, Zop.B + /// LASTA Bresult, Pg, Zop.B + /// + public static unsafe Vector ExtractAfterLastVector(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// float32_t svlasta[_f32](svbool_t pg, svfloat32_t op) + /// LASTA Wresult, Pg, Zop.S + /// LASTA Sresult, Pg, Zop.S + /// + public static unsafe Vector ExtractAfterLastVector(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// uint16_t svlasta[_u16](svbool_t pg, svuint16_t op) + /// LASTA Wresult, Pg, Zop.H + /// LASTA Hresult, Pg, Zop.H + /// + public static unsafe Vector ExtractAfterLastVector(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// uint32_t svlasta[_u32](svbool_t pg, svuint32_t op) + /// LASTA Wresult, Pg, Zop.S + /// LASTA Sresult, Pg, Zop.S + /// + public static unsafe Vector ExtractAfterLastVector(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// uint64_t svlasta[_u64](svbool_t pg, svuint64_t op) + /// LASTA Xresult, Pg, Zop.D + /// LASTA Dresult, Pg, Zop.D + /// + public static unsafe Vector ExtractAfterLastVector(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// uint8_t svlastb[_u8](svbool_t pg, svuint8_t op) + /// LASTB Wresult, Pg, Zop.B + /// LASTB Bresult, Pg, Zop.B + /// + public static unsafe byte ExtractLastScalar(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// float64_t svlastb[_f64](svbool_t pg, svfloat64_t op) + /// LASTB Xresult, Pg, Zop.D + /// LASTB Dresult, Pg, Zop.D + /// + public static unsafe double ExtractLastScalar(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// int16_t svlastb[_s16](svbool_t pg, svint16_t op) + /// LASTB Wresult, Pg, Zop.H + /// LASTB Hresult, Pg, Zop.H + /// + public static unsafe short ExtractLastScalar(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// int32_t svlastb[_s32](svbool_t pg, svint32_t op) + /// LASTB Wresult, Pg, Zop.S + /// LASTB Sresult, Pg, Zop.S + /// + public static unsafe int ExtractLastScalar(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// int64_t svlastb[_s64](svbool_t pg, svint64_t op) + /// LASTB Xresult, Pg, Zop.D + /// LASTB Dresult, Pg, Zop.D + /// + public static unsafe long ExtractLastScalar(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// int8_t svlastb[_s8](svbool_t pg, svint8_t op) + /// LASTB Wresult, Pg, Zop.B + /// LASTB Bresult, Pg, Zop.B + /// + public static unsafe sbyte ExtractLastScalar(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// float32_t svlastb[_f32](svbool_t pg, svfloat32_t op) + /// LASTB Wresult, Pg, Zop.S + /// LASTB Sresult, Pg, Zop.S + /// + public static unsafe float ExtractLastScalar(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// uint16_t svlastb[_u16](svbool_t pg, svuint16_t op) + /// LASTB Wresult, Pg, Zop.H + /// LASTB Hresult, Pg, Zop.H + /// + public static unsafe ushort ExtractLastScalar(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// uint32_t svlastb[_u32](svbool_t pg, svuint32_t op) + /// LASTB Wresult, Pg, Zop.S + /// LASTB Sresult, Pg, Zop.S + /// + public static unsafe uint ExtractLastScalar(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// uint64_t svlastb[_u64](svbool_t pg, svuint64_t op) + /// LASTB Xresult, Pg, Zop.D + /// LASTB Dresult, Pg, Zop.D + /// + public static unsafe ulong ExtractLastScalar(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// uint8_t svlastb[_u8](svbool_t pg, svuint8_t op) + /// LASTB Wresult, Pg, Zop.B + /// LASTB Bresult, Pg, Zop.B + /// + public static unsafe Vector ExtractLastVector(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// float64_t svlastb[_f64](svbool_t pg, svfloat64_t op) + /// LASTB Xresult, Pg, Zop.D + /// LASTB Dresult, Pg, Zop.D + /// + public static unsafe Vector ExtractLastVector(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// int16_t svlastb[_s16](svbool_t pg, svint16_t op) + /// LASTB Wresult, Pg, Zop.H + /// LASTB Hresult, Pg, Zop.H + /// + public static unsafe Vector ExtractLastVector(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// int32_t svlastb[_s32](svbool_t pg, svint32_t op) + /// LASTB Wresult, Pg, Zop.S + /// LASTB Sresult, Pg, Zop.S + /// + public static unsafe Vector ExtractLastVector(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// int64_t svlastb[_s64](svbool_t pg, svint64_t op) + /// LASTB Xresult, Pg, Zop.D + /// LASTB Dresult, Pg, Zop.D + /// + public static unsafe Vector ExtractLastVector(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// int8_t svlastb[_s8](svbool_t pg, svint8_t op) + /// LASTB Wresult, Pg, Zop.B + /// LASTB Bresult, Pg, Zop.B + /// + public static unsafe Vector ExtractLastVector(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// float32_t svlastb[_f32](svbool_t pg, svfloat32_t op) + /// LASTB Wresult, Pg, Zop.S + /// LASTB Sresult, Pg, Zop.S + /// + public static unsafe Vector ExtractLastVector(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// uint16_t svlastb[_u16](svbool_t pg, svuint16_t op) + /// LASTB Wresult, Pg, Zop.H + /// LASTB Hresult, Pg, Zop.H + /// + public static unsafe Vector ExtractLastVector(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// uint32_t svlastb[_u32](svbool_t pg, svuint32_t op) + /// LASTB Wresult, Pg, Zop.S + /// LASTB Sresult, Pg, Zop.S + /// + public static unsafe Vector ExtractLastVector(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// uint64_t svlastb[_u64](svbool_t pg, svuint64_t op) + /// LASTB Xresult, Pg, Zop.D + /// LASTB Dresult, Pg, Zop.D + /// + public static unsafe Vector ExtractLastVector(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// svuint8_t svext[_u8](svuint8_t op1, svuint8_t op2, uint64_t imm3) + /// EXT Ztied1.B, Ztied1.B, Zop2.B, #imm3 + /// + public static unsafe Vector ExtractVector(Vector upper, Vector lower, [ConstantExpected] byte index) { throw new PlatformNotSupportedException(); } + + /// + /// svfloat64_t svext[_f64](svfloat64_t op1, svfloat64_t op2, uint64_t imm3) + /// EXT Ztied1.B, Ztied1.B, Zop2.B, #imm3 * 8 + /// + public static unsafe Vector ExtractVector(Vector upper, Vector lower, [ConstantExpected] byte index) { throw new PlatformNotSupportedException(); } + + /// + /// svint16_t svext[_s16](svint16_t op1, svint16_t op2, uint64_t imm3) + /// EXT Ztied1.B, Ztied1.B, Zop2.B, #imm3 * 2 + /// + public static unsafe Vector ExtractVector(Vector upper, Vector lower, [ConstantExpected] byte index) { throw new PlatformNotSupportedException(); } + + /// + /// svint32_t svext[_s32](svint32_t op1, svint32_t op2, uint64_t imm3) + /// EXT Ztied1.B, Ztied1.B, Zop2.B, #imm3 * 4 + /// + public static unsafe Vector ExtractVector(Vector upper, Vector lower, [ConstantExpected] byte index) { throw new PlatformNotSupportedException(); } + + /// + /// svint64_t svext[_s64](svint64_t op1, svint64_t op2, uint64_t imm3) + /// EXT Ztied1.B, Ztied1.B, Zop2.B, #imm3 * 8 + /// + public static unsafe Vector ExtractVector(Vector upper, Vector lower, [ConstantExpected] byte index) { throw new PlatformNotSupportedException(); } + + /// + /// svint8_t svext[_s8](svint8_t op1, svint8_t op2, uint64_t imm3) + /// EXT Ztied1.B, Ztied1.B, Zop2.B, #imm3 + /// + public static unsafe Vector ExtractVector(Vector upper, Vector lower, [ConstantExpected] byte index) { throw new PlatformNotSupportedException(); } + + /// + /// svfloat32_t svext[_f32](svfloat32_t op1, svfloat32_t op2, uint64_t imm3) + /// EXT Ztied1.B, Ztied1.B, Zop2.B, #imm3 * 4 + /// + public static unsafe Vector ExtractVector(Vector upper, Vector lower, [ConstantExpected] byte index) { throw new PlatformNotSupportedException(); } + + /// + /// svuint16_t svext[_u16](svuint16_t op1, svuint16_t op2, uint64_t imm3) + /// EXT Ztied1.B, Ztied1.B, Zop2.B, #imm3 * 2 + /// + public static unsafe Vector ExtractVector(Vector upper, Vector lower, [ConstantExpected] byte index) { throw new PlatformNotSupportedException(); } + + /// + /// svuint32_t svext[_u32](svuint32_t op1, svuint32_t op2, uint64_t imm3) + /// EXT Ztied1.B, Ztied1.B, Zop2.B, #imm3 * 4 + /// + public static unsafe Vector ExtractVector(Vector upper, Vector lower, [ConstantExpected] byte index) { throw new PlatformNotSupportedException(); } + + /// + /// svuint64_t svext[_u64](svuint64_t op1, svuint64_t op2, uint64_t imm3) + /// EXT Ztied1.B, Ztied1.B, Zop2.B, #imm3 * 8 + /// + public static unsafe Vector ExtractVector(Vector upper, Vector lower, [ConstantExpected] byte index) { throw new PlatformNotSupportedException(); } + + /// FusedMultiplyAdd : Multiply-add, addend first /// @@ -5598,6 +5940,150 @@ internal Arm64() { } /// public static unsafe Vector SignExtendWideningUpper(Vector value) { throw new PlatformNotSupportedException(); } + /// + /// bool svptest_any(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestAnyTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + + /// + /// bool svptest_any(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestAnyTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + + /// + /// bool svptest_any(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestAnyTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + + /// + /// bool svptest_any(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestAnyTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + + /// + /// bool svptest_any(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestAnyTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + + /// + /// bool svptest_any(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestAnyTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + + /// + /// bool svptest_any(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestAnyTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + + /// + /// bool svptest_any(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestAnyTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + + /// + /// bool svptest_first(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestFirstTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + + /// + /// bool svptest_first(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestFirstTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + + /// + /// bool svptest_first(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestFirstTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + + /// + /// bool svptest_first(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestFirstTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + + /// + /// bool svptest_first(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestFirstTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + + /// + /// bool svptest_first(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestFirstTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + + /// + /// bool svptest_first(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestFirstTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + + /// + /// bool svptest_first(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestFirstTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + + /// + /// bool svptest_last(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestLastTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + + /// + /// bool svptest_last(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestLastTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + + /// + /// bool svptest_last(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestLastTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + + /// + /// bool svptest_last(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestLastTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + + /// + /// bool svptest_last(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestLastTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + + /// + /// bool svptest_last(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestLastTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + + /// + /// bool svptest_last(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestLastTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + + /// + /// bool svptest_last(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestLastTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + /// Interleave even elements from two inputs 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 fba023cbb54c6..f52d67ded547d 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 @@ -1458,6 +1458,348 @@ internal Arm64() { } /// public static unsafe Vector DotProductBySelectedScalar(Vector addend, Vector left, Vector right, [ConstantExpected] byte rightIndex) => DotProductBySelectedScalar(addend, left, right, rightIndex); + + /// + /// uint8_t svlasta[_u8](svbool_t pg, svuint8_t op) + /// LASTA Wresult, Pg, Zop.B + /// LASTA Bresult, Pg, Zop.B + /// + public static unsafe byte ExtractAfterLastScalar(Vector value) => ExtractAfterLastScalar(value); + + /// + /// float64_t svlasta[_f64](svbool_t pg, svfloat64_t op) + /// LASTA Xresult, Pg, Zop.D + /// LASTA Dresult, Pg, Zop.D + /// + public static unsafe double ExtractAfterLastScalar(Vector value) => ExtractAfterLastScalar(value); + + /// + /// int16_t svlasta[_s16](svbool_t pg, svint16_t op) + /// LASTA Wresult, Pg, Zop.H + /// LASTA Hresult, Pg, Zop.H + /// + public static unsafe short ExtractAfterLastScalar(Vector value) => ExtractAfterLastScalar(value); + + /// + /// int32_t svlasta[_s32](svbool_t pg, svint32_t op) + /// LASTA Wresult, Pg, Zop.S + /// LASTA Sresult, Pg, Zop.S + /// + public static unsafe int ExtractAfterLastScalar(Vector value) => ExtractAfterLastScalar(value); + + /// + /// int64_t svlasta[_s64](svbool_t pg, svint64_t op) + /// LASTA Xresult, Pg, Zop.D + /// LASTA Dresult, Pg, Zop.D + /// + public static unsafe long ExtractAfterLastScalar(Vector value) => ExtractAfterLastScalar(value); + + /// + /// int8_t svlasta[_s8](svbool_t pg, svint8_t op) + /// LASTA Wresult, Pg, Zop.B + /// LASTA Bresult, Pg, Zop.B + /// + public static unsafe sbyte ExtractAfterLastScalar(Vector value) => ExtractAfterLastScalar(value); + + /// + /// float32_t svlasta[_f32](svbool_t pg, svfloat32_t op) + /// LASTA Wresult, Pg, Zop.S + /// LASTA Sresult, Pg, Zop.S + /// + public static unsafe float ExtractAfterLastScalar(Vector value) => ExtractAfterLastScalar(value); + + /// + /// uint16_t svlasta[_u16](svbool_t pg, svuint16_t op) + /// LASTA Wresult, Pg, Zop.H + /// LASTA Hresult, Pg, Zop.H + /// + public static unsafe ushort ExtractAfterLastScalar(Vector value) => ExtractAfterLastScalar(value); + + /// + /// uint32_t svlasta[_u32](svbool_t pg, svuint32_t op) + /// LASTA Wresult, Pg, Zop.S + /// LASTA Sresult, Pg, Zop.S + /// + public static unsafe uint ExtractAfterLastScalar(Vector value) => ExtractAfterLastScalar(value); + + /// + /// uint64_t svlasta[_u64](svbool_t pg, svuint64_t op) + /// LASTA Xresult, Pg, Zop.D + /// LASTA Dresult, Pg, Zop.D + /// + public static unsafe ulong ExtractAfterLastScalar(Vector value) => ExtractAfterLastScalar(value); + + /// + /// uint8_t svlasta[_u8](svbool_t pg, svuint8_t op) + /// LASTA Wresult, Pg, Zop.B + /// LASTA Bresult, Pg, Zop.B + /// + public static unsafe Vector ExtractAfterLastVector(Vector value) => ExtractAfterLastVector(value); + + /// + /// float64_t svlasta[_f64](svbool_t pg, svfloat64_t op) + /// LASTA Xresult, Pg, Zop.D + /// LASTA Dresult, Pg, Zop.D + /// + public static unsafe Vector ExtractAfterLastVector(Vector value) => ExtractAfterLastVector(value); + + /// + /// int16_t svlasta[_s16](svbool_t pg, svint16_t op) + /// LASTA Wresult, Pg, Zop.H + /// LASTA Hresult, Pg, Zop.H + /// + public static unsafe Vector ExtractAfterLastVector(Vector value) => ExtractAfterLastVector(value); + + /// + /// int32_t svlasta[_s32](svbool_t pg, svint32_t op) + /// LASTA Wresult, Pg, Zop.S + /// LASTA Sresult, Pg, Zop.S + /// + public static unsafe Vector ExtractAfterLastVector(Vector value) => ExtractAfterLastVector(value); + + /// + /// int64_t svlasta[_s64](svbool_t pg, svint64_t op) + /// LASTA Xresult, Pg, Zop.D + /// LASTA Dresult, Pg, Zop.D + /// + public static unsafe Vector ExtractAfterLastVector(Vector value) => ExtractAfterLastVector(value); + + /// + /// int8_t svlasta[_s8](svbool_t pg, svint8_t op) + /// LASTA Wresult, Pg, Zop.B + /// LASTA Bresult, Pg, Zop.B + /// + public static unsafe Vector ExtractAfterLastVector(Vector value) => ExtractAfterLastVector(value); + + /// + /// float32_t svlasta[_f32](svbool_t pg, svfloat32_t op) + /// LASTA Wresult, Pg, Zop.S + /// LASTA Sresult, Pg, Zop.S + /// + public static unsafe Vector ExtractAfterLastVector(Vector value) => ExtractAfterLastVector(value); + + /// + /// uint16_t svlasta[_u16](svbool_t pg, svuint16_t op) + /// LASTA Wresult, Pg, Zop.H + /// LASTA Hresult, Pg, Zop.H + /// + public static unsafe Vector ExtractAfterLastVector(Vector value) => ExtractAfterLastVector(value); + + /// + /// uint32_t svlasta[_u32](svbool_t pg, svuint32_t op) + /// LASTA Wresult, Pg, Zop.S + /// LASTA Sresult, Pg, Zop.S + /// + public static unsafe Vector ExtractAfterLastVector(Vector value) => ExtractAfterLastVector(value); + + /// + /// uint64_t svlasta[_u64](svbool_t pg, svuint64_t op) + /// LASTA Xresult, Pg, Zop.D + /// LASTA Dresult, Pg, Zop.D + /// + public static unsafe Vector ExtractAfterLastVector(Vector value) => ExtractAfterLastVector(value); + + /// + /// uint8_t svlastb[_u8](svbool_t pg, svuint8_t op) + /// LASTB Wresult, Pg, Zop.B + /// LASTB Bresult, Pg, Zop.B + /// + public static unsafe byte ExtractLastScalar(Vector value) => ExtractLastScalar(value); + + /// + /// float64_t svlastb[_f64](svbool_t pg, svfloat64_t op) + /// LASTB Xresult, Pg, Zop.D + /// LASTB Dresult, Pg, Zop.D + /// + public static unsafe double ExtractLastScalar(Vector value) => ExtractLastScalar(value); + + /// + /// int16_t svlastb[_s16](svbool_t pg, svint16_t op) + /// LASTB Wresult, Pg, Zop.H + /// LASTB Hresult, Pg, Zop.H + /// + public static unsafe short ExtractLastScalar(Vector value) => ExtractLastScalar(value); + + /// + /// int32_t svlastb[_s32](svbool_t pg, svint32_t op) + /// LASTB Wresult, Pg, Zop.S + /// LASTB Sresult, Pg, Zop.S + /// + public static unsafe int ExtractLastScalar(Vector value) => ExtractLastScalar(value); + + /// + /// int64_t svlastb[_s64](svbool_t pg, svint64_t op) + /// LASTB Xresult, Pg, Zop.D + /// LASTB Dresult, Pg, Zop.D + /// + public static unsafe long ExtractLastScalar(Vector value) => ExtractLastScalar(value); + + /// + /// int8_t svlastb[_s8](svbool_t pg, svint8_t op) + /// LASTB Wresult, Pg, Zop.B + /// LASTB Bresult, Pg, Zop.B + /// + public static unsafe sbyte ExtractLastScalar(Vector value) => ExtractLastScalar(value); + + /// + /// float32_t svlastb[_f32](svbool_t pg, svfloat32_t op) + /// LASTB Wresult, Pg, Zop.S + /// LASTB Sresult, Pg, Zop.S + /// + public static unsafe float ExtractLastScalar(Vector value) => ExtractLastScalar(value); + + /// + /// uint16_t svlastb[_u16](svbool_t pg, svuint16_t op) + /// LASTB Wresult, Pg, Zop.H + /// LASTB Hresult, Pg, Zop.H + /// + public static unsafe ushort ExtractLastScalar(Vector value) => ExtractLastScalar(value); + + /// + /// uint32_t svlastb[_u32](svbool_t pg, svuint32_t op) + /// LASTB Wresult, Pg, Zop.S + /// LASTB Sresult, Pg, Zop.S + /// + public static unsafe uint ExtractLastScalar(Vector value) => ExtractLastScalar(value); + + /// + /// uint64_t svlastb[_u64](svbool_t pg, svuint64_t op) + /// LASTB Xresult, Pg, Zop.D + /// LASTB Dresult, Pg, Zop.D + /// + public static unsafe ulong ExtractLastScalar(Vector value) => ExtractLastScalar(value); + + /// + /// uint8_t svlastb[_u8](svbool_t pg, svuint8_t op) + /// LASTB Wresult, Pg, Zop.B + /// LASTB Bresult, Pg, Zop.B + /// + public static unsafe Vector ExtractLastVector(Vector value) => ExtractLastVector(value); + + /// + /// float64_t svlastb[_f64](svbool_t pg, svfloat64_t op) + /// LASTB Xresult, Pg, Zop.D + /// LASTB Dresult, Pg, Zop.D + /// + public static unsafe Vector ExtractLastVector(Vector value) => ExtractLastVector(value); + + /// + /// int16_t svlastb[_s16](svbool_t pg, svint16_t op) + /// LASTB Wresult, Pg, Zop.H + /// LASTB Hresult, Pg, Zop.H + /// + public static unsafe Vector ExtractLastVector(Vector value) => ExtractLastVector(value); + + /// + /// int32_t svlastb[_s32](svbool_t pg, svint32_t op) + /// LASTB Wresult, Pg, Zop.S + /// LASTB Sresult, Pg, Zop.S + /// + public static unsafe Vector ExtractLastVector(Vector value) => ExtractLastVector(value); + + /// + /// int64_t svlastb[_s64](svbool_t pg, svint64_t op) + /// LASTB Xresult, Pg, Zop.D + /// LASTB Dresult, Pg, Zop.D + /// + public static unsafe Vector ExtractLastVector(Vector value) => ExtractLastVector(value); + + /// + /// int8_t svlastb[_s8](svbool_t pg, svint8_t op) + /// LASTB Wresult, Pg, Zop.B + /// LASTB Bresult, Pg, Zop.B + /// + public static unsafe Vector ExtractLastVector(Vector value) => ExtractLastVector(value); + + /// + /// float32_t svlastb[_f32](svbool_t pg, svfloat32_t op) + /// LASTB Wresult, Pg, Zop.S + /// LASTB Sresult, Pg, Zop.S + /// + public static unsafe Vector ExtractLastVector(Vector value) => ExtractLastVector(value); + + /// + /// uint16_t svlastb[_u16](svbool_t pg, svuint16_t op) + /// LASTB Wresult, Pg, Zop.H + /// LASTB Hresult, Pg, Zop.H + /// + public static unsafe Vector ExtractLastVector(Vector value) => ExtractLastVector(value); + + /// + /// uint32_t svlastb[_u32](svbool_t pg, svuint32_t op) + /// LASTB Wresult, Pg, Zop.S + /// LASTB Sresult, Pg, Zop.S + /// + public static unsafe Vector ExtractLastVector(Vector value) => ExtractLastVector(value); + + /// + /// uint64_t svlastb[_u64](svbool_t pg, svuint64_t op) + /// LASTB Xresult, Pg, Zop.D + /// LASTB Dresult, Pg, Zop.D + /// + public static unsafe Vector ExtractLastVector(Vector value) => ExtractLastVector(value); + + /// + /// svuint8_t svext[_u8](svuint8_t op1, svuint8_t op2, uint64_t imm3) + /// EXT Ztied1.B, Ztied1.B, Zop2.B, #imm3 + /// + public static unsafe Vector ExtractVector(Vector upper, Vector lower, [ConstantExpected] byte index) => ExtractVector(upper, lower, index); + + /// + /// svfloat64_t svext[_f64](svfloat64_t op1, svfloat64_t op2, uint64_t imm3) + /// EXT Ztied1.B, Ztied1.B, Zop2.B, #imm3 * 8 + /// + public static unsafe Vector ExtractVector(Vector upper, Vector lower, [ConstantExpected] byte index) => ExtractVector(upper, lower, index); + + /// + /// svint16_t svext[_s16](svint16_t op1, svint16_t op2, uint64_t imm3) + /// EXT Ztied1.B, Ztied1.B, Zop2.B, #imm3 * 2 + /// + public static unsafe Vector ExtractVector(Vector upper, Vector lower, [ConstantExpected] byte index) => ExtractVector(upper, lower, index); + + /// + /// svint32_t svext[_s32](svint32_t op1, svint32_t op2, uint64_t imm3) + /// EXT Ztied1.B, Ztied1.B, Zop2.B, #imm3 * 4 + /// + public static unsafe Vector ExtractVector(Vector upper, Vector lower, [ConstantExpected] byte index) => ExtractVector(upper, lower, index); + + /// + /// svint64_t svext[_s64](svint64_t op1, svint64_t op2, uint64_t imm3) + /// EXT Ztied1.B, Ztied1.B, Zop2.B, #imm3 * 8 + /// + public static unsafe Vector ExtractVector(Vector upper, Vector lower, [ConstantExpected] byte index) => ExtractVector(upper, lower, index); + + /// + /// svint8_t svext[_s8](svint8_t op1, svint8_t op2, uint64_t imm3) + /// EXT Ztied1.B, Ztied1.B, Zop2.B, #imm3 + /// + public static unsafe Vector ExtractVector(Vector upper, Vector lower, [ConstantExpected] byte index) => ExtractVector(upper, lower, index); + + /// + /// svfloat32_t svext[_f32](svfloat32_t op1, svfloat32_t op2, uint64_t imm3) + /// EXT Ztied1.B, Ztied1.B, Zop2.B, #imm3 * 4 + /// + public static unsafe Vector ExtractVector(Vector upper, Vector lower, [ConstantExpected] byte index) => ExtractVector(upper, lower, index); + + /// + /// svuint16_t svext[_u16](svuint16_t op1, svuint16_t op2, uint64_t imm3) + /// EXT Ztied1.B, Ztied1.B, Zop2.B, #imm3 * 2 + /// + public static unsafe Vector ExtractVector(Vector upper, Vector lower, [ConstantExpected] byte index) => ExtractVector(upper, lower, index); + + /// + /// svuint32_t svext[_u32](svuint32_t op1, svuint32_t op2, uint64_t imm3) + /// EXT Ztied1.B, Ztied1.B, Zop2.B, #imm3 * 4 + /// + public static unsafe Vector ExtractVector(Vector upper, Vector lower, [ConstantExpected] byte index) => ExtractVector(upper, lower, index); + + /// + /// svuint64_t svext[_u64](svuint64_t op1, svuint64_t op2, uint64_t imm3) + /// EXT Ztied1.B, Ztied1.B, Zop2.B, #imm3 * 8 + /// + public static unsafe Vector ExtractVector(Vector upper, Vector lower, [ConstantExpected] byte index) => ExtractVector(upper, lower, index); + + /// FusedMultiplyAdd : Multiply-add, addend first /// @@ -5640,6 +5982,151 @@ internal Arm64() { } public static unsafe Vector SubtractSaturate(Vector left, Vector right) => SubtractSaturate(left, right); + /// + /// bool svptest_any(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestAnyTrue(Vector leftMask, Vector rightMask) => TestAnyTrue(leftMask, rightMask); + + /// + /// bool svptest_any(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestAnyTrue(Vector leftMask, Vector rightMask) => TestAnyTrue(leftMask, rightMask); + + /// + /// bool svptest_any(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestAnyTrue(Vector leftMask, Vector rightMask) => TestAnyTrue(leftMask, rightMask); + + /// + /// bool svptest_any(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestAnyTrue(Vector leftMask, Vector rightMask) => TestAnyTrue(leftMask, rightMask); + + /// + /// bool svptest_any(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestAnyTrue(Vector leftMask, Vector rightMask) => TestAnyTrue(leftMask, rightMask); + + /// + /// bool svptest_any(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestAnyTrue(Vector leftMask, Vector rightMask) => TestAnyTrue(leftMask, rightMask); + + /// + /// bool svptest_any(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestAnyTrue(Vector leftMask, Vector rightMask) => TestAnyTrue(leftMask, rightMask); + + /// + /// bool svptest_any(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestAnyTrue(Vector leftMask, Vector rightMask) => TestAnyTrue(leftMask, rightMask); + + /// + /// bool svptest_first(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestFirstTrue(Vector leftMask, Vector rightMask) => TestFirstTrue(leftMask, rightMask); + + /// + /// bool svptest_first(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestFirstTrue(Vector leftMask, Vector rightMask) => TestFirstTrue(leftMask, rightMask); + + /// + /// bool svptest_first(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestFirstTrue(Vector leftMask, Vector rightMask) => TestFirstTrue(leftMask, rightMask); + + /// + /// bool svptest_first(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestFirstTrue(Vector leftMask, Vector rightMask) => TestFirstTrue(leftMask, rightMask); + + /// + /// bool svptest_first(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestFirstTrue(Vector leftMask, Vector rightMask) => TestFirstTrue(leftMask, rightMask); + + /// + /// bool svptest_first(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestFirstTrue(Vector leftMask, Vector rightMask) => TestFirstTrue(leftMask, rightMask); + + /// + /// bool svptest_first(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestFirstTrue(Vector leftMask, Vector rightMask) => TestFirstTrue(leftMask, rightMask); + + /// + /// bool svptest_first(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestFirstTrue(Vector leftMask, Vector rightMask) => TestFirstTrue(leftMask, rightMask); + + /// + /// bool svptest_last(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestLastTrue(Vector leftMask, Vector rightMask) => TestLastTrue(leftMask, rightMask); + + /// + /// bool svptest_last(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestLastTrue(Vector leftMask, Vector rightMask) => TestLastTrue(leftMask, rightMask); + + /// + /// bool svptest_last(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestLastTrue(Vector leftMask, Vector rightMask) => TestLastTrue(leftMask, rightMask); + + /// + /// bool svptest_last(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestLastTrue(Vector leftMask, Vector rightMask) => TestLastTrue(leftMask, rightMask); + + /// + /// bool svptest_last(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestLastTrue(Vector leftMask, Vector rightMask) => TestLastTrue(leftMask, rightMask); + + /// + /// bool svptest_last(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestLastTrue(Vector leftMask, Vector rightMask) => TestLastTrue(leftMask, rightMask); + + /// + /// bool svptest_last(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestLastTrue(Vector leftMask, Vector rightMask) => TestLastTrue(leftMask, rightMask); + + /// + /// bool svptest_last(svbool_t pg, svbool_t op) + /// PTEST + /// + public static unsafe bool TestLastTrue(Vector leftMask, Vector rightMask) => TestLastTrue(leftMask, rightMask); + + /// Interleave even elements from two inputs /// 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 3e85d1af8d583..773ebf725c95c 100644 --- a/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs +++ b/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs @@ -4391,6 +4391,57 @@ internal Arm64() { } public static System.Numerics.Vector DotProductBySelectedScalar(System.Numerics.Vector addend, System.Numerics.Vector left, System.Numerics.Vector right, [ConstantExpected] byte rightIndex) { throw null; } public static System.Numerics.Vector DotProductBySelectedScalar(System.Numerics.Vector addend, System.Numerics.Vector left, System.Numerics.Vector right, [ConstantExpected] byte rightIndex) { throw null; } + public static unsafe byte ExtractAfterLastScalar(System.Numerics.Vector value) { throw null; } + public static unsafe double ExtractAfterLastScalar(System.Numerics.Vector value) { throw null; } + public static unsafe short ExtractAfterLastScalar(System.Numerics.Vector value) { throw null; } + public static unsafe int ExtractAfterLastScalar(System.Numerics.Vector value) { throw null; } + public static unsafe long ExtractAfterLastScalar(System.Numerics.Vector value) { throw null; } + public static unsafe sbyte ExtractAfterLastScalar(System.Numerics.Vector value) { throw null; } + public static unsafe float ExtractAfterLastScalar(System.Numerics.Vector value) { throw null; } + public static unsafe ushort ExtractAfterLastScalar(System.Numerics.Vector value) { throw null; } + public static unsafe uint ExtractAfterLastScalar(System.Numerics.Vector value) { throw null; } + public static unsafe ulong ExtractAfterLastScalar(System.Numerics.Vector value) { throw null; } + public static unsafe System.Numerics.Vector ExtractAfterLastVector(System.Numerics.Vector value) { throw null; } + public static unsafe System.Numerics.Vector ExtractAfterLastVector(System.Numerics.Vector value) { throw null; } + public static unsafe System.Numerics.Vector ExtractAfterLastVector(System.Numerics.Vector value) { throw null; } + public static unsafe System.Numerics.Vector ExtractAfterLastVector(System.Numerics.Vector value) { throw null; } + public static unsafe System.Numerics.Vector ExtractAfterLastVector(System.Numerics.Vector value) { throw null; } + public static unsafe System.Numerics.Vector ExtractAfterLastVector(System.Numerics.Vector value) { throw null; } + public static unsafe System.Numerics.Vector ExtractAfterLastVector(System.Numerics.Vector value) { throw null; } + public static unsafe System.Numerics.Vector ExtractAfterLastVector(System.Numerics.Vector value) { throw null; } + public static unsafe System.Numerics.Vector ExtractAfterLastVector(System.Numerics.Vector value) { throw null; } + public static unsafe System.Numerics.Vector ExtractAfterLastVector(System.Numerics.Vector value) { throw null; } + public static unsafe byte ExtractLastScalar(System.Numerics.Vector value) { throw null; } + public static unsafe double ExtractLastScalar(System.Numerics.Vector value) { throw null; } + public static unsafe short ExtractLastScalar(System.Numerics.Vector value) { throw null; } + public static unsafe int ExtractLastScalar(System.Numerics.Vector value) { throw null; } + public static unsafe long ExtractLastScalar(System.Numerics.Vector value) { throw null; } + public static unsafe sbyte ExtractLastScalar(System.Numerics.Vector value) { throw null; } + public static unsafe float ExtractLastScalar(System.Numerics.Vector value) { throw null; } + public static unsafe ushort ExtractLastScalar(System.Numerics.Vector value) { throw null; } + public static unsafe uint ExtractLastScalar(System.Numerics.Vector value) { throw null; } + public static unsafe ulong ExtractLastScalar(System.Numerics.Vector value) { throw null; } + public static unsafe System.Numerics.Vector ExtractLastVector(System.Numerics.Vector value) { throw null; } + public static unsafe System.Numerics.Vector ExtractLastVector(System.Numerics.Vector value) { throw null; } + public static unsafe System.Numerics.Vector ExtractLastVector(System.Numerics.Vector value) { throw null; } + public static unsafe System.Numerics.Vector ExtractLastVector(System.Numerics.Vector value) { throw null; } + public static unsafe System.Numerics.Vector ExtractLastVector(System.Numerics.Vector value) { throw null; } + public static unsafe System.Numerics.Vector ExtractLastVector(System.Numerics.Vector value) { throw null; } + public static unsafe System.Numerics.Vector ExtractLastVector(System.Numerics.Vector value) { throw null; } + public static unsafe System.Numerics.Vector ExtractLastVector(System.Numerics.Vector value) { throw null; } + public static unsafe System.Numerics.Vector ExtractLastVector(System.Numerics.Vector value) { throw null; } + public static unsafe System.Numerics.Vector ExtractLastVector(System.Numerics.Vector value) { throw null; } + public static unsafe System.Numerics.Vector ExtractVector(System.Numerics.Vector upper, System.Numerics.Vector lower, [ConstantExpected] byte index) { throw null; } + public static unsafe System.Numerics.Vector ExtractVector(System.Numerics.Vector upper, System.Numerics.Vector lower, [ConstantExpected] byte index) { throw null; } + public static unsafe System.Numerics.Vector ExtractVector(System.Numerics.Vector upper, System.Numerics.Vector lower, [ConstantExpected] byte index) { throw null; } + public static unsafe System.Numerics.Vector ExtractVector(System.Numerics.Vector upper, System.Numerics.Vector lower, [ConstantExpected] byte index) { throw null; } + public static unsafe System.Numerics.Vector ExtractVector(System.Numerics.Vector upper, System.Numerics.Vector lower, [ConstantExpected] byte index) { throw null; } + public static unsafe System.Numerics.Vector ExtractVector(System.Numerics.Vector upper, System.Numerics.Vector lower, [ConstantExpected] byte index) { throw null; } + public static unsafe System.Numerics.Vector ExtractVector(System.Numerics.Vector upper, System.Numerics.Vector lower, [ConstantExpected] byte index) { throw null; } + public static unsafe System.Numerics.Vector ExtractVector(System.Numerics.Vector upper, System.Numerics.Vector lower, [ConstantExpected] byte index) { throw null; } + public static unsafe System.Numerics.Vector ExtractVector(System.Numerics.Vector upper, System.Numerics.Vector lower, [ConstantExpected] byte index) { throw null; } + public static unsafe System.Numerics.Vector ExtractVector(System.Numerics.Vector upper, System.Numerics.Vector lower, [ConstantExpected] byte index) { throw null; } + public static System.Numerics.Vector FusedMultiplyAdd(System.Numerics.Vector addend, System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } public static System.Numerics.Vector FusedMultiplyAdd(System.Numerics.Vector addend, System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } public static System.Numerics.Vector FusedMultiplyAddBySelectedScalar(System.Numerics.Vector addend, System.Numerics.Vector left, System.Numerics.Vector right, [ConstantExpected] byte rightIndex) { throw null; } @@ -5007,6 +5058,31 @@ internal Arm64() { } public static System.Numerics.Vector SubtractSaturate(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } public static System.Numerics.Vector SubtractSaturate(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static bool TestAnyTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } + public static bool TestAnyTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } + public static bool TestAnyTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } + public static bool TestAnyTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } + public static bool TestAnyTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } + public static bool TestAnyTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } + public static bool TestAnyTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } + public static bool TestAnyTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } + public static bool TestFirstTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } + public static bool TestFirstTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } + public static bool TestFirstTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } + public static bool TestFirstTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } + public static bool TestFirstTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } + public static bool TestFirstTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } + public static bool TestFirstTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } + public static bool TestFirstTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } + public static bool TestLastTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } + public static bool TestLastTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } + public static bool TestLastTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } + public static bool TestLastTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } + public static bool TestLastTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } + public static bool TestLastTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } + public static bool TestLastTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } + public static bool TestLastTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } + public static System.Numerics.Vector TransposeEven(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } public static System.Numerics.Vector TransposeEven(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } public static System.Numerics.Vector TransposeEven(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 6a1b0391cdaff..1ef3bad8fe0c8 100644 --- a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs +++ b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs @@ -3901,6 +3901,15 @@ ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeOdd_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeOdd", ["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 * 2 + 1] || result[i + 1] != right[index * 2 + 1]"}), ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeOdd_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeOdd", ["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 * 2 + 1] || result[i + 1] != right[index * 2 + 1]"}), ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeOdd_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeOdd", ["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 * 2 + 1] || result[i + 1] != right[index * 2 + 1]"}), + + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "SByte", ["Op1Value"] = "Sve.CreateTrueMaskSByte(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateTrueMaskSByte(SveMaskPattern.All)", ["ValidateEntry"] = "result != true"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "Int16", ["Op1Value"] = "Sve.CreateFalseMaskInt16()", ["Op2Value"] = "Sve.CreateTrueMaskInt16(SveMaskPattern.All)", ["ValidateEntry"] = "result != false"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "Int32", ["Op1Value"] = "Sve.CreateFalseMaskInt32()", ["Op2Value"] = "Sve.CreateFalseMaskInt32()", ["ValidateEntry"] = "result != true"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "Int64", ["Op1Value"] = "Sve.CreateTrueMaskInt64(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateTrueMaskInt64(SveMaskPattern.All)", ["ValidateEntry"] = "result != true"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "Byte", ["Op1Value"] = "Sve.CreateTrueMaskByte(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateFalseMaskByte()", ["ValidateEntry"] = "result != false"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "UInt16", ["Op1Value"] = "Sve.CreateTrueMaskUInt16(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateTrueMaskUInt16(SveMaskPattern.All)", ["ValidateEntry"] = "result != true"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "UInt32", ["Op1Value"] = "Sve.CreateTrueMaskUInt32(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateFalseMaskUInt32()", ["ValidateEntry"] = "result != false"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "UInt64", ["Op1Value"] = "Sve.CreateFalseMaskUInt64()", ["Op2Value"] = "Sve.CreateFalseMaskUInt64()", ["ValidateEntry"] = "result != true"}), }; diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveTestTest.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveTestTest.template new file mode 100644 index 0000000000000..44dbb55484bc9 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveTestTest.template @@ -0,0 +1,125 @@ +// 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 TestTest__{TestName}(); + + if (test.IsSupported) + { + // Validates basic functionality works + test.RunBasicScenario_Load(); + + // Validates calling via reflection works + test.RunReflectionScenario_Load(); + } + 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 TestTest__{TestName} + { + public TestTest__{TestName}() + { + Succeeded = true; + } + + public bool IsSupported => {Isa}.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + Vector<{MaskBaseType}> op1 = {Op1Value}; + Vector<{MaskBaseType}> op2 = {Op2Value}; + + var result = {Isa}.{Method}(op1, op2); + + ValidateResult(op1, op2, result); + } + + public void RunReflectionScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + + Vector<{MaskBaseType}> op1 = {Op1Value}; + Vector<{MaskBaseType}> op2 = {Op2Value}; + + var result = typeof({Isa}).GetMethod(nameof({Isa}.{Method}), new Type[] { typeof(Vector<{MaskBaseType}>), typeof(Vector<{MaskBaseType}>) }) + .Invoke(null, new object[] { + op1, op2 + }); + + ValidateResult(op1, op2, (bool)result); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + Succeeded = false; + + try + { + RunBasicScenario_Load(); + } + catch (PlatformNotSupportedException) + { + Succeeded = true; + } + } + + private void ValidateResult(Vector<{MaskBaseType}> op1, Vector<{MaskBaseType}> op2, bool result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if ({ValidateEntry}) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}(Vector<{MaskBaseType}>, Vector<{MaskBaseType}>): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" op1: ({op1})"); + TestLibrary.TestFramework.LogInformation($" op2: ({op2})"); + TestLibrary.TestFramework.LogInformation($" result: ({result})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} From c5f13f69b80b43c11a3f700aadbd4e0745c530ae Mon Sep 17 00:00:00 2001 From: TIHan Date: Tue, 18 Jun 2024 10:21:17 -0700 Subject: [PATCH 02/10] Properly handling Test APIs --- src/coreclr/jit/hwintrinsiccodegenarm64.cpp | 4 +++- src/coreclr/jit/lowerarmarch.cpp | 21 +++++++++++++++++++ .../GenerateHWIntrinsicTests_Arm.cs | 4 ++-- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp index e36ff199aa9d4..15324e2de5b02 100644 --- a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp +++ b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp @@ -2058,8 +2058,10 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) } case NI_Sve_TestAnyTrue: + case NI_Sve_TestFirstTrue: + case NI_Sve_TestLastTrue: + assert(targetReg == REG_NA); GetEmitter()->emitIns_R_R(INS_sve_ptest, EA_SCALABLE, op1Reg, op2Reg, INS_OPTS_SCALABLE_B); - GetEmitter()->emitIns_R_COND(INS_cset, EA_8BYTE, targetReg, INS_COND_EQ); // TODO break; default: diff --git a/src/coreclr/jit/lowerarmarch.cpp b/src/coreclr/jit/lowerarmarch.cpp index 436c770065d3b..b61c1a73ec74a 100644 --- a/src/coreclr/jit/lowerarmarch.cpp +++ b/src/coreclr/jit/lowerarmarch.cpp @@ -1266,6 +1266,27 @@ GenTree* Lowering::LowerHWIntrinsic(GenTreeHWIntrinsic* node) return LowerHWIntrinsicCmpOp(node, GT_NE); } + case NI_Sve_TestAnyTrue: + { + LowerNodeCC(node, GenCondition::NE); + node->gtType = TYP_VOID; + return node->gtNext; + } + + case NI_Sve_TestFirstTrue: + { + LowerNodeCC(node, GenCondition::SLT); + node->gtType = TYP_VOID; + return node->gtNext; + } + + case NI_Sve_TestLastTrue: + { + LowerNodeCC(node, GenCondition::ULT); + node->gtType = TYP_VOID; + return node->gtNext; + } + case NI_Vector128_WithLower: case NI_Vector128_WithUpper: { diff --git a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs index 1ef3bad8fe0c8..05b32475b5f1a 100644 --- a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs +++ b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs @@ -3904,12 +3904,12 @@ ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "SByte", ["Op1Value"] = "Sve.CreateTrueMaskSByte(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateTrueMaskSByte(SveMaskPattern.All)", ["ValidateEntry"] = "result != true"}), ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "Int16", ["Op1Value"] = "Sve.CreateFalseMaskInt16()", ["Op2Value"] = "Sve.CreateTrueMaskInt16(SveMaskPattern.All)", ["ValidateEntry"] = "result != false"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "Int32", ["Op1Value"] = "Sve.CreateFalseMaskInt32()", ["Op2Value"] = "Sve.CreateFalseMaskInt32()", ["ValidateEntry"] = "result != true"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "Int32", ["Op1Value"] = "Sve.CreateFalseMaskInt32()", ["Op2Value"] = "Sve.CreateFalseMaskInt32()", ["ValidateEntry"] = "result != false"}), ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "Int64", ["Op1Value"] = "Sve.CreateTrueMaskInt64(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateTrueMaskInt64(SveMaskPattern.All)", ["ValidateEntry"] = "result != true"}), ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "Byte", ["Op1Value"] = "Sve.CreateTrueMaskByte(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateFalseMaskByte()", ["ValidateEntry"] = "result != false"}), ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "UInt16", ["Op1Value"] = "Sve.CreateTrueMaskUInt16(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateTrueMaskUInt16(SveMaskPattern.All)", ["ValidateEntry"] = "result != true"}), ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "UInt32", ["Op1Value"] = "Sve.CreateTrueMaskUInt32(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateFalseMaskUInt32()", ["ValidateEntry"] = "result != false"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "UInt64", ["Op1Value"] = "Sve.CreateFalseMaskUInt64()", ["Op2Value"] = "Sve.CreateFalseMaskUInt64()", ["ValidateEntry"] = "result != true"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "UInt64", ["Op1Value"] = "Sve.CreateFalseMaskUInt64()", ["Op2Value"] = "Sve.CreateFalseMaskUInt64()", ["ValidateEntry"] = "result != false"}), }; From a532cf0876242ef9416c25df973d60128a8fb00b Mon Sep 17 00:00:00 2001 From: TIHan Date: Tue, 18 Jun 2024 19:01:03 -0700 Subject: [PATCH 03/10] Added Sve.ExtractVector tests and they pass --- src/coreclr/jit/hwintrinsicarm64.cpp | 1 + src/coreclr/jit/hwintrinsiccodegenarm64.cpp | 25 +- src/coreclr/jit/hwintrinsiclistarm64sve.h | 2 +- src/coreclr/jit/lowerarmarch.cpp | 1 + src/coreclr/jit/lsraarm64.cpp | 1 + .../Arm/Sve.PlatformNotSupported.cs | 48 +-- .../src/System/Runtime/Intrinsics/Arm/Sve.cs | 48 +-- .../ref/System.Runtime.Intrinsics.cs | 48 +-- .../GenerateHWIntrinsicTests_Arm.cs | 29 ++ .../Arm/Shared/SveExtractVectorTest.template | 337 ++++++++++++++++++ 10 files changed, 466 insertions(+), 74 deletions(-) create mode 100644 src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveExtractVectorTest.template diff --git a/src/coreclr/jit/hwintrinsicarm64.cpp b/src/coreclr/jit/hwintrinsicarm64.cpp index 5a32b4cbeee3d..3a7062e408a16 100644 --- a/src/coreclr/jit/hwintrinsicarm64.cpp +++ b/src/coreclr/jit/hwintrinsicarm64.cpp @@ -400,6 +400,7 @@ void HWIntrinsicInfo::lookupImmBounds( case NI_AdvSimd_Arm64_InsertSelectedScalar: case NI_Sve_FusedMultiplyAddBySelectedScalar: case NI_Sve_FusedMultiplySubtractBySelectedScalar: + case NI_Sve_ExtractVector: immUpperBound = Compiler::getSIMDVectorLength(simdSize, baseType) - 1; break; diff --git a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp index 15324e2de5b02..f8ca0333ef575 100644 --- a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp +++ b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp @@ -2061,9 +2061,32 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) case NI_Sve_TestFirstTrue: case NI_Sve_TestLastTrue: assert(targetReg == REG_NA); - GetEmitter()->emitIns_R_R(INS_sve_ptest, EA_SCALABLE, op1Reg, op2Reg, INS_OPTS_SCALABLE_B); + GetEmitter()->emitIns_R_R(ins, EA_SCALABLE, op1Reg, op2Reg, INS_OPTS_SCALABLE_B); break; + case NI_Sve_ExtractVector: + { + assert(isRMW); + + if (targetReg != op1Reg) + { + assert(targetReg != op2Reg); + + GetEmitter()->emitIns_Mov(INS_mov, emitTypeSize(node), targetReg, op1Reg, /* canSkip */ true); + } + + HWIntrinsicImmOpHelper helper(this, intrin.op3, node); + + for (helper.EmitBegin(); !helper.Done(); helper.EmitCaseEnd()) + { + const int elementIndex = helper.ImmValue(); + const int byteIndex = genTypeSize(intrin.baseType) * elementIndex; + + GetEmitter()->emitIns_R_R_I(ins, emitSize, targetReg, op2Reg, byteIndex, INS_OPTS_SCALABLE_B); + } + break; + } + default: unreached(); } diff --git a/src/coreclr/jit/hwintrinsiclistarm64sve.h b/src/coreclr/jit/hwintrinsiclistarm64sve.h index 85c90df8671cf..1ee40bcb97a5d 100644 --- a/src/coreclr/jit/hwintrinsiclistarm64sve.h +++ b/src/coreclr/jit/hwintrinsiclistarm64sve.h @@ -73,7 +73,7 @@ HARDWARE_INTRINSIC(Sve, ExtractAfterLastScalar, HARDWARE_INTRINSIC(Sve, ExtractAfterLastVector, -1, -1, false, {INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation) HARDWARE_INTRINSIC(Sve, ExtractLastScalar, -1, -1, false, {INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation) HARDWARE_INTRINSIC(Sve, ExtractLastVector, -1, -1, false, {INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation) -HARDWARE_INTRINSIC(Sve, ExtractVector, -1, 3, true, {INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext}, HW_Category_SIMD, HW_Flag_Scalable) +HARDWARE_INTRINSIC(Sve, ExtractVector, -1, 3, true, {INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasRMWSemantics|HW_Flag_SpecialCodeGen) HARDWARE_INTRINSIC(Sve, FusedMultiplyAdd, -1, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_fmla, INS_sve_fmla}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_HasRMWSemantics|HW_Flag_LowMaskedOperation|HW_Flag_FmaIntrinsic|HW_Flag_SpecialCodeGen) HARDWARE_INTRINSIC(Sve, FusedMultiplyAddBySelectedScalar, -1, 4, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_fmla, INS_sve_fmla}, HW_Category_SIMDByIndexedElement, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasRMWSemantics|HW_Flag_FmaIntrinsic|HW_Flag_LowVectorOperation) HARDWARE_INTRINSIC(Sve, FusedMultiplyAddNegated, -1, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_fnmla, INS_sve_fnmla}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_HasRMWSemantics|HW_Flag_LowMaskedOperation|HW_Flag_FmaIntrinsic|HW_Flag_SpecialCodeGen) diff --git a/src/coreclr/jit/lowerarmarch.cpp b/src/coreclr/jit/lowerarmarch.cpp index b61c1a73ec74a..7be777bc6f652 100644 --- a/src/coreclr/jit/lowerarmarch.cpp +++ b/src/coreclr/jit/lowerarmarch.cpp @@ -3219,6 +3219,7 @@ void Lowering::ContainCheckHWIntrinsic(GenTreeHWIntrinsic* node) case NI_Sve_PrefetchInt16: case NI_Sve_PrefetchInt32: case NI_Sve_PrefetchInt64: + case NI_Sve_ExtractVector: assert(hasImmediateOperand); assert(varTypeIsIntegral(intrin.op3)); if (intrin.op3->IsCnsIntOrI()) diff --git a/src/coreclr/jit/lsraarm64.cpp b/src/coreclr/jit/lsraarm64.cpp index 0256b105a774b..2b56aa64fb011 100644 --- a/src/coreclr/jit/lsraarm64.cpp +++ b/src/coreclr/jit/lsraarm64.cpp @@ -1451,6 +1451,7 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree, int* pDstCou case NI_Sve_PrefetchInt16: case NI_Sve_PrefetchInt32: case NI_Sve_PrefetchInt64: + case NI_Sve_ExtractVector: needBranchTargetReg = !intrin.op3->isContainedIntOrIImmed(); break; 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 71a4becb052a3..2734bb5be5011 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 @@ -5944,145 +5944,145 @@ internal Arm64() { } /// bool svptest_any(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestAnyTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + public static unsafe bool TestAnyTrue(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } /// /// bool svptest_any(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestAnyTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + public static unsafe bool TestAnyTrue(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } /// /// bool svptest_any(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestAnyTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + public static unsafe bool TestAnyTrue(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } /// /// bool svptest_any(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestAnyTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + public static unsafe bool TestAnyTrue(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } /// /// bool svptest_any(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestAnyTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + public static unsafe bool TestAnyTrue(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } /// /// bool svptest_any(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestAnyTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + public static unsafe bool TestAnyTrue(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } /// /// bool svptest_any(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestAnyTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + public static unsafe bool TestAnyTrue(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } /// /// bool svptest_any(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestAnyTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + public static unsafe bool TestAnyTrue(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } /// /// bool svptest_first(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestFirstTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + public static unsafe bool TestFirstTrue(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } /// /// bool svptest_first(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestFirstTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + public static unsafe bool TestFirstTrue(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } /// /// bool svptest_first(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestFirstTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + public static unsafe bool TestFirstTrue(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } /// /// bool svptest_first(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestFirstTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + public static unsafe bool TestFirstTrue(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } /// /// bool svptest_first(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestFirstTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + public static unsafe bool TestFirstTrue(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } /// /// bool svptest_first(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestFirstTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + public static unsafe bool TestFirstTrue(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } /// /// bool svptest_first(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestFirstTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + public static unsafe bool TestFirstTrue(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } /// /// bool svptest_first(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestFirstTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + public static unsafe bool TestFirstTrue(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } /// /// bool svptest_last(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestLastTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + public static unsafe bool TestLastTrue(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } /// /// bool svptest_last(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestLastTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + public static unsafe bool TestLastTrue(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } /// /// bool svptest_last(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestLastTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + public static unsafe bool TestLastTrue(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } /// /// bool svptest_last(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestLastTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + public static unsafe bool TestLastTrue(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } /// /// bool svptest_last(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestLastTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + public static unsafe bool TestLastTrue(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } /// /// bool svptest_last(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestLastTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + public static unsafe bool TestLastTrue(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } /// /// bool svptest_last(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestLastTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + public static unsafe bool TestLastTrue(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } /// /// bool svptest_last(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestLastTrue(Vector leftMask, Vector rightMask) { throw new PlatformNotSupportedException(); } + public static unsafe bool TestLastTrue(Vector mask, Vector srcMask) { throw new PlatformNotSupportedException(); } /// Interleave even elements from two inputs 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 f52d67ded547d..46d6eb4a4dd59 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 @@ -5986,145 +5986,145 @@ internal Arm64() { } /// bool svptest_any(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestAnyTrue(Vector leftMask, Vector rightMask) => TestAnyTrue(leftMask, rightMask); + public static unsafe bool TestAnyTrue(Vector mask, Vector srcMask) => TestAnyTrue(mask, srcMask); /// /// bool svptest_any(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestAnyTrue(Vector leftMask, Vector rightMask) => TestAnyTrue(leftMask, rightMask); + public static unsafe bool TestAnyTrue(Vector mask, Vector srcMask) => TestAnyTrue(mask, srcMask); /// /// bool svptest_any(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestAnyTrue(Vector leftMask, Vector rightMask) => TestAnyTrue(leftMask, rightMask); + public static unsafe bool TestAnyTrue(Vector mask, Vector srcMask) => TestAnyTrue(mask, srcMask); /// /// bool svptest_any(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestAnyTrue(Vector leftMask, Vector rightMask) => TestAnyTrue(leftMask, rightMask); + public static unsafe bool TestAnyTrue(Vector mask, Vector srcMask) => TestAnyTrue(mask, srcMask); /// /// bool svptest_any(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestAnyTrue(Vector leftMask, Vector rightMask) => TestAnyTrue(leftMask, rightMask); + public static unsafe bool TestAnyTrue(Vector mask, Vector srcMask) => TestAnyTrue(mask, srcMask); /// /// bool svptest_any(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestAnyTrue(Vector leftMask, Vector rightMask) => TestAnyTrue(leftMask, rightMask); + public static unsafe bool TestAnyTrue(Vector mask, Vector srcMask) => TestAnyTrue(mask, srcMask); /// /// bool svptest_any(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestAnyTrue(Vector leftMask, Vector rightMask) => TestAnyTrue(leftMask, rightMask); + public static unsafe bool TestAnyTrue(Vector mask, Vector srcMask) => TestAnyTrue(mask, srcMask); /// /// bool svptest_any(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestAnyTrue(Vector leftMask, Vector rightMask) => TestAnyTrue(leftMask, rightMask); + public static unsafe bool TestAnyTrue(Vector mask, Vector srcMask) => TestAnyTrue(mask, srcMask); /// /// bool svptest_first(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestFirstTrue(Vector leftMask, Vector rightMask) => TestFirstTrue(leftMask, rightMask); + public static unsafe bool TestFirstTrue(Vector mask, Vector srcMask) => TestFirstTrue(mask, srcMask); /// /// bool svptest_first(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestFirstTrue(Vector leftMask, Vector rightMask) => TestFirstTrue(leftMask, rightMask); + public static unsafe bool TestFirstTrue(Vector mask, Vector srcMask) => TestFirstTrue(mask, srcMask); /// /// bool svptest_first(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestFirstTrue(Vector leftMask, Vector rightMask) => TestFirstTrue(leftMask, rightMask); + public static unsafe bool TestFirstTrue(Vector mask, Vector srcMask) => TestFirstTrue(mask, srcMask); /// /// bool svptest_first(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestFirstTrue(Vector leftMask, Vector rightMask) => TestFirstTrue(leftMask, rightMask); + public static unsafe bool TestFirstTrue(Vector mask, Vector srcMask) => TestFirstTrue(mask, srcMask); /// /// bool svptest_first(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestFirstTrue(Vector leftMask, Vector rightMask) => TestFirstTrue(leftMask, rightMask); + public static unsafe bool TestFirstTrue(Vector mask, Vector srcMask) => TestFirstTrue(mask, srcMask); /// /// bool svptest_first(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestFirstTrue(Vector leftMask, Vector rightMask) => TestFirstTrue(leftMask, rightMask); + public static unsafe bool TestFirstTrue(Vector mask, Vector srcMask) => TestFirstTrue(mask, srcMask); /// /// bool svptest_first(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestFirstTrue(Vector leftMask, Vector rightMask) => TestFirstTrue(leftMask, rightMask); + public static unsafe bool TestFirstTrue(Vector mask, Vector srcMask) => TestFirstTrue(mask, srcMask); /// /// bool svptest_first(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestFirstTrue(Vector leftMask, Vector rightMask) => TestFirstTrue(leftMask, rightMask); + public static unsafe bool TestFirstTrue(Vector mask, Vector srcMask) => TestFirstTrue(mask, srcMask); /// /// bool svptest_last(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestLastTrue(Vector leftMask, Vector rightMask) => TestLastTrue(leftMask, rightMask); + public static unsafe bool TestLastTrue(Vector mask, Vector srcMask) => TestLastTrue(mask, srcMask); /// /// bool svptest_last(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestLastTrue(Vector leftMask, Vector rightMask) => TestLastTrue(leftMask, rightMask); + public static unsafe bool TestLastTrue(Vector mask, Vector srcMask) => TestLastTrue(mask, srcMask); /// /// bool svptest_last(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestLastTrue(Vector leftMask, Vector rightMask) => TestLastTrue(leftMask, rightMask); + public static unsafe bool TestLastTrue(Vector mask, Vector srcMask) => TestLastTrue(mask, srcMask); /// /// bool svptest_last(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestLastTrue(Vector leftMask, Vector rightMask) => TestLastTrue(leftMask, rightMask); + public static unsafe bool TestLastTrue(Vector mask, Vector srcMask) => TestLastTrue(mask, srcMask); /// /// bool svptest_last(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestLastTrue(Vector leftMask, Vector rightMask) => TestLastTrue(leftMask, rightMask); + public static unsafe bool TestLastTrue(Vector mask, Vector srcMask) => TestLastTrue(mask, srcMask); /// /// bool svptest_last(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestLastTrue(Vector leftMask, Vector rightMask) => TestLastTrue(leftMask, rightMask); + public static unsafe bool TestLastTrue(Vector mask, Vector srcMask) => TestLastTrue(mask, srcMask); /// /// bool svptest_last(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestLastTrue(Vector leftMask, Vector rightMask) => TestLastTrue(leftMask, rightMask); + public static unsafe bool TestLastTrue(Vector mask, Vector srcMask) => TestLastTrue(mask, srcMask); /// /// bool svptest_last(svbool_t pg, svbool_t op) /// PTEST /// - public static unsafe bool TestLastTrue(Vector leftMask, Vector rightMask) => TestLastTrue(leftMask, rightMask); + public static unsafe bool TestLastTrue(Vector mask, Vector srcMask) => TestLastTrue(mask, srcMask); /// Interleave even elements from two inputs 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 773ebf725c95c..de9e1c31bef2f 100644 --- a/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs +++ b/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs @@ -5058,30 +5058,30 @@ internal Arm64() { } public static System.Numerics.Vector SubtractSaturate(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } public static System.Numerics.Vector SubtractSaturate(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } - public static bool TestAnyTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } - public static bool TestAnyTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } - public static bool TestAnyTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } - public static bool TestAnyTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } - public static bool TestAnyTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } - public static bool TestAnyTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } - public static bool TestAnyTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } - public static bool TestAnyTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } - public static bool TestFirstTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } - public static bool TestFirstTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } - public static bool TestFirstTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } - public static bool TestFirstTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } - public static bool TestFirstTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } - public static bool TestFirstTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } - public static bool TestFirstTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } - public static bool TestFirstTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } - public static bool TestLastTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } - public static bool TestLastTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } - public static bool TestLastTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } - public static bool TestLastTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } - public static bool TestLastTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } - public static bool TestLastTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } - public static bool TestLastTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } - public static bool TestLastTrue(System.Numerics.Vector leftMask, System.Numerics.Vector rightMask) { throw null; } + public static bool TestAnyTrue(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static bool TestAnyTrue(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static bool TestAnyTrue(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static bool TestAnyTrue(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static bool TestAnyTrue(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static bool TestAnyTrue(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static bool TestAnyTrue(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static bool TestAnyTrue(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static bool TestFirstTrue(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static bool TestFirstTrue(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static bool TestFirstTrue(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static bool TestFirstTrue(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static bool TestFirstTrue(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static bool TestFirstTrue(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static bool TestFirstTrue(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static bool TestFirstTrue(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static bool TestLastTrue(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static bool TestLastTrue(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static bool TestLastTrue(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static bool TestLastTrue(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static bool TestLastTrue(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static bool TestLastTrue(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static bool TestLastTrue(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } + public static bool TestLastTrue(System.Numerics.Vector mask, System.Numerics.Vector srcMask) { throw null; } public static System.Numerics.Vector TransposeEven(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } public static System.Numerics.Vector TransposeEven(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 05b32475b5f1a..afa273ad073b7 100644 --- a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs +++ b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs @@ -3910,6 +3910,35 @@ ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "UInt16", ["Op1Value"] = "Sve.CreateTrueMaskUInt16(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateTrueMaskUInt16(SveMaskPattern.All)", ["ValidateEntry"] = "result != true"}), ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "UInt32", ["Op1Value"] = "Sve.CreateTrueMaskUInt32(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateFalseMaskUInt32()", ["ValidateEntry"] = "result != false"}), ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "UInt64", ["Op1Value"] = "Sve.CreateFalseMaskUInt64()", ["Op2Value"] = "Sve.CreateFalseMaskUInt64()", ["ValidateEntry"] = "result != false"}), + + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "SByte", ["Op1Value"] = "Sve.CreateTrueMaskSByte(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateTrueMaskSByte(SveMaskPattern.All)", ["ValidateEntry"] = "result != true"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "Int16", ["Op1Value"] = "Sve.CreateFalseMaskInt16()", ["Op2Value"] = "Sve.CreateTrueMaskInt16(SveMaskPattern.All)", ["ValidateEntry"] = "result != false"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "Int32", ["Op1Value"] = "Sve.CreateFalseMaskInt32()", ["Op2Value"] = "Sve.CreateFalseMaskInt32()", ["ValidateEntry"] = "result != false"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "Int64", ["Op1Value"] = "Sve.CreateTrueMaskInt64(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateTrueMaskInt64(SveMaskPattern.All)", ["ValidateEntry"] = "result != true"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "Byte", ["Op1Value"] = "Sve.CreateTrueMaskByte(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateFalseMaskByte()", ["ValidateEntry"] = "result != false"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "UInt16", ["Op1Value"] = "Sve.CreateTrueMaskUInt16(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateTrueMaskUInt16(SveMaskPattern.All)", ["ValidateEntry"] = "result != true"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "UInt32", ["Op1Value"] = "Sve.CreateTrueMaskUInt32(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateFalseMaskUInt32()", ["ValidateEntry"] = "result != false"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "UInt64", ["Op1Value"] = "Sve.CreateFalseMaskUInt64()", ["Op2Value"] = "Sve.CreateFalseMaskUInt64()", ["ValidateEntry"] = "result != false"}), + + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "SByte", ["Op1Value"] = "Sve.CreateTrueMaskSByte(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateTrueMaskSByte(SveMaskPattern.All)", ["ValidateEntry"] = "result != true"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "Int16", ["Op1Value"] = "Sve.CreateFalseMaskInt16()", ["Op2Value"] = "Sve.CreateTrueMaskInt16(SveMaskPattern.All)", ["ValidateEntry"] = "result != false"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "Int32", ["Op1Value"] = "Sve.CreateFalseMaskInt32()", ["Op2Value"] = "Sve.CreateFalseMaskInt32()", ["ValidateEntry"] = "result != false"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "Int64", ["Op1Value"] = "Sve.CreateTrueMaskInt64(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateTrueMaskInt64(SveMaskPattern.All)", ["ValidateEntry"] = "result != true"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "Byte", ["Op1Value"] = "Sve.CreateTrueMaskByte(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateFalseMaskByte()", ["ValidateEntry"] = "result != false"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "UInt16", ["Op1Value"] = "Sve.CreateTrueMaskUInt16(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateTrueMaskUInt16(SveMaskPattern.All)", ["ValidateEntry"] = "result != true"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "UInt32", ["Op1Value"] = "Sve.CreateTrueMaskUInt32(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateFalseMaskUInt32()", ["ValidateEntry"] = "result != false"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "UInt64", ["Op1Value"] = "Sve.CreateFalseMaskUInt64()", ["Op2Value"] = "Sve.CreateFalseMaskUInt64()", ["ValidateEntry"] = "result != false"}), + + ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_Byte_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), + ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_Double_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i)) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_Int16_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), + ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_Int32_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), + ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_Int64_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), + ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_SByte_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), + ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_Single_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i)) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_UInt16_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), + ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_UInt32_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), + ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_UInt64_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), }; diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveExtractVectorTest.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveExtractVectorTest.template new file mode 100644 index 0000000000000..b19c4db7df335 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveExtractVectorTest.template @@ -0,0 +1,337 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; +using Xunit; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + [Fact] + public static void {TestName}() + { + var test = new ExtractVectorTest__{TestName}(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if ({LoadIsa}.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class ExtractVectorTest__{TestName} + { + private struct DataTable + { + private byte[] inArray1; + private byte[] inArray2; + private byte[] outArray; + + private GCHandle inHandle1; + private GCHandle inHandle2; + private GCHandle outHandle; + + private ulong alignment; + + public DataTable({Op1BaseType}[] inArray1, {Op2BaseType}[] inArray2, {RetBaseType}[] outArray, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); + int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<{Op2BaseType}>(); + int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<{RetBaseType}>(); + if ((alignment != 64 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < 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 * 2]; + + this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); + this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); + this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); + + this.alignment = (ulong)alignment; + + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray1Ptr), ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), (uint)sizeOfinArray1); + Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef(inArray2Ptr), ref Unsafe.As<{Op2BaseType}, byte>(ref inArray2[0]), (uint)sizeOfinArray2); + } + + public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); + public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); + public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); + + public void Dispose() + { + inHandle1.Free(); + inHandle2.Free(); + outHandle.Free(); + } + + private static unsafe void* Align(byte* buffer, ulong expectedAlignment) + { + return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); + } + } + + private struct TestStruct + { + public {Op1VectorType}<{Op1BaseType}> _fld1; + public {Op2VectorType}<{Op2BaseType}> _fld2; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1VectorType}<{Op1BaseType}>, byte>(ref testStruct._fld1), ref Unsafe.As<{Op1BaseType}, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp2}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op2VectorType}<{Op2BaseType}>, byte>(ref testStruct._fld2), ref Unsafe.As<{Op2BaseType}, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<{Op2VectorType}<{Op2BaseType}>>()); + + return testStruct; + } + + public void RunStructFldScenario(ExtractVectorTest__{TestName} testClass) + { + var result = {Isa}.{Method}(_fld1, _fld2, ElementIndex); + + Unsafe.Write(testClass._dataTable.outArrayPtr, result); + testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); + } + } + + private static readonly int LargestVectorSize = {LargestVectorSize}; + + private static readonly int Op1ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); + private static readonly int Op2ElementCount = Unsafe.SizeOf<{Op2VectorType}<{Op2BaseType}>>() / sizeof({Op2BaseType}); + private static readonly int RetElementCount = Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>() / sizeof({RetBaseType}); + private static readonly byte ElementIndex = {ElementIndex}; + + private static {Op1BaseType}[] _data1 = new {Op1BaseType}[Op1ElementCount]; + private static {Op2BaseType}[] _data2 = new {Op2BaseType}[Op2ElementCount]; + + private {Op1VectorType}<{Op1BaseType}> _fld1; + private {Op2VectorType}<{Op2BaseType}> _fld2; + + private DataTable _dataTable; + + public ExtractVectorTest__{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] = {NextValueOp2}; } + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op2VectorType}<{Op2BaseType}>, byte>(ref _fld2), ref Unsafe.As<{Op2BaseType}, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<{Op2VectorType}<{Op2BaseType}>>()); + + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = {NextValueOp1}; } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = {NextValueOp2}; } + _dataTable = new DataTable(_data1, _data2, new {RetBaseType}[RetElementCount], LargestVectorSize); + } + + public bool IsSupported => {Isa}.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = {Isa}.{Method}( + Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr), + Unsafe.Read<{Op2VectorType}<{Op2BaseType}>>(_dataTable.inArray2Ptr), + ElementIndex + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = {Isa}.{Method}( + {LoadIsa}.Load{Op1VectorType}(Sve.CreateTrueMask{RetBaseType}(SveMaskPattern.All), ({Op1BaseType}*)(_dataTable.inArray1Ptr)), + {LoadIsa}.Load{Op2VectorType}(Sve.CreateTrueMask{RetBaseType}(SveMaskPattern.All), ({Op2BaseType}*)(_dataTable.inArray2Ptr)), + ElementIndex + ); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof({Isa}).GetMethod(nameof({Isa}.{Method}), new Type[] { typeof({Op1VectorType}<{Op1BaseType}>), typeof({Op2VectorType}<{Op2BaseType}>), typeof(byte) }) + .Invoke(null, new object[] { + Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr), + Unsafe.Read<{Op2VectorType}<{Op2BaseType}>>(_dataTable.inArray2Ptr), + ElementIndex + }); + + Unsafe.Write(_dataTable.outArrayPtr, ({RetVectorType}<{RetBaseType}>)(result)); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr); + var op2 = Unsafe.Read<{Op2VectorType}<{Op2BaseType}>>(_dataTable.inArray2Ptr); + var result = {Isa}.{Method}(op1, op2, ElementIndex); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(op1, op2, _dataTable.outArrayPtr); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = {Isa}.{Method}(_fld1, _fld2, ElementIndex); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = {Isa}.{Method}(test._fld1, test._fld2, ElementIndex); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void 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, {Op2VectorType}<{Op2BaseType}> op2, void* result, [CallerMemberName] string method = "") + { + {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; + {Op2BaseType}[] inArray2 = new {Op2BaseType}[Op2ElementCount]; + {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), op1); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op2BaseType}, byte>(ref inArray2[0]), op2); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") + { + {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; + {Op2BaseType}[] inArray2 = new {Op2BaseType}[Op2ElementCount]; + {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op2BaseType}, byte>(ref inArray2[0]), ref Unsafe.AsRef(op2), (uint)Unsafe.SizeOf<{Op2VectorType}<{Op2BaseType}>>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf<{RetVectorType}<{RetBaseType}>>()); + + ValidateResult(inArray1, inArray2, outArray, method); + } + + private void ValidateResult({Op1BaseType}[] firstOp, {Op2BaseType}[] secondOp, {RetBaseType}[] result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + for (var i = 0; i < RetElementCount; i++) + { + if ({ValidateIterResult}) + { + succeeded = false; + break; + } + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}<{RetBaseType}>({Op1VectorType}<{Op1BaseType}>, {Op2VectorType}<{Op2BaseType}>, {ElementIndex}): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); + TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} From 174cd355e93a590f0fc54ffcea6229223aa557f9 Mon Sep 17 00:00:00 2001 From: TIHan Date: Wed, 19 Jun 2024 15:30:15 -0700 Subject: [PATCH 04/10] Added more extract tests. Still getting asserts. --- src/coreclr/jit/hwintrinsiclistarm64sve.h | 8 +- .../GenerateHWIntrinsicTests_Arm.cs | 44 +++ .../Arm/Shared/SveExtractTest.template | 282 ++++++++++++++++++ .../Arm/Shared/SveExtractVectorTest.template | 4 +- 4 files changed, 332 insertions(+), 6 deletions(-) create mode 100644 src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveExtractTest.template diff --git a/src/coreclr/jit/hwintrinsiclistarm64sve.h b/src/coreclr/jit/hwintrinsiclistarm64sve.h index 1ee40bcb97a5d..4517b9c96ebc2 100644 --- a/src/coreclr/jit/hwintrinsiclistarm64sve.h +++ b/src/coreclr/jit/hwintrinsiclistarm64sve.h @@ -69,10 +69,10 @@ HARDWARE_INTRINSIC(Sve, CreateWhileLessThanOrEqualMask8Bit, HARDWARE_INTRINSIC(Sve, Divide, -1, 2, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sdiv, INS_sve_udiv, INS_sve_sdiv, INS_sve_udiv, INS_sve_fdiv, INS_sve_fdiv}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_HasRMWSemantics|HW_Flag_LowMaskedOperation) HARDWARE_INTRINSIC(Sve, DotProduct, -1, 3, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sdot, INS_sve_udot, INS_sve_sdot, INS_sve_udot, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasRMWSemantics) HARDWARE_INTRINSIC(Sve, DotProductBySelectedScalar, -1, 4, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sdot, INS_sve_udot, INS_sve_sdot, INS_sve_udot, INS_invalid, INS_invalid}, HW_Category_SIMDByIndexedElement, HW_Flag_Scalable|HW_Flag_BaseTypeFromFirstArg|HW_Flag_HasImmediateOperand|HW_Flag_HasRMWSemantics|HW_Flag_LowVectorOperation) -HARDWARE_INTRINSIC(Sve, ExtractAfterLastScalar, -1, -1, false, {INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation) -HARDWARE_INTRINSIC(Sve, ExtractAfterLastVector, -1, -1, false, {INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation) -HARDWARE_INTRINSIC(Sve, ExtractLastScalar, -1, -1, false, {INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation) -HARDWARE_INTRINSIC(Sve, ExtractLastVector, -1, -1, false, {INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation) +HARDWARE_INTRINSIC(Sve, ExtractAfterLastScalar, -1, -1, false, {INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_BaseTypeFromFirstArg) +HARDWARE_INTRINSIC(Sve, ExtractAfterLastVector, -1, -1, false, {INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_SpecialCodeGen) +HARDWARE_INTRINSIC(Sve, ExtractLastScalar, -1, -1, false, {INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_BaseTypeFromFirstArg) +HARDWARE_INTRINSIC(Sve, ExtractLastVector, -1, -1, false, {INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_SpecialCodeGen) HARDWARE_INTRINSIC(Sve, ExtractVector, -1, 3, true, {INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasRMWSemantics|HW_Flag_SpecialCodeGen) HARDWARE_INTRINSIC(Sve, FusedMultiplyAdd, -1, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_fmla, INS_sve_fmla}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_HasRMWSemantics|HW_Flag_LowMaskedOperation|HW_Flag_FmaIntrinsic|HW_Flag_SpecialCodeGen) HARDWARE_INTRINSIC(Sve, FusedMultiplyAddBySelectedScalar, -1, 4, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_fmla, INS_sve_fmla}, HW_Category_SIMDByIndexedElement, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasRMWSemantics|HW_Flag_FmaIntrinsic|HW_Flag_LowVectorOperation) diff --git a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs index afa273ad073b7..8bc0557fff0ce 100644 --- a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs +++ b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs @@ -3939,6 +3939,50 @@ ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_UInt16_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_UInt32_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_UInt64_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), + + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_Byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateResult"] = "firstOp[0] != result[0]"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_Double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateResult"] = "BitConverter.DoubleToInt64Bits(firstOp[0]) != BitConverter.DoubleToInt64Bits(result[0])"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_Int16", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateResult"] = "firstOp[0] != result[0]"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_Int32", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateResult"] = "firstOp[0] != result[0]"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_Int64", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateResult"] = "firstOp[0] != result[0]"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_SByte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateResult"] = "firstOp[0] != result[0]"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_Single", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateResult"] = "BitConverter.SingleToInt32Bits(firstOp[0]) != BitConverter.SingleToInt32Bits(result[0])"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_UInt16", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateResult"] = "firstOp[0] != result[0]"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_UInt32", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateResult"] = "firstOp[0] != result[0]"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_UInt64", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateResult"] = "firstOp[0] != result[0]"}), + + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_Byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["RetType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateResult"] = "firstOp[0] != result"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_Double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["RetType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateResult"] = "BitConverter.DoubleToInt64Bits(firstOp[0]) != BitConverter.DoubleToInt64Bits(result)"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_Int16", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["RetType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateResult"] = "firstOp[0] != result"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_Int32", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["RetType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateResult"] = "firstOp[0] != result"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_Int64", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["RetType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateResult"] = "firstOp[0] != result"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_SByte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["RetType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateResult"] = "firstOp[0] != result"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_Single", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["RetType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateResult"] = "BitConverter.SingleToInt32Bits(firstOp[0]) != BitConverter.SingleToInt32Bits(result)"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_UInt16", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["RetType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateResult"] = "firstOp[0] != result"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_UInt32", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["RetType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateResult"] = "firstOp[0] != result"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_UInt64", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["RetType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateResult"] = "firstOp[0] != result"}), + + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastVector_Byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateResult"] = "firstOp[0] != result[0]"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastVector_Double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateResult"] = "BitConverter.DoubleToInt64Bits(firstOp[0]) != BitConverter.DoubleToInt64Bits(result[0])"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastVector_Int16", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateResult"] = "firstOp[0] != result[0]"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastVector_Int32", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateResult"] = "firstOp[0] != result[0]"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastVector_Int64", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateResult"] = "firstOp[0] != result[0]"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastVector_SByte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateResult"] = "firstOp[0] != result[0]"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastVector_Single", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateResult"] = "BitConverter.SingleToInt32Bits(firstOp[0]) != BitConverter.SingleToInt32Bits(result[0])"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastVector_UInt16", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateResult"] = "firstOp[0] != result[0]"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastVector_UInt32", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateResult"] = "firstOp[0] != result[0]"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastVector_UInt64", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateResult"] = "firstOp[0] != result[0]"}), + + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastScalar_Byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["RetType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateResult"] = "firstOp[0] != result"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastScalar_Double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["RetType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateResult"] = "BitConverter.DoubleToInt64Bits(firstOp[0]) != BitConverter.DoubleToInt64Bits(result)"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastScalar_Int16", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["RetType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateResult"] = "firstOp[0] != result"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastScalar_Int32", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["RetType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateResult"] = "firstOp[0] != result"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastScalar_Int64", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["RetType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateResult"] = "firstOp[0] != result"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastScalar_SByte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["RetType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateResult"] = "firstOp[0] != result"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastScalar_Single", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["RetType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateResult"] = "BitConverter.SingleToInt32Bits(firstOp[0]) != BitConverter.SingleToInt32Bits(result)"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastScalar_UInt16", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["RetType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateResult"] = "firstOp[0] != result"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastScalar_UInt32", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["RetType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateResult"] = "firstOp[0] != result"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastScalar_UInt64", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["RetType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateResult"] = "firstOp[0] != result"}), }; diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveExtractTest.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveExtractTest.template new file mode 100644 index 0000000000000..8b249644f0dfa --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveExtractTest.template @@ -0,0 +1,282 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/****************************************************************************** + * This file is auto-generated from a template file by the GenerateTests.csx * + * script in tests\src\JIT\HardwareIntrinsics\Arm\Shared. In order to make * + * changes, please update the corresponding template and run according to the * + * directions listed in the file. * + ******************************************************************************/ + +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; +using Xunit; + +namespace JIT.HardwareIntrinsics.Arm +{ + public static partial class Program + { + [Fact] + public static void {TestName}() + { + var test = new SveExtractTest__{TestName}(); + + if (test.IsSupported) + { + // Validates basic functionality works, using Unsafe.Read + test.RunBasicScenario_UnsafeRead(); + + if ({LoadIsa}.IsSupported) + { + // Validates basic functionality works, using Load + test.RunBasicScenario_Load(); + } + + // Validates calling via reflection works, using Unsafe.Read + test.RunReflectionScenario_UnsafeRead(); + + // Validates passing a local works, using Unsafe.Read + test.RunLclVarScenario_UnsafeRead(); + + // Validates passing an instance member of a class works + test.RunClassFldScenario(); + + // Validates passing the field of a local struct works + test.RunStructLclFldScenario(); + + // Validates passing an instance member of a struct works + test.RunStructFldScenario(); + } + else + { + // Validates we throw on unsupported hardware + test.RunUnsupportedScenario(); + } + + if (!test.Succeeded) + { + throw new Exception("One or more scenarios did not complete as expected."); + } + } + } + + public sealed unsafe class SveExtractTest__{TestName} + { + private struct DataTable + { + private byte[] inArray1; + + private GCHandle inHandle1; + + private ulong alignment; + + public DataTable({Op1BaseType}[] inArray1, int alignment) + { + int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); + if ((alignment != 64 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1) + { + throw new ArgumentException("Invalid value of alignment"); + } + + this.inArray1 = new byte[alignment * 2]; + this.inHandle1 = GCHandle.Alloc(this.inArray1, 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 Dispose() + { + inHandle1.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(SveExtractTest__{TestName} testClass) + { + var result = {Isa}.{Method}(_fld1); + + testClass.ValidateResult(_fld1, result); + } + } + + private static readonly int LargestVectorSize = {LargestVectorSize}; + + private static readonly int Op1ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); + + private static {Op1BaseType}[] _data1 = new {Op1BaseType}[Op1ElementCount]; + + private {Op1VectorType}<{Op1BaseType}> _fld1; + + private DataTable _dataTable; + + public SveExtractTest__{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, LargestVectorSize); + } + + public bool IsSupported => {Isa}.IsSupported; + + public bool Succeeded { get; set; } + + public void RunBasicScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); + + var result = {Isa}.{Method}( + Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr) + ); + + ValidateResult(_dataTable.inArray1Ptr, result); + } + + public void RunBasicScenario_Load() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + + var result = {Isa}.{Method}( + {LoadIsa}.Load{Op1VectorType}(Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All), ({Op1BaseType}*)(_dataTable.inArray1Ptr)) + ); + + ValidateResult(_dataTable.inArray1Ptr, result); + } + + public void RunReflectionScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); + + var result = typeof({Isa}).GetMethod(nameof({Isa}.{Method}), new Type[] { typeof({Op1VectorType}<{Op1BaseType}>) }) + .Invoke(null, new object[] { + Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr) + }); + + ValidateResult(_dataTable.inArray1Ptr, ({RetType})result); + } + + public void RunLclVarScenario_UnsafeRead() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); + + var op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr); + var result = {Isa}.{Method}(op1); + + ValidateResult(op1, result); + } + + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + var result = {Isa}.{Method}(_fld1); + + ValidateResult(_fld1, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + var test = TestStruct.Create(); + var result = {Isa}.{Method}(test._fld1); + + ValidateResult(test._fld1, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + + public void RunUnsupportedScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); + + bool succeeded = false; + + try + { + RunBasicScenario_UnsafeRead(); + } + catch (PlatformNotSupportedException) + { + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; + } + } + + private void ValidateResult({Op1VectorType}<{Op1BaseType}> op1, {RetType} result, [CallerMemberName] string method = "") + { + {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; + + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), op1); + + ValidateResult(inArray1, result, method); + } + + private void ValidateResult(void* op1, {RetType} result, [CallerMemberName] string method = "") + { + {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; + + Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); + + ValidateResult(inArray1, result, method); + } + + private void ValidateResult({Op1BaseType}[] firstOp, {RetType} result, [CallerMemberName] string method = "") + { + bool succeeded = true; + + if ({ValidateResult}) + { + succeeded = false; + } + + if (!succeeded) + { + TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}({Op1VectorType}<{Op1BaseType}>): {method} failed:"); + TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); + TestLibrary.TestFramework.LogInformation($" result: {result}"); + TestLibrary.TestFramework.LogInformation(string.Empty); + + Succeeded = false; + } + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveExtractVectorTest.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveExtractVectorTest.template index b19c4db7df335..b0ab0394b655d 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveExtractVectorTest.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveExtractVectorTest.template @@ -197,8 +197,8 @@ namespace JIT.HardwareIntrinsics.Arm TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); var result = {Isa}.{Method}( - {LoadIsa}.Load{Op1VectorType}(Sve.CreateTrueMask{RetBaseType}(SveMaskPattern.All), ({Op1BaseType}*)(_dataTable.inArray1Ptr)), - {LoadIsa}.Load{Op2VectorType}(Sve.CreateTrueMask{RetBaseType}(SveMaskPattern.All), ({Op2BaseType}*)(_dataTable.inArray2Ptr)), + {LoadIsa}.Load{Op1VectorType}(Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All), ({Op1BaseType}*)(_dataTable.inArray1Ptr)), + {LoadIsa}.Load{Op2VectorType}(Sve.CreateTrueMask{Op2BaseType}(SveMaskPattern.All), ({Op2BaseType}*)(_dataTable.inArray2Ptr)), ElementIndex ); From 385c4560311a5d0dd5f9b08ceb61f7fe6ca760f8 Mon Sep 17 00:00:00 2001 From: TIHan Date: Wed, 19 Jun 2024 17:16:47 -0700 Subject: [PATCH 05/10] Fixed tests. Still working on assertion failures for LastScalar. --- src/coreclr/jit/hwintrinsiccodegenarm64.cpp | 25 +++++++++-- src/coreclr/jit/hwintrinsiclistarm64sve.h | 4 +- .../GenerateHWIntrinsicTests_Arm.cs | 42 +++++++++---------- 3 files changed, 45 insertions(+), 26 deletions(-) diff --git a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp index f8ca0333ef575..f3e1ced57ef67 100644 --- a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp +++ b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp @@ -490,6 +490,24 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) { assert(!instrIsRMW); + insScalableOpts soptEmb = INS_SCALABLE_OPTS_NONE; + switch (intrinEmbMask.id) + { + case NI_Sve_ExtractAfterLastVector: + case NI_Sve_ExtractLastVector: + soptEmb = INS_SCALABLE_OPTS_WITH_SIMD_SCALAR; + break; + + case NI_Sve_ExtractAfterLastScalar: + case NI_Sve_ExtractLastScalar: + assert(!varTypeIsSIMD(op2)); + assert(GetEmitter()->isGeneralRegister(targetReg)); + break; + + default: + break; + } + if (targetReg != falseReg) { // If targetReg is not the same as `falseReg` then need to move @@ -511,7 +529,7 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) // If falseValue is zero, just zero out those lanes of targetReg using `movprfx` // and /Z GetEmitter()->emitIns_R_R_R(INS_sve_movprfx, emitSize, targetReg, maskReg, targetReg, - opt); + opt, soptEmb); } } else if (emitter::isVectorRegister(embMaskOp1Reg) && (targetReg == embMaskOp1Reg)) @@ -522,7 +540,8 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) // We cannot use use `movprfx` here to move falseReg to targetReg because that will // overwrite the value of embMaskOp1Reg which is present in targetReg. - GetEmitter()->emitIns_R_R_R(insEmbMask, emitSize, targetReg, maskReg, embMaskOp1Reg, opt); + GetEmitter()->emitIns_R_R_R(insEmbMask, emitSize, targetReg, maskReg, embMaskOp1Reg, opt, + soptEmb); GetEmitter()->emitIns_R_R_R_R(INS_sve_sel, emitSize, targetReg, maskReg, targetReg, falseReg, opt, INS_SCALABLE_OPTS_UNPREDICATED); @@ -536,7 +555,7 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) } } - GetEmitter()->emitIns_R_R_R(insEmbMask, emitSize, targetReg, maskReg, embMaskOp1Reg, opt); + GetEmitter()->emitIns_R_R_R(insEmbMask, emitSize, targetReg, maskReg, embMaskOp1Reg, opt, soptEmb); break; } diff --git a/src/coreclr/jit/hwintrinsiclistarm64sve.h b/src/coreclr/jit/hwintrinsiclistarm64sve.h index 4517b9c96ebc2..05c72649929d2 100644 --- a/src/coreclr/jit/hwintrinsiclistarm64sve.h +++ b/src/coreclr/jit/hwintrinsiclistarm64sve.h @@ -69,9 +69,9 @@ HARDWARE_INTRINSIC(Sve, CreateWhileLessThanOrEqualMask8Bit, HARDWARE_INTRINSIC(Sve, Divide, -1, 2, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sdiv, INS_sve_udiv, INS_sve_sdiv, INS_sve_udiv, INS_sve_fdiv, INS_sve_fdiv}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_HasRMWSemantics|HW_Flag_LowMaskedOperation) HARDWARE_INTRINSIC(Sve, DotProduct, -1, 3, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sdot, INS_sve_udot, INS_sve_sdot, INS_sve_udot, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasRMWSemantics) HARDWARE_INTRINSIC(Sve, DotProductBySelectedScalar, -1, 4, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sdot, INS_sve_udot, INS_sve_sdot, INS_sve_udot, INS_invalid, INS_invalid}, HW_Category_SIMDByIndexedElement, HW_Flag_Scalable|HW_Flag_BaseTypeFromFirstArg|HW_Flag_HasImmediateOperand|HW_Flag_HasRMWSemantics|HW_Flag_LowVectorOperation) -HARDWARE_INTRINSIC(Sve, ExtractAfterLastScalar, -1, -1, false, {INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_BaseTypeFromFirstArg) +HARDWARE_INTRINSIC(Sve, ExtractAfterLastScalar, -1, -1, false, {INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_BaseTypeFromFirstArg|HW_Flag_SpecialCodeGen) HARDWARE_INTRINSIC(Sve, ExtractAfterLastVector, -1, -1, false, {INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_SpecialCodeGen) -HARDWARE_INTRINSIC(Sve, ExtractLastScalar, -1, -1, false, {INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_BaseTypeFromFirstArg) +HARDWARE_INTRINSIC(Sve, ExtractLastScalar, -1, -1, false, {INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_BaseTypeFromFirstArg|HW_Flag_SpecialCodeGen) HARDWARE_INTRINSIC(Sve, ExtractLastVector, -1, -1, false, {INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_SpecialCodeGen) HARDWARE_INTRINSIC(Sve, ExtractVector, -1, 3, true, {INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasRMWSemantics|HW_Flag_SpecialCodeGen) HARDWARE_INTRINSIC(Sve, FusedMultiplyAdd, -1, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_fmla, INS_sve_fmla}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_HasRMWSemantics|HW_Flag_LowMaskedOperation|HW_Flag_FmaIntrinsic|HW_Flag_SpecialCodeGen) diff --git a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs index 8bc0557fff0ce..61c21367fb716 100644 --- a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs +++ b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs @@ -3940,27 +3940,27 @@ ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_UInt32_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_UInt64_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_Byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateResult"] = "firstOp[0] != result[0]"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_Double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateResult"] = "BitConverter.DoubleToInt64Bits(firstOp[0]) != BitConverter.DoubleToInt64Bits(result[0])"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_Int16", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateResult"] = "firstOp[0] != result[0]"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_Int32", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateResult"] = "firstOp[0] != result[0]"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_Int64", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateResult"] = "firstOp[0] != result[0]"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_SByte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateResult"] = "firstOp[0] != result[0]"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_Single", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateResult"] = "BitConverter.SingleToInt32Bits(firstOp[0]) != BitConverter.SingleToInt32Bits(result[0])"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_UInt16", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateResult"] = "firstOp[0] != result[0]"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_UInt32", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateResult"] = "firstOp[0] != result[0]"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_UInt64", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateResult"] = "firstOp[0] != result[0]"}), - - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_Byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["RetType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateResult"] = "firstOp[0] != result"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_Double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["RetType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateResult"] = "BitConverter.DoubleToInt64Bits(firstOp[0]) != BitConverter.DoubleToInt64Bits(result)"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_Int16", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["RetType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateResult"] = "firstOp[0] != result"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_Int32", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["RetType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateResult"] = "firstOp[0] != result"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_Int64", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["RetType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateResult"] = "firstOp[0] != result"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_SByte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["RetType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateResult"] = "firstOp[0] != result"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_Single", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["RetType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateResult"] = "BitConverter.SingleToInt32Bits(firstOp[0]) != BitConverter.SingleToInt32Bits(result)"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_UInt16", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["RetType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateResult"] = "firstOp[0] != result"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_UInt32", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["RetType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateResult"] = "firstOp[0] != result"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_UInt64", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["RetType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateResult"] = "firstOp[0] != result"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_Byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateResult"] = "firstOp[firstOp.Length - 1] != result[0] || result[1] != 0"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_Double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateResult"] = "BitConverter.DoubleToInt64Bits(firstOp[firstOp.Length - 1]) != BitConverter.DoubleToInt64Bits(result[0]) || result[1] != 0"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_Int16", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateResult"] = "firstOp[firstOp.Length - 1] != result[0] || result[1] != 0"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_Int32", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateResult"] = "firstOp[firstOp.Length - 1] != result[0] || result[1] != 0"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_Int64", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateResult"] = "firstOp[firstOp.Length - 1] != result[0] || result[1] != 0"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_SByte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateResult"] = "firstOp[firstOp.Length - 1] != result[0] || result[1] != 0"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_Single", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateResult"] = "BitConverter.SingleToInt32Bits(firstOp[firstOp.Length - 1]) != BitConverter.SingleToInt32Bits(result[0]) || result[1] != 0"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_UInt16", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateResult"] = "firstOp[firstOp.Length - 1] != result[0] || result[1] != 0"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_UInt32", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateResult"] = "firstOp[firstOp.Length - 1] != result[0] || result[1] != 0"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_UInt64", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateResult"] = "firstOp[firstOp.Length - 1] != result[0] || result[1] != 0"}), + + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_Byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["RetType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateResult"] = "firstOp[firstOp.Length - 1] != result"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_Double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["RetType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateResult"] = "BitConverter.DoubleToInt64Bits(firstOp[firstOp.Length - 1]) != BitConverter.DoubleToInt64Bits(result)"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_Int16", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["RetType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateResult"] = "firstOp[firstOp.Length - 1] != result"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_Int32", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["RetType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateResult"] = "firstOp[firstOp.Length - 1] != result"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_Int64", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["RetType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateResult"] = "firstOp[firstOp.Length - 1] != result"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_SByte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["RetType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateResult"] = "firstOp[firstOp.Length - 1] != result"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_Single", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["RetType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateResult"] = "BitConverter.SingleToInt32Bits(firstOp[firstOp.Length - 1]) != BitConverter.SingleToInt32Bits(result)"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_UInt16", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["RetType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateResult"] = "firstOp[firstOp.Length - 1] != result"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_UInt32", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["RetType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateResult"] = "firstOp[firstOp.Length - 1] != result"}), + ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_UInt64", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["RetType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateResult"] = "firstOp[firstOp.Length - 1] != result"}), ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastVector_Byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateResult"] = "firstOp[0] != result[0]"}), ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastVector_Double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateResult"] = "BitConverter.DoubleToInt64Bits(firstOp[0]) != BitConverter.DoubleToInt64Bits(result[0])"}), From 038177cb97868e19134710cfabd48bb96aecd927 Mon Sep 17 00:00:00 2001 From: TIHan Date: Thu, 20 Jun 2024 16:23:58 -0700 Subject: [PATCH 06/10] Removed ExtractLast and ExtractAfterLast APIs for now. Added more test coverage for TestAnyTrue, TestFirstTrue, TestLastTrue. --- src/coreclr/jit/hwintrinsiccodegenarm64.cpp | 25 +- src/coreclr/jit/hwintrinsiclistarm64sve.h | 4 - .../Arm/Sve.PlatformNotSupported.cs | 280 ----------------- .../src/System/Runtime/Intrinsics/Arm/Sve.cs | 280 ----------------- .../ref/System.Runtime.Intrinsics.cs | 40 --- .../GenerateHWIntrinsicTests_Arm.cs | 82 ++--- .../HardwareIntrinsics/Arm/Shared/Helpers.cs | 44 +++ .../Arm/Shared/SveExtractTest.template | 282 ------------------ .../Arm/Shared/SveTestTest.template | 66 ++++ 9 files changed, 134 insertions(+), 969 deletions(-) delete mode 100644 src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveExtractTest.template diff --git a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp index f3e1ced57ef67..f8ca0333ef575 100644 --- a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp +++ b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp @@ -490,24 +490,6 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) { assert(!instrIsRMW); - insScalableOpts soptEmb = INS_SCALABLE_OPTS_NONE; - switch (intrinEmbMask.id) - { - case NI_Sve_ExtractAfterLastVector: - case NI_Sve_ExtractLastVector: - soptEmb = INS_SCALABLE_OPTS_WITH_SIMD_SCALAR; - break; - - case NI_Sve_ExtractAfterLastScalar: - case NI_Sve_ExtractLastScalar: - assert(!varTypeIsSIMD(op2)); - assert(GetEmitter()->isGeneralRegister(targetReg)); - break; - - default: - break; - } - if (targetReg != falseReg) { // If targetReg is not the same as `falseReg` then need to move @@ -529,7 +511,7 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) // If falseValue is zero, just zero out those lanes of targetReg using `movprfx` // and /Z GetEmitter()->emitIns_R_R_R(INS_sve_movprfx, emitSize, targetReg, maskReg, targetReg, - opt, soptEmb); + opt); } } else if (emitter::isVectorRegister(embMaskOp1Reg) && (targetReg == embMaskOp1Reg)) @@ -540,8 +522,7 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) // We cannot use use `movprfx` here to move falseReg to targetReg because that will // overwrite the value of embMaskOp1Reg which is present in targetReg. - GetEmitter()->emitIns_R_R_R(insEmbMask, emitSize, targetReg, maskReg, embMaskOp1Reg, opt, - soptEmb); + GetEmitter()->emitIns_R_R_R(insEmbMask, emitSize, targetReg, maskReg, embMaskOp1Reg, opt); GetEmitter()->emitIns_R_R_R_R(INS_sve_sel, emitSize, targetReg, maskReg, targetReg, falseReg, opt, INS_SCALABLE_OPTS_UNPREDICATED); @@ -555,7 +536,7 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) } } - GetEmitter()->emitIns_R_R_R(insEmbMask, emitSize, targetReg, maskReg, embMaskOp1Reg, opt, soptEmb); + GetEmitter()->emitIns_R_R_R(insEmbMask, emitSize, targetReg, maskReg, embMaskOp1Reg, opt); break; } diff --git a/src/coreclr/jit/hwintrinsiclistarm64sve.h b/src/coreclr/jit/hwintrinsiclistarm64sve.h index 05c72649929d2..3b43a35aca233 100644 --- a/src/coreclr/jit/hwintrinsiclistarm64sve.h +++ b/src/coreclr/jit/hwintrinsiclistarm64sve.h @@ -69,10 +69,6 @@ HARDWARE_INTRINSIC(Sve, CreateWhileLessThanOrEqualMask8Bit, HARDWARE_INTRINSIC(Sve, Divide, -1, 2, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sdiv, INS_sve_udiv, INS_sve_sdiv, INS_sve_udiv, INS_sve_fdiv, INS_sve_fdiv}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_HasRMWSemantics|HW_Flag_LowMaskedOperation) HARDWARE_INTRINSIC(Sve, DotProduct, -1, 3, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sdot, INS_sve_udot, INS_sve_sdot, INS_sve_udot, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasRMWSemantics) HARDWARE_INTRINSIC(Sve, DotProductBySelectedScalar, -1, 4, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_sdot, INS_sve_udot, INS_sve_sdot, INS_sve_udot, INS_invalid, INS_invalid}, HW_Category_SIMDByIndexedElement, HW_Flag_Scalable|HW_Flag_BaseTypeFromFirstArg|HW_Flag_HasImmediateOperand|HW_Flag_HasRMWSemantics|HW_Flag_LowVectorOperation) -HARDWARE_INTRINSIC(Sve, ExtractAfterLastScalar, -1, -1, false, {INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_BaseTypeFromFirstArg|HW_Flag_SpecialCodeGen) -HARDWARE_INTRINSIC(Sve, ExtractAfterLastVector, -1, -1, false, {INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta, INS_sve_lasta}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_SpecialCodeGen) -HARDWARE_INTRINSIC(Sve, ExtractLastScalar, -1, -1, false, {INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_BaseTypeFromFirstArg|HW_Flag_SpecialCodeGen) -HARDWARE_INTRINSIC(Sve, ExtractLastVector, -1, -1, false, {INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb, INS_sve_lastb}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation|HW_Flag_SpecialCodeGen) HARDWARE_INTRINSIC(Sve, ExtractVector, -1, 3, true, {INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext, INS_sve_ext}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasRMWSemantics|HW_Flag_SpecialCodeGen) HARDWARE_INTRINSIC(Sve, FusedMultiplyAdd, -1, -1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_fmla, INS_sve_fmla}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_HasRMWSemantics|HW_Flag_LowMaskedOperation|HW_Flag_FmaIntrinsic|HW_Flag_SpecialCodeGen) HARDWARE_INTRINSIC(Sve, FusedMultiplyAddBySelectedScalar, -1, 4, true, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_fmla, INS_sve_fmla}, HW_Category_SIMDByIndexedElement, HW_Flag_Scalable|HW_Flag_HasImmediateOperand|HW_Flag_HasRMWSemantics|HW_Flag_FmaIntrinsic|HW_Flag_LowVectorOperation) 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 2734bb5be5011..0f92394dfc33c 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 @@ -1403,286 +1403,6 @@ internal Arm64() { } public static unsafe Vector DotProductBySelectedScalar(Vector addend, Vector left, Vector right, [ConstantExpected] byte rightIndex) { throw new PlatformNotSupportedException(); } - /// - /// uint8_t svlasta[_u8](svbool_t pg, svuint8_t op) - /// LASTA Wresult, Pg, Zop.B - /// LASTA Bresult, Pg, Zop.B - /// - public static unsafe byte ExtractAfterLastScalar(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// float64_t svlasta[_f64](svbool_t pg, svfloat64_t op) - /// LASTA Xresult, Pg, Zop.D - /// LASTA Dresult, Pg, Zop.D - /// - public static unsafe double ExtractAfterLastScalar(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// int16_t svlasta[_s16](svbool_t pg, svint16_t op) - /// LASTA Wresult, Pg, Zop.H - /// LASTA Hresult, Pg, Zop.H - /// - public static unsafe short ExtractAfterLastScalar(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// int32_t svlasta[_s32](svbool_t pg, svint32_t op) - /// LASTA Wresult, Pg, Zop.S - /// LASTA Sresult, Pg, Zop.S - /// - public static unsafe int ExtractAfterLastScalar(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// int64_t svlasta[_s64](svbool_t pg, svint64_t op) - /// LASTA Xresult, Pg, Zop.D - /// LASTA Dresult, Pg, Zop.D - /// - public static unsafe long ExtractAfterLastScalar(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// int8_t svlasta[_s8](svbool_t pg, svint8_t op) - /// LASTA Wresult, Pg, Zop.B - /// LASTA Bresult, Pg, Zop.B - /// - public static unsafe sbyte ExtractAfterLastScalar(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// float32_t svlasta[_f32](svbool_t pg, svfloat32_t op) - /// LASTA Wresult, Pg, Zop.S - /// LASTA Sresult, Pg, Zop.S - /// - public static unsafe float ExtractAfterLastScalar(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// uint16_t svlasta[_u16](svbool_t pg, svuint16_t op) - /// LASTA Wresult, Pg, Zop.H - /// LASTA Hresult, Pg, Zop.H - /// - public static unsafe ushort ExtractAfterLastScalar(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// uint32_t svlasta[_u32](svbool_t pg, svuint32_t op) - /// LASTA Wresult, Pg, Zop.S - /// LASTA Sresult, Pg, Zop.S - /// - public static unsafe uint ExtractAfterLastScalar(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// uint64_t svlasta[_u64](svbool_t pg, svuint64_t op) - /// LASTA Xresult, Pg, Zop.D - /// LASTA Dresult, Pg, Zop.D - /// - public static unsafe ulong ExtractAfterLastScalar(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// uint8_t svlasta[_u8](svbool_t pg, svuint8_t op) - /// LASTA Wresult, Pg, Zop.B - /// LASTA Bresult, Pg, Zop.B - /// - public static unsafe Vector ExtractAfterLastVector(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// float64_t svlasta[_f64](svbool_t pg, svfloat64_t op) - /// LASTA Xresult, Pg, Zop.D - /// LASTA Dresult, Pg, Zop.D - /// - public static unsafe Vector ExtractAfterLastVector(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// int16_t svlasta[_s16](svbool_t pg, svint16_t op) - /// LASTA Wresult, Pg, Zop.H - /// LASTA Hresult, Pg, Zop.H - /// - public static unsafe Vector ExtractAfterLastVector(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// int32_t svlasta[_s32](svbool_t pg, svint32_t op) - /// LASTA Wresult, Pg, Zop.S - /// LASTA Sresult, Pg, Zop.S - /// - public static unsafe Vector ExtractAfterLastVector(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// int64_t svlasta[_s64](svbool_t pg, svint64_t op) - /// LASTA Xresult, Pg, Zop.D - /// LASTA Dresult, Pg, Zop.D - /// - public static unsafe Vector ExtractAfterLastVector(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// int8_t svlasta[_s8](svbool_t pg, svint8_t op) - /// LASTA Wresult, Pg, Zop.B - /// LASTA Bresult, Pg, Zop.B - /// - public static unsafe Vector ExtractAfterLastVector(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// float32_t svlasta[_f32](svbool_t pg, svfloat32_t op) - /// LASTA Wresult, Pg, Zop.S - /// LASTA Sresult, Pg, Zop.S - /// - public static unsafe Vector ExtractAfterLastVector(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// uint16_t svlasta[_u16](svbool_t pg, svuint16_t op) - /// LASTA Wresult, Pg, Zop.H - /// LASTA Hresult, Pg, Zop.H - /// - public static unsafe Vector ExtractAfterLastVector(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// uint32_t svlasta[_u32](svbool_t pg, svuint32_t op) - /// LASTA Wresult, Pg, Zop.S - /// LASTA Sresult, Pg, Zop.S - /// - public static unsafe Vector ExtractAfterLastVector(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// uint64_t svlasta[_u64](svbool_t pg, svuint64_t op) - /// LASTA Xresult, Pg, Zop.D - /// LASTA Dresult, Pg, Zop.D - /// - public static unsafe Vector ExtractAfterLastVector(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// uint8_t svlastb[_u8](svbool_t pg, svuint8_t op) - /// LASTB Wresult, Pg, Zop.B - /// LASTB Bresult, Pg, Zop.B - /// - public static unsafe byte ExtractLastScalar(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// float64_t svlastb[_f64](svbool_t pg, svfloat64_t op) - /// LASTB Xresult, Pg, Zop.D - /// LASTB Dresult, Pg, Zop.D - /// - public static unsafe double ExtractLastScalar(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// int16_t svlastb[_s16](svbool_t pg, svint16_t op) - /// LASTB Wresult, Pg, Zop.H - /// LASTB Hresult, Pg, Zop.H - /// - public static unsafe short ExtractLastScalar(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// int32_t svlastb[_s32](svbool_t pg, svint32_t op) - /// LASTB Wresult, Pg, Zop.S - /// LASTB Sresult, Pg, Zop.S - /// - public static unsafe int ExtractLastScalar(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// int64_t svlastb[_s64](svbool_t pg, svint64_t op) - /// LASTB Xresult, Pg, Zop.D - /// LASTB Dresult, Pg, Zop.D - /// - public static unsafe long ExtractLastScalar(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// int8_t svlastb[_s8](svbool_t pg, svint8_t op) - /// LASTB Wresult, Pg, Zop.B - /// LASTB Bresult, Pg, Zop.B - /// - public static unsafe sbyte ExtractLastScalar(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// float32_t svlastb[_f32](svbool_t pg, svfloat32_t op) - /// LASTB Wresult, Pg, Zop.S - /// LASTB Sresult, Pg, Zop.S - /// - public static unsafe float ExtractLastScalar(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// uint16_t svlastb[_u16](svbool_t pg, svuint16_t op) - /// LASTB Wresult, Pg, Zop.H - /// LASTB Hresult, Pg, Zop.H - /// - public static unsafe ushort ExtractLastScalar(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// uint32_t svlastb[_u32](svbool_t pg, svuint32_t op) - /// LASTB Wresult, Pg, Zop.S - /// LASTB Sresult, Pg, Zop.S - /// - public static unsafe uint ExtractLastScalar(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// uint64_t svlastb[_u64](svbool_t pg, svuint64_t op) - /// LASTB Xresult, Pg, Zop.D - /// LASTB Dresult, Pg, Zop.D - /// - public static unsafe ulong ExtractLastScalar(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// uint8_t svlastb[_u8](svbool_t pg, svuint8_t op) - /// LASTB Wresult, Pg, Zop.B - /// LASTB Bresult, Pg, Zop.B - /// - public static unsafe Vector ExtractLastVector(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// float64_t svlastb[_f64](svbool_t pg, svfloat64_t op) - /// LASTB Xresult, Pg, Zop.D - /// LASTB Dresult, Pg, Zop.D - /// - public static unsafe Vector ExtractLastVector(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// int16_t svlastb[_s16](svbool_t pg, svint16_t op) - /// LASTB Wresult, Pg, Zop.H - /// LASTB Hresult, Pg, Zop.H - /// - public static unsafe Vector ExtractLastVector(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// int32_t svlastb[_s32](svbool_t pg, svint32_t op) - /// LASTB Wresult, Pg, Zop.S - /// LASTB Sresult, Pg, Zop.S - /// - public static unsafe Vector ExtractLastVector(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// int64_t svlastb[_s64](svbool_t pg, svint64_t op) - /// LASTB Xresult, Pg, Zop.D - /// LASTB Dresult, Pg, Zop.D - /// - public static unsafe Vector ExtractLastVector(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// int8_t svlastb[_s8](svbool_t pg, svint8_t op) - /// LASTB Wresult, Pg, Zop.B - /// LASTB Bresult, Pg, Zop.B - /// - public static unsafe Vector ExtractLastVector(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// float32_t svlastb[_f32](svbool_t pg, svfloat32_t op) - /// LASTB Wresult, Pg, Zop.S - /// LASTB Sresult, Pg, Zop.S - /// - public static unsafe Vector ExtractLastVector(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// uint16_t svlastb[_u16](svbool_t pg, svuint16_t op) - /// LASTB Wresult, Pg, Zop.H - /// LASTB Hresult, Pg, Zop.H - /// - public static unsafe Vector ExtractLastVector(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// uint32_t svlastb[_u32](svbool_t pg, svuint32_t op) - /// LASTB Wresult, Pg, Zop.S - /// LASTB Sresult, Pg, Zop.S - /// - public static unsafe Vector ExtractLastVector(Vector value) { throw new PlatformNotSupportedException(); } - - /// - /// uint64_t svlastb[_u64](svbool_t pg, svuint64_t op) - /// LASTB Xresult, Pg, Zop.D - /// LASTB Dresult, Pg, Zop.D - /// - public static unsafe Vector ExtractLastVector(Vector value) { throw new PlatformNotSupportedException(); } - /// /// svuint8_t svext[_u8](svuint8_t op1, svuint8_t op2, uint64_t imm3) /// EXT Ztied1.B, Ztied1.B, Zop2.B, #imm3 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 46d6eb4a4dd59..56e5edb1f0425 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 @@ -1459,286 +1459,6 @@ internal Arm64() { } public static unsafe Vector DotProductBySelectedScalar(Vector addend, Vector left, Vector right, [ConstantExpected] byte rightIndex) => DotProductBySelectedScalar(addend, left, right, rightIndex); - /// - /// uint8_t svlasta[_u8](svbool_t pg, svuint8_t op) - /// LASTA Wresult, Pg, Zop.B - /// LASTA Bresult, Pg, Zop.B - /// - public static unsafe byte ExtractAfterLastScalar(Vector value) => ExtractAfterLastScalar(value); - - /// - /// float64_t svlasta[_f64](svbool_t pg, svfloat64_t op) - /// LASTA Xresult, Pg, Zop.D - /// LASTA Dresult, Pg, Zop.D - /// - public static unsafe double ExtractAfterLastScalar(Vector value) => ExtractAfterLastScalar(value); - - /// - /// int16_t svlasta[_s16](svbool_t pg, svint16_t op) - /// LASTA Wresult, Pg, Zop.H - /// LASTA Hresult, Pg, Zop.H - /// - public static unsafe short ExtractAfterLastScalar(Vector value) => ExtractAfterLastScalar(value); - - /// - /// int32_t svlasta[_s32](svbool_t pg, svint32_t op) - /// LASTA Wresult, Pg, Zop.S - /// LASTA Sresult, Pg, Zop.S - /// - public static unsafe int ExtractAfterLastScalar(Vector value) => ExtractAfterLastScalar(value); - - /// - /// int64_t svlasta[_s64](svbool_t pg, svint64_t op) - /// LASTA Xresult, Pg, Zop.D - /// LASTA Dresult, Pg, Zop.D - /// - public static unsafe long ExtractAfterLastScalar(Vector value) => ExtractAfterLastScalar(value); - - /// - /// int8_t svlasta[_s8](svbool_t pg, svint8_t op) - /// LASTA Wresult, Pg, Zop.B - /// LASTA Bresult, Pg, Zop.B - /// - public static unsafe sbyte ExtractAfterLastScalar(Vector value) => ExtractAfterLastScalar(value); - - /// - /// float32_t svlasta[_f32](svbool_t pg, svfloat32_t op) - /// LASTA Wresult, Pg, Zop.S - /// LASTA Sresult, Pg, Zop.S - /// - public static unsafe float ExtractAfterLastScalar(Vector value) => ExtractAfterLastScalar(value); - - /// - /// uint16_t svlasta[_u16](svbool_t pg, svuint16_t op) - /// LASTA Wresult, Pg, Zop.H - /// LASTA Hresult, Pg, Zop.H - /// - public static unsafe ushort ExtractAfterLastScalar(Vector value) => ExtractAfterLastScalar(value); - - /// - /// uint32_t svlasta[_u32](svbool_t pg, svuint32_t op) - /// LASTA Wresult, Pg, Zop.S - /// LASTA Sresult, Pg, Zop.S - /// - public static unsafe uint ExtractAfterLastScalar(Vector value) => ExtractAfterLastScalar(value); - - /// - /// uint64_t svlasta[_u64](svbool_t pg, svuint64_t op) - /// LASTA Xresult, Pg, Zop.D - /// LASTA Dresult, Pg, Zop.D - /// - public static unsafe ulong ExtractAfterLastScalar(Vector value) => ExtractAfterLastScalar(value); - - /// - /// uint8_t svlasta[_u8](svbool_t pg, svuint8_t op) - /// LASTA Wresult, Pg, Zop.B - /// LASTA Bresult, Pg, Zop.B - /// - public static unsafe Vector ExtractAfterLastVector(Vector value) => ExtractAfterLastVector(value); - - /// - /// float64_t svlasta[_f64](svbool_t pg, svfloat64_t op) - /// LASTA Xresult, Pg, Zop.D - /// LASTA Dresult, Pg, Zop.D - /// - public static unsafe Vector ExtractAfterLastVector(Vector value) => ExtractAfterLastVector(value); - - /// - /// int16_t svlasta[_s16](svbool_t pg, svint16_t op) - /// LASTA Wresult, Pg, Zop.H - /// LASTA Hresult, Pg, Zop.H - /// - public static unsafe Vector ExtractAfterLastVector(Vector value) => ExtractAfterLastVector(value); - - /// - /// int32_t svlasta[_s32](svbool_t pg, svint32_t op) - /// LASTA Wresult, Pg, Zop.S - /// LASTA Sresult, Pg, Zop.S - /// - public static unsafe Vector ExtractAfterLastVector(Vector value) => ExtractAfterLastVector(value); - - /// - /// int64_t svlasta[_s64](svbool_t pg, svint64_t op) - /// LASTA Xresult, Pg, Zop.D - /// LASTA Dresult, Pg, Zop.D - /// - public static unsafe Vector ExtractAfterLastVector(Vector value) => ExtractAfterLastVector(value); - - /// - /// int8_t svlasta[_s8](svbool_t pg, svint8_t op) - /// LASTA Wresult, Pg, Zop.B - /// LASTA Bresult, Pg, Zop.B - /// - public static unsafe Vector ExtractAfterLastVector(Vector value) => ExtractAfterLastVector(value); - - /// - /// float32_t svlasta[_f32](svbool_t pg, svfloat32_t op) - /// LASTA Wresult, Pg, Zop.S - /// LASTA Sresult, Pg, Zop.S - /// - public static unsafe Vector ExtractAfterLastVector(Vector value) => ExtractAfterLastVector(value); - - /// - /// uint16_t svlasta[_u16](svbool_t pg, svuint16_t op) - /// LASTA Wresult, Pg, Zop.H - /// LASTA Hresult, Pg, Zop.H - /// - public static unsafe Vector ExtractAfterLastVector(Vector value) => ExtractAfterLastVector(value); - - /// - /// uint32_t svlasta[_u32](svbool_t pg, svuint32_t op) - /// LASTA Wresult, Pg, Zop.S - /// LASTA Sresult, Pg, Zop.S - /// - public static unsafe Vector ExtractAfterLastVector(Vector value) => ExtractAfterLastVector(value); - - /// - /// uint64_t svlasta[_u64](svbool_t pg, svuint64_t op) - /// LASTA Xresult, Pg, Zop.D - /// LASTA Dresult, Pg, Zop.D - /// - public static unsafe Vector ExtractAfterLastVector(Vector value) => ExtractAfterLastVector(value); - - /// - /// uint8_t svlastb[_u8](svbool_t pg, svuint8_t op) - /// LASTB Wresult, Pg, Zop.B - /// LASTB Bresult, Pg, Zop.B - /// - public static unsafe byte ExtractLastScalar(Vector value) => ExtractLastScalar(value); - - /// - /// float64_t svlastb[_f64](svbool_t pg, svfloat64_t op) - /// LASTB Xresult, Pg, Zop.D - /// LASTB Dresult, Pg, Zop.D - /// - public static unsafe double ExtractLastScalar(Vector value) => ExtractLastScalar(value); - - /// - /// int16_t svlastb[_s16](svbool_t pg, svint16_t op) - /// LASTB Wresult, Pg, Zop.H - /// LASTB Hresult, Pg, Zop.H - /// - public static unsafe short ExtractLastScalar(Vector value) => ExtractLastScalar(value); - - /// - /// int32_t svlastb[_s32](svbool_t pg, svint32_t op) - /// LASTB Wresult, Pg, Zop.S - /// LASTB Sresult, Pg, Zop.S - /// - public static unsafe int ExtractLastScalar(Vector value) => ExtractLastScalar(value); - - /// - /// int64_t svlastb[_s64](svbool_t pg, svint64_t op) - /// LASTB Xresult, Pg, Zop.D - /// LASTB Dresult, Pg, Zop.D - /// - public static unsafe long ExtractLastScalar(Vector value) => ExtractLastScalar(value); - - /// - /// int8_t svlastb[_s8](svbool_t pg, svint8_t op) - /// LASTB Wresult, Pg, Zop.B - /// LASTB Bresult, Pg, Zop.B - /// - public static unsafe sbyte ExtractLastScalar(Vector value) => ExtractLastScalar(value); - - /// - /// float32_t svlastb[_f32](svbool_t pg, svfloat32_t op) - /// LASTB Wresult, Pg, Zop.S - /// LASTB Sresult, Pg, Zop.S - /// - public static unsafe float ExtractLastScalar(Vector value) => ExtractLastScalar(value); - - /// - /// uint16_t svlastb[_u16](svbool_t pg, svuint16_t op) - /// LASTB Wresult, Pg, Zop.H - /// LASTB Hresult, Pg, Zop.H - /// - public static unsafe ushort ExtractLastScalar(Vector value) => ExtractLastScalar(value); - - /// - /// uint32_t svlastb[_u32](svbool_t pg, svuint32_t op) - /// LASTB Wresult, Pg, Zop.S - /// LASTB Sresult, Pg, Zop.S - /// - public static unsafe uint ExtractLastScalar(Vector value) => ExtractLastScalar(value); - - /// - /// uint64_t svlastb[_u64](svbool_t pg, svuint64_t op) - /// LASTB Xresult, Pg, Zop.D - /// LASTB Dresult, Pg, Zop.D - /// - public static unsafe ulong ExtractLastScalar(Vector value) => ExtractLastScalar(value); - - /// - /// uint8_t svlastb[_u8](svbool_t pg, svuint8_t op) - /// LASTB Wresult, Pg, Zop.B - /// LASTB Bresult, Pg, Zop.B - /// - public static unsafe Vector ExtractLastVector(Vector value) => ExtractLastVector(value); - - /// - /// float64_t svlastb[_f64](svbool_t pg, svfloat64_t op) - /// LASTB Xresult, Pg, Zop.D - /// LASTB Dresult, Pg, Zop.D - /// - public static unsafe Vector ExtractLastVector(Vector value) => ExtractLastVector(value); - - /// - /// int16_t svlastb[_s16](svbool_t pg, svint16_t op) - /// LASTB Wresult, Pg, Zop.H - /// LASTB Hresult, Pg, Zop.H - /// - public static unsafe Vector ExtractLastVector(Vector value) => ExtractLastVector(value); - - /// - /// int32_t svlastb[_s32](svbool_t pg, svint32_t op) - /// LASTB Wresult, Pg, Zop.S - /// LASTB Sresult, Pg, Zop.S - /// - public static unsafe Vector ExtractLastVector(Vector value) => ExtractLastVector(value); - - /// - /// int64_t svlastb[_s64](svbool_t pg, svint64_t op) - /// LASTB Xresult, Pg, Zop.D - /// LASTB Dresult, Pg, Zop.D - /// - public static unsafe Vector ExtractLastVector(Vector value) => ExtractLastVector(value); - - /// - /// int8_t svlastb[_s8](svbool_t pg, svint8_t op) - /// LASTB Wresult, Pg, Zop.B - /// LASTB Bresult, Pg, Zop.B - /// - public static unsafe Vector ExtractLastVector(Vector value) => ExtractLastVector(value); - - /// - /// float32_t svlastb[_f32](svbool_t pg, svfloat32_t op) - /// LASTB Wresult, Pg, Zop.S - /// LASTB Sresult, Pg, Zop.S - /// - public static unsafe Vector ExtractLastVector(Vector value) => ExtractLastVector(value); - - /// - /// uint16_t svlastb[_u16](svbool_t pg, svuint16_t op) - /// LASTB Wresult, Pg, Zop.H - /// LASTB Hresult, Pg, Zop.H - /// - public static unsafe Vector ExtractLastVector(Vector value) => ExtractLastVector(value); - - /// - /// uint32_t svlastb[_u32](svbool_t pg, svuint32_t op) - /// LASTB Wresult, Pg, Zop.S - /// LASTB Sresult, Pg, Zop.S - /// - public static unsafe Vector ExtractLastVector(Vector value) => ExtractLastVector(value); - - /// - /// uint64_t svlastb[_u64](svbool_t pg, svuint64_t op) - /// LASTB Xresult, Pg, Zop.D - /// LASTB Dresult, Pg, Zop.D - /// - public static unsafe Vector ExtractLastVector(Vector value) => ExtractLastVector(value); - /// /// svuint8_t svext[_u8](svuint8_t op1, svuint8_t op2, uint64_t imm3) /// EXT Ztied1.B, Ztied1.B, Zop2.B, #imm3 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 de9e1c31bef2f..e14bb9c9c4ee7 100644 --- a/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs +++ b/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs @@ -4391,46 +4391,6 @@ internal Arm64() { } public static System.Numerics.Vector DotProductBySelectedScalar(System.Numerics.Vector addend, System.Numerics.Vector left, System.Numerics.Vector right, [ConstantExpected] byte rightIndex) { throw null; } public static System.Numerics.Vector DotProductBySelectedScalar(System.Numerics.Vector addend, System.Numerics.Vector left, System.Numerics.Vector right, [ConstantExpected] byte rightIndex) { throw null; } - public static unsafe byte ExtractAfterLastScalar(System.Numerics.Vector value) { throw null; } - public static unsafe double ExtractAfterLastScalar(System.Numerics.Vector value) { throw null; } - public static unsafe short ExtractAfterLastScalar(System.Numerics.Vector value) { throw null; } - public static unsafe int ExtractAfterLastScalar(System.Numerics.Vector value) { throw null; } - public static unsafe long ExtractAfterLastScalar(System.Numerics.Vector value) { throw null; } - public static unsafe sbyte ExtractAfterLastScalar(System.Numerics.Vector value) { throw null; } - public static unsafe float ExtractAfterLastScalar(System.Numerics.Vector value) { throw null; } - public static unsafe ushort ExtractAfterLastScalar(System.Numerics.Vector value) { throw null; } - public static unsafe uint ExtractAfterLastScalar(System.Numerics.Vector value) { throw null; } - public static unsafe ulong ExtractAfterLastScalar(System.Numerics.Vector value) { throw null; } - public static unsafe System.Numerics.Vector ExtractAfterLastVector(System.Numerics.Vector value) { throw null; } - public static unsafe System.Numerics.Vector ExtractAfterLastVector(System.Numerics.Vector value) { throw null; } - public static unsafe System.Numerics.Vector ExtractAfterLastVector(System.Numerics.Vector value) { throw null; } - public static unsafe System.Numerics.Vector ExtractAfterLastVector(System.Numerics.Vector value) { throw null; } - public static unsafe System.Numerics.Vector ExtractAfterLastVector(System.Numerics.Vector value) { throw null; } - public static unsafe System.Numerics.Vector ExtractAfterLastVector(System.Numerics.Vector value) { throw null; } - public static unsafe System.Numerics.Vector ExtractAfterLastVector(System.Numerics.Vector value) { throw null; } - public static unsafe System.Numerics.Vector ExtractAfterLastVector(System.Numerics.Vector value) { throw null; } - public static unsafe System.Numerics.Vector ExtractAfterLastVector(System.Numerics.Vector value) { throw null; } - public static unsafe System.Numerics.Vector ExtractAfterLastVector(System.Numerics.Vector value) { throw null; } - public static unsafe byte ExtractLastScalar(System.Numerics.Vector value) { throw null; } - public static unsafe double ExtractLastScalar(System.Numerics.Vector value) { throw null; } - public static unsafe short ExtractLastScalar(System.Numerics.Vector value) { throw null; } - public static unsafe int ExtractLastScalar(System.Numerics.Vector value) { throw null; } - public static unsafe long ExtractLastScalar(System.Numerics.Vector value) { throw null; } - public static unsafe sbyte ExtractLastScalar(System.Numerics.Vector value) { throw null; } - public static unsafe float ExtractLastScalar(System.Numerics.Vector value) { throw null; } - public static unsafe ushort ExtractLastScalar(System.Numerics.Vector value) { throw null; } - public static unsafe uint ExtractLastScalar(System.Numerics.Vector value) { throw null; } - public static unsafe ulong ExtractLastScalar(System.Numerics.Vector value) { throw null; } - public static unsafe System.Numerics.Vector ExtractLastVector(System.Numerics.Vector value) { throw null; } - public static unsafe System.Numerics.Vector ExtractLastVector(System.Numerics.Vector value) { throw null; } - public static unsafe System.Numerics.Vector ExtractLastVector(System.Numerics.Vector value) { throw null; } - public static unsafe System.Numerics.Vector ExtractLastVector(System.Numerics.Vector value) { throw null; } - public static unsafe System.Numerics.Vector ExtractLastVector(System.Numerics.Vector value) { throw null; } - public static unsafe System.Numerics.Vector ExtractLastVector(System.Numerics.Vector value) { throw null; } - public static unsafe System.Numerics.Vector ExtractLastVector(System.Numerics.Vector value) { throw null; } - public static unsafe System.Numerics.Vector ExtractLastVector(System.Numerics.Vector value) { throw null; } - public static unsafe System.Numerics.Vector ExtractLastVector(System.Numerics.Vector value) { throw null; } - public static unsafe System.Numerics.Vector ExtractLastVector(System.Numerics.Vector value) { throw null; } public static unsafe System.Numerics.Vector ExtractVector(System.Numerics.Vector upper, System.Numerics.Vector lower, [ConstantExpected] byte index) { throw null; } public static unsafe System.Numerics.Vector ExtractVector(System.Numerics.Vector upper, System.Numerics.Vector lower, [ConstantExpected] byte index) { throw null; } public static unsafe System.Numerics.Vector ExtractVector(System.Numerics.Vector upper, System.Numerics.Vector lower, [ConstantExpected] byte index) { throw null; } diff --git a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs index 61c21367fb716..58ed27fe030fb 100644 --- a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs +++ b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs @@ -3911,23 +3911,27 @@ ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "UInt32", ["Op1Value"] = "Sve.CreateTrueMaskUInt32(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateFalseMaskUInt32()", ["ValidateEntry"] = "result != false"}), ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "UInt64", ["Op1Value"] = "Sve.CreateFalseMaskUInt64()", ["Op2Value"] = "Sve.CreateFalseMaskUInt64()", ["ValidateEntry"] = "result != false"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "SByte", ["Op1Value"] = "Sve.CreateTrueMaskSByte(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateTrueMaskSByte(SveMaskPattern.All)", ["ValidateEntry"] = "result != true"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "Int16", ["Op1Value"] = "Sve.CreateFalseMaskInt16()", ["Op2Value"] = "Sve.CreateTrueMaskInt16(SveMaskPattern.All)", ["ValidateEntry"] = "result != false"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "Int32", ["Op1Value"] = "Sve.CreateFalseMaskInt32()", ["Op2Value"] = "Sve.CreateFalseMaskInt32()", ["ValidateEntry"] = "result != false"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "Int64", ["Op1Value"] = "Sve.CreateTrueMaskInt64(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateTrueMaskInt64(SveMaskPattern.All)", ["ValidateEntry"] = "result != true"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "Byte", ["Op1Value"] = "Sve.CreateTrueMaskByte(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateFalseMaskByte()", ["ValidateEntry"] = "result != false"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "UInt16", ["Op1Value"] = "Sve.CreateTrueMaskUInt16(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateTrueMaskUInt16(SveMaskPattern.All)", ["ValidateEntry"] = "result != true"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "UInt32", ["Op1Value"] = "Sve.CreateTrueMaskUInt32(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateFalseMaskUInt32()", ["ValidateEntry"] = "result != false"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "UInt64", ["Op1Value"] = "Sve.CreateFalseMaskUInt64()", ["Op2Value"] = "Sve.CreateFalseMaskUInt64()", ["ValidateEntry"] = "result != false"}), - - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "SByte", ["Op1Value"] = "Sve.CreateTrueMaskSByte(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateTrueMaskSByte(SveMaskPattern.All)", ["ValidateEntry"] = "result != true"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "Int16", ["Op1Value"] = "Sve.CreateFalseMaskInt16()", ["Op2Value"] = "Sve.CreateTrueMaskInt16(SveMaskPattern.All)", ["ValidateEntry"] = "result != false"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "Int32", ["Op1Value"] = "Sve.CreateFalseMaskInt32()", ["Op2Value"] = "Sve.CreateFalseMaskInt32()", ["ValidateEntry"] = "result != false"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "Int64", ["Op1Value"] = "Sve.CreateTrueMaskInt64(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateTrueMaskInt64(SveMaskPattern.All)", ["ValidateEntry"] = "result != true"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "Byte", ["Op1Value"] = "Sve.CreateTrueMaskByte(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateFalseMaskByte()", ["ValidateEntry"] = "result != false"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "UInt16", ["Op1Value"] = "Sve.CreateTrueMaskUInt16(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateTrueMaskUInt16(SveMaskPattern.All)", ["ValidateEntry"] = "result != true"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "UInt32", ["Op1Value"] = "Sve.CreateTrueMaskUInt32(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateFalseMaskUInt32()", ["ValidateEntry"] = "result != false"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "UInt64", ["Op1Value"] = "Sve.CreateFalseMaskUInt64()", ["Op2Value"] = "Sve.CreateFalseMaskUInt64()", ["ValidateEntry"] = "result != false"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "SByte", ["Op1Value"] = "Helpers.CreateAndFillMaskFromFirstElement(1)", ["Op2Value"] = "Helpers.CreateAndFillMaskFromFirstElement(1)", ["ValidateEntry"] = "result != true"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "Int16", ["Op1Value"] = "Helpers.CreateAndFillMaskFromFirstElement(1)", ["Op2Value"] = "Helpers.CreateAndFillMaskFromSecondElement(1)", ["ValidateEntry"] = "result != false"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "Int32", ["Op1Value"] = "Sve.CreateFalseMaskInt32()", ["Op2Value"] = "Sve.CreateFalseMaskInt32()", ["ValidateEntry"] = "result != false"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "Int64", ["Op1Value"] = "Helpers.CreateAndFillMaskFromFirstElement(1)", ["Op2Value"] = "Helpers.CreateAndFillMaskFromFirstElement(1)", ["ValidateEntry"] = "result != true"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "Byte", ["Op1Value"] = "Sve.CreateTrueMaskByte(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateFalseMaskByte()", ["ValidateEntry"] = "result != false"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "UInt16", ["Op1Value"] = "Sve.CreateTrueMaskUInt16(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateTrueMaskUInt16(SveMaskPattern.All)", ["ValidateEntry"] = "result != true"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "UInt32", ["Op1Value"] = "Sve.CreateTrueMaskUInt32(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateFalseMaskUInt32()", ["ValidateEntry"] = "result != false"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "UInt64", ["Op1Value"] = "Sve.CreateFalseMaskUInt64()", ["Op2Value"] = "Sve.CreateFalseMaskUInt64()", ["ValidateEntry"] = "result != false"}), + + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "SByte", ["Op1Value"] = "Helpers.CreateAndFillMaskFromLastElement(1)", ["Op2Value"] = "Helpers.CreateAndFillMaskFromLastElement(1)", ["ValidateEntry"] = "result != true"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "Int16", ["Op1Value"] = "Helpers.CreateAndFillMaskFromLastElement(1)", ["Op2Value"] = "Helpers.CreateAndFillMaskFromSecondToLastElement(1)", ["ValidateEntry"] = "result != false"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "Int32", ["Op1Value"] = "Helpers.CreateAndFillMaskFromSecondToLastElement(1)", ["Op2Value"] = "Helpers.CreateAndFillMaskFromLastElement(1)", ["ValidateEntry"] = "result != true"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "Int64", ["Op1Value"] = "Sve.CreateTrueMaskInt64(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateTrueMaskInt64(SveMaskPattern.All)", ["ValidateEntry"] = "result != true"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "Byte", ["Op1Value"] = "Sve.CreateTrueMaskByte(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateFalseMaskByte()", ["ValidateEntry"] = "result != false"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "UInt16", ["Op1Value"] = "Sve.CreateTrueMaskUInt16(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateTrueMaskUInt16(SveMaskPattern.All)", ["ValidateEntry"] = "result != true"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "UInt32", ["Op1Value"] = "Sve.CreateTrueMaskUInt32(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateFalseMaskUInt32()", ["ValidateEntry"] = "result != false"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "UInt64", ["Op1Value"] = "Sve.CreateFalseMaskUInt64()", ["Op2Value"] = "Sve.CreateFalseMaskUInt64()", ["ValidateEntry"] = "result != false"}), + + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_short_custom1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "Int16", ["Op1Value"] = "Helpers.CreateAndFillMaskFromFirstElement(1)", ["Op2Value"] = "Helpers.CreateAndFillMaskFromSecondElement(1)", ["ValidateEntry"] = "result != true"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_short_custom1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "Int16", ["Op1Value"] = "Helpers.CreateAndFillMaskFromLastElement(1)", ["Op2Value"] = "Helpers.CreateAndFillMaskFromSecondToLastElement(1)", ["ValidateEntry"] = "result != true"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_short_custom1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "Int16", ["Op1Value"] = "Helpers.CreateAndFillMaskFromFirstElement(1)", ["Op2Value"] = "Helpers.CreateAndFillMaskFromSecondElement(1)", ["ValidateEntry"] = "result != true"}), ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_Byte_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_Double_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i)) != BitConverter.DoubleToInt64Bits(result[i])"}), @@ -3939,50 +3943,6 @@ ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_UInt16_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_UInt32_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_UInt64_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), - - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_Byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateResult"] = "firstOp[firstOp.Length - 1] != result[0] || result[1] != 0"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_Double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateResult"] = "BitConverter.DoubleToInt64Bits(firstOp[firstOp.Length - 1]) != BitConverter.DoubleToInt64Bits(result[0]) || result[1] != 0"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_Int16", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateResult"] = "firstOp[firstOp.Length - 1] != result[0] || result[1] != 0"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_Int32", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateResult"] = "firstOp[firstOp.Length - 1] != result[0] || result[1] != 0"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_Int64", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateResult"] = "firstOp[firstOp.Length - 1] != result[0] || result[1] != 0"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_SByte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateResult"] = "firstOp[firstOp.Length - 1] != result[0] || result[1] != 0"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_Single", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateResult"] = "BitConverter.SingleToInt32Bits(firstOp[firstOp.Length - 1]) != BitConverter.SingleToInt32Bits(result[0]) || result[1] != 0"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_UInt16", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateResult"] = "firstOp[firstOp.Length - 1] != result[0] || result[1] != 0"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_UInt32", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateResult"] = "firstOp[firstOp.Length - 1] != result[0] || result[1] != 0"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastVector_UInt64", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateResult"] = "firstOp[firstOp.Length - 1] != result[0] || result[1] != 0"}), - - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_Byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["RetType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateResult"] = "firstOp[firstOp.Length - 1] != result"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_Double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["RetType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateResult"] = "BitConverter.DoubleToInt64Bits(firstOp[firstOp.Length - 1]) != BitConverter.DoubleToInt64Bits(result)"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_Int16", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["RetType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateResult"] = "firstOp[firstOp.Length - 1] != result"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_Int32", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["RetType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateResult"] = "firstOp[firstOp.Length - 1] != result"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_Int64", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["RetType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateResult"] = "firstOp[firstOp.Length - 1] != result"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_SByte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["RetType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateResult"] = "firstOp[firstOp.Length - 1] != result"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_Single", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["RetType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateResult"] = "BitConverter.SingleToInt32Bits(firstOp[firstOp.Length - 1]) != BitConverter.SingleToInt32Bits(result)"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_UInt16", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["RetType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateResult"] = "firstOp[firstOp.Length - 1] != result"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_UInt32", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["RetType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateResult"] = "firstOp[firstOp.Length - 1] != result"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractLastScalar_UInt64", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["RetType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateResult"] = "firstOp[firstOp.Length - 1] != result"}), - - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastVector_Byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateResult"] = "firstOp[0] != result[0]"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastVector_Double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateResult"] = "BitConverter.DoubleToInt64Bits(firstOp[0]) != BitConverter.DoubleToInt64Bits(result[0])"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastVector_Int16", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateResult"] = "firstOp[0] != result[0]"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastVector_Int32", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateResult"] = "firstOp[0] != result[0]"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastVector_Int64", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateResult"] = "firstOp[0] != result[0]"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastVector_SByte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateResult"] = "firstOp[0] != result[0]"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastVector_Single", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateResult"] = "BitConverter.SingleToInt32Bits(firstOp[0]) != BitConverter.SingleToInt32Bits(result[0])"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastVector_UInt16", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateResult"] = "firstOp[0] != result[0]"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastVector_UInt32", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateResult"] = "firstOp[0] != result[0]"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastVector_UInt64", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastVector", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["RetType"] = "Vector", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateResult"] = "firstOp[0] != result[0]"}), - - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastScalar_Byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["RetType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateResult"] = "firstOp[0] != result"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastScalar_Double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["RetType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateResult"] = "BitConverter.DoubleToInt64Bits(firstOp[0]) != BitConverter.DoubleToInt64Bits(result)"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastScalar_Int16", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["RetType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateResult"] = "firstOp[0] != result"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastScalar_Int32", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["RetType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateResult"] = "firstOp[0] != result"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastScalar_Int64", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["RetType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateResult"] = "firstOp[0] != result"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastScalar_SByte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["RetType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateResult"] = "firstOp[0] != result"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastScalar_Single", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["RetType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateResult"] = "BitConverter.SingleToInt32Bits(firstOp[0]) != BitConverter.SingleToInt32Bits(result)"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastScalar_UInt16", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["RetType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateResult"] = "firstOp[0] != result"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastScalar_UInt32", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["RetType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateResult"] = "firstOp[0] != result"}), - ("SveExtractTest.template", new Dictionary { ["TestName"] = "SveExtractAfterLastScalar_UInt64", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractAfterLastScalar", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["RetType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateResult"] = "firstOp[0] != result"}), }; diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs index f47938b15f927..98c1458e926ec 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs @@ -17,6 +17,50 @@ namespace JIT.HardwareIntrinsics.Arm { static class Helpers { + public static Vector CreateAndFillMaskFromFirstElement(T value) where T: unmanaged + { + var count = Vector.Count; + var arr = new T[count]; + for (var i = 0; i < count; i++) + { + arr[i] = value; + } + return new Vector(arr); + } + + public static Vector CreateAndFillMaskFromSecondElement(T value) where T: unmanaged + { + var count = Vector.Count; + var arr = new T[count]; + for (var i = 1; i < count; i++) + { + arr[i] = value; + } + return new Vector(arr); + } + + public static Vector CreateAndFillMaskFromLastElement(T value) where T: unmanaged + { + var count = Vector.Count; + var arr = new T[count]; + for (var i = count - 1; i >= 0; i--) + { + arr[i] = value; + } + return new Vector(arr); + } + + public static Vector CreateAndFillMaskFromSecondToLastElement(T value) where T: unmanaged + { + var count = Vector.Count; + var arr = new T[count]; + for (var i = count - 2; i >= 0; i--) + { + arr[i] = value; + } + return new Vector(arr); + } + public static sbyte CountLeadingSignBits(sbyte op1) { return (sbyte)(CountLeadingZeroBits((sbyte)((ulong)op1 ^ ((ulong)op1 >> 1))) - 1); diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveExtractTest.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveExtractTest.template deleted file mode 100644 index 8b249644f0dfa..0000000000000 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveExtractTest.template +++ /dev/null @@ -1,282 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/****************************************************************************** - * This file is auto-generated from a template file by the GenerateTests.csx * - * script in tests\src\JIT\HardwareIntrinsics\Arm\Shared. In order to make * - * changes, please update the corresponding template and run according to the * - * directions listed in the file. * - ******************************************************************************/ - -using System; -using System.Numerics; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Runtime.Intrinsics; -using System.Runtime.Intrinsics.Arm; -using Xunit; - -namespace JIT.HardwareIntrinsics.Arm -{ - public static partial class Program - { - [Fact] - public static void {TestName}() - { - var test = new SveExtractTest__{TestName}(); - - if (test.IsSupported) - { - // Validates basic functionality works, using Unsafe.Read - test.RunBasicScenario_UnsafeRead(); - - if ({LoadIsa}.IsSupported) - { - // Validates basic functionality works, using Load - test.RunBasicScenario_Load(); - } - - // Validates calling via reflection works, using Unsafe.Read - test.RunReflectionScenario_UnsafeRead(); - - // Validates passing a local works, using Unsafe.Read - test.RunLclVarScenario_UnsafeRead(); - - // Validates passing an instance member of a class works - test.RunClassFldScenario(); - - // Validates passing the field of a local struct works - test.RunStructLclFldScenario(); - - // Validates passing an instance member of a struct works - test.RunStructFldScenario(); - } - else - { - // Validates we throw on unsupported hardware - test.RunUnsupportedScenario(); - } - - if (!test.Succeeded) - { - throw new Exception("One or more scenarios did not complete as expected."); - } - } - } - - public sealed unsafe class SveExtractTest__{TestName} - { - private struct DataTable - { - private byte[] inArray1; - - private GCHandle inHandle1; - - private ulong alignment; - - public DataTable({Op1BaseType}[] inArray1, int alignment) - { - int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<{Op1BaseType}>(); - if ((alignment != 64 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1) - { - throw new ArgumentException("Invalid value of alignment"); - } - - this.inArray1 = new byte[alignment * 2]; - this.inHandle1 = GCHandle.Alloc(this.inArray1, 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 Dispose() - { - inHandle1.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(SveExtractTest__{TestName} testClass) - { - var result = {Isa}.{Method}(_fld1); - - testClass.ValidateResult(_fld1, result); - } - } - - private static readonly int LargestVectorSize = {LargestVectorSize}; - - private static readonly int Op1ElementCount = Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>() / sizeof({Op1BaseType}); - - private static {Op1BaseType}[] _data1 = new {Op1BaseType}[Op1ElementCount]; - - private {Op1VectorType}<{Op1BaseType}> _fld1; - - private DataTable _dataTable; - - public SveExtractTest__{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, LargestVectorSize); - } - - public bool IsSupported => {Isa}.IsSupported; - - public bool Succeeded { get; set; } - - public void RunBasicScenario_UnsafeRead() - { - TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); - - var result = {Isa}.{Method}( - Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr) - ); - - ValidateResult(_dataTable.inArray1Ptr, result); - } - - public void RunBasicScenario_Load() - { - TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); - - var result = {Isa}.{Method}( - {LoadIsa}.Load{Op1VectorType}(Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All), ({Op1BaseType}*)(_dataTable.inArray1Ptr)) - ); - - ValidateResult(_dataTable.inArray1Ptr, result); - } - - public void RunReflectionScenario_UnsafeRead() - { - TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); - - var result = typeof({Isa}).GetMethod(nameof({Isa}.{Method}), new Type[] { typeof({Op1VectorType}<{Op1BaseType}>) }) - .Invoke(null, new object[] { - Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr) - }); - - ValidateResult(_dataTable.inArray1Ptr, ({RetType})result); - } - - public void RunLclVarScenario_UnsafeRead() - { - TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); - - var op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr); - var result = {Isa}.{Method}(op1); - - ValidateResult(op1, result); - } - - public void RunClassFldScenario() - { - TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); - - var result = {Isa}.{Method}(_fld1); - - ValidateResult(_fld1, result); - } - - public void RunStructLclFldScenario() - { - TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); - - var test = TestStruct.Create(); - var result = {Isa}.{Method}(test._fld1); - - ValidateResult(test._fld1, result); - } - - public void RunStructFldScenario() - { - TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); - - var test = TestStruct.Create(); - test.RunStructFldScenario(this); - } - - public void RunUnsupportedScenario() - { - TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); - - bool succeeded = false; - - try - { - RunBasicScenario_UnsafeRead(); - } - catch (PlatformNotSupportedException) - { - succeeded = true; - } - - if (!succeeded) - { - Succeeded = false; - } - } - - private void ValidateResult({Op1VectorType}<{Op1BaseType}> op1, {RetType} result, [CallerMemberName] string method = "") - { - {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; - - Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), op1); - - ValidateResult(inArray1, result, method); - } - - private void ValidateResult(void* op1, {RetType} result, [CallerMemberName] string method = "") - { - {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; - - Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), ref Unsafe.AsRef(op1), (uint)Unsafe.SizeOf<{Op1VectorType}<{Op1BaseType}>>()); - - ValidateResult(inArray1, result, method); - } - - private void ValidateResult({Op1BaseType}[] firstOp, {RetType} result, [CallerMemberName] string method = "") - { - bool succeeded = true; - - if ({ValidateResult}) - { - succeeded = false; - } - - if (!succeeded) - { - TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}({Op1VectorType}<{Op1BaseType}>): {method} failed:"); - TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); - TestLibrary.TestFramework.LogInformation($" result: {result}"); - TestLibrary.TestFramework.LogInformation(string.Empty); - - Succeeded = false; - } - } - } -} diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveTestTest.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveTestTest.template index 44dbb55484bc9..6606b124f4053 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveTestTest.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveTestTest.template @@ -33,6 +33,15 @@ namespace JIT.HardwareIntrinsics.Arm // Validates calling via reflection works test.RunReflectionScenario_Load(); + + // 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 { @@ -49,8 +58,34 @@ namespace JIT.HardwareIntrinsics.Arm public sealed unsafe class TestTest__{TestName} { + private struct TestStruct + { + public Vector<{MaskBaseType}> _fld1; + + public static TestStruct Create() + { + var testStruct = new TestStruct(); + + testStruct._fld1 = {Op1Value}; + + return testStruct; + } + + public void RunStructFldScenario(TestTest__{TestName} testClass) + { + Vector<{MaskBaseType}> op2 = {Op2Value}; + + var result = {Isa}.{Method}(_fld1, op2); + + testClass.ValidateResult(_fld1, op2, result); + } + } + + private Vector<{MaskBaseType}> _fld1; + public TestTest__{TestName}() { + _fld1 = {Op1Value}; Succeeded = true; } @@ -85,6 +120,37 @@ namespace JIT.HardwareIntrinsics.Arm ValidateResult(op1, op2, (bool)result); } + public void RunClassFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); + + Vector<{MaskBaseType}> op2 = {Op2Value}; + + var result = {Isa}.{Method}(_fld1, op2); + + ValidateResult(_fld1, op2, result); + } + + public void RunStructLclFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); + + Vector<{MaskBaseType}> op2 = {Op2Value}; + + var test = TestStruct.Create(); + var result = {Isa}.{Method}(test._fld1, op2); + + ValidateResult(test._fld1, op2, result); + } + + public void RunStructFldScenario() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); + + var test = TestStruct.Create(); + test.RunStructFldScenario(this); + } + public void RunUnsupportedScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); From cc3decc3cdd7957beb50d1aff6d72d23e08d5b52 Mon Sep 17 00:00:00 2001 From: TIHan Date: Fri, 21 Jun 2024 10:55:16 -0700 Subject: [PATCH 07/10] Fixing test --- .../Arm/Shared/SveTestTest.template | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveTestTest.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveTestTest.template index 6606b124f4053..26b73049fc4a5 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveTestTest.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveTestTest.template @@ -29,10 +29,10 @@ namespace JIT.HardwareIntrinsics.Arm if (test.IsSupported) { // Validates basic functionality works - test.RunBasicScenario_Load(); + test.RunBasicScenario(); // Validates calling via reflection works - test.RunReflectionScenario_Load(); + test.RunReflectionScenario(); // Validates passing an instance member of a class works test.RunClassFldScenario(); @@ -93,9 +93,9 @@ namespace JIT.HardwareIntrinsics.Arm public bool Succeeded { get; set; } - public void RunBasicScenario_Load() + public void RunBasicScenario() { - TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario)); Vector<{MaskBaseType}> op1 = {Op1Value}; Vector<{MaskBaseType}> op2 = {Op2Value}; @@ -105,9 +105,9 @@ namespace JIT.HardwareIntrinsics.Arm ValidateResult(op1, op2, result); } - public void RunReflectionScenario_Load() + public void RunReflectionScenario() { - TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); + TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario)); Vector<{MaskBaseType}> op1 = {Op1Value}; Vector<{MaskBaseType}> op2 = {Op2Value}; @@ -155,15 +155,20 @@ namespace JIT.HardwareIntrinsics.Arm { TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); - Succeeded = false; + bool succeeded = false; try { - RunBasicScenario_Load(); + RunBasicScenario(); } catch (PlatformNotSupportedException) { - Succeeded = true; + succeeded = true; + } + + if (!succeeded) + { + Succeeded = false; } } From b6b574a95270abaf8423319865e808f72e323d28 Mon Sep 17 00:00:00 2001 From: TIHan Date: Fri, 21 Jun 2024 16:21:49 -0700 Subject: [PATCH 08/10] Fixed test again. Formatting. --- src/coreclr/jit/hwintrinsiccodegenarm64.cpp | 2 +- .../HardwareIntrinsics/Arm/Shared/SveTestTest.template | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp index 4e157a9995896..75e941c9306f9 100644 --- a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp +++ b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp @@ -2126,7 +2126,7 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) } break; } - + case NI_Sve_InsertIntoShiftedVector: { assert(isRMW); diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveTestTest.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveTestTest.template index 26b73049fc4a5..b6c3cf3954f9b 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveTestTest.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveTestTest.template @@ -85,7 +85,14 @@ namespace JIT.HardwareIntrinsics.Arm public TestTest__{TestName}() { - _fld1 = {Op1Value}; + if ({Isa}.IsSupported) + { + _fld1 = {Op1Value}; + } + else + { + _fld1 = default; + } Succeeded = true; } From c84567a0c6f56e58bf03e1fdc9b21ae1093e0918 Mon Sep 17 00:00:00 2001 From: TIHan Date: Mon, 24 Jun 2024 12:49:52 -0700 Subject: [PATCH 09/10] Feedback --- src/coreclr/jit/emitarm64sve.cpp | 1 + src/coreclr/jit/hwintrinsiccodegenarm64.cpp | 2 +- .../GenerateHWIntrinsicTests_Arm.cs | 56 +++++++++---------- .../HardwareIntrinsics/Arm/Shared/Helpers.cs | 37 +----------- .../Arm/Shared/SveExtractVectorTest.template | 42 ++++++++++++++ .../Arm/Shared/SveTestTest.template | 30 ++++++++++ 6 files changed, 102 insertions(+), 66 deletions(-) diff --git a/src/coreclr/jit/emitarm64sve.cpp b/src/coreclr/jit/emitarm64sve.cpp index 99e86bb38c15c..3afae796d1ab4 100644 --- a/src/coreclr/jit/emitarm64sve.cpp +++ b/src/coreclr/jit/emitarm64sve.cpp @@ -2727,6 +2727,7 @@ void emitter::emitInsSve_R_R_I(instruction ins, if (sopt == INS_SCALABLE_OPTS_WITH_VECTOR_PAIR) { fmt = IF_SVE_BQ_2A; + unreached(); // Not supported yet. } else { diff --git a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp index 75e941c9306f9..e76eb94a94c89 100644 --- a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp +++ b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp @@ -2112,7 +2112,7 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) { assert(targetReg != op2Reg); - GetEmitter()->emitIns_Mov(INS_mov, emitTypeSize(node), targetReg, op1Reg, /* canSkip */ true); + GetEmitter()->emitIns_R_R(INS_sve_movprfx, EA_SCALABLE, targetReg, op1Reg); } HWIntrinsicImmOpHelper helper(this, intrin.op3, node); diff --git a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs index 9759ccfb886ab..3bed152984c18 100644 --- a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs +++ b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs @@ -3955,36 +3955,32 @@ ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeOdd_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeOdd", ["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 * 2 + 1] || result[i + 1] != right[index * 2 + 1]"}), ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeOdd_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeOdd", ["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 * 2 + 1] || result[i + 1] != right[index * 2 + 1]"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "SByte", ["Op1Value"] = "Sve.CreateTrueMaskSByte(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateTrueMaskSByte(SveMaskPattern.All)", ["ValidateEntry"] = "result != true"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "Int16", ["Op1Value"] = "Sve.CreateFalseMaskInt16()", ["Op2Value"] = "Sve.CreateTrueMaskInt16(SveMaskPattern.All)", ["ValidateEntry"] = "result != false"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "Int32", ["Op1Value"] = "Sve.CreateFalseMaskInt32()", ["Op2Value"] = "Sve.CreateFalseMaskInt32()", ["ValidateEntry"] = "result != false"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "Int64", ["Op1Value"] = "Sve.CreateTrueMaskInt64(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateTrueMaskInt64(SveMaskPattern.All)", ["ValidateEntry"] = "result != true"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "Byte", ["Op1Value"] = "Sve.CreateTrueMaskByte(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateFalseMaskByte()", ["ValidateEntry"] = "result != false"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "UInt16", ["Op1Value"] = "Sve.CreateTrueMaskUInt16(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateTrueMaskUInt16(SveMaskPattern.All)", ["ValidateEntry"] = "result != true"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "UInt32", ["Op1Value"] = "Sve.CreateTrueMaskUInt32(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateFalseMaskUInt32()", ["ValidateEntry"] = "result != false"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "UInt64", ["Op1Value"] = "Sve.CreateFalseMaskUInt64()", ["Op2Value"] = "Sve.CreateFalseMaskUInt64()", ["ValidateEntry"] = "result != false"}), - - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "SByte", ["Op1Value"] = "Helpers.CreateAndFillMaskFromFirstElement(1)", ["Op2Value"] = "Helpers.CreateAndFillMaskFromFirstElement(1)", ["ValidateEntry"] = "result != true"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "Int16", ["Op1Value"] = "Helpers.CreateAndFillMaskFromFirstElement(1)", ["Op2Value"] = "Helpers.CreateAndFillMaskFromSecondElement(1)", ["ValidateEntry"] = "result != false"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "Int32", ["Op1Value"] = "Sve.CreateFalseMaskInt32()", ["Op2Value"] = "Sve.CreateFalseMaskInt32()", ["ValidateEntry"] = "result != false"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "Int64", ["Op1Value"] = "Helpers.CreateAndFillMaskFromFirstElement(1)", ["Op2Value"] = "Helpers.CreateAndFillMaskFromFirstElement(1)", ["ValidateEntry"] = "result != true"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "Byte", ["Op1Value"] = "Sve.CreateTrueMaskByte(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateFalseMaskByte()", ["ValidateEntry"] = "result != false"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "UInt16", ["Op1Value"] = "Sve.CreateTrueMaskUInt16(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateTrueMaskUInt16(SveMaskPattern.All)", ["ValidateEntry"] = "result != true"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "UInt32", ["Op1Value"] = "Sve.CreateTrueMaskUInt32(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateFalseMaskUInt32()", ["ValidateEntry"] = "result != false"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "UInt64", ["Op1Value"] = "Sve.CreateFalseMaskUInt64()", ["Op2Value"] = "Sve.CreateFalseMaskUInt64()", ["ValidateEntry"] = "result != false"}), - - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "SByte", ["Op1Value"] = "Helpers.CreateAndFillMaskFromLastElement(1)", ["Op2Value"] = "Helpers.CreateAndFillMaskFromLastElement(1)", ["ValidateEntry"] = "result != true"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "Int16", ["Op1Value"] = "Helpers.CreateAndFillMaskFromLastElement(1)", ["Op2Value"] = "Helpers.CreateAndFillMaskFromSecondToLastElement(1)", ["ValidateEntry"] = "result != false"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "Int32", ["Op1Value"] = "Helpers.CreateAndFillMaskFromSecondToLastElement(1)", ["Op2Value"] = "Helpers.CreateAndFillMaskFromLastElement(1)", ["ValidateEntry"] = "result != true"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "Int64", ["Op1Value"] = "Sve.CreateTrueMaskInt64(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateTrueMaskInt64(SveMaskPattern.All)", ["ValidateEntry"] = "result != true"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "Byte", ["Op1Value"] = "Sve.CreateTrueMaskByte(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateFalseMaskByte()", ["ValidateEntry"] = "result != false"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "UInt16", ["Op1Value"] = "Sve.CreateTrueMaskUInt16(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateTrueMaskUInt16(SveMaskPattern.All)", ["ValidateEntry"] = "result != true"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "UInt32", ["Op1Value"] = "Sve.CreateTrueMaskUInt32(SveMaskPattern.All)", ["Op2Value"] = "Sve.CreateFalseMaskUInt32()", ["ValidateEntry"] = "result != false"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "UInt64", ["Op1Value"] = "Sve.CreateFalseMaskUInt64()", ["Op2Value"] = "Sve.CreateFalseMaskUInt64()", ["ValidateEntry"] = "result != false"}), - - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_short_custom1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "Int16", ["Op1Value"] = "Helpers.CreateAndFillMaskFromFirstElement(1)", ["Op2Value"] = "Helpers.CreateAndFillMaskFromSecondElement(1)", ["ValidateEntry"] = "result != true"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_short_custom1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "Int16", ["Op1Value"] = "Helpers.CreateAndFillMaskFromLastElement(1)", ["Op2Value"] = "Helpers.CreateAndFillMaskFromSecondToLastElement(1)", ["ValidateEntry"] = "result != true"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_short_custom1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "Int16", ["Op1Value"] = "Helpers.CreateAndFillMaskFromFirstElement(1)", ["Op2Value"] = "Helpers.CreateAndFillMaskFromSecondElement(1)", ["ValidateEntry"] = "result != true"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "SByte", ["Op1Value"] = "Helpers.InitVector(_ => Helpers.getMaskSByte())", ["Op2Value"] = "Helpers.InitVector(_ => Helpers.getMaskSByte())", ["ValidateEntry"] = "TestAnyTrue(op1, op2) != result"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "Int16", ["Op1Value"] = "Helpers.InitVector(_ => Helpers.getMaskInt16())", ["Op2Value"] = "Helpers.InitVector(_ => Helpers.getMaskInt16())", ["ValidateEntry"] = "TestAnyTrue(op1, op2) != result"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "Int32", ["Op1Value"] = "Helpers.InitVector(_ => Helpers.getMaskInt32())", ["Op2Value"] = "Helpers.InitVector(_ => Helpers.getMaskInt32())", ["ValidateEntry"] = "TestAnyTrue(op1, op2) != result"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "Int64", ["Op1Value"] = "Helpers.InitVector(_ => Helpers.getMaskInt64())", ["Op2Value"] = "Helpers.InitVector(_ => Helpers.getMaskInt64())", ["ValidateEntry"] = "TestAnyTrue(op1, op2) != result"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "Byte", ["Op1Value"] = "Helpers.InitVector(_ => Helpers.getMaskByte())", ["Op2Value"] = "Helpers.InitVector(_ => Helpers.getMaskByte())", ["ValidateEntry"] = "TestAnyTrue(op1, op2) != result"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "UInt16", ["Op1Value"] = "Helpers.InitVector(_ => Helpers.getMaskUInt16())", ["Op2Value"] = "Helpers.InitVector(_ => Helpers.getMaskUInt16())", ["ValidateEntry"] = "TestAnyTrue(op1, op2) != result"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "UInt32", ["Op1Value"] = "Helpers.InitVector(_ => Helpers.getMaskUInt32())", ["Op2Value"] = "Helpers.InitVector(_ => Helpers.getMaskUInt32())", ["ValidateEntry"] = "TestAnyTrue(op1, op2) != result"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "UInt64", ["Op1Value"] = "Helpers.InitVector(_ => Helpers.getMaskUInt64())", ["Op2Value"] = "Helpers.InitVector(_ => Helpers.getMaskUInt64())", ["ValidateEntry"] = "TestAnyTrue(op1, op2) != result"}), + + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "SByte", ["Op1Value"] = "Helpers.InitVector(_ => Helpers.getMaskSByte())", ["Op2Value"] = "Helpers.InitVector(_ => Helpers.getMaskSByte())", ["ValidateEntry"] = "TestFirstTrue(op1, op2) != result"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "Int16", ["Op1Value"] = "Helpers.InitVector(_ => Helpers.getMaskInt16())", ["Op2Value"] = "Helpers.InitVector(_ => Helpers.getMaskInt16())", ["ValidateEntry"] = "TestFirstTrue(op1, op2) != result"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "Int32", ["Op1Value"] = "Helpers.InitVector(_ => Helpers.getMaskInt32())", ["Op2Value"] = "Helpers.InitVector(_ => Helpers.getMaskInt32())", ["ValidateEntry"] = "TestFirstTrue(op1, op2) != result"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "Int64", ["Op1Value"] = "Helpers.InitVector(_ => Helpers.getMaskInt64())", ["Op2Value"] = "Helpers.InitVector(_ => Helpers.getMaskInt64())", ["ValidateEntry"] = "TestFirstTrue(op1, op2) != result"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "Byte", ["Op1Value"] = "Helpers.InitVector(_ => Helpers.getMaskByte())", ["Op2Value"] = "Helpers.InitVector(_ => Helpers.getMaskByte())", ["ValidateEntry"] = "TestFirstTrue(op1, op2) != result"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "UInt16", ["Op1Value"] = "Helpers.InitVector(_ => Helpers.getMaskUInt16())", ["Op2Value"] = "Helpers.InitVector(_ => Helpers.getMaskUInt16())", ["ValidateEntry"] = "TestFirstTrue(op1, op2) != result"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "UInt32", ["Op1Value"] = "Helpers.InitVector(_ => Helpers.getMaskUInt32())", ["Op2Value"] = "Helpers.InitVector(_ => Helpers.getMaskUInt32())", ["ValidateEntry"] = "TestFirstTrue(op1, op2) != result"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestFirstTrue_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestFirstTrue", ["MaskBaseType"] = "UInt64", ["Op1Value"] = "Helpers.InitVector(_ => Helpers.getMaskUInt64())", ["Op2Value"] = "Helpers.InitVector(_ => Helpers.getMaskUInt64())", ["ValidateEntry"] = "TestFirstTrue(op1, op2) != result"}), + + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "SByte", ["Op1Value"] = "Helpers.InitVector(_ => Helpers.getMaskSByte())", ["Op2Value"] = "Helpers.InitVector(_ => Helpers.getMaskSByte())", ["ValidateEntry"] = "TestLastTrue(op1, op2) != result"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "Int16", ["Op1Value"] = "Helpers.InitVector(_ => Helpers.getMaskInt16())", ["Op2Value"] = "Helpers.InitVector(_ => Helpers.getMaskInt16())", ["ValidateEntry"] = "TestLastTrue(op1, op2) != result"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "Int32", ["Op1Value"] = "Helpers.InitVector(_ => Helpers.getMaskInt32())", ["Op2Value"] = "Helpers.InitVector(_ => Helpers.getMaskInt32())", ["ValidateEntry"] = "TestLastTrue(op1, op2) != result"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "Int64", ["Op1Value"] = "Helpers.InitVector(_ => Helpers.getMaskInt64())", ["Op2Value"] = "Helpers.InitVector(_ => Helpers.getMaskInt64())", ["ValidateEntry"] = "TestLastTrue(op1, op2) != result"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "Byte", ["Op1Value"] = "Helpers.InitVector(_ => Helpers.getMaskByte())", ["Op2Value"] = "Helpers.InitVector(_ => Helpers.getMaskByte())", ["ValidateEntry"] = "TestLastTrue(op1, op2) != result"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "UInt16", ["Op1Value"] = "Helpers.InitVector(_ => Helpers.getMaskUInt16())", ["Op2Value"] = "Helpers.InitVector(_ => Helpers.getMaskUInt16())", ["ValidateEntry"] = "TestLastTrue(op1, op2) != result"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "UInt32", ["Op1Value"] = "Helpers.InitVector(_ => Helpers.getMaskUInt32())", ["Op2Value"] = "Helpers.InitVector(_ => Helpers.getMaskUInt32())", ["ValidateEntry"] = "TestLastTrue(op1, op2) != result"}), + ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "UInt64", ["Op1Value"] = "Helpers.InitVector(_ => Helpers.getMaskUInt64())", ["Op2Value"] = "Helpers.InitVector(_ => Helpers.getMaskUInt64())", ["ValidateEntry"] = "TestLastTrue(op1, op2) != result"}), ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_Byte_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_Double_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i)) != BitConverter.DoubleToInt64Bits(result[i])"}), diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs index dcd0ec5235ef8..a698defaee5a1 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs @@ -17,46 +17,13 @@ namespace JIT.HardwareIntrinsics.Arm { static class Helpers { - public static Vector CreateAndFillMaskFromFirstElement(T value) where T: unmanaged + public static Vector InitVector(Func f) { var count = Vector.Count; var arr = new T[count]; for (var i = 0; i < count; i++) { - arr[i] = value; - } - return new Vector(arr); - } - - public static Vector CreateAndFillMaskFromSecondElement(T value) where T: unmanaged - { - var count = Vector.Count; - var arr = new T[count]; - for (var i = 1; i < count; i++) - { - arr[i] = value; - } - return new Vector(arr); - } - - public static Vector CreateAndFillMaskFromLastElement(T value) where T: unmanaged - { - var count = Vector.Count; - var arr = new T[count]; - for (var i = count - 1; i >= 0; i--) - { - arr[i] = value; - } - return new Vector(arr); - } - - public static Vector CreateAndFillMaskFromSecondToLastElement(T value) where T: unmanaged - { - var count = Vector.Count; - var arr = new T[count]; - for (var i = count - 2; i >= 0; i--) - { - arr[i] = value; + arr[i] = f(i); } return new Vector(arr); } diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveExtractVectorTest.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveExtractVectorTest.template index b0ab0394b655d..3e391755dc557 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveExtractVectorTest.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveExtractVectorTest.template @@ -34,6 +34,8 @@ namespace JIT.HardwareIntrinsics.Arm { // Validates basic functionality works, using Load test.RunBasicScenario_Load(); + test.RunBasicScenario_Load_Wrapper(); + test.RunBasicScenario_Load_WrapperWithIndex(); } // Validates calling via reflection works, using Unsafe.Read @@ -206,6 +208,46 @@ namespace JIT.HardwareIntrinsics.Arm ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } + [MethodImpl(MethodImplOptions.NoInlining)] + {RetVectorType}<{RetBaseType}> Wrapper() + { + return {Isa}.{Method}( + {LoadIsa}.Load{Op1VectorType}(Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All), ({Op1BaseType}*)(_dataTable.inArray1Ptr)), + {LoadIsa}.Load{Op2VectorType}(Sve.CreateTrueMask{Op2BaseType}(SveMaskPattern.All), ({Op2BaseType}*)(_dataTable.inArray2Ptr)), + {ElementIndex} + ); + } + + public void RunBasicScenario_Load_Wrapper() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load_Wrapper)); + + var result = Wrapper<{RetBaseType}>(); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + {RetVectorType}<{RetBaseType}> WrapperWithIndex(byte index) + { + return {Isa}.{Method}( + {LoadIsa}.Load{Op1VectorType}(Sve.CreateTrueMask{Op1BaseType}(SveMaskPattern.All), ({Op1BaseType}*)(_dataTable.inArray1Ptr)), + {LoadIsa}.Load{Op2VectorType}(Sve.CreateTrueMask{Op2BaseType}(SveMaskPattern.All), ({Op2BaseType}*)(_dataTable.inArray2Ptr)), + index + ); + } + + public void RunBasicScenario_Load_WrapperWithIndex() + { + TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load_WrapperWithIndex)); + + var result = WrapperWithIndex<{RetBaseType}>(ElementIndex); + + Unsafe.Write(_dataTable.outArrayPtr, result); + ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); + } + public void RunReflectionScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveTestTest.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveTestTest.template index b6c3cf3954f9b..dcabcad9cc323 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveTestTest.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveTestTest.template @@ -179,6 +179,36 @@ namespace JIT.HardwareIntrinsics.Arm } } + /// Find any occurrence where both left and right and set + static bool TestAnyTrue(Vector<{MaskBaseType}> left, Vector<{MaskBaseType}> right) + { + for (var i = 0; i < Vector<{MaskBaseType}>.Count; i++) + { + if ((left[i] > 0) && (right[i] > 0)) return true; + } + return false; + } + + /// Find first true value in left, and return contents of right + static bool TestFirstTrue(Vector<{MaskBaseType}> left, Vector<{MaskBaseType}> right) + { + for (var i = 0; i < Vector<{MaskBaseType}>.Count; i++) + { + if (left[i] > 0) return (right[i] > 0) ? true : false; + } + return false; + } + + /// Find last true value in left, and return contents of right + static bool TestLastTrue(Vector<{MaskBaseType}> left, Vector<{MaskBaseType}> right) + { + for (var i = Vector<{MaskBaseType}>.Count - 1; i > 0; i--) + { + if (left[i] > 0) return (right[i] > 0) ? true : false; + } + return false; + } + private void ValidateResult(Vector<{MaskBaseType}> op1, Vector<{MaskBaseType}> op2, bool result, [CallerMemberName] string method = "") { bool succeeded = true; From fe04dffff51fe9b687342042c2bdbf461575737d Mon Sep 17 00:00:00 2001 From: TIHan Date: Mon, 24 Jun 2024 13:27:00 -0700 Subject: [PATCH 10/10] Fix ordering --- .../GenerateHWIntrinsicTests_Arm.cs | 62 +++++++++---------- .../Arm/Shared/SveTestTest.template | 10 +-- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs index 3bed152984c18..993fb5995cfef 100644 --- a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs +++ b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs @@ -3178,6 +3178,17 @@ ("SveCreateTrueMaskTest.template", new Dictionary { ["TestName"] = "Sve_CreateTrueMaskUInt32", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateTrueMaskUInt32", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1Type"] = "SveMaskPattern"}), ("SveCreateTrueMaskTest.template", new Dictionary { ["TestName"] = "Sve_CreateTrueMaskUInt64", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "CreateTrueMaskUInt64", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1Type"] = "SveMaskPattern"}), + ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_Byte_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), + ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_Double_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i)) != BitConverter.DoubleToInt64Bits(result[i])"}), + ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_Int16_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), + ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_Int32_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), + ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_Int64_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), + ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_SByte_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), + ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_Single_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i)) != BitConverter.SingleToInt32Bits(result[i])"}), + ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_UInt16_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), + ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_UInt32_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), + ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_UInt64_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), + // ("SveGatherVectorVectorBases.template", new Dictionary { ["TestName"] = "Sve_GatherVector_Bases_float_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "GatherVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt32", ["ExtendedElementType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueBase"] = "TestLibrary.Generator.GetSingle()"}), // ("SveGatherVectorVectorBases.template", new Dictionary { ["TestName"] = "Sve_GatherVector_Bases_int_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "GatherVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt32", ["ExtendedElementType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueBase"] = "TestLibrary.Generator.GetInt32()"}), // ("SveGatherVectorVectorBases.template", new Dictionary { ["TestName"] = "Sve_GatherVector_Bases_uint_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "GatherVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt32", ["ExtendedElementType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "Helpers.getMaskUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["NextValueBase"] = "TestLibrary.Generator.GetUInt32()"}), @@ -3934,27 +3945,6 @@ ("SveSimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sve_RoundToZero_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "RoundToZero", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "Helpers.RoundToZero(firstOp[i]) != result[i]", ["GetIterResult"] = "Helpers.RoundToZero(leftOp[i])"}), ("SveSimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sve_RoundToZero_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "RoundToZero", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "Helpers.RoundToZero(firstOp[i]) != result[i]", ["GetIterResult"] = "Helpers.RoundToZero(leftOp[i])"}), - ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeEven_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[i] != left[index * 2] || result[i + 1] != right[index * 2]"}), - ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeEven_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateEntry"] = "result[i] != left[index * 2] || result[i + 1] != right[index * 2]"}), - ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeEven_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[i] != left[index * 2] || result[i + 1] != right[index * 2]"}), - ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeEven_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[i] != left[index * 2] || result[i + 1] != right[index * 2]"}), - ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeEven_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[i] != left[index * 2] || result[i + 1] != right[index * 2]"}), - ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeEven_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateEntry"] = "result[i] != left[index * 2] || result[i + 1] != right[index * 2]"}), - ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeEven_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[i] != left[index * 2] || result[i + 1] != right[index * 2]"}), - ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeEven_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeEven", ["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 * 2] || result[i + 1] != right[index * 2]"}), - ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeEven_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeEven", ["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 * 2] || result[i + 1] != right[index * 2]"}), - ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeEven_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeEven", ["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 * 2] || result[i + 1] != right[index * 2]"}), - ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeOdd_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[i] != left[index * 2 + 1] || result[i + 1] != right[index * 2 + 1]"}), - ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeOdd_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateEntry"] = "result[i] != left[index * 2 + 1] || result[i + 1] != right[index * 2 + 1]"}), - ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeOdd_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[i] != left[index * 2 + 1] || result[i + 1] != right[index * 2 + 1]"}), - ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeOdd_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[i] != left[index * 2 + 1] || result[i + 1] != right[index * 2 + 1]"}), - ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeOdd_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[i] != left[index * 2 + 1] || result[i + 1] != right[index * 2 + 1]"}), - ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeOdd_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateEntry"] = "result[i] != left[index * 2 + 1] || result[i + 1] != right[index * 2 + 1]"}), - ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeOdd_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[i] != left[index * 2 + 1] || result[i + 1] != right[index * 2 + 1]"}), - ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeOdd_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeOdd", ["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 * 2 + 1] || result[i + 1] != right[index * 2 + 1]"}), - ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeOdd_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeOdd", ["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 * 2 + 1] || result[i + 1] != right[index * 2 + 1]"}), - ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeOdd_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeOdd", ["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 * 2 + 1] || result[i + 1] != right[index * 2 + 1]"}), - ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "SByte", ["Op1Value"] = "Helpers.InitVector(_ => Helpers.getMaskSByte())", ["Op2Value"] = "Helpers.InitVector(_ => Helpers.getMaskSByte())", ["ValidateEntry"] = "TestAnyTrue(op1, op2) != result"}), ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "Int16", ["Op1Value"] = "Helpers.InitVector(_ => Helpers.getMaskInt16())", ["Op2Value"] = "Helpers.InitVector(_ => Helpers.getMaskInt16())", ["ValidateEntry"] = "TestAnyTrue(op1, op2) != result"}), ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestAnyTrue_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestAnyTrue", ["MaskBaseType"] = "Int32", ["Op1Value"] = "Helpers.InitVector(_ => Helpers.getMaskInt32())", ["Op2Value"] = "Helpers.InitVector(_ => Helpers.getMaskInt32())", ["ValidateEntry"] = "TestAnyTrue(op1, op2) != result"}), @@ -3982,16 +3972,26 @@ ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "UInt32", ["Op1Value"] = "Helpers.InitVector(_ => Helpers.getMaskUInt32())", ["Op2Value"] = "Helpers.InitVector(_ => Helpers.getMaskUInt32())", ["ValidateEntry"] = "TestLastTrue(op1, op2) != result"}), ("SveTestTest.template", new Dictionary { ["TestName"] = "SveTestLastTrue_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TestLastTrue", ["MaskBaseType"] = "UInt64", ["Op1Value"] = "Helpers.InitVector(_ => Helpers.getMaskUInt64())", ["Op2Value"] = "Helpers.InitVector(_ => Helpers.getMaskUInt64())", ["ValidateEntry"] = "TestLastTrue(op1, op2) != result"}), - ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_Byte_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), - ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_Double_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i)) != BitConverter.DoubleToInt64Bits(result[i])"}), - ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_Int16_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), - ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_Int32_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), - ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_Int64_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), - ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_SByte_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), - ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_Single_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "BitConverter.SingleToInt32Bits(Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i)) != BitConverter.SingleToInt32Bits(result[i])"}), - ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_UInt16_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), - ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_UInt32_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), - ("SveExtractVectorTest.template", new Dictionary { ["TestName"] = "SveExtractVector_UInt64_1", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ExtractVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ElementIndex"] = "1", ["ValidateIterResult"] = "Helpers.ExtractVector(firstOp, secondOp, ElementIndex, i) != result[i]"}), + ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeEven_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[i] != left[index * 2] || result[i + 1] != right[index * 2]"}), + ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeEven_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateEntry"] = "result[i] != left[index * 2] || result[i + 1] != right[index * 2]"}), + ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeEven_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[i] != left[index * 2] || result[i + 1] != right[index * 2]"}), + ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeEven_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[i] != left[index * 2] || result[i + 1] != right[index * 2]"}), + ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeEven_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[i] != left[index * 2] || result[i + 1] != right[index * 2]"}), + ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeEven_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateEntry"] = "result[i] != left[index * 2] || result[i + 1] != right[index * 2]"}), + ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeEven_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeEven", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[i] != left[index * 2] || result[i + 1] != right[index * 2]"}), + ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeEven_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeEven", ["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 * 2] || result[i + 1] != right[index * 2]"}), + ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeEven_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeEven", ["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 * 2] || result[i + 1] != right[index * 2]"}), + ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeEven_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeEven", ["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 * 2] || result[i + 1] != right[index * 2]"}), + ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeOdd_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateEntry"] = "result[i] != left[index * 2 + 1] || result[i + 1] != right[index * 2 + 1]"}), + ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeOdd_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateEntry"] = "result[i] != left[index * 2 + 1] || result[i + 1] != right[index * 2 + 1]"}), + ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeOdd_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateEntry"] = "result[i] != left[index * 2 + 1] || result[i + 1] != right[index * 2 + 1]"}), + ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeOdd_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateEntry"] = "result[i] != left[index * 2 + 1] || result[i + 1] != right[index * 2 + 1]"}), + ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeOdd_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateEntry"] = "result[i] != left[index * 2 + 1] || result[i + 1] != right[index * 2 + 1]"}), + ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeOdd_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateEntry"] = "result[i] != left[index * 2 + 1] || result[i + 1] != right[index * 2 + 1]"}), + ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeOdd_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeOdd", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateEntry"] = "result[i] != left[index * 2 + 1] || result[i + 1] != right[index * 2 + 1]"}), + ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeOdd_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeOdd", ["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 * 2 + 1] || result[i + 1] != right[index * 2 + 1]"}), + ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeOdd_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeOdd", ["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 * 2 + 1] || result[i + 1] != right[index * 2 + 1]"}), + ("SveVecPairBinOpTest.template", new Dictionary { ["TestName"] = "SveTransposeOdd_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "TransposeOdd", ["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 * 2 + 1] || result[i + 1] != right[index * 2 + 1]"}), }; diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveTestTest.template b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveTestTest.template index dcabcad9cc323..61445c6847e71 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveTestTest.template +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveTestTest.template @@ -194,7 +194,7 @@ namespace JIT.HardwareIntrinsics.Arm { for (var i = 0; i < Vector<{MaskBaseType}>.Count; i++) { - if (left[i] > 0) return (right[i] > 0) ? true : false; + if (left[i] > 0) return (right[i] > 0); } return false; } @@ -202,9 +202,9 @@ namespace JIT.HardwareIntrinsics.Arm /// Find last true value in left, and return contents of right static bool TestLastTrue(Vector<{MaskBaseType}> left, Vector<{MaskBaseType}> right) { - for (var i = Vector<{MaskBaseType}>.Count - 1; i > 0; i--) + for (var i = Vector<{MaskBaseType}>.Count - 1; i >= 0; i--) { - if (left[i] > 0) return (right[i] > 0) ? true : false; + if (left[i] > 0) return (right[i] > 0); } return false; } @@ -221,8 +221,8 @@ namespace JIT.HardwareIntrinsics.Arm if (!succeeded) { TestLibrary.TestFramework.LogInformation($"{nameof({Isa})}.{nameof({Isa}.{Method})}(Vector<{MaskBaseType}>, Vector<{MaskBaseType}>): {method} failed:"); - TestLibrary.TestFramework.LogInformation($" op1: ({op1})"); - TestLibrary.TestFramework.LogInformation($" op2: ({op2})"); + TestLibrary.TestFramework.LogInformation($" mask: ({op1})"); + TestLibrary.TestFramework.LogInformation($" srcMask: ({op2})"); TestLibrary.TestFramework.LogInformation($" result: ({result})"); TestLibrary.TestFramework.LogInformation(string.Empty);