Skip to content

Commit 424c52a

Browse files
Mirroring API change : #98055 (comment)
1 parent 90c5092 commit 424c52a

File tree

5 files changed

+39
-12
lines changed

5 files changed

+39
-12
lines changed

src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/ISimdVector_2.cs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -553,11 +553,18 @@ static virtual bool TryCopyTo(TSelf vector, Span<T> destination)
553553
// New Surface Area
554554
//
555555

556-
/// <summary>Checks if the MSB of any of the vector lanes is non zero.</summary>
557-
/// <param name="vector">The vector to check MSB.</param>
558-
/// <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>
556+
/// <summary>Checks if any of the vector lanes are equivalent to value.</summary>
557+
/// <param name="vector">The Vector.</param>
558+
/// <param name="value">The Value to check.</param>
559+
/// <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>
559560
/// <exception cref="NotSupportedException">The type of the elements in the vector (<typeparamref name="T" />) is not supported.</exception>
560-
static abstract bool AnyMatches(TSelf vector);
561+
static abstract bool Any(TSelf vector, T value);
562+
563+
/// <summary>Checks if any of the vector lanes have All Bits set.</summary>
564+
/// <param name="vector">The Vector to check.</param>
565+
/// <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>
566+
/// <exception cref="NotSupportedException">The type of the elements in the vector (<typeparamref name="T" />) is not supported.</exception>
567+
static abstract bool AnyWhereAllBitsSet(TSelf vector);
561568

562569
static abstract int IndexOfLastMatch(TSelf vector);
563570
}

src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128_1.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -692,9 +692,14 @@ private string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] stri
692692
// New Surface Area
693693
//
694694

695-
static bool ISimdVector<Vector128<T>, T>.AnyMatches(Vector128<T> vector)
695+
static bool ISimdVector<Vector128<T>, T>.AnyWhereAllBitsSet(Vector128<T> vector)
696696
{
697-
return (vector != Vector128<T>.Zero);
697+
return (Vector128.EqualsAny(vector, Vector128<T>.AllBitsSet));
698+
}
699+
700+
static bool ISimdVector<Vector128<T>, T>.Any(Vector128<T> vector, T value)
701+
{
702+
return (Vector128.EqualsAny(vector, Vector128.Create((T)value)));
698703
}
699704

700705
static int ISimdVector<Vector128<T>, T>.IndexOfLastMatch(Vector128<T> vector)

src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256_1.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -682,9 +682,14 @@ private string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] stri
682682
// New Surface Area
683683
//
684684

685-
static bool ISimdVector<Vector256<T>, T>.AnyMatches(Vector256<T> vector)
685+
static bool ISimdVector<Vector256<T>, T>.AnyWhereAllBitsSet(Vector256<T> vector)
686686
{
687-
return (vector != Vector256<T>.Zero);
687+
return (Vector256.EqualsAny(vector, Vector256<T>.AllBitsSet));
688+
}
689+
690+
static bool ISimdVector<Vector256<T>, T>.Any(Vector256<T> vector, T value)
691+
{
692+
return (Vector256.EqualsAny(vector, Vector256.Create((T)value)));
688693
}
689694

690695
static int ISimdVector<Vector256<T>, T>.IndexOfLastMatch(Vector256<T> vector)

src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512_1.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -682,9 +682,14 @@ private string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] stri
682682
// New Surface Area
683683
//
684684

685-
static bool ISimdVector<Vector512<T>, T>.AnyMatches(Vector512<T> vector)
685+
static bool ISimdVector<Vector512<T>, T>.AnyWhereAllBitsSet(Vector512<T> vector)
686686
{
687-
return (vector != Vector512<T>.Zero);
687+
return (Vector512.EqualsAny(vector, Vector512<T>.AllBitsSet));
688+
}
689+
690+
static bool ISimdVector<Vector512<T>, T>.Any(Vector512<T> vector, T value)
691+
{
692+
return (Vector512.EqualsAny(vector, Vector512.Create((T)value)));
688693
}
689694

690695
static int ISimdVector<Vector512<T>, T>.IndexOfLastMatch(Vector512<T> vector)

src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64_1.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,9 +757,14 @@ private string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] stri
757757
// New Surface Area
758758
//
759759

760-
static bool ISimdVector<Vector64<T>, T>.AnyMatches(Vector64<T> vector)
760+
static bool ISimdVector<Vector64<T>, T>.AnyWhereAllBitsSet(Vector64<T> vector)
761761
{
762-
return (vector != Vector64<T>.Zero);
762+
return (Vector64.EqualsAny(vector, Vector64<T>.AllBitsSet));
763+
}
764+
765+
static bool ISimdVector<Vector64<T>, T>.Any(Vector64<T> vector, T value)
766+
{
767+
return (Vector64.EqualsAny(vector, Vector64.Create((T)value)));
763768
}
764769

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

0 commit comments

Comments
 (0)