Skip to content

Commit

Permalink
Fixing behavior for iSimdVector helper
Browse files Browse the repository at this point in the history
  • Loading branch information
DeepakRajendrakumaran committed Mar 21, 2024
1 parent 0772e00 commit d8bc357
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -694,8 +694,7 @@ private string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] stri

static bool ISimdVector<Vector128<T>, T>.AnyMatches(Vector128<T> vector)
{
uint mask = vector.ExtractMostSignificantBits();
return (mask != 0);
return (vector != Vector128<T>.Zero);
}

static int ISimdVector<Vector128<T>, T>.IndexOfLastMatch(Vector128<T> vector)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -684,8 +684,7 @@ private string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] stri

static bool ISimdVector<Vector256<T>, T>.AnyMatches(Vector256<T> vector)
{
uint mask = vector.ExtractMostSignificantBits();
return (mask != 0);
return (vector != Vector256<T>.Zero);
}

static int ISimdVector<Vector256<T>, T>.IndexOfLastMatch(Vector256<T> vector)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -684,8 +684,7 @@ private string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] stri

static bool ISimdVector<Vector512<T>, T>.AnyMatches(Vector512<T> vector)
{
ulong mask = vector.ExtractMostSignificantBits();
return (mask != 0);
return (vector != Vector512<T>.Zero);
}

static int ISimdVector<Vector512<T>, T>.IndexOfLastMatch(Vector512<T> vector)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -759,8 +759,7 @@ private string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] stri

static bool ISimdVector<Vector64<T>, T>.AnyMatches(Vector64<T> vector)
{
uint mask = vector.ExtractMostSignificantBits();
return (mask != 0);
return (vector != Vector64<T>.Zero);
}

static int ISimdVector<Vector64<T>, T>.IndexOfLastMatch(Vector64<T> vector)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2204,7 +2204,7 @@ private static unsafe bool HasMatch<TVectorByte>(TVectorByte vector)
{
return VectorContainsNonAsciiChar((Vector128<byte>)(object)vector);
}
return TVectorByte.AnyMatches(vector);
return ((vector & TVectorByte.Create((byte)0b1000_0000)) != TVectorByte.Zero);
}


Expand Down

0 comments on commit d8bc357

Please sign in to comment.