-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix size used for vectorization check in BitArray (#111558) #111564
base: main
Are you sure you want to change the base?
Conversation
@@ -885,7 +885,7 @@ public unsafe void CopyTo(Array array, int index) | |||
} | |||
} | |||
} | |||
else if (Ssse3.IsSupported && ((uint)m_length >= Vector512<byte>.Count * 2u)) | |||
else if (Ssse3.IsSupported && ((uint)m_length >= Vector128<byte>.Count * 2u)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think while you're on it, we can also replace various Sse2.And with just plain operators, e.g.
Vector128<byte> extractedLower = Sse2.And(shuffledLower, bitMask128);
to
Vector128<byte> extractedLower = shuffledLower & bitMask128;
but that's optional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
Run a quick perf test that shows this is a perf improvement for all affected sizes? |
FWIW this would only affect pre-AVX2 X86 CPUs (or NAOT as I was informed we don't do Avx2 checks :/) else if (Avx2.IsSupported && (uint)m_length >= Vector256<byte>.Count)
...
else if (Ssse3.IsSupported && ((uint)m_length >= Vector128<byte>.Count * 2u))
...
else if (AdvSimd.Arm64.IsSupported) |
This PR resolves #111558 by correcting the vector size used in the vectorization check within BitArray.