Skip to content

Commit d8bc357

Browse files
Fixing behavior for iSimdVector helper
1 parent 0772e00 commit d8bc357

File tree

5 files changed

+5
-9
lines changed

5 files changed

+5
-9
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -694,8 +694,7 @@ private string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] stri
694694

695695
static bool ISimdVector<Vector128<T>, T>.AnyMatches(Vector128<T> vector)
696696
{
697-
uint mask = vector.ExtractMostSignificantBits();
698-
return (mask != 0);
697+
return (vector != Vector128<T>.Zero);
699698
}
700699

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

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -684,8 +684,7 @@ private string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] stri
684684

685685
static bool ISimdVector<Vector256<T>, T>.AnyMatches(Vector256<T> vector)
686686
{
687-
uint mask = vector.ExtractMostSignificantBits();
688-
return (mask != 0);
687+
return (vector != Vector256<T>.Zero);
689688
}
690689

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

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -684,8 +684,7 @@ private string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] stri
684684

685685
static bool ISimdVector<Vector512<T>, T>.AnyMatches(Vector512<T> vector)
686686
{
687-
ulong mask = vector.ExtractMostSignificantBits();
688-
return (mask != 0);
687+
return (vector != Vector512<T>.Zero);
689688
}
690689

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

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,8 +759,7 @@ private string ToString([StringSyntax(StringSyntaxAttribute.NumericFormat)] stri
759759

760760
static bool ISimdVector<Vector64<T>, T>.AnyMatches(Vector64<T> vector)
761761
{
762-
uint mask = vector.ExtractMostSignificantBits();
763-
return (mask != 0);
762+
return (vector != Vector64<T>.Zero);
764763
}
765764

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

src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2204,7 +2204,7 @@ private static unsafe bool HasMatch<TVectorByte>(TVectorByte vector)
22042204
{
22052205
return VectorContainsNonAsciiChar((Vector128<byte>)(object)vector);
22062206
}
2207-
return TVectorByte.AnyMatches(vector);
2207+
return ((vector & TVectorByte.Create((byte)0b1000_0000)) != TVectorByte.Zero);
22082208
}
22092209

22102210

0 commit comments

Comments
 (0)