Skip to content
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

Vector.ConditionalSelect and Vector128.ConditionalSelect don't emit vpblendvb on x64 #67039

Closed
gfoidl opened this issue Mar 23, 2022 · 3 comments · Fixed by #69509
Closed

Vector.ConditionalSelect and Vector128.ConditionalSelect don't emit vpblendvb on x64 #67039

gfoidl opened this issue Mar 23, 2022 · 3 comments · Fixed by #69509

Comments

@gfoidl
Copy link
Member

gfoidl commented Mar 23, 2022

Vector.ConditionalSelect emits on x64 with AVX2 supported a series of

vpand
vpandn
vpor

instead of emitting

vpblendvb

only.

The same is for Vector128.ConditionalSelect.

Is this by design or a missed oppurtunity to use available instructions?

See also sharplab and I see the same on .NET 7 Preview 2.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Mar 23, 2022
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@ghost
Copy link

ghost commented Mar 23, 2022

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

Issue Details

Vector.ConditionalSelect emits on x64 with AVX2 supported a series of

vpand
vpandn
vpor

instead of emitting

vpblendvb

only.

The same is for Vector128.ConditionalSelect.

Is this by design or a missed oppurtunity to use available instructions?

See also sharplab and I see the same on .NET 7 Preview 2.

Author: gfoidl
Assignees: -
Labels:

area-System.Runtime.Intrinsics, untriaged

Milestone: -

@tannergooding
Copy link
Member

ConditionalSelect is "bitwise" and so optimizing it to be blend requires an additional JIT optimization that's not been implemented yet (it has to know the mask comes from something like a Compare).

That optimization is planned, its just not been done yet.

@tannergooding tannergooding removed the untriaged New issue has not been triaged by the area owner label Mar 23, 2022
@tannergooding tannergooding added this to the 7.0.0 milestone Mar 23, 2022
@dakersnar dakersnar self-assigned this May 9, 2022
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label May 18, 2022
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label May 25, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jun 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants