SVE: Fix the mask values returned by Helper#114255
Merged
kunalspathak merged 5 commits intodotnet:mainfrom Apr 4, 2025
Merged
Conversation
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Contributor
There was a problem hiding this comment.
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (2)
src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs:7747
- Directly returning the modulo result fixes the incorrect mask value, but confirm that TestLibrary.Generator.GetInt32() always produces non-negative values to ensure the returned mask is strictly 0 or 1.
return (float)(TestLibrary.Generator.GetInt32()%(int)2);
src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs:7745
- Consider adding unit tests to validate that both getMaskSingle() and getMaskDouble() always return 0 or 1 as intended.
public static float getMaskSingle() { ... }
Contributor
Author
|
@dotnet/jit-contrib @dotnet/arm64-contrib |
Contributor
amanasifkhalid
left a comment
There was a problem hiding this comment.
Looks like there are some new CI failures to sort through
amanasifkhalid
approved these changes
Apr 4, 2025
Member
|
/backport to release/9.0-staging |
Contributor
|
Started backporting to release/9.0-staging: https://github.com/dotnet/runtime/actions/runs/15539869299 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As pointed in #112264 (comment), the mask values returned by helper methods
GetMaskDouble()andGetMaskSingle()are incorrect and were getting returned usingBitConverter.DoubleToInt64Bits()andBitConverter.SingleToInt32Bits()respectively. This might make a lane active or inactive, depending on the value ofbit 0(on which mask registers operate on). However, in the validation, we just assume that anything that is non-zero is active. Fix it by returning strictly either 0 or 1.Fixes: #112264
These might also be related certain functional incorrect failures seen in #112377. Note that in the issue, there was also a reference of getting
Index was outside the bounds of the arraywhich might be unrelated and is not addressed by this fix.