Skip to content

Commit adc9869

Browse files
committed
run tests
1 parent 3e40709 commit adc9869

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

BitFaster.Caching.UnitTests/Intrinsics.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#if NETCOREAPP3_1_OR_GREATER
22
using System.Runtime.Intrinsics.X86;
33
#endif
4+
#if NET6_0_OR_GREATER
5+
using System.Runtime.Intrinsics.Arm;
6+
#endif
7+
48
using Xunit;
59

610
namespace BitFaster.Caching.UnitTests
@@ -10,8 +14,15 @@ public static class Intrinsics
1014
public static void SkipAvxIfNotSupported<I>()
1115
{
1216
#if NETCOREAPP3_1_OR_GREATER
17+
#if NET6_0_OR_GREATER
1318
// when we are trying to test Avx2, skip the test if it's not supported
19+
Skip.If(typeof(I) == typeof(DetectIsa) && !(Avx2.IsSupported || AdvSimd.Arm64.IsSupported));
20+
#else
21+
// when we are trying to test Avx2, skip the test if it's not supported
1422
Skip.If(typeof(I) == typeof(DetectIsa) && !Avx2.IsSupported);
23+
#endif
24+
25+
1526
#else
1627
Skip.If(true);
1728
#endif

BitFaster.Caching/Lfu/CmSketchCore.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ private unsafe void IncrementArm(T value)
409409
maskedB = AdvSimd.Not(maskedB);
410410

411411
incA = AdvSimd.And(maskedA, incA);
412-
incB = AdvSimd.And(maskedA, incB);
412+
incB = AdvSimd.And(maskedB, incB);
413413

414414
tablePtr[t0] += AdvSimd.Extract(incA, 0);
415415
tablePtr[t1] += AdvSimd.Extract(incA, 1);

0 commit comments

Comments
 (0)