Skip to content

Commit

Permalink
Fix indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
MihaZupan committed Jun 19, 2024
1 parent 5421ed4 commit f5c1e6e
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions src/libraries/System.Private.CoreLib/src/System/SpanHelpers.T.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3793,11 +3793,9 @@ public static int CountValueType<T>(ref T current, T value, int length) where T
}

// Count the last vector and mask off the elements that were already counted (number of elements between oneVectorAwayFromEnd and current).
{
ulong mask = Vector512.Equals(Vector512.LoadUnsafe(ref oneVectorAwayFromEnd), targetVector).ExtractMostSignificantBits();
mask >>= (int)((nuint)Unsafe.ByteOffset(ref oneVectorAwayFromEnd, ref current) / (uint)Unsafe.SizeOf<T>());
count += BitOperations.PopCount(mask);
}
ulong mask = Vector512.Equals(Vector512.LoadUnsafe(ref oneVectorAwayFromEnd), targetVector).ExtractMostSignificantBits();
mask >>= (int)((nuint)Unsafe.ByteOffset(ref oneVectorAwayFromEnd, ref current) / (uint)Unsafe.SizeOf<T>());
count += BitOperations.PopCount(mask);
}
else if (Vector256.IsHardwareAccelerated && length >= Vector256<T>.Count)
{
Expand All @@ -3810,11 +3808,9 @@ public static int CountValueType<T>(ref T current, T value, int length) where T
}

// Count the last vector and mask off the elements that were already counted (number of elements between oneVectorAwayFromEnd and current).
{
uint mask = Vector256.Equals(Vector256.LoadUnsafe(ref oneVectorAwayFromEnd), targetVector).ExtractMostSignificantBits();
mask >>= (int)((nuint)Unsafe.ByteOffset(ref oneVectorAwayFromEnd, ref current) / (uint)Unsafe.SizeOf<T>());
count += BitOperations.PopCount(mask);
}
uint mask = Vector256.Equals(Vector256.LoadUnsafe(ref oneVectorAwayFromEnd), targetVector).ExtractMostSignificantBits();
mask >>= (int)((nuint)Unsafe.ByteOffset(ref oneVectorAwayFromEnd, ref current) / (uint)Unsafe.SizeOf<T>());
count += BitOperations.PopCount(mask);
}
else
{
Expand All @@ -3827,11 +3823,9 @@ public static int CountValueType<T>(ref T current, T value, int length) where T
}

// Count the last vector and mask off the elements that were already counted (number of elements between oneVectorAwayFromEnd and current).
{
uint mask = Vector128.Equals(Vector128.LoadUnsafe(ref oneVectorAwayFromEnd), targetVector).ExtractMostSignificantBits();
mask >>= (int)((nuint)Unsafe.ByteOffset(ref oneVectorAwayFromEnd, ref current) / (uint)Unsafe.SizeOf<T>());
count += BitOperations.PopCount(mask);
}
uint mask = Vector128.Equals(Vector128.LoadUnsafe(ref oneVectorAwayFromEnd), targetVector).ExtractMostSignificantBits();
mask >>= (int)((nuint)Unsafe.ByteOffset(ref oneVectorAwayFromEnd, ref current) / (uint)Unsafe.SizeOf<T>());
count += BitOperations.PopCount(mask);
}
}
else
Expand Down

0 comments on commit f5c1e6e

Please sign in to comment.