-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[release/7.0] JIT: fix incorrect scale in genCreateAddrMode + no-opt (#…
…75560) * Fix invalid addressing mode scale in debug mode * Add a test * Update Runtime_75312.il * Update Runtime_75312.ilproj * Drop unneeded initialization * Slightly better fix * Test an even better fix? * Refactoring * address feedback Co-authored-by: EgorBo <egorbo@gmail.com>
- Loading branch information
1 parent
adbfdfa
commit 6297d41
Showing
3 changed files
with
86 additions
and
42 deletions.
There are no files selected for viewing
This file contains 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
52 changes: 52 additions & 0 deletions
52
src/tests/JIT/Regression/JitBlue/Runtime_75312/Runtime_75312.il
This file contains 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,52 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
.assembly extern System.Runtime {} | ||
.assembly extern System.Runtime.Extensions {} | ||
.assembly extern System.Console {} | ||
.assembly Runtime_75312 {} | ||
|
||
.class public abstract auto ansi sealed beforefieldinit Runtime_75312 | ||
extends [System.Runtime]System.Object | ||
{ | ||
.method private hidebysig static | ||
int32 Main () cil managed | ||
{ | ||
.entrypoint | ||
.maxstack 2 | ||
.locals init ( | ||
[0] int64 a | ||
) | ||
ldc.i8 1234605616436508552 | ||
stloc.0 | ||
ldc.i4 1146447579 | ||
ldloca.s 0 | ||
conv.u | ||
newobj instance void [System.Runtime]System.IntPtr::.ctor(void*) | ||
call int32 [System.Runtime]System.IntPtr::op_Explicit(native int) | ||
call int32 Runtime_75312::Test(int32) | ||
sub | ||
ret | ||
} | ||
|
||
.method private hidebysig static int32 Test (int32 lcl) cil managed noinlining nooptimization | ||
{ | ||
.maxstack 8 | ||
|
||
// return *(int*)(arg0 + ((3 * 0) << 2) + 1); | ||
// to avoid constant folding in Roslyn (even for Debug) it's written in IL | ||
|
||
ldarg.0 | ||
ldc.i4.3 | ||
ldc.i4.0 | ||
mul | ||
ldc.i4.2 | ||
shl | ||
add | ||
ldc.i4.1 | ||
add | ||
conv.i | ||
ldind.i4 | ||
ret | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/tests/JIT/Regression/JitBlue/Runtime_75312/Runtime_75312.ilproj
This file contains 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,11 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.IL"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<CLRTestTargetUnsupported Condition="'$(TargetBits)' != '32'">true</CLRTestTargetUnsupported> | ||
<DebugType>None</DebugType> | ||
<Optimize>True</Optimize> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectName).il" /> | ||
</ItemGroup> | ||
</Project> |