Enable AVX-512 for string/span Equals/StartsWith#84885
Conversation
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch, @kunalspathak Issue DetailsContributes to #77034 A small clean up in Benchmark:private string TestData =>
"https://github.com/dotnet/runtime/blob/main/CONTRIBUTING.md?r=0";
[Benchmark]
public bool Test() => TestData.StartsWith(
"https://github.com/dotnet/runtime/blob/main/CONTRIBUTING.md",
StringComparison.OrdinalIgnoreCase);codegen diff for
10x faster (Ryzen 7950x, win11-x64)
|
|
/benchmark json aspnet-citrine-win runtime |
|
Benchmark started for json on aspnet-citrine-win with runtime. Logs: link |
|
@tannergooding @BruceForstall @dotnet/avx512-contrib PTAL, no impact on TE, SPMI diffs are empty due to missing contexts - lots of missing contexts mean it found quite a few places for avx512 path, jit-utils found +16kb diff on BCL. |
Contributes to #77034
A small clean up in
impExpandHalfConstEqualsSIMDto make it SIMD size agnostic. At some point I plan to unify this withLowerCallMemcmpbut currently they're different: this one hasOrdinalIngoreCasesupport and produces better codegen when data is half constant (not just length).LowerCallMemcmpwill aslo be removed because we need a new phase where we can rely on SSA/VN to keep all existing optimizations.Benchmark:
(Ryzen 7950x, win11-x64)
codegen diff for
Test_IgnoreCase():Was:
New codgen:
AVX-512 is used for
[32..64]length range (in utf16)