From 8a0b81ee445440561879f8df43336ce9548d0ba5 Mon Sep 17 00:00:00 2001 From: Egor Chesakov Date: Wed, 23 Oct 2019 22:07:37 -0700 Subject: [PATCH] Add AdvSimd (LeadingZeroCount, LeadingSignCount, PopCount) (dotnet/coreclr#27382) * AdvSimd.LeadingSignCount * AdvSimd.LeadingZeroCount * AdvSimd.PopCount Commit migrated from https://github.com/dotnet/coreclr/commit/310f71592b1373297a98ae268f795ca6dedd62e6 --- .../Intrinsics/Arm/AdvSimd.PlatformNotSupported.cs | 202 +++++++++++++++++++++ .../src/System/Runtime/Intrinsics/Arm/AdvSimd.cs | 202 +++++++++++++++++++++ .../Intrinsics/Arm/ArmBase.PlatformNotSupported.cs | 12 ++ .../src/System/Runtime/Intrinsics/Arm/ArmBase.cs | 12 ++ 4 files changed, 428 insertions(+) diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.PlatformNotSupported.cs index 64e0ff4..d360c65 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.PlatformNotSupported.cs @@ -550,6 +550,180 @@ namespace System.Runtime.Intrinsics.Arm public static Vector128 AndNot(Vector128 left, Vector128 right) { throw new PlatformNotSupportedException(); } /// + /// int8x8_t vcls_s8 (int8x8_t a) + /// A32: VCLS Dd, Dm + /// A64: CLS Vd, Vn + /// + public static Vector64 LeadingSignCount(Vector64 value) { throw new PlatformNotSupportedException(); } + + /// + /// uint8x8_t vcls_u8 (uint8x8_t a) + /// A32: VCLS Dd, Dm + /// A64: CLS Vd, Vn + /// The above native signature does not exist. We provide this additional overload for consistency with the other scalar APIs. + /// + public static Vector64 LeadingSignCount(Vector64 value) { throw new PlatformNotSupportedException(); } + + /// + /// int16x4_t vcls_s16 (int16x4_t a) + /// A32: VCLS Dd, Dm + /// A64: CLS Vd, Vn + /// + public static Vector64 LeadingSignCount(Vector64 value) { throw new PlatformNotSupportedException(); } + + /// + /// uint16x4_t vcls_u16 (uint16x4_t a) + /// A32: VCLS Dd, Dm + /// A64: CLS Vd, Vn + /// The above native signature does not exist. We provide this additional overload for consistency with the other scalar APIs. + /// + public static Vector64 LeadingSignCount(Vector64 value) { throw new PlatformNotSupportedException(); } + + /// + /// int32x2_t vcls_s32 (int32x2_t a) + /// A32: VCLS Dd, Dm + /// A64: CLS Vd, Vn + /// + public static Vector64 LeadingSignCount(Vector64 value) { throw new PlatformNotSupportedException(); } + + /// + /// uint32x2_t vcls_u32 (uint32x2_t a) + /// A32: VCLS Dd, Dm + /// A64: CLS Vd, Vn + /// The above native signature does not exist. We provide this additional overload for consistency with the other scalar APIs. + /// + public static Vector64 LeadingSignCount(Vector64 value) { throw new PlatformNotSupportedException(); } + + /// + /// int8x16_t vclsq_s8 (int8x16_t a) + /// A32: VCLS Qd, Qm + /// A64: CLS Vd, Vn + /// + public static Vector128 LeadingSignCount(Vector128 value) { throw new PlatformNotSupportedException(); } + + /// + /// uint8x16_t vclsq_u8 (uint8x16_t a) + /// A32: VCLS Qd, Qm + /// A64: CLS Vd, Vn + /// The above native signature does not exist. We provide this additional overload for consistency with the other scalar APIs. + /// + public static Vector128 LeadingSignCount(Vector128 value) { throw new PlatformNotSupportedException(); } + + /// + /// int16x8_t vclsq_s16 (int16x8_t a) + /// A32: VCLS Qd, Qm + /// A64: CLS Vd, Vn + /// + public static Vector128 LeadingSignCount(Vector128 value) { throw new PlatformNotSupportedException(); } + + /// + /// uint16x8_t vclsq_u16 (uint16x8_t a) + /// A32: VCLS Qd, Qm + /// A64: CLS Vd, Vn + /// The above native signature does not exist. We provide this additional overload for consistency with the other scalar APIs. + /// + public static Vector128 LeadingSignCount(Vector128 value) { throw new PlatformNotSupportedException(); } + + /// + /// int32x4_t vclsq_s32 (int32x4_t a) + /// A32: VCLS Qd, Qm + /// A64: CLS Vd, Vn + /// + public static Vector128 LeadingSignCount(Vector128 value) { throw new PlatformNotSupportedException(); } + + /// + /// uint32x4_t vclsq_u32 (uint32x4_t a) + /// A32: VCLS Qd, Qm + /// A64: CLS Vd, Vn + /// The above native signature does not exist. We provide this additional overload for consistency with the other scalar APIs. + /// + public static Vector128 LeadingSignCount(Vector128 value) { throw new PlatformNotSupportedException(); } + + /// + /// int8x8_t vclz_s8 (int8x8_t a) + /// A32: VCLZ Dd, Dm + /// A64: CLZ Vd, Vn + /// + public static Vector64 LeadingZeroCount(Vector64 value) { throw new PlatformNotSupportedException(); } + + /// + /// uint8x8_t vclz_u8 (uint8x8_t a) + /// A32: VCLZ Dd, Dm + /// A64: CLZ Vd, Vn + /// + public static Vector64 LeadingZeroCount(Vector64 value) { throw new PlatformNotSupportedException(); } + + /// + /// int16x4_t vclz_s16 (int16x4_t a) + /// A32: VCLZ Dd, Dm + /// A64: CLZ Vd, Vn + /// + public static Vector64 LeadingZeroCount(Vector64 value) { throw new PlatformNotSupportedException(); } + + /// + /// uint16x4_t vclz_u16 (uint16x4_t a) + /// A32: VCLZ Dd, Dm + /// A64: CLZ Vd, Vn + /// + public static Vector64 LeadingZeroCount(Vector64 value) { throw new PlatformNotSupportedException(); } + + /// + /// int32x2_t vclz_s32 (int32x2_t a) + /// A32: VCLZ Dd, Dm + /// A64: CLZ Vd, Vn + /// + public static Vector64 LeadingZeroCount(Vector64 value) { throw new PlatformNotSupportedException(); } + + /// + /// uint32x2_t vclz_u32 (uint32x2_t a) + /// A32: VCLZ Dd, Dm + /// A64: CLZ Vd, Vn + /// + public static Vector64 LeadingZeroCount(Vector64 value) { throw new PlatformNotSupportedException(); } + + /// + /// int8x16_t vclzq_s8 (int8x16_t a) + /// A32: VCLZ Qd, Qm + /// A64: CLZ Vd, Vn + /// + public static Vector128 LeadingZeroCount(Vector128 value) { throw new PlatformNotSupportedException(); } + + /// + /// uint8x16_t vclzq_u8 (uint8x16_t a) + /// A32: VCLZ Qd, Qm + /// A64: CLZ Vd, Vn + /// + public static Vector128 LeadingZeroCount(Vector128 value) { throw new PlatformNotSupportedException(); } + + /// + /// int16x8_t vclzq_s16 (int16x8_t a) + /// A32: VCLZ Qd, Qm + /// A64: CLZ Vd, Vn + /// + public static Vector128 LeadingZeroCount(Vector128 value) { throw new PlatformNotSupportedException(); } + + /// + /// uint16x8_t vclzq_u16 (uint16x8_t a) + /// A32: VCLZ Qd, Qm + /// A64: CLZ Vd, Vn + /// + public static Vector128 LeadingZeroCount(Vector128 value) { throw new PlatformNotSupportedException(); } + + /// + /// int32x4_t vclzq_s32 (int32x4_t a) + /// A32: VCLZ Qd, Qm + /// A64: CLZ Vd, Vn + /// + public static Vector128 LeadingZeroCount(Vector128 value) { throw new PlatformNotSupportedException(); } + + /// + /// uint32x4_t vclzq_u32 (uint32x4_t a) + /// A32: VCLZ Qd, Qm + /// A64: CLZ Vd, Vn + /// + public static Vector128 LeadingZeroCount(Vector128 value) { throw new PlatformNotSupportedException(); } + + /// /// uint8x8_t vld1_u8 (uint8_t const * ptr) /// A32: VLD1.8 Dd, [Rn] /// A64: LD1 Vt.8B, [Xn] @@ -1101,6 +1275,34 @@ namespace System.Runtime.Intrinsics.Arm public static Vector128 OrNot(Vector128 left, Vector128 right) { throw new PlatformNotSupportedException(); } /// + /// int8x8_t vcnt_s8 (int8x8_t a) + /// A32: VCNT Dd, Dm + /// A64: CNT Vd, Vn + /// + public static Vector64 PopCount(Vector64 value) { throw new PlatformNotSupportedException(); } + + /// + /// uint8x8_t vcnt_u8 (uint8x8_t a) + /// A32: VCNT Dd, Dm + /// A64: CNT Vd, Vn + /// + public static Vector64 PopCount(Vector64 value) { throw new PlatformNotSupportedException(); } + + /// + /// int8x16_t vcntq_s8 (int8x16_t a) + /// A32: VCNT Qd, Qm + /// A64: CNT Vd, Vn + /// + public static Vector128 PopCount(Vector128 value) { throw new PlatformNotSupportedException(); } + + /// + /// uint8x16_t vcntq_u8 (uint8x16_t a) + /// A32: VCNT Qd, Qm + /// A64: CNT Vd, Vn + /// + public static Vector128 PopCount(Vector128 value) { throw new PlatformNotSupportedException(); } + + /// /// uint8x8_t vsub_u8 (uint8x8_t a, uint8x8_t b) /// A32: VSUB.I8 Dd, Dn, Dm /// A64: SUB Vd.8B, Vn.8B, Vm.8B diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.cs index 8d0fbd5..b62be64 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.cs @@ -552,6 +552,180 @@ namespace System.Runtime.Intrinsics.Arm public static Vector128 AndNot(Vector128 left, Vector128 right) => AndNot(left, right); /// + /// int8x8_t vcls_s8 (int8x8_t a) + /// A32: VCLS Dd, Dm + /// A64: CLS Vd, Vn + /// + public static Vector64 LeadingSignCount(Vector64 value) => LeadingSignCount(value); + + /// + /// uint8x8_t vcls_u8 (uint8x8_t a) + /// A32: VCLS Dd, Dm + /// A64: CLS Vd, Vn + /// The above native signature does not exist. We provide this additional overload for consistency with the other scalar APIs. + /// + public static Vector64 LeadingSignCount(Vector64 value) => LeadingSignCount(value); + + /// + /// int16x4_t vcls_s16 (int16x4_t a) + /// A32: VCLS Dd, Dm + /// A64: CLS Vd, Vn + /// + public static Vector64 LeadingSignCount(Vector64 value) => LeadingSignCount(value); + + /// + /// uint16x4_t vcls_u16 (uint16x4_t a) + /// A32: VCLS Dd, Dm + /// A64: CLS Vd, Vn + /// The above native signature does not exist. We provide this additional overload for consistency with the other scalar APIs. + /// + public static Vector64 LeadingSignCount(Vector64 value) => LeadingSignCount(value); + + /// + /// int32x2_t vcls_s32 (int32x2_t a) + /// A32: VCLS Dd, Dm + /// A64: CLS Vd, Vn + /// + public static Vector64 LeadingSignCount(Vector64 value) => LeadingSignCount(value); + + /// + /// uint32x2_t vcls_u32 (uint32x2_t a) + /// A32: VCLS Dd, Dm + /// A64: CLS Vd, Vn + /// The above native signature does not exist. We provide this additional overload for consistency with the other scalar APIs. + /// + public static Vector64 LeadingSignCount(Vector64 value) => LeadingSignCount(value); + + /// + /// int8x16_t vclsq_s8 (int8x16_t a) + /// A32: VCLS Qd, Qm + /// A64: CLS Vd, Vn + /// + public static Vector128 LeadingSignCount(Vector128 value) => LeadingSignCount(value); + + /// + /// uint8x16_t vclsq_u8 (uint8x16_t a) + /// A32: VCLS Qd, Qm + /// A64: CLS Vd, Vn + /// The above native signature does not exist. We provide this additional overload for consistency with the other scalar APIs. + /// + public static Vector128 LeadingSignCount(Vector128 value) => LeadingSignCount(value); + + /// + /// int16x8_t vclsq_s16 (int16x8_t a) + /// A32: VCLS Qd, Qm + /// A64: CLS Vd, Vn + /// + public static Vector128 LeadingSignCount(Vector128 value) => LeadingSignCount(value); + + /// + /// uint16x8_t vclsq_u16 (uint16x8_t a) + /// A32: VCLS Qd, Qm + /// A64: CLS Vd, Vn + /// The above native signature does not exist. We provide this additional overload for consistency with the other scalar APIs. + /// + public static Vector128 LeadingSignCount(Vector128 value) => LeadingSignCount(value); + + /// + /// int32x4_t vclsq_s32 (int32x4_t a) + /// A32: VCLS Qd, Qm + /// A64: CLS Vd, Vn + /// + public static Vector128 LeadingSignCount(Vector128 value) => LeadingSignCount(value); + + /// + /// uint32x4_t vclsq_u32 (uint32x4_t a) + /// A32: VCLS Qd, Qm + /// A64: CLS Vd, Vn + /// The above native signature does not exist. We provide this additional overload for consistency with the other scalar APIs. + /// + public static Vector128 LeadingSignCount(Vector128 value) => LeadingSignCount(value); + + /// + /// int8x8_t vclz_s8 (int8x8_t a) + /// A32: VCLZ Dd, Dm + /// A64: CLZ Vd, Vn + /// + public static Vector64 LeadingZeroCount(Vector64 value) => LeadingZeroCount(value); + + /// + /// uint8x8_t vclz_u8 (uint8x8_t a) + /// A32: VCLZ Dd, Dm + /// A64: CLZ Vd, Vn + /// + public static Vector64 LeadingZeroCount(Vector64 value) => LeadingZeroCount(value); + + /// + /// int16x4_t vclz_s16 (int16x4_t a) + /// A32: VCLZ Dd, Dm + /// A64: CLZ Vd, Vn + /// + public static Vector64 LeadingZeroCount(Vector64 value) => LeadingZeroCount(value); + + /// + /// uint16x4_t vclz_u16 (uint16x4_t a) + /// A32: VCLZ Dd, Dm + /// A64: CLZ Vd, Vn + /// + public static Vector64 LeadingZeroCount(Vector64 value) => LeadingZeroCount(value); + + /// + /// int32x2_t vclz_s32 (int32x2_t a) + /// A32: VCLZ Dd, Dm + /// A64: CLZ Vd, Vn + /// + public static Vector64 LeadingZeroCount(Vector64 value) => LeadingZeroCount(value); + + /// + /// uint32x2_t vclz_u32 (uint32x2_t a) + /// A32: VCLZ Dd, Dm + /// A64: CLZ Vd, Vn + /// + public static Vector64 LeadingZeroCount(Vector64 value) => LeadingZeroCount(value); + + /// + /// int8x16_t vclzq_s8 (int8x16_t a) + /// A32: VCLZ Qd, Qm + /// A64: CLZ Vd, Vn + /// + public static Vector128 LeadingZeroCount(Vector128 value) => LeadingZeroCount(value); + + /// + /// uint8x16_t vclzq_u8 (uint8x16_t a) + /// A32: VCLZ Qd, Qm + /// A64: CLZ Vd, Vn + /// + public static Vector128 LeadingZeroCount(Vector128 value) => LeadingZeroCount(value); + + /// + /// int16x8_t vclzq_s16 (int16x8_t a) + /// A32: VCLZ Qd, Qm + /// A64: CLZ Vd, Vn + /// + public static Vector128 LeadingZeroCount(Vector128 value) => LeadingZeroCount(value); + + /// + /// uint16x8_t vclzq_u16 (uint16x8_t a) + /// A32: VCLZ Qd, Qm + /// A64: CLZ Vd, Vn + /// + public static Vector128 LeadingZeroCount(Vector128 value) => LeadingZeroCount(value); + + /// + /// int32x4_t vclzq_s32 (int32x4_t a) + /// A32: VCLZ Qd, Qm + /// A64: CLZ Vd, Vn + /// + public static Vector128 LeadingZeroCount(Vector128 value) => LeadingZeroCount(value); + + /// + /// uint32x4_t vclzq_u32 (uint32x4_t a) + /// A32: VCLZ Qd, Qm + /// A64: CLZ Vd, Vn + /// + public static Vector128 LeadingZeroCount(Vector128 value) => LeadingZeroCount(value); + + /// /// uint8x8_t vld1_u8 (uint8_t const * ptr) /// A32: VLD1.8 Dd, [Rn] /// A64: LD1 Vt.8B, [Xn] @@ -1103,6 +1277,34 @@ namespace System.Runtime.Intrinsics.Arm public static Vector128 OrNot(Vector128 left, Vector128 right) => OrNot(left, right); /// + /// int8x8_t vcnt_s8 (int8x8_t a) + /// A32: VCNT Dd, Dm + /// A64: CNT Vd, Vn + /// + public static Vector64 PopCount(Vector64 value) => PopCount(value); + + /// + /// uint8x8_t vcnt_u8 (uint8x8_t a) + /// A32: VCNT Dd, Dm + /// A64: CNT Vd, Vn + /// + public static Vector64 PopCount(Vector64 value) => PopCount(value); + + /// + /// int8x16_t vcntq_s8 (int8x16_t a) + /// A32: VCNT Qd, Qm + /// A64: CNT Vd, Vn + /// + public static Vector128 PopCount(Vector128 value) => PopCount(value); + + /// + /// uint8x16_t vcntq_u8 (uint8x16_t a) + /// A32: VCNT Qd, Qm + /// A64: CNT Vd, Vn + /// + public static Vector128 PopCount(Vector128 value) => PopCount(value); + + /// /// uint8x8_t vsub_u8 (uint8x8_t a, uint8x8_t b) /// A32: VSUB.I8 Dd, Dn, Dm /// A64: ADD Vd.8B, Vn.8B, Vm.8B diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/ArmBase.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/ArmBase.PlatformNotSupported.cs index 75b0785..6fe42d6 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/ArmBase.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/ArmBase.PlatformNotSupported.cs @@ -34,6 +34,18 @@ namespace System.Runtime.Intrinsics.Arm public static int LeadingSignCount(long value) { throw new PlatformNotSupportedException(); } /// + /// A64: CLS Wd, Wn + /// The above native signature does not exist. We provide this additional overload for consistency with the other scalar APIs. + /// + public static int LeadingSignCount(uint value) { throw new PlatformNotSupportedException(); } + + /// + /// A64: CLS Xd, Xn + /// The above native signature does not exist. We provide this additional overload for consistency with the other scalar APIs. + /// + public static int LeadingSignCount(ulong value) { throw new PlatformNotSupportedException(); } + + /// /// A64: CLZ Xd, Xn /// public static int LeadingZeroCount(long value) { throw new PlatformNotSupportedException(); } diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/ArmBase.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/ArmBase.cs index 830959e..03af833 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/ArmBase.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/ArmBase.cs @@ -35,6 +35,18 @@ namespace System.Runtime.Intrinsics.Arm public static int LeadingSignCount(long value) => LeadingSignCount(value); /// + /// A64: CLS Wd, Wn + /// The above native signature does not exist. We provide this additional overload for consistency with the other scalar APIs. + /// + public static int LeadingSignCount(uint value) => LeadingSignCount(value); + + /// + /// A64: CLS Xd, Xn + /// The above native signature does not exist. We provide this additional overload for consistency with the other scalar APIs. + /// + public static int LeadingSignCount(ulong value) => LeadingSignCount(value); + + /// /// A64: CLZ Xd, Xn /// public static int LeadingZeroCount(long value) => LeadingZeroCount(value); -- 2.7.4