diff options
Diffstat (limited to 'src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Popcnt.cs')
-rw-r--r-- | src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Popcnt.cs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Popcnt.cs b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Popcnt.cs new file mode 100644 index 000000000..ba73eb234 --- /dev/null +++ b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Popcnt.cs @@ -0,0 +1,31 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Runtime.Intrinsics; + +namespace System.Runtime.Intrinsics.X86 +{ + /// <summary> + /// This class provides access to Intel POPCNT hardware instructions via intrinsics + /// </summary> + [CLSCompliant(false)] + public abstract class Popcnt : Sse42 + { + internal Popcnt() { } + + public new static bool IsSupported { get => IsSupported; } + + /// <summary> + /// int _mm_popcnt_u32 (unsigned int a) + /// POPCNT reg, reg/m32 + /// </summary> + public static uint PopCount(uint value) => PopCount(value); + /// <summary> + /// __int64 _mm_popcnt_u64 (unsigned __int64 a) + /// POPCNT reg, reg/m64 + /// </summary> + public static ulong PopCount(ulong value) => PopCount(value); + } +} |