Skip to content

Commit 011be92

Browse files
a74nhmichaelgsharp
authored andcommitted
JIT ARM64-SVE: Add BitwiseClear and BooleanNot (dotnet#101853)
1 parent 7a238cf commit 011be92

File tree

7 files changed

+390
-5
lines changed

7 files changed

+390
-5
lines changed

src/coreclr/jit/emitarm64sve.cpp

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3602,12 +3602,7 @@ void emitter::emitInsSve_R_R_R(instruction ins,
36023602
fmt = IF_SVE_GW_3A;
36033603
break;
36043604

3605-
case INS_sve_clz:
3606-
case INS_sve_cls:
3607-
case INS_sve_cnt:
3608-
case INS_sve_cnot:
36093605
case INS_sve_not:
3610-
case INS_sve_nots:
36113606
if (isPredicateRegister(reg1) && sopt != INS_SCALABLE_OPTS_UNPREDICATED)
36123607
{
36133608
assert(opt == INS_OPTS_SCALABLE_B);
@@ -3627,6 +3622,26 @@ void emitter::emitInsSve_R_R_R(instruction ins,
36273622
}
36283623
break;
36293624

3625+
case INS_sve_nots:
3626+
assert(opt == INS_OPTS_SCALABLE_B);
3627+
assert(isPredicateRegister(reg1)); // DDDD
3628+
assert(isPredicateRegister(reg2)); // gggg
3629+
assert(isPredicateRegister(reg3)); // NNNN
3630+
fmt = IF_SVE_CZ_4A;
3631+
break;
3632+
3633+
case INS_sve_clz:
3634+
case INS_sve_cls:
3635+
case INS_sve_cnt:
3636+
case INS_sve_cnot:
3637+
assert(isVectorRegister(reg1));
3638+
assert(isLowPredicateRegister(reg2));
3639+
assert(isVectorRegister(reg3));
3640+
assert(insOptsScalableStandard(opt));
3641+
assert(insScalableOptsNone(sopt));
3642+
fmt = IF_SVE_AP_3A;
3643+
break;
3644+
36303645
case INS_sve_fabs:
36313646
case INS_sve_fneg:
36323647
assert(isVectorRegister(reg1));

src/coreclr/jit/hwintrinsiclistarm64sve.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ HARDWARE_INTRINSIC(Sve, Add,
2222
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)
2323
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)
2424
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)
25+
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)
26+
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)
2527
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)
2628
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)
2729
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)

src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.PlatformNotSupported.cs

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,164 @@ internal Arm64() { }
353353
public static unsafe Vector<ulong> AndAcross(Vector<ulong> value) { throw new PlatformNotSupportedException(); }
354354

355355

