-
Notifications
You must be signed in to change notification settings - Fork 35
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
[BUG] ContainsS returns different result to Contains #31
Comments
I tried your example on Unity but the same result is true |
@yenmoc Do the .NET SIMD types work under Unity? Are you sure it isn't just running without hardware acceleration (what's the result of Interesting if that is so as this definitely fails under .NET 6 |
And this fails in particular when And the needle to |
Sorry my previous answer was because i didn't read your question carefully In ContainsSIMD.cs for (int i = 0; i < source.Length - count; i += count)
{
var v = new Vector<T>(source, i);
if (Vector.EqualsAny(v, vectorValue))
{
return true;
}
} Change to for (int i = 0; i <= source.Length - count; i += count)
{
var v = new Vector<T>(source, i);
if (Vector.EqualsAny(v, vectorValue))
{
return true;
}
} |
Outputs
Or another more simple example:
It appears that .ContainsS fails for any of the last
Vector<T>.Count
elements when(haystack.Length % Vector<T>.Count) == 0
The text was updated successfully, but these errors were encountered: