Uh oh!
There was an error while loading. Please reload this page.
SVE: Fix the mask values returned by Helper - #114255
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
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() { ... }
Uh oh!
There was an error while loading. Please reload this page.
kunalspathak
commented
Apr 4, 2025
@dotnet/jit-contrib @dotnet/arm64-contrib |
amanasifkhalid
left a comment
There was a problem hiding this comment.
Looks like there are some new CI failures to sort through
Uh oh!
There was an error while loading. Please reload this page.
jozkee
commented
Jun 9, 2025
/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 arraywhich might be unrelated and is not addressed by this fix.