-
Notifications
You must be signed in to change notification settings - Fork 5.2k
SVE: Fix the mask values returned by Helper #114255
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
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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() { ... }
@dotnet/jit-contrib @dotnet/arm64-contrib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there are some new CI failures to sort through
/backport to release/9.0-staging |
Started backporting to release/9.0-staging: https://github.com/dotnet/runtime/actions/runs/15539869299 |
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 array
which might be unrelated and is not addressed by this fix.