Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[arm64] Addressing modes for SIMD #67490

Merged
merged 4 commits into from
Apr 3, 2022
Merged

[arm64] Addressing modes for SIMD #67490

merged 4 commits into from
Apr 3, 2022

Conversation

EgorBo
Copy link
Member

@EgorBo EgorBo commented Apr 2, 2022

This PR implements addressing modes for SIMD vectors on arm64 (for now only loads with unscaled indices)
Closes #67435

Benchmark:

static byte[] _array1 = new byte[100000]; 
static byte[] _array2 = new byte[100000]; 
 
[Benchmark] 
public bool SequenceEqual() => _array1.AsSpan().SequenceEqual(_array2);
Method Toolchain Mean Error StdDev Ratio
SequenceEqual /Core_Root/corerun 3.635 us 0.0031 us 0.0027 us 1.00
SequenceEqual /Core_Root_pr/corerun 2.546 us 0.0224 us 0.0210 us 0.70

codegen diff example: https://www.diffchecker.com/wACQMKBT (SpanHelpers.SequenceEqual)

@ghost ghost assigned EgorBo Apr 2, 2022
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Apr 2, 2022
@ghost
Copy link

ghost commented Apr 2, 2022

Tagging subscribers to this area: @JulieLeeMSFT
See info in area-owners.md if you want to be subscribed.

Issue Details

This PR implements addressing modes for SIMD vectors on arm64

Benchmark:

static byte[] _array1 = new byte[100000]; 
static byte[] _array2 = new byte[100000]; 
 
[Benchmark] 
public bool SequenceEquals() => _array1.AsSpan().SequenceEqual(_array2);
Method Toolchain Mean Error StdDev Ratio
SequenceEquals /Core_Root/corerun 3.635 us 0.0031 us 0.0027 us 1.00
SequenceEquals /Core_Root_pr/corerun 2.546 us 0.0224 us 0.0210 us 0.70

codegen diff example: https://www.diffchecker.com/wACQMKBT (SpanHelpers.SequenceEqual)

Author: EgorBo
Assignees: EgorBo
Labels:

area-CodeGen-coreclr

Milestone: -

@EgorBo
Copy link
Member Author

EgorBo commented Apr 3, 2022

@dotnet/jit-contrib PTAL, simple change, diffs are small but cover SpanHelpers methods which are perf-critical

@danmoseley
Copy link
Member

Is this change sufficiently protected by an existing benchmark?

@EgorBo
Copy link
Member Author

EgorBo commented Apr 3, 2022

Is this change sufficiently protected by an existing benchmark?

Yes, SpanHelpers are heavily used under the hood in many benchmarks and Regexes, we even have explicit benchmarks, e.g. https://github.com/dotnet/performance/blob/d7dac8a7ca12a28d099192f8a901cf8e30361384/src/benchmarks/micro/libraries/System.Memory/Span.cs#L48

@EgorBo EgorBo merged commit fa294c0 into dotnet:main Apr 3, 2022
@ghost ghost locked as resolved and limited conversation to collaborators May 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[arm64] Addressing mode for vectors
3 participants