• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

neon-sunset / U8String / 5953891787

23 Aug 2023 04:20PM UTC coverage: 21.364%. Remained the same
5953891787

push

github

neon-sunset
fix: invalid rune count calculation on ARM64

133 of 874 branches covered (15.22%)

Branch coverage included in aggregate %.

12 of 12 new or added lines in 2 files covered. (100.0%)

481 of 2000 relevant lines covered (24.05%)

41214.18 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

42.86
/src/Extensions/VectorExtensions.cs
1
using System.Numerics;
2
using System.Runtime.Intrinsics;
3
using System.Runtime.Intrinsics.Arm;
4

5
namespace U8Primitives;
6

7
internal static class VectorExtensions
8
{
9
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
10
    internal static int CountMatches(this Vector256<byte> mask)
11
    {
12
        if (Vector256.IsHardwareAccelerated)
141!
13
        {
14
            return BitOperations.PopCount(mask.ExtractMostSignificantBits());
141✔
15
        }
16

17
        return CountMatches(mask.GetLower()) + CountMatches(mask.GetUpper());
×
18
    }
19

20
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
21
    internal static int CountMatches(this Vector128<byte> mask)
22
    {
23
        // Is there really no way to use AddAcross here?
24
        if (AdvSimd.Arm64.IsSupported)
6!
25
        {
26
            var matches = AdvSimd
×
27
                .ShiftRightLogicalNarrowingLower(mask.AsUInt16(), 4)
×
28
                .AsUInt64()
×
29
                .ToScalar();
×
30
            return BitOperations.PopCount(matches) >> 2;
×
31
        }
32

33
        return BitOperations.PopCount(mask.ExtractMostSignificantBits());
6✔
34
    }
35
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc