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

Fixes #106142. #106369

Merged
merged 2 commits into from
Aug 14, 2024
Merged

Fixes #106142. #106369

merged 2 commits into from
Aug 14, 2024

Conversation

DeepakRajendrakumaran
Copy link
Contributor

@DeepakRajendrakumaran DeepakRajendrakumaran commented Aug 13, 2024

This Fixes #106142

Rotate requires the count to be normalized depending on base type. This was already done with f251b17 but there was a behavioral mismatch between x86 and x64 with the mod(%) operator

@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 Aug 13, 2024
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Aug 13, 2024
@JulieLeeMSFT
Copy link
Member

@tannergooding @jakobbotsch , please review the code before RC1 snap.
Cc @dotnet/jit-contrib .

src/coreclr/jit/simd.h Outdated Show resolved Hide resolved
Copy link
Member

@jakobbotsch jakobbotsch left a comment

Choose a reason for hiding this comment

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

Can you add the test?

@JulieLeeMSFT
Copy link
Member

Thanks for the work. If tests pass, I will merge today.

@@ -802,17 +802,27 @@ TBase EvaluateBinaryScalarSpecialized(genTreeOps oper, TBase arg0, TBase arg1)
case GT_ROL:
{
// Normalize the "rotate by" value
arg1 %= (sizeof(TBase) * BITS_PER_BYTE);
Copy link
Member

Choose a reason for hiding this comment

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

Was the behavioral difference for negative inputs, since %= is remainder of truncating division and so handles signed values differently?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep. It was different for negative inputs. For eg. one of the test case has the rotate count show up as -2 in here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JIT: Bad codegen with Avx512F.VL.RotateLeftVariable and Avx512F.VL.RotateRightVariable on win-x86
4 participants