-
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.
[JIT] ARM32/ARM64 - Fixed zero/sign-extension for
GT_STORE_LCL_VAR
…
…in codegen (#84716) * Try to zero-extend if it is possible * Added test * Fix arm32 as well * Remove branch check for arm32. Added more specific check for arm64. * Remove unwanted code * Trying to fix build * use general register check * Update Runtime_84693.cs
- Loading branch information
Showing
5 changed files
with
74 additions
and
4 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
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
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
40 changes: 40 additions & 0 deletions
40
src/tests/JIT/Regression/JitBlue/Runtime_84693/Runtime_84693.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,40 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Runtime.CompilerServices; | ||
using Xunit; | ||
|
||
public class Test | ||
{ | ||
// This is trying to verify that we zero-extend from the result of "(byte)(-s_2)". | ||
public class Program | ||
{ | ||
public static short s_2; | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
public static void Consume(int x) {} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
public static int M8(byte arg0) | ||
{ | ||
s_2 = 1; | ||
arg0 = (byte)(-s_2); | ||
var vr1 = arg0 & arg0; | ||
Consume(vr1); | ||
return vr1; | ||
} | ||
} | ||
|
||
[Fact] | ||
public static int TestEntryPoint() { | ||
var result = Test.Program.M8(1); | ||
if (result != 255) | ||
{ | ||
return 0; | ||
} | ||
return 100; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/tests/JIT/Regression/JitBlue/Runtime_84693/Runtime_84693.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,8 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<Optimize>True</Optimize> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectName).cs" /> | ||
</ItemGroup> | ||
</Project> |