Optimize FormattingHelpers.CountHexDigits using Lzcnt.LeadingZeroCount (dotnet/corecl...
authorEgor Bogatov <egorbo@gmail.com>
Fri, 26 Oct 2018 06:07:08 +0000 (09:07 +0300)
committerStephen Toub <stoub@microsoft.com>
Fri, 26 Oct 2018 06:07:08 +0000 (23:07 -0700)
commit43e51349b7f120c4581771fc84365c6725629dd0
tree2c29176913b04e2ba8569e1bbb0d4be0a57b476c
parent16d239d2a43a13fa2c58fbaf80136e752ebd5280
Optimize FormattingHelpers.CountHexDigits using Lzcnt.LeadingZeroCount (dotnet/coreclr#19006)

* Optimize CountHexDigits using Lzcnt

* shift bits instead

* use Lzcnt only on 64 bit

* Optimize Buffer.Utilities.SelectBucketIndex()

* #if HAS_INTRINSICS

* remove HAS_INTRINSICS

* remove HAS_INTRINSICS

Commit migrated from https://github.com/dotnet/coreclr/commit/d236b8c5e42013d70879bea349d49d7d466364c8
src/libraries/System.Private.CoreLib/src/System/Buffers/Text/FormattingHelpers.CountDigits.cs
src/libraries/System.Private.CoreLib/src/System/Buffers/Utilities.cs