-
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.
Handle contained BITCAST for STORE_LCL_FLD (#55852)
* Do not mark BITCAST as contained for STORE_LCL_FLD * Add unit test * Handle contained BITCAST in STORE_LCL_FLD * Return 100
- Loading branch information
1 parent
3847790
commit d38a539
Showing
3 changed files
with
69 additions
and
2 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
32 changes: 32 additions & 0 deletions
32
src/tests/JIT/Regression/JitBlue/Runtime_55141/Runtime_55141.cs
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,32 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Runtime.CompilerServices; | ||
|
||
struct S0 | ||
{ | ||
public ulong F0; | ||
public ulong F1; | ||
public long F2; | ||
public uint F4; | ||
public uint F6; | ||
} | ||
|
||
public class Runtime_55141 | ||
{ | ||
// UDIV is lowered to the MULHI/BITCAST nodes and they are stored in field (STORE_LCL_FLD). | ||
// BITCAST is marked as contained so the value to be stored can be used from MULHI, but marking | ||
// the containment of BITCAST is not supported in codegen for STORE_LCL_FLD. | ||
public static int Main() | ||
{ | ||
return (uint)Run(0) == 0 ? 100 : 0; | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
public static uint Run(long x) | ||
{ | ||
S0 vr1 = default(S0); | ||
vr1.F4 = (uint)x / 254; | ||
return vr1.F6; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/tests/JIT/Regression/JitBlue/Runtime_55141/Runtime_55141.csproj
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,10 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<Optimize>True</Optimize> | ||
<DebugType>None</DebugType> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectName).cs" /> | ||
</ItemGroup> | ||
</Project> |