Light up core ASCII.Utility methods with Vector256/Vector512 code paths. (#88532)
authoranthonycanino <anthony.canino@intel.com>
Mon, 17 Jul 2023 22:23:26 +0000 (15:23 -0700)
committerGitHub <noreply@github.com>
Mon, 17 Jul 2023 22:23:26 +0000 (15:23 -0700)
commita5136765a90168dbaa3b7e87b507c479d27540e5
tree93b70318b2f1f65963a270353dd13c7e7910d446
parent2268fb323b49e482bc049bad5d6074e40bf4f543
Light up core ASCII.Utility methods with Vector256/Vector512 code paths. (#88532)

* Lib upgrade for ToUtf16

* Upgrade NarrowUtf16ToAscii with Vector512

* Complete the upgrade in NarrowUtf16ToAscii method
with Vector512 and Vector256 APIs.

* Adding VectorXX paths to `GetIndexOfFirstNonAscii` functions.

* Adding optimization to Vecto256 VectorContainsNonAsciiChar method.

* Code path refactoring and cleanup.

* Code changes based on the review:
1. turn some variables into explicitly specified const.
2. removed some helper functions and inlined them.

* Resolve comments

* revert the changes at GetIndexOfFirstNonAsciiByte

---------

Co-authored-by: Ruihan-Yin <ruihan.yin@intel.com>
src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs
src/libraries/System.Text.Encoding/tests/Ascii/FromUtf16Tests.cs
src/libraries/System.Text.Encoding/tests/Ascii/ToUtf16Tests.cs