diff --git a/src/coreclr/jit/emitarm64sve.cpp b/src/coreclr/jit/emitarm64sve.cpp index ad10c8248e0a49..edaa8e2070618f 100644 --- a/src/coreclr/jit/emitarm64sve.cpp +++ b/src/coreclr/jit/emitarm64sve.cpp @@ -3602,12 +3602,7 @@ void emitter::emitInsSve_R_R_R(instruction ins, fmt = IF_SVE_GW_3A; break; - case INS_sve_clz: - case INS_sve_cls: - case INS_sve_cnt: - case INS_sve_cnot: case INS_sve_not: - case INS_sve_nots: if (isPredicateRegister(reg1) && sopt != INS_SCALABLE_OPTS_UNPREDICATED) { assert(opt == INS_OPTS_SCALABLE_B); @@ -3627,6 +3622,26 @@ void emitter::emitInsSve_R_R_R(instruction ins, } break; + case INS_sve_nots: + assert(opt == INS_OPTS_SCALABLE_B); + assert(isPredicateRegister(reg1)); // DDDD + assert(isPredicateRegister(reg2)); // gggg + assert(isPredicateRegister(reg3)); // NNNN + fmt = IF_SVE_CZ_4A; + break; + + case INS_sve_clz: + case INS_sve_cls: + case INS_sve_cnt: + case INS_sve_cnot: + assert(isVectorRegister(reg1)); + assert(isLowPredicateRegister(reg2)); + assert(isVectorRegister(reg3)); + assert(insOptsScalableStandard(opt)); + assert(insScalableOptsNone(sopt)); + fmt = IF_SVE_AP_3A; + break; + case INS_sve_fabs: case INS_sve_fneg: assert(isVectorRegister(reg1)); diff --git a/src/coreclr/jit/hwintrinsiclistarm64sve.h b/src/coreclr/jit/hwintrinsiclistarm64sve.h index a2af0bec711392..2df9c505695587 100644 --- a/src/coreclr/jit/hwintrinsiclistarm64sve.h +++ b/src/coreclr/jit/hwintrinsiclistarm64sve.h @@ -22,6 +22,8 @@ HARDWARE_INTRINSIC(Sve, Add, HARDWARE_INTRINSIC(Sve, AddAcross, -1, 1, true, {INS_sve_saddv, INS_sve_uaddv, INS_sve_saddv, INS_sve_uaddv, INS_sve_saddv, INS_sve_uaddv, INS_sve_uaddv, INS_sve_uaddv, INS_sve_faddv, INS_sve_faddv}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_BaseTypeFromFirstArg|HW_Flag_EmbeddedMaskedOperation) HARDWARE_INTRINSIC(Sve, And, -1, -1, false, {INS_sve_and, INS_sve_and, INS_sve_and, INS_sve_and, INS_sve_and, INS_sve_and, INS_sve_and, INS_sve_and, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_OptionalEmbeddedMaskedOperation|HW_Flag_HasRMWSemantics|HW_Flag_LowMaskedOperation) HARDWARE_INTRINSIC(Sve, AndAcross, -1, -1, false, {INS_sve_andv, INS_sve_andv, INS_sve_andv, INS_sve_andv, INS_sve_andv, INS_sve_andv, INS_sve_andv, INS_sve_andv, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation) +HARDWARE_INTRINSIC(Sve, BitwiseClear, -1, -1, false, {INS_sve_bic, INS_sve_bic, INS_sve_bic, INS_sve_bic, INS_sve_bic, INS_sve_bic, INS_sve_bic, INS_sve_bic, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_OptionalEmbeddedMaskedOperation|HW_Flag_HasRMWSemantics|HW_Flag_LowMaskedOperation) +HARDWARE_INTRINSIC(Sve, BooleanNot, -1, -1, false, {INS_sve_cnot, INS_sve_cnot, INS_sve_cnot, INS_sve_cnot, INS_sve_cnot, INS_sve_cnot, INS_sve_cnot, INS_sve_cnot, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_EmbeddedMaskedOperation|HW_Flag_LowMaskedOperation) HARDWARE_INTRINSIC(Sve, ConditionalSelect, -1, 3, true, {INS_sve_sel, INS_sve_sel, INS_sve_sel, INS_sve_sel, INS_sve_sel, INS_sve_sel, INS_sve_sel, INS_sve_sel, INS_sve_sel, INS_sve_sel}, HW_Category_SIMD, HW_Flag_Scalable|HW_Flag_ExplicitMaskedOperation|HW_Flag_SupportsContainment) HARDWARE_INTRINSIC(Sve, Count16BitElements, 0, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_cnth, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_NoFloatingPointUsed) HARDWARE_INTRINSIC(Sve, Count32BitElements, 0, 1, false, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sve_cntw, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_Scalable|HW_Flag_HasEnumOperand|HW_Flag_SpecialCodeGen|HW_Flag_NoFloatingPointUsed) 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 43eec348f76fc5..e794c1b8f3b4d6 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 @@ -353,6 +353,164 @@ internal Arm64() { } public static unsafe Vector AndAcross(Vector value) { throw new PlatformNotSupportedException(); } + /// BitwiseClear : Bitwise clear + + /// + /// svuint8_t svbic[_u8]_m(svbool_t pg, svuint8_t op1, svuint8_t op2) + /// svuint8_t svbic[_u8]_x(svbool_t pg, svuint8_t op1, svuint8_t op2) + /// svuint8_t svbic[_u8]_z(svbool_t pg, svuint8_t op1, svuint8_t op2) + /// BIC Ztied1.B, Pg/M, Ztied1.B, Zop2.B + /// BIC Zresult.D, Zop1.D, Zop2.D + /// svbool_t svbic[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BIC Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector BitwiseClear(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svint16_t svbic[_s16]_m(svbool_t pg, svint16_t op1, svint16_t op2) + /// svint16_t svbic[_s16]_x(svbool_t pg, svint16_t op1, svint16_t op2) + /// svint16_t svbic[_s16]_z(svbool_t pg, svint16_t op1, svint16_t op2) + /// BIC Ztied1.H, Pg/M, Ztied1.H, Zop2.H + /// BIC Zresult.D, Zop1.D, Zop2.D + /// svbool_t svbic[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BIC Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector BitwiseClear(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svint32_t svbic[_s32]_m(svbool_t pg, svint32_t op1, svint32_t op2) + /// svint32_t svbic[_s32]_x(svbool_t pg, svint32_t op1, svint32_t op2) + /// svint32_t svbic[_s32]_z(svbool_t pg, svint32_t op1, svint32_t op2) + /// BIC Ztied1.S, Pg/M, Ztied1.S, Zop2.S + /// BIC Zresult.D, Zop1.D, Zop2.D + /// svbool_t svbic[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BIC Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector BitwiseClear(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svint64_t svbic[_s64]_m(svbool_t pg, svint64_t op1, svint64_t op2) + /// svint64_t svbic[_s64]_x(svbool_t pg, svint64_t op1, svint64_t op2) + /// svint64_t svbic[_s64]_z(svbool_t pg, svint64_t op1, svint64_t op2) + /// BIC Ztied1.D, Pg/M, Ztied1.D, Zop2.D + /// BIC Zresult.D, Zop1.D, Zop2.D + /// svbool_t svbic[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BIC Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector BitwiseClear(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svint8_t svbic[_s8]_m(svbool_t pg, svint8_t op1, svint8_t op2) + /// svint8_t svbic[_s8]_x(svbool_t pg, svint8_t op1, svint8_t op2) + /// svint8_t svbic[_s8]_z(svbool_t pg, svint8_t op1, svint8_t op2) + /// BIC Ztied1.B, Pg/M, Ztied1.B, Zop2.B + /// BIC Zresult.D, Zop1.D, Zop2.D + /// svbool_t svbic[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BIC Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector BitwiseClear(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svuint16_t svbic[_u16]_m(svbool_t pg, svuint16_t op1, svuint16_t op2) + /// svuint16_t svbic[_u16]_x(svbool_t pg, svuint16_t op1, svuint16_t op2) + /// svuint16_t svbic[_u16]_z(svbool_t pg, svuint16_t op1, svuint16_t op2) + /// BIC Ztied1.H, Pg/M, Ztied1.H, Zop2.H + /// BIC Zresult.D, Zop1.D, Zop2.D + /// svbool_t svbic[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BIC Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector BitwiseClear(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svuint32_t svbic[_u32]_m(svbool_t pg, svuint32_t op1, svuint32_t op2) + /// svuint32_t svbic[_u32]_x(svbool_t pg, svuint32_t op1, svuint32_t op2) + /// svuint32_t svbic[_u32]_z(svbool_t pg, svuint32_t op1, svuint32_t op2) + /// BIC Ztied1.S, Pg/M, Ztied1.S, Zop2.S + /// BIC Zresult.D, Zop1.D, Zop2.D + /// svbool_t svbic[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BIC Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector BitwiseClear(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + /// + /// svuint64_t svbic[_u64]_m(svbool_t pg, svuint64_t op1, svuint64_t op2) + /// svuint64_t svbic[_u64]_x(svbool_t pg, svuint64_t op1, svuint64_t op2) + /// svuint64_t svbic[_u64]_z(svbool_t pg, svuint64_t op1, svuint64_t op2) + /// BIC Ztied1.D, Pg/M, Ztied1.D, Zop2.D + /// BIC Zresult.D, Zop1.D, Zop2.D + /// svbool_t svbic[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BIC Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector BitwiseClear(Vector left, Vector right) { throw new PlatformNotSupportedException(); } + + + /// BooleanNot : Logically invert boolean condition + + /// + /// svuint8_t svcnot[_u8]_m(svuint8_t inactive, svbool_t pg, svuint8_t op) + /// svuint8_t svcnot[_u8]_x(svbool_t pg, svuint8_t op) + /// svuint8_t svcnot[_u8]_z(svbool_t pg, svuint8_t op) + /// CNOT Ztied.B, Pg/M, Zop.B + /// + public static unsafe Vector BooleanNot(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// svint16_t svcnot[_s16]_m(svint16_t inactive, svbool_t pg, svint16_t op) + /// svint16_t svcnot[_s16]_x(svbool_t pg, svint16_t op) + /// svint16_t svcnot[_s16]_z(svbool_t pg, svint16_t op) + /// CNOT Ztied.H, Pg/M, Zop.H + /// + public static unsafe Vector BooleanNot(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// svint32_t svcnot[_s32]_m(svint32_t inactive, svbool_t pg, svint32_t op) + /// svint32_t svcnot[_s32]_x(svbool_t pg, svint32_t op) + /// svint32_t svcnot[_s32]_z(svbool_t pg, svint32_t op) + /// CNOT Ztied.S, Pg/M, Zop.S + /// + public static unsafe Vector BooleanNot(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// svint64_t svcnot[_s64]_m(svint64_t inactive, svbool_t pg, svint64_t op) + /// svint64_t svcnot[_s64]_x(svbool_t pg, svint64_t op) + /// svint64_t svcnot[_s64]_z(svbool_t pg, svint64_t op) + /// CNOT Ztied.D, Pg/M, Zop.D + /// + public static unsafe Vector BooleanNot(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// svint8_t svcnot[_s8]_m(svint8_t inactive, svbool_t pg, svint8_t op) + /// svint8_t svcnot[_s8]_x(svbool_t pg, svint8_t op) + /// svint8_t svcnot[_s8]_z(svbool_t pg, svint8_t op) + /// CNOT Ztied.B, Pg/M, Zop.B + /// + public static unsafe Vector BooleanNot(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// svuint16_t svcnot[_u16]_m(svuint16_t inactive, svbool_t pg, svuint16_t op) + /// svuint16_t svcnot[_u16]_x(svbool_t pg, svuint16_t op) + /// svuint16_t svcnot[_u16]_z(svbool_t pg, svuint16_t op) + /// CNOT Ztied.H, Pg/M, Zop.H + /// + public static unsafe Vector BooleanNot(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// svuint32_t svcnot[_u32]_m(svuint32_t inactive, svbool_t pg, svuint32_t op) + /// svuint32_t svcnot[_u32]_x(svbool_t pg, svuint32_t op) + /// svuint32_t svcnot[_u32]_z(svbool_t pg, svuint32_t op) + /// CNOT Ztied.S, Pg/M, Zop.S + /// + public static unsafe Vector BooleanNot(Vector value) { throw new PlatformNotSupportedException(); } + + /// + /// svuint64_t svcnot[_u64]_m(svuint64_t inactive, svbool_t pg, svuint64_t op) + /// svuint64_t svcnot[_u64]_x(svbool_t pg, svuint64_t op) + /// svuint64_t svcnot[_u64]_z(svbool_t pg, svuint64_t op) + /// CNOT Ztied.D, Pg/M, Zop.D + /// + public static unsafe Vector BooleanNot(Vector value) { throw new PlatformNotSupportedException(); } + + /// ConditionalSelect : Conditionally select elements /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.cs index 6814d2f8317aa7..64e44b48676ea1 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 @@ -382,6 +382,164 @@ internal Arm64() { } public static unsafe Vector AndAcross(Vector value) => AndAcross(value); + /// BitwiseClear : Bitwise clear + + /// + /// svuint8_t svbic[_u8]_m(svbool_t pg, svuint8_t op1, svuint8_t op2) + /// svuint8_t svbic[_u8]_x(svbool_t pg, svuint8_t op1, svuint8_t op2) + /// svuint8_t svbic[_u8]_z(svbool_t pg, svuint8_t op1, svuint8_t op2) + /// BIC Ztied1.B, Pg/M, Ztied1.B, Zop2.B + /// BIC Zresult.D, Zop1.D, Zop2.D + /// svbool_t svbic[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BIC Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector BitwiseClear(Vector left, Vector right) => BitwiseClear(left, right); + + /// + /// svint16_t svbic[_s16]_m(svbool_t pg, svint16_t op1, svint16_t op2) + /// svint16_t svbic[_s16]_x(svbool_t pg, svint16_t op1, svint16_t op2) + /// svint16_t svbic[_s16]_z(svbool_t pg, svint16_t op1, svint16_t op2) + /// BIC Ztied1.H, Pg/M, Ztied1.H, Zop2.H + /// BIC Zresult.D, Zop1.D, Zop2.D + /// svbool_t svbic[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BIC Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector BitwiseClear(Vector left, Vector right) => BitwiseClear(left, right); + + /// + /// svint32_t svbic[_s32]_m(svbool_t pg, svint32_t op1, svint32_t op2) + /// svint32_t svbic[_s32]_x(svbool_t pg, svint32_t op1, svint32_t op2) + /// svint32_t svbic[_s32]_z(svbool_t pg, svint32_t op1, svint32_t op2) + /// BIC Ztied1.S, Pg/M, Ztied1.S, Zop2.S + /// BIC Zresult.D, Zop1.D, Zop2.D + /// svbool_t svbic[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BIC Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector BitwiseClear(Vector left, Vector right) => BitwiseClear(left, right); + + /// + /// svint64_t svbic[_s64]_m(svbool_t pg, svint64_t op1, svint64_t op2) + /// svint64_t svbic[_s64]_x(svbool_t pg, svint64_t op1, svint64_t op2) + /// svint64_t svbic[_s64]_z(svbool_t pg, svint64_t op1, svint64_t op2) + /// BIC Ztied1.D, Pg/M, Ztied1.D, Zop2.D + /// BIC Zresult.D, Zop1.D, Zop2.D + /// svbool_t svbic[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BIC Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector BitwiseClear(Vector left, Vector right) => BitwiseClear(left, right); + + /// + /// svint8_t svbic[_s8]_m(svbool_t pg, svint8_t op1, svint8_t op2) + /// svint8_t svbic[_s8]_x(svbool_t pg, svint8_t op1, svint8_t op2) + /// svint8_t svbic[_s8]_z(svbool_t pg, svint8_t op1, svint8_t op2) + /// BIC Ztied1.B, Pg/M, Ztied1.B, Zop2.B + /// BIC Zresult.D, Zop1.D, Zop2.D + /// svbool_t svbic[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BIC Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector BitwiseClear(Vector left, Vector right) => BitwiseClear(left, right); + + /// + /// svuint16_t svbic[_u16]_m(svbool_t pg, svuint16_t op1, svuint16_t op2) + /// svuint16_t svbic[_u16]_x(svbool_t pg, svuint16_t op1, svuint16_t op2) + /// svuint16_t svbic[_u16]_z(svbool_t pg, svuint16_t op1, svuint16_t op2) + /// BIC Ztied1.H, Pg/M, Ztied1.H, Zop2.H + /// BIC Zresult.D, Zop1.D, Zop2.D + /// svbool_t svbic[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BIC Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector BitwiseClear(Vector left, Vector right) => BitwiseClear(left, right); + + /// + /// svuint32_t svbic[_u32]_m(svbool_t pg, svuint32_t op1, svuint32_t op2) + /// svuint32_t svbic[_u32]_x(svbool_t pg, svuint32_t op1, svuint32_t op2) + /// svuint32_t svbic[_u32]_z(svbool_t pg, svuint32_t op1, svuint32_t op2) + /// BIC Ztied1.S, Pg/M, Ztied1.S, Zop2.S + /// BIC Zresult.D, Zop1.D, Zop2.D + /// svbool_t svbic[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BIC Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector BitwiseClear(Vector left, Vector right) => BitwiseClear(left, right); + + /// + /// svuint64_t svbic[_u64]_m(svbool_t pg, svuint64_t op1, svuint64_t op2) + /// svuint64_t svbic[_u64]_x(svbool_t pg, svuint64_t op1, svuint64_t op2) + /// svuint64_t svbic[_u64]_z(svbool_t pg, svuint64_t op1, svuint64_t op2) + /// BIC Ztied1.D, Pg/M, Ztied1.D, Zop2.D + /// BIC Zresult.D, Zop1.D, Zop2.D + /// svbool_t svbic[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2) + /// BIC Presult.B, Pg/Z, Pop1.B, Pop2.B + /// + public static unsafe Vector BitwiseClear(Vector left, Vector right) => BitwiseClear(left, right); + + + /// BooleanNot : Logically invert boolean condition + + /// + /// svuint8_t svcnot[_u8]_m(svuint8_t inactive, svbool_t pg, svuint8_t op) + /// svuint8_t svcnot[_u8]_x(svbool_t pg, svuint8_t op) + /// svuint8_t svcnot[_u8]_z(svbool_t pg, svuint8_t op) + /// CNOT Ztied.B, Pg/M, Zop.B + /// + public static unsafe Vector BooleanNot(Vector value) => BooleanNot(value); + + /// + /// svint16_t svcnot[_s16]_m(svint16_t inactive, svbool_t pg, svint16_t op) + /// svint16_t svcnot[_s16]_x(svbool_t pg, svint16_t op) + /// svint16_t svcnot[_s16]_z(svbool_t pg, svint16_t op) + /// CNOT Ztied.H, Pg/M, Zop.H + /// + public static unsafe Vector BooleanNot(Vector value) => BooleanNot(value); + + /// + /// svint32_t svcnot[_s32]_m(svint32_t inactive, svbool_t pg, svint32_t op) + /// svint32_t svcnot[_s32]_x(svbool_t pg, svint32_t op) + /// svint32_t svcnot[_s32]_z(svbool_t pg, svint32_t op) + /// CNOT Ztied.S, Pg/M, Zop.S + /// + public static unsafe Vector BooleanNot(Vector value) => BooleanNot(value); + + /// + /// svint64_t svcnot[_s64]_m(svint64_t inactive, svbool_t pg, svint64_t op) + /// svint64_t svcnot[_s64]_x(svbool_t pg, svint64_t op) + /// svint64_t svcnot[_s64]_z(svbool_t pg, svint64_t op) + /// CNOT Ztied.D, Pg/M, Zop.D + /// + public static unsafe Vector BooleanNot(Vector value) => BooleanNot(value); + + /// + /// svint8_t svcnot[_s8]_m(svint8_t inactive, svbool_t pg, svint8_t op) + /// svint8_t svcnot[_s8]_x(svbool_t pg, svint8_t op) + /// svint8_t svcnot[_s8]_z(svbool_t pg, svint8_t op) + /// CNOT Ztied.B, Pg/M, Zop.B + /// + public static unsafe Vector BooleanNot(Vector value) => BooleanNot(value); + + /// + /// svuint16_t svcnot[_u16]_m(svuint16_t inactive, svbool_t pg, svuint16_t op) + /// svuint16_t svcnot[_u16]_x(svbool_t pg, svuint16_t op) + /// svuint16_t svcnot[_u16]_z(svbool_t pg, svuint16_t op) + /// CNOT Ztied.H, Pg/M, Zop.H + /// + public static unsafe Vector BooleanNot(Vector value) => BooleanNot(value); + + /// + /// svuint32_t svcnot[_u32]_m(svuint32_t inactive, svbool_t pg, svuint32_t op) + /// svuint32_t svcnot[_u32]_x(svbool_t pg, svuint32_t op) + /// svuint32_t svcnot[_u32]_z(svbool_t pg, svuint32_t op) + /// CNOT Ztied.S, Pg/M, Zop.S + /// + public static unsafe Vector BooleanNot(Vector value) => BooleanNot(value); + + /// + /// svuint64_t svcnot[_u64]_m(svuint64_t inactive, svbool_t pg, svuint64_t op) + /// svuint64_t svcnot[_u64]_x(svbool_t pg, svuint64_t op) + /// svuint64_t svcnot[_u64]_z(svbool_t pg, svuint64_t op) + /// CNOT Ztied.D, Pg/M, Zop.D + /// + public static unsafe Vector BooleanNot(Vector value) => BooleanNot(value); + + /// ConditionalSelect : Conditionally select elements /// diff --git a/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs b/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs index e4f5e1d215802d..9150de02b88346 100644 --- a/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs +++ b/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs @@ -4215,6 +4215,24 @@ internal Arm64() { } public static System.Numerics.Vector AndAcross(System.Numerics.Vector value) { throw null; } public static System.Numerics.Vector AndAcross(System.Numerics.Vector value) { throw null; } + public static System.Numerics.Vector BitwiseClear(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector BitwiseClear(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector BitwiseClear(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector BitwiseClear(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector BitwiseClear(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector BitwiseClear(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector BitwiseClear(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + public static System.Numerics.Vector BitwiseClear(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; } + + public static System.Numerics.Vector BooleanNot(System.Numerics.Vector value) { throw null; } + public static System.Numerics.Vector BooleanNot(System.Numerics.Vector value) { throw null; } + public static System.Numerics.Vector BooleanNot(System.Numerics.Vector value) { throw null; } + public static System.Numerics.Vector BooleanNot(System.Numerics.Vector value) { throw null; } + public static System.Numerics.Vector BooleanNot(System.Numerics.Vector value) { throw null; } + public static System.Numerics.Vector BooleanNot(System.Numerics.Vector value) { throw null; } + public static System.Numerics.Vector BooleanNot(System.Numerics.Vector value) { throw null; } + public static System.Numerics.Vector BooleanNot(System.Numerics.Vector value) { throw null; } + public static ulong Count16BitElements([ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } public static ulong Count32BitElements([ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } public static ulong Count64BitElements([ConstantExpected] SveMaskPattern pattern = SveMaskPattern.All) { throw null; } diff --git a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs index 5701becf7c486c..070afeb2b8c836 100644 --- a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs +++ b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs @@ -2939,6 +2939,24 @@ ("SveVecReduceUnOpTest.template", new Dictionary { ["TestName"] = "Sve_AndAcross_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "AndAcross", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateReduceOpResult"] = "Helpers.AndAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), ("SveVecReduceUnOpTest.template", new Dictionary { ["TestName"] = "Sve_AndAcross_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "AndAcross", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateReduceOpResult"] = "Helpers.AndAcross(firstOp) != result[0]", ["ValidateRemainingResults"] = "result[i] != 0"}), + ("SveVecBinOpTest.template", new Dictionary { ["TestName"] = "Sve_BitwiseClear_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "(sbyte)TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.BitwiseClear(left[i], right[i])"}), + ("SveVecBinOpTest.template", new Dictionary { ["TestName"] = "Sve_BitwiseClear_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "(short)TestLibrary.Generator.GetInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.BitwiseClear(left[i], right[i])"}), + ("SveVecBinOpTest.template", new Dictionary { ["TestName"] = "Sve_BitwiseClear_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.BitwiseClear(left[i], right[i])"}), + ("SveVecBinOpTest.template", new Dictionary { ["TestName"] = "Sve_BitwiseClear_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.BitwiseClear(left[i], right[i])"}), + ("SveVecBinOpTest.template", new Dictionary { ["TestName"] = "Sve_BitwiseClear_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "(byte)TestLibrary.Generator.GetByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.BitwiseClear(left[i], right[i])"}), + ("SveVecBinOpTest.template", new Dictionary { ["TestName"] = "Sve_BitwiseClear_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.BitwiseClear(left[i], right[i])"}), + ("SveVecBinOpTest.template", new Dictionary { ["TestName"] = "Sve_BitwiseClear_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.BitwiseClear(left[i], right[i])"}), + ("SveVecBinOpTest.template", new Dictionary { ["TestName"] = "Sve_BitwiseClear_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "BitwiseClear", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.BitwiseClear(left[i], right[i]) != result[i]", ["GetIterResult"] = "Helpers.BitwiseClear(left[i], right[i])"}), + + ("SveSimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sve_BooleanNot_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "BooleanNot", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "Helpers.BooleanNot(firstOp[i]) != result[i]", ["GetIterResult"] = "Helpers.BooleanNot(leftOp[i])"}), + ("SveSimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sve_BooleanNot_short", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "BooleanNot", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "Helpers.BooleanNot(firstOp[i]) != result[i]", ["GetIterResult"] = "Helpers.BooleanNot(leftOp[i])"}), + ("SveSimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sve_BooleanNot_int", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "BooleanNot", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "Helpers.BooleanNot(firstOp[i]) != result[i]", ["GetIterResult"] = "Helpers.BooleanNot(leftOp[i])"}), + ("SveSimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sve_BooleanNot_long", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "BooleanNot", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "Helpers.BooleanNot(firstOp[i]) != result[i]", ["GetIterResult"] = "Helpers.BooleanNot(leftOp[i])"}), + ("SveSimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sve_BooleanNot_byte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "BooleanNot", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Byte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "Helpers.BooleanNot(firstOp[i]) != result[i]", ["GetIterResult"] = "Helpers.BooleanNot(leftOp[i])"}), + ("SveSimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sve_BooleanNot_ushort", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "BooleanNot", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "Helpers.BooleanNot(firstOp[i]) != result[i]", ["GetIterResult"] = "Helpers.BooleanNot(leftOp[i])"}), + ("SveSimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sve_BooleanNot_uint", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "BooleanNot", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "Helpers.BooleanNot(firstOp[i]) != result[i]", ["GetIterResult"] = "Helpers.BooleanNot(leftOp[i])"}), + ("SveSimpleVecOpTest.template", new Dictionary { ["TestName"] = "Sve_BooleanNot_ulong", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "BooleanNot", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "Helpers.BooleanNot(firstOp[i]) != result[i]", ["GetIterResult"] = "Helpers.BooleanNot(leftOp[i])"}), + ("SveConditionalSelect.template", new Dictionary { ["TestName"] = "Sve_ConditionalSelect_float", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ConditionalSelect", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Single", ["Op3VectorType"] = "Vector", ["Op3BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp3"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "(firstOp[i] != 0 ? (result[i] != secondOp[i]) : (result[i] != thirdOp[i]))",}), ("SveConditionalSelect.template", new Dictionary { ["TestName"] = "Sve_ConditionalSelect_double", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ConditionalSelect", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "Double", ["Op3VectorType"] = "Vector", ["Op3BaseType"] = "Double", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp3"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "(firstOp[i] != 0 ? (result[i] != secondOp[i]) : (result[i] != thirdOp[i]))",}), ("SveConditionalSelect.template", new Dictionary { ["TestName"] = "Sve_ConditionalSelect_sbyte", ["Isa"] = "Sve", ["LoadIsa"] = "Sve", ["Method"] = "ConditionalSelect", ["RetVectorType"] = "Vector", ["RetBaseType"] = "SByte", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector", ["Op2BaseType"] = "SByte", ["Op3VectorType"] = "Vector", ["Op3BaseType"] = "SByte", ["LargestVectorSize"] = "64", ["NextValueOp1"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["NextValueOp3"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "(firstOp[i] != 0 ? (result[i] != secondOp[i]) : (result[i] != thirdOp[i]))",}), diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs index faf6d504ece6bc..0d645e5816df17 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs @@ -1477,6 +1477,22 @@ private static sbyte HighNarrowing(short op1, bool round) public static short AddWideningUpper(short[] op1, sbyte[] op2, int i) => AddWidening(op1[i], op2[i + op2.Length / 2]); + public static sbyte BooleanNot(sbyte value) => (sbyte)(value == 0 ? 1 : 0); + + public static byte BooleanNot(byte value) => (byte)(value == 0 ? 1 : 0); + + public static short BooleanNot(short value) => (short)(value == 0 ? 1 : 0); + + public static ushort BooleanNot(ushort value) => (ushort)(value == 0 ? 1 : 0); + + public static int BooleanNot(int value) => (int)(value == 0 ? 1 : 0); + + public static uint BooleanNot(uint value) => (uint)(value == 0 ? 1 : 0); + + public static long BooleanNot(long value) => (long)(value == 0 ? 1 : 0); + + public static ulong BooleanNot(ulong value) => (ulong)(value == 0 ? 1 : 0); + public static sbyte ExtractNarrowing(short op1) => (sbyte)op1; public static sbyte ExtractNarrowingUpper(sbyte[] op1, short[] op2, int i) => i < op1.Length ? op1[i] : ExtractNarrowing(op2[i - op1.Length]);