-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Fix for out of range rotate amount during lower #131909
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
Open
dhartglassMSFT
wants to merge
11
commits into
dotnet:main
Choose a base branch
from
dhartglassMSFT:fix_for_ROR_roate_assert
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d458b06
add testcase
dhartglassMSFT 7c2c432
initial impl
dhartglassMSFT 3593535
explicit masking for some operands in importercalls
dhartglassMSFT c833b2d
move importer rotate logic to a common place
dhartglassMSFT 72cfceb
remove comment
dhartglassMSFT bd64b0f
reword comments
dhartglassMSFT 74b848f
transform spelling typo in comment
dhartglassMSFT 4fbaaa2
jit format
dhartglassMSFT a74014d
reword comment
dhartglassMSFT d1984cd
WASM PR feedback
dhartglassMSFT df2ebf9
git format changes
dhartglassMSFT File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
src/tests/JIT/Regression/JitBlue/Runtime_129298/Runtime_129298.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| // Testcase exposed an ROR node with an out of range operand on arm64, | ||
| // asserted in lowering | ||
|
|
||
| using System; | ||
| using System.Numerics; | ||
| using System.Runtime.CompilerServices; | ||
| using Xunit; | ||
|
|
||
| public class Runtime_129298 | ||
| { | ||
| private static volatile uint Input_p0 = 1; | ||
| private static volatile uint Input_p1 = 1; | ||
|
|
||
| [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] | ||
| public static uint Fn(uint p0, uint p1) | ||
| { | ||
| unchecked | ||
| { | ||
| uint v1, v3, v5, v6, v8, v11, v15, v16, v22, v26, v28; | ||
| uint v33 = 0, v40, v44; | ||
| uint v21 = 0; | ||
| int v2, v4, v7, v9, v10, v29; | ||
| v1 = p0 % p1; | ||
| v2 = BitOperations.LeadingZeroCount(v1); v3 = (uint)v2; | ||
| v4 = BitOperations.LeadingZeroCount(v1); v5 = (uint)v4; | ||
| v6 = BitOperations.RotateLeft(p0, 0); | ||
| v7 = BitOperations.IsPow2(0x80000000u) ? 1 : 0; v8 = (uint)v7; | ||
| v9 = (p1 < p0) ? 1 : 0; | ||
| if (v9 == 0) | ||
| { | ||
| v22 = Math.Min(0xFFFFFFFEu, 0xFFFFFFFFu); | ||
| return v22; | ||
| } | ||
| v10 = (v1 > p1) ? 1 : 0; v11 = (uint)v10; | ||
| v15 = v6 + 0x12345u; v16 = v11 + p1; | ||
| v26 = BitOperations.RotateLeft(0xFFFFFFFFu, (int)v21); | ||
| v28 = p1 ^ 3u; | ||
| v29 = (v15 <= v16) ? 1 : 0; | ||
| if (v29 != 0) | ||
| { | ||
| v33 = (uint)BitOperations.TrailingZeroCount(v16); | ||
| return v33 ^ v5; | ||
| } | ||
| // unreached at runtime; v33 = 0 (default-init) reaches Lowering. | ||
| v40 = BitOperations.RotateLeft(p0, (int)(0x7FFFFFFEu % v33)); | ||
| v44 = v40 ^ v5; | ||
| return v44; | ||
| } | ||
| } | ||
|
|
||
| [Fact] | ||
| public static void TestEntryPoint() | ||
| { | ||
| // The JIT must compile Fn (including the dead rotate block) under | ||
| // FullOpts without asserting. For the given inputs Fn takes the first | ||
| // early return, so the result is Math.Min(0xFFFFFFFE, 0xFFFFFFFF). | ||
| Assert.Equal(0xFFFFFFFEu, Fn(Input_p0, Input_p1)); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.