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

Ensure that Arm64 correctly handles multiplication of simd by a 64-bit scalar #106839

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

tannergooding
Copy link
Member

This resolves #106838

@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 Aug 22, 2024
@tannergooding
Copy link
Member Author

Extracted from #106594 so that it can be backported to .NET 9

@tannergooding
Copy link
Member Author

CC. @dotnet/jit-contrib for review

This fixes #106838 and will need backport

Copy link
Member

@EgorBo EgorBo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

x64 has a similar path - is it ok as is?

@tannergooding
Copy link
Member Author

tannergooding commented Aug 26, 2024

x64 has a similar path - is it ok as is?

Yes. The issue here was specifically with multiplication by a scalar, since Arm64 handles it by extracting the separate components.

For x64, we always broadcast that scalar to a vector and then use a vectorized implementation instead, not extracting.

-- The test is notably also xplat, not Arm64 specific and so is also validating that x64 is correct.

@tannergooding tannergooding merged commit 086ee66 into dotnet:main Aug 26, 2024
114 checks passed
@tannergooding tannergooding deleted the fix-106838 branch August 26, 2024 15:32
@tannergooding
Copy link
Member Author

/backport to release/9.0

Copy link
Contributor

Started backporting to release/9.0: https://github.com/dotnet/runtime/actions/runs/10562736191

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.

SIMD multiplication by scalar UInt64 can produce incorrect results on Arm64
2 participants