AdvSimd support for System.Text.Unicode.Utf8Utility.GetPointerToFirstInvalidByte...
authorCarlos Sanchez Lopez <1175054+carlossanlop@users.noreply.github.com>
Mon, 20 Jul 2020 22:26:22 +0000 (15:26 -0700)
committerGitHub <noreply@github.com>
Mon, 20 Jul 2020 22:26:22 +0000 (15:26 -0700)
commit9d88a948ba3c18a9bea2217ad51828913701c2eb
tree8ec4d1cb4d77a838130798fea39aa924ed5e7427
parent73247415306f537ef831f83b891d5559439ca182
AdvSimd support for System.Text.Unicode.Utf8Utility.GetPointerToFirstInvalidByte (#38653)

* AdvSimd support for System.Text.Unicode.Utf8Utility.GetPointerToFirstInvalidByte

* Move comment to the top, add shims.

* Little endian checks

* Use custom MoveMask method for AdvSimd

* Address suggestions to improve the AdvSimdMoveMask method

* Define initialMask outside MoveMask method

* UInt64 in Arm64MoveMask

* Add unit test case to verify intrinsics improvement

* Avoid casting to smaller integer type

* Typo and comment

* Use ShiftRightArithmetic instead of CompareEqual + And.
Remove test case causing other unit tests to fail.

* Use AddPairwise version of GetNotAsciiBytes

* Add missing shims causing Linux build to fail

* Simplify GetNonAsciiBytes to only one AddPairwise call, shorter bitmask

* Respect data type returned by masking method

* Address suggestions - assert trailingzerocount and bring back uint mask

* Trailing zeroes in AdvSimd need to be divided by 4, and total number should not be larger than 16

* Avoid declaring static field which causes PNSE in Utf8String.Experimental (S.P.Corelib code is used for being NetStandard)

* Prefer using nuint for BitConverter.TrailingZeroCount
src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf8Utility.Validation.cs