11using System ;
22using System . Collections . Generic ;
3- using System . Diagnostics . CodeAnalysis ;
43using System . Runtime . CompilerServices ;
54
65
7- #if NET6_0_OR_GREATER
6+ #if NET
87using System . Runtime . Intrinsics ;
98using System . Runtime . Intrinsics . Arm ;
109using System . Runtime . Intrinsics . X86 ;
@@ -57,7 +56,7 @@ public CmSketchNoPin(long maximumSize, IEqualityComparer<T> comparer)
5756 /// <returns>The estimated frequency of the value.</returns>
5857 public int EstimateFrequency ( T value )
5958 {
60- #if NET48
59+ #if NETSTANDARD
6160 return EstimateFrequencyStd ( value ) ;
6261#else
6362
@@ -67,7 +66,7 @@ public int EstimateFrequency(T value)
6766 {
6867 return EstimateFrequencyAvx ( value ) ;
6968 }
70- #if NET6_0_OR_GREATER
69+ #if NET
7170 else if ( isa . IsArm64Supported )
7271 {
7372 return EstimateFrequencyArm ( value ) ;
@@ -86,7 +85,7 @@ public int EstimateFrequency(T value)
8685 /// <param name="value">The value.</param>
8786 public void Increment ( T value )
8887 {
89- #if NET48
88+ #if NETSTANDARD
9089 IncrementStd ( value ) ;
9190#else
9291
@@ -96,7 +95,7 @@ public void Increment(T value)
9695 {
9796 IncrementAvx ( value ) ;
9897 }
99- #if NET6_0_OR_GREATER
98+ #if NET
10099 else if ( isa . IsArm64Supported )
101100 {
102101 IncrementArm ( value ) ;
@@ -233,7 +232,7 @@ private void Reset()
233232 size = ( size - ( count0 >> 2 ) ) >> 1 ;
234233 }
235234
236- #if NET6_0_OR_GREATER
235+ #if NET
237236 private unsafe int EstimateFrequencyAvx ( T value )
238237 {
239238 int blockHash = Spread ( comparer . GetHashCode ( value ) ) ;
@@ -267,7 +266,7 @@ private unsafe int EstimateFrequencyAvx(T value)
267266 . AsUInt16 ( ) ;
268267
269268 // set the zeroed high parts of the long value to ushort.Max
270- #if NET6_0
269+ #if NET
271270 count = Avx2 . Blend ( count , Vector128 < ushort > . AllBitsSet , 0b10101010 ) ;
272271#else
273272 count = Avx2 . Blend ( count , Vector128 . Create ( ushort . MaxValue ) , 0b10101010 ) ;
@@ -333,7 +332,7 @@ private unsafe void IncrementAvx(T value)
333332 }
334333#endif
335334
336- #if NET6_0_OR_GREATER
335+ #if NET
337336 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
338337 private unsafe void IncrementArm ( T value )
339338 {
0 commit comments