summaryrefslogtreecommitdiff
path: root/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Popcnt.cs
diff options
context:
space:
mode:
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>2019-01-18 12:01:03 +0100
committerStephen Toub <stoub@microsoft.com>2019-01-18 11:47:21 -0500
commitf1fe9ff1ecb257d260d83ab30be112f77273c95d (patch)
tree06e6940ef15054d246343968adb5879c386b60ec /src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Popcnt.cs
parent7fb4ac5629230302800991444f960feefc6da38c (diff)
downloadcoreclr-f1fe9ff1ecb257d260d83ab30be112f77273c95d.tar.gz
coreclr-f1fe9ff1ecb257d260d83ab30be112f77273c95d.tar.bz2
coreclr-f1fe9ff1ecb257d260d83ab30be112f77273c95d.zip
Enable detection of HW intrinsics (dotnet/corert#6836)
I took the liberty of marking the types containing the hardware intrinsics as [Intrinsic] to avoid doing a name check on everything in the system module. It feels like we should take advantage of this attribute in CoreCLR too. This doesn't actually enable the support because RyuJIT unconditionally disables HW intrinsics for prejit (both CoreRT and CPAOT are considered prejit). We might want to do something about this on the RyuJIT side to address that (for CPAOT, to be able to pregenerate best code possible ahead of time, assuming a fixed ISA; and for CoreRT without JIT, where the concerns about AVX-SSE penalty don't apply). See conversation in dotnet/coreclr#21603 Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
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.cs3
1 files changed, 3 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
index 60d2899bcd..c262e99671 100644
--- a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Popcnt.cs
+++ b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Popcnt.cs
@@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.
using System;
+using System.Runtime.CompilerServices;
using System.Runtime.Intrinsics;
namespace System.Runtime.Intrinsics.X86
@@ -10,6 +11,7 @@ namespace System.Runtime.Intrinsics.X86
/// <summary>
/// This class provides access to Intel POPCNT hardware instructions via intrinsics
/// </summary>
+ [Intrinsic]
[CLSCompliant(false)]
public abstract class Popcnt : Sse42
{
@@ -17,6 +19,7 @@ namespace System.Runtime.Intrinsics.X86
public new static bool IsSupported { get => IsSupported; }
+ [Intrinsic]
public new abstract class X64 : Sse41.X64
{
internal X64() { }