Skip to content

Commit 9a7de4e

Browse files
author
Prashanth Govindarajan
committed
Bug fix
1 parent b4edde6 commit 9a7de4e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/libraries/System.Private.CoreLib/src/System/Text/ASCIIUtility.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,10 @@ private static unsafe nuint GetIndexOfFirstNonAsciiChar_Intrinsified(char* pBuff
650650
Debug.Assert(Sse2.IsSupported || AdvSimd.Arm64.IsSupported, "Sse2 or AdvSimd64 required.");
651651
Debug.Assert(BitConverter.IsLittleEndian, "This SSE2/Arm64 implementation assumes little-endian.");
652652

653-
Vector128<byte> bitmask = Vector128.Create((ushort)0x1001).AsByte();
653+
Vector128<byte> bitmask = BitConverter.IsLittleEndian ?
654+
Vector128.Create(0x80402010_08040201).AsByte() :
655+
Vector128.Create(0x01020408_10204080).AsByte();
656+
654657
Vector128<ushort> firstVector, secondVector;
655658
uint currentMask;
656659
char* pOriginalBuffer = pBuffer;

0 commit comments

Comments
 (0)