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

[release/5.0] Fix logic to test bits in a constant vector (Vector256) #48613

Merged
merged 3 commits into from
Mar 10, 2021

Conversation

EgorBo
Copy link
Member

@EgorBo EgorBo commented Feb 22, 2021

Issue: #47385
Fix in master: #47385

Customer Impact

If a user tries to create a Vector256 via Create overload and the first half of its arguments are zeros and the second part is, let's say, all "1" (or any other constant) - a special optimization will always optimize that Create to Vector256<T>.Zero. A simple example:

Console.WriteLine(Vector256.Create(0, 0, 0, 0, 1, 1, 1, 1));

prints:

<0, 0, 0, 0, 0, 0, 0, 0>

but is expected to print:

<0, 0, 0, 0, 1, 1, 1, 1>

Same for -1 and AllBitSets, and same for Vector64 on arm64.
Where T type is pretty much any type Vectors support.

Testing

This PR adds a regression test.

Risk

Low. This impacts only rare specific cases with hardware intrinsics.

Regression

Yes, the optimization Vector256(0,0,0...0) to Vector256<>.Zero was introduced in 5.0

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Feb 22, 2021
Copy link
Contributor

@echesakov echesakov left a comment

Choose a reason for hiding this comment

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

LGTM

@echesakov echesakov added this to the 5.0.x milestone Feb 23, 2021
@Anipik Anipik added the Servicing-consider Issue for next servicing release review label Mar 1, 2021
@JulieLeeMSFT
Copy link
Member

CC @jeffschwMSFT

Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

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

Approved. We should consider this for 5.0.x

@leecow leecow added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Mar 2, 2021
@leecow leecow modified the milestones: 5.0.x, 5.0.5 Mar 2, 2021
@Anipik Anipik merged commit 89f4d8f into dotnet:release/5.0 Mar 10, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Apr 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-x64 arch-x86 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI Servicing-approved Approved for servicing release
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

8 participants