Skip to content

Conversation

@tannergooding
Copy link
Member

This resolves #75792

@ghost ghost added the area-System.Memory label Sep 19, 2022
@ghost ghost assigned tannergooding Sep 19, 2022
@ghost
Copy link

ghost commented Sep 19, 2022

Tagging subscribers to this area: @dotnet/area-system-memory
See info in area-owners.md if you want to be subscribed.

Issue Details

This resolves #75792

Author: tannergooding
Assignees: -
Labels:

area-System.Memory

Milestone: -

Copy link
Member

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

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

@tannergooding big thanks for your help! PTAL at my comments, I think I've found a bug

Copy link
Member

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

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

LGTM!

@tannergooding
Copy link
Member Author

@stephentoub, would appreciate a secondary sign-off from you before merging.

Great to have a second pair of eyes since we're backporting for .NET 7

}

return ComputeLastIndex(ref searchSpace, ref currentSearchSpace, equals);
return ComputeLastIndex(offset, equals);
Copy link
Member

Choose a reason for hiding this comment

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

It doesn't affect this PR, but I wonder why it's written like this rather than:

if (equals != Vector128<TValue>.Zero)
{
    return ComputeLastIndex(offset, equals);
}

Is this just style, or we expect the not found case to be the most common and want the branch predictor to default to that?

Copy link
Member

Choose a reason for hiding this comment

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

we expect the not found case to be the most common and want the branch predictor to default to that

That was my assumption when I was implementing it.

@adamsitnik adamsitnik merged commit 81d75bd into dotnet:main Sep 20, 2022
@tannergooding
Copy link
Member Author

/backport to release/7.0-rc2

@github-actions
Copy link
Contributor

Started backporting to release/7.0-rc2: https://github.com/dotnet/runtime/actions/runs/3089699377

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GCStress crash stable repro

5 participants