Improve pref of `Array.IndexOf()` for certain `T`. (dotnet/coreclr#24293)
authordschinde <dschindelman@gmail.com>
Tue, 30 Apr 2019 00:38:49 +0000 (19:38 -0500)
committerJan Kotas <jkotas@microsoft.com>
Tue, 30 Apr 2019 00:38:49 +0000 (17:38 -0700)
commitdef74339bc8a36af67710dc9c3d0ff97cf578c7b
treec44330704e6c37d26c7ebfe8be21df2819b58a7a
parenta2e40c0563c1c6fc8b87c84e21df6ec3f09544d0
Improve pref of `Array.IndexOf()` for certain `T`. (dotnet/coreclr#24293)

Applies changes to `Array.IndexOf()` and `Array.LastIndexOf()` similar
to the changes made in dotnet/coreclr#20855, so that types other than `byte` and
`char` can use use the fast vectorized path.

Also allows 32-bit and 64-bit types for which
`RuntimeHelpers.IsBitwiseEquatable<T>()` returns `true` to use the
faster implementation of `IndexOf` and `LastIndexOf` from
`MemoryExtensions`.

Commit migrated from https://github.com/dotnet/coreclr/commit/2551753281ce89be4321c3d23111db6c6b7e77c0
src/libraries/System.Private.CoreLib/src/System/Array.cs