dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.66k stars 4.57k forks source link

ARM64-SVE: Detect mask usage for Across functions #101973

Open a74nh opened 2 months ago

a74nh commented 2 months ago

ConditionalSelect is used to mask an API. For methods that reduce down to a scalar value (eg all the Across methods), this would be done via:

a = Sve.AddAcross(Sve.ConditionalSelect(mask, a, zero));

Currently this will produce an SEL instruction to select the correct entries. Then will feed this into an ADD that uses an all-true mask.

Instead, the SEL needs merging into the ADD to produce a single ADD instruction using the mask.

See https://github.com/dotnet/runtime/issues/101770 for history.

dotnet-policy-service[bot] commented 2 months ago

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

kunalspathak commented 2 weeks ago

https://github.com/dotnet/runtime/pull/104640 falls in similar category.