Repository navigation
arm64: Optimize Vector helper APIs - #132117
jonathandavies-arm wants to merge 9 commits into
Conversation
dotnet#121981 (comment) Import Vector64/128 helper APIs through Arm64 compare masks so Count, IndexOf, LastIndexOf, and related Any/All/None helpers can benefit from existing ExtractMostSignificantBits lowering. Preserve Scalar<T>.Equals NaN semantics for floating-point value helpers and keep unsupported 64-bit mask encodings on fallback paths.
|
Azure Pipelines: Successfully started running 5 pipeline(s). 11 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
|
cc: @dotnet/arm64-contrib @dhartglassMSFT |
|
/azp run runtime-coreclr superpmi-diffs |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
Hi @jonathandavies-arm, did you look at diffs? From the pipeline (fullopts)
|
Gate the new Vector helper registrations and importer paths on TARGET_ARM64, and remove their xarch-specific lowering. This preserves Arm64 code generation while leaving other targets on the existing managed paths.
I've added a change and this work is now limited to ARM64, so the disasm increases should now only be on the ARM64 builds. The extra instructions come from how the new imports turn vector comparison results into an element index. The existing managed-helper path can use I've put together a performance suite for this work on a separate branch, perf/vector-helper-investigation. It includes the custom benchmarks, run scripts and recorded results. Despite the larger disassembly in some cases, we see improved execution time for the tested count/index helpers on a Cortex-X925. The table below shows representative median times (including loop and array-access overhead) for integer vectors with the match in the last lane, comparing the PR with main using the same runtime and CoreLib and swapping only the JIT:
I also ran the relevant
I think it is best to allow this change to go in, accept that the asmdiffs will increase but we get better performance. |
Import Vector64/128 helper APIs through Arm64 compare masks so Count, IndexOf, LastIndexOf, and related Any/All/None helpers can benefit from existing ExtractMostSignificantBits lowering. Preserve Scalar.Equals NaN semantics for floating-point value helpers and keep unsupported 64-bit mask encodings on fallback paths.
#121981 (comment)