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

Use inline Vector{128|256}.Create for constants #54827

Merged
3 commits merged into from
Jul 12, 2021
Merged

Conversation

gfoidl
Copy link
Member

@gfoidl gfoidl commented Jun 28, 2021

Fixes #44115

Used Vector(128|256)<\w+> \w+ = as regex-search, seems that these three places are the onley one left.
The SSE-helper, that are mentioned in the issue, got re-written by @GrabYourPitchforks some time ago, and there patterns for the new codegen is already used.

Codegen was validated (manually) to see that it's an improvement.

It's not clear to me whether the touched codes are built for .NET Core 3.1 or not. So I added conditional compilation, as for .NET Core 3.1 the codegen is quite worse when Vector{128|256}.Create is used (that's why we initially had the different patterns before the JIT started to emit constants and read them from the data-segment).

/cc: @tannergooding

@dotnet-issue-labeler
Copy link

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

@@ -120,9 +120,11 @@ public BitArray(byte[] bytes)
_version = 0;
}

#if !NET6_0_OR_GREATER
Copy link
Member

Choose a reason for hiding this comment

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

Why are these ifdefs needed... isn't this file only compiled for netcoreappcurrent?

Copy link
Member Author

Choose a reason for hiding this comment

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

isn't this file only compiled for netcoreappcurrent?

This is the point I don't know (alluded in the description).
But if so, I'll just remove them.

My point is just to make sure that .NET Core 3.1 doesn't regress, as it's a LTS through Dec, 2022.

Copy link
Member

Choose a reason for hiding this comment

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

They're not needed. This file is only included in System.Collections.csproj, which only builds for netcoreappcurrent:

<TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks>

Base64Decoder/Encoder.cs are only included in System.Memory, which only builds for netcoreappcurrent:

<TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks>

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! 👍🏻

It's only built for NetCoreAppCurrent, so no need to special case older runtimes.
@ghost
Copy link

ghost commented Jul 12, 2021

Hello @tannergooding!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit 738b09b into dotnet:main Jul 12, 2021
@gfoidl gfoidl deleted the vector-constants branch July 12, 2021 17:17
@ghost ghost locked as resolved and limited conversation to collaborators Aug 11, 2021
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Revise how constant SIMD vectors are defined in BCL
3 participants