Skip to content

Sve: Fix Gather/Scatter tests #115036

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

Merged
merged 1 commit into from
Apr 25, 2025
Merged

Conversation

kunalspathak
Copy link
Member

SVE Gather/Scatter tests populates a data array and then get the addresses of some of the elements of data array. These addresses are then passed to SVE APIs to see if the API correctly loads the required elements and validates the result. The step where we were populating the individual element address has a bug in pointer arithmetic and was returning incorrect address of pointers. When the underlying data is double, returning invalid aligned data element address would treat the underlying data as NaN or other times, might not match the expected return result from these APIs. I have fixed the pointer arithmetic to correctly calculate the address of the individual element and now the tests are passing as expected. I have also added Debug.Assert() while setting up the addresses to make sure we are doing it correctly.

I also noticed similar problem for Scatter test cases and fixed them too.

Fixes: #114646
Fixes: #112264

@Copilot Copilot AI review requested due to automatic review settings April 25, 2025 06:06
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

Files not reviewed (3)
  • src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveGatherVectorFirstFaultingVectorBases.template: Language not supported
  • src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveGatherVectorVectorBases.template: Language not supported
  • src/tests/JIT/HardwareIntrinsics/Arm/Shared/SveScatterVectorBases.template: Language not supported

@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 25, 2025
Copy link
Contributor

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

@kunalspathak
Copy link
Member Author

@dotnet/jit-contrib @dotnet/arm64-contrib @a74nh

@kunalspathak
Copy link
Member Author

/azp run runtime-coreclr jitstress, runtime-coreclr outerloop

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

Copy link
Contributor

@a74nh a74nh left a comment

Choose a reason for hiding this comment

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

LGTM.
And the asserts are useful.

@kunalspathak
Copy link
Member Author

/ba-g outerloop failures are unrelated

@kunalspathak kunalspathak merged commit 32463ba into dotnet:main Apr 25, 2025
140 of 143 checks passed
@kunalspathak kunalspathak deleted the sve-gatherbase branch April 25, 2025 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
3 participants