ARM-SVE: Fix validation logic for GatherVectorByteOffsetFirstFaulting
tests
#107165
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.
Fixes #106621. Fixes #106815.
ValidateFirstFaultingResult
, we pass theBoundedMemory
object's underlying byte array directly toCheckGatherVectorWithByteOffsetFirstFaultingBehavior
instead of first converting it to an array of the user-facing type. This way, we don't risk dropping any bytes via imprecise length conversions for byte amounts that aren't multiples of the base type's size (i.e. if theBoundedMemory
object is 5 bytes long, the naive calculationinBounded.Length / Unsafe.SizeOf<Int32>()
will drop the last byte).CheckGatherVectorWithByteOffsetFirstFaultingBehavior
, when we're determining the expected fault result, it is not enough to check if the starting offset is out-of-bounds; we also have to factor in the size of the load to ensure the remaining bytes of the load operation fault if they walk off the end of the byte array.@dotnet/arm64-contrib PTAL. All
GatherVectorFirstFaulting
tests pass under stress modes. Thanks!