Skip to content

Commit

Permalink
Mirroring API change : #98055 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeepakRajendrakumaran committed Apr 5, 2024
1 parent 90c5092 commit 424c52a
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -553,11 +553,18 @@ static virtual bool TryCopyTo(TSelf vector, Span<T> destination)
// New Surface Area
//

/// <summary>Checks if the MSB of any of the vector lanes is non zero.</summary>
/// <param name="vector">The vector to check MSB.</param>
/// <returns><c>true</c> if <paramref name="vector" /> has any lanes with a non-zero MSB otherwise, <c>false</c> if MSB is zero for all lanes />.</returns>
/// <summary>Checks if any of the vector lanes are equivalent to value.</summary>
/// <param name="vector">The Vector.</param>
/// <param name="value">The Value to check.</param>
/// <returns><c>true</c> if <paramref name="vector" /> has any lanes equivalent to <paramref name="value" /> otherwise, <c>false</c> if none of the lanes are equivalent to <paramref name="value" /> />.</returns>
/// <exception cref="NotSupportedException">The type of the elements in the vector (<typeparamref name="T" />) is not supported.</exception>
static abstract bool AnyMatches(TSelf vector);
static abstract bool Any(TSelf vector, T value);

/// <summary>Checks if any of the vector lanes have All Bits set.</summary>
/// <param name="vector">The Vector to check.</param>
/// <returns><c>true</c> if <paramref name="vector" /> has any lanes with All Bits set otherwise, <c>false</c> if none of the lanes have All Bits set />.</returns>
/// <exception cref="NotSupportedException">The type of the elements in the vector (<typeparamref name="T" />) is not supported.</exception>
static abstract bool AnyWhereAllBitsSet(TSelf vector);

static abstract int IndexOfLastMatch(TSelf vector);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -692,9 +692,14 @@ private string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] stri
// New Surface Area
//

static bool ISimdVector<Vector128<T>, T>.AnyMatches(Vector128<T> vector)
static bool ISimdVector<Vector128<T>, T>.AnyWhereAllBitsSet(Vector128<T> vector)
{
return (vector != Vector128<T>.Zero);
return (Vector128.EqualsAny(vector, Vector128<T>.AllBitsSet));
}

static bool ISimdVector<Vector128<T>, T>.Any(Vector128<T> vector, T value)
{
return (Vector128.EqualsAny(vector, Vector128.Create((T)value)));
}

static int ISimdVector<Vector128<T>, T>.IndexOfLastMatch(Vector128<T> vector)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -682,9 +682,14 @@ private string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] stri
// New Surface Area
//

static bool ISimdVector<Vector256<T>, T>.AnyMatches(Vector256<T> vector)
static bool ISimdVector<Vector256<T>, T>.AnyWhereAllBitsSet(Vector256<T> vector)
{
return (vector != Vector256<T>.Zero);
return (Vector256.EqualsAny(vector, Vector256<T>.AllBitsSet));
}

static bool ISimdVector<Vector256<T>, T>.Any(Vector256<T> vector, T value)
{
return (Vector256.EqualsAny(vector, Vector256.Create((T)value)));
}

static int ISimdVector<Vector256<T>, T>.IndexOfLastMatch(Vector256<T> vector)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -682,9 +682,14 @@ private string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] stri
// New Surface Area
//

static bool ISimdVector<Vector512<T>, T>.AnyMatches(Vector512<T> vector)
static bool ISimdVector<Vector512<T>, T>.AnyWhereAllBitsSet(Vector512<T> vector)
{
return (vector != Vector512<T>.Zero);
return (Vector512.EqualsAny(vector, Vector512<T>.AllBitsSet));
}

static bool ISimdVector<Vector512<T>, T>.Any(Vector512<T> vector, T value)
{
return (Vector512.EqualsAny(vector, Vector512.Create((T)value)));
}

static int ISimdVector<Vector512<T>, T>.IndexOfLastMatch(Vector512<T> vector)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -757,9 +757,14 @@ private string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] stri
// New Surface Area
//

static bool ISimdVector<Vector64<T>, T>.AnyMatches(Vector64<T> vector)
static bool ISimdVector<Vector64<T>, T>.AnyWhereAllBitsSet(Vector64<T> vector)
{
return (vector != Vector64<T>.Zero);
return (Vector64.EqualsAny(vector, Vector64<T>.AllBitsSet));
}

static bool ISimdVector<Vector64<T>, T>.Any(Vector64<T> vector, T value)
{
return (Vector64.EqualsAny(vector, Vector64.Create((T)value)));
}

static int ISimdVector<Vector64<T>, T>.IndexOfLastMatch(Vector64<T> vector)
Expand Down

0 comments on commit 424c52a

Please sign in to comment.