356+
/// BitwiseClear : Bitwise clear
357+
358+
/// <summary>
359+
/// svuint8_t svbic[_u8]_m(svbool_t pg, svuint8_t op1, svuint8_t op2)
360+
/// svuint8_t svbic[_u8]_x(svbool_t pg, svuint8_t op1, svuint8_t op2)
361+
/// svuint8_t svbic[_u8]_z(svbool_t pg, svuint8_t op1, svuint8_t op2)
362+
/// BIC Ztied1.B, Pg/M, Ztied1.B, Zop2.B
363+
/// BIC Zresult.D, Zop1.D, Zop2.D
364+
/// svbool_t svbic[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2)
365+
/// BIC Presult.B, Pg/Z, Pop1.B, Pop2.B
366+
/// </summary>
367+
public static unsafe Vector<byte> BitwiseClear(Vector<byte> left, Vector<byte> right) { throw new PlatformNotSupportedException(); }
368+
369+
/// <summary>
370+
/// svint16_t svbic[_s16]_m(svbool_t pg, svint16_t op1, svint16_t op2)
371+
/// svint16_t svbic[_s16]_x(svbool_t pg, svint16_t op1, svint16_t op2)
372+
/// svint16_t svbic[_s16]_z(svbool_t pg, svint16_t op1, svint16_t op2)
373+
/// BIC Ztied1.H, Pg/M, Ztied1.H, Zop2.H
374+
/// BIC Zresult.D, Zop1.D, Zop2.D
375+
/// svbool_t svbic[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2)
376+
/// BIC Presult.B, Pg/Z, Pop1.B, Pop2.B
377+
/// </summary>
378+
public static unsafe Vector<short> BitwiseClear(Vector<short> left, Vector<short> right) { throw new PlatformNotSupportedException(); }
379+
380+
/// <summary>
381+
/// svint32_t svbic[_s32]_m(svbool_t pg, svint32_t op1, svint32_t op2)
382+
/// svint32_t svbic[_s32]_x(svbool_t pg, svint32_t op1, svint32_t op2)
383+
/// svint32_t svbic[_s32]_z(svbool_t pg, svint32_t op1, svint32_t op2)
384+
/// BIC Ztied1.S, Pg/M, Ztied1.S, Zop2.S
385+
/// BIC Zresult.D, Zop1.D, Zop2.D
386+
/// svbool_t svbic[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2)
387+
/// BIC Presult.B, Pg/Z, Pop1.B, Pop2.B
388+
/// </summary>
389+
public static unsafe Vector<int> BitwiseClear(Vector<int> left, Vector<int> right) { throw new PlatformNotSupportedException(); }
390+
391+
/// <summary>
392+
/// svint64_t svbic[_s64]_m(svbool_t pg, svint64_t op1, svint64_t op2)
393+
/// svint64_t svbic[_s64]_x(svbool_t pg, svint64_t op1, svint64_t op2)
394+
/// svint64_t svbic[_s64]_z(svbool_t pg, svint64_t op1, svint64_t op2)
395+
/// BIC Ztied1.D, Pg/M, Ztied1.D, Zop2.D
396+
/// BIC Zresult.D, Zop1.D, Zop2.D
397+
/// svbool_t svbic[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2)
398+
/// BIC Presult.B, Pg/Z, Pop1.B, Pop2.B
399+
/// </summary>
400+
public static unsafe Vector<long> BitwiseClear(Vector<long> left, Vector<long> right) { throw new PlatformNotSupportedException(); }
401+
402+
/// <summary>
403+
/// svint8_t svbic[_s8]_m(svbool_t pg, svint8_t op1, svint8_t op2)
404+
/// svint8_t svbic[_s8]_x(svbool_t pg, svint8_t op1, svint8_t op2)
405+
/// svint8_t svbic[_s8]_z(svbool_t pg, svint8_t op1, svint8_t op2)
406+
/// BIC Ztied1.B, Pg/M, Ztied1.B, Zop2.B
407+
/// BIC Zresult.D, Zop1.D, Zop2.D
408+
/// svbool_t svbic[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2)
409+
/// BIC Presult.B, Pg/Z, Pop1.B, Pop2.B
410+
/// </summary>
411+
public static unsafe Vector<sbyte> BitwiseClear(Vector<sbyte> left, Vector<sbyte> right) { throw new PlatformNotSupportedException(); }
412+
413+
/// <summary>
414+
/// svuint16_t svbic[_u16]_m(svbool_t pg, svuint16_t op1, svuint16_t op2)
415+
/// svuint16_t svbic[_u16]_x(svbool_t pg, svuint16_t op1, svuint16_t op2)
416+
/// svuint16_t svbic[_u16]_z(svbool_t pg, svuint16_t op1, svuint16_t op2)
417+
/// BIC Ztied1.H, Pg/M, Ztied1.H, Zop2.H
418+
/// BIC Zresult.D, Zop1.D, Zop2.D
419+
/// svbool_t svbic[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2)
420+
/// BIC Presult.B, Pg/Z, Pop1.B, Pop2.B
421+
/// </summary>
422+
public static unsafe Vector<ushort> BitwiseClear(Vector<ushort> left, Vector<ushort> right) { throw new PlatformNotSupportedException(); }
423+
424+
/// <summary>
425+
/// svuint32_t svbic[_u32]_m(svbool_t pg, svuint32_t op1, svuint32_t op2)
426+
/// svuint32_t svbic[_u32]_x(svbool_t pg, svuint32_t op1, svuint32_t op2)
427+
/// svuint32_t svbic[_u32]_z(svbool_t pg, svuint32_t op1, svuint32_t op2)
428+
/// BIC Ztied1.S, Pg/M, Ztied1.S, Zop2.S
429+
/// BIC Zresult.D, Zop1.D, Zop2.D
430+
/// svbool_t svbic[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2)
431+
/// BIC Presult.B, Pg/Z, Pop1.B, Pop2.B
432+
/// </summary>
433+
public static unsafe Vector<uint> BitwiseClear(Vector<uint> left, Vector<uint> right) { throw new PlatformNotSupportedException(); }
434+
435+
/// <summary>
436+
/// svuint64_t svbic[_u64]_m(svbool_t pg, svuint64_t op1, svuint64_t op2)
437+
/// svuint64_t svbic[_u64]_x(svbool_t pg, svuint64_t op1, svuint64_t op2)
438+
/// svuint64_t svbic[_u64]_z(svbool_t pg, svuint64_t op1, svuint64_t op2)
439+
/// BIC Ztied1.D, Pg/M, Ztied1.D, Zop2.D
440+
/// BIC Zresult.D, Zop1.D, Zop2.D
441+
/// svbool_t svbic[_b]_z(svbool_t pg, svbool_t op1, svbool_t op2)
442+
/// BIC Presult.B, Pg/Z, Pop1.B, Pop2.B
443+
/// </summary>
444+
public static unsafe Vector<ulong> BitwiseClear(Vector<ulong> left, Vector<ulong> right) { throw new PlatformNotSupportedException(); }
445+
446+
447+
/// BooleanNot : Logically invert boolean condition
448+
449+
/// <summary>
450+
/// svuint8_t svcnot[_u8]_m(svuint8_t inactive, svbool_t pg, svuint8_t op)
451+
/// svuint8_t svcnot[_u8]_x(svbool_t pg, svuint8_t op)
452+
/// svuint8_t svcnot[_u8]_z(svbool_t pg, svuint8_t op)
453+
/// CNOT Ztied.B, Pg/M, Zop.B
454+
/// </summary>
455+
public static unsafe Vector<byte> BooleanNot(Vector<byte> value) { throw new PlatformNotSupportedException(); }
456+
457+
/// <summary>
458+
/// svint16_t svcnot[_s16]_m(svint16_t inactive, svbool_t pg, svint16_t op)
459+
/// svint16_t svcnot[_s16]_x(svbool_t pg, svint16_t op)
460+
/// svint16_t svcnot[_s16]_z(svbool_t pg, svint16_t op)
461+
/// CNOT Ztied.H, Pg/M, Zop.H
462+
/// </summary>
463+
public static unsafe Vector<short> BooleanNot(Vector<short> value) { throw new PlatformNotSupportedException(); }
464+
465+
/// <summary>
466+
/// svint32_t svcnot[_s32]_m(svint32_t inactive, svbool_t pg, svint32_t op)
467+
/// svint32_t svcnot[_s32]_x(svbool_t pg, svint32_t op)
468+
/// svint32_t svcnot[_s32]_z(svbool_t pg, svint32_t op)
469+
/// CNOT Ztied.S, Pg/M, Zop.S
470+
/// </summary>
471+
public static unsafe Vector<int> BooleanNot(Vector<int> value) { throw new PlatformNotSupportedException(); }
472+
473+
/// <summary>
474+
/// svint64_t svcnot[_s64]_m(svint64_t inactive, svbool_t pg, svint64_t op)
475+
/// svint64_t svcnot[_s64]_x(svbool_t pg, svint64_t op)
476+
/// svint64_t svcnot[_s64]_z(svbool_t pg, svint64_t op)
477+
/// CNOT Ztied.D, Pg/M, Zop.D
478+
/// </summary>
479+
public static unsafe Vector<long> BooleanNot(Vector<long> value) { throw new PlatformNotSupportedException(); }
480+
481+
/// <summary>
482+
/// svint8_t svcnot[_s8]_m(svint8_t inactive, svbool_t pg, svint8_t op)
483+
/// svint8_t svcnot[_s8]_x(svbool_t pg, svint8_t op)
484+
/// svint8_t svcnot[_s8]_z(svbool_t pg, svint8_t op)
485+
/// CNOT Ztied.B, Pg/M, Zop.B
486+
/// </summary>
487+
public static unsafe Vector<sbyte> BooleanNot(Vector<sbyte> value) { throw new PlatformNotSupportedException(); }
488+
489+
/// <summary>
490+
/// svuint16_t svcnot[_u16]_m(svuint16_t inactive, svbool_t pg, svuint16_t op)
491+
/// svuint16_t svcnot[_u16]_x(svbool_t pg, svuint16_t op)
492+
/// svuint16_t svcnot[_u16]_z(svbool_t pg, svuint16_t op)
493+
/// CNOT Ztied.H, Pg/M, Zop.H
494+
/// </summary>
495+
public static unsafe Vector<ushort> BooleanNot(Vector<ushort> value) { throw new PlatformNotSupportedException(); }
496+
497+
/// <summary>
498+
/// svuint32_t svcnot[_u32]_m(svuint32_t inactive, svbool_t pg, svuint32_t op)
499+
/// svuint32_t svcnot[_u32]_x(svbool_t pg, svuint32_t op)
500+
/// svuint32_t svcnot[_u32]_z(svbool_t pg, svuint32_t op)
501+
/// CNOT Ztied.S, Pg/M, Zop.S
502+
/// </summary>
503+
public static unsafe Vector<uint> BooleanNot(Vector<uint> value) { throw new PlatformNotSupportedException(); }
504+
505+
/// <summary>
506+
/// svuint64_t svcnot[_u64]_m(svuint64_t inactive, svbool_t pg, svuint64_t op)
507+
/// svuint64_t svcnot[_u64]_x(svbool_t pg, svuint64_t op)
508+
/// svuint64_t svcnot[_u64]_z(svbool_t pg, svuint64_t op)
509+
/// CNOT Ztied.D, Pg/M, Zop.D
510+
/// </summary>
511+
public static unsafe Vector<ulong> BooleanNot(Vector<ulong> value) { throw new PlatformNotSupportedException(); }
512+
513+
356514
/// ConditionalSelect : Conditionally select elements
357515

358516
/// <summary>

0 commit comments

Comments
 (0)