-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mark operands of non-RMW as delayFree (#57252)
* For non-RMW intrinsics, always delayfree the operands * Add test case * Update test case to add Avx2.IsSupported
- Loading branch information
1 parent
5817dc8
commit 6fca5a5
Showing
4 changed files
with
48 additions
and
5 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
30 changes: 30 additions & 0 deletions
30
src/tests/JIT/Regression/JitBlue/Runtime_56967/Runtime_56967.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,30 @@ | ||
using System; | ||
using System.Runtime.Intrinsics; | ||
using System.Runtime.Intrinsics.X86; | ||
|
||
public class Program | ||
{ | ||
// 'vlu1' is source as well as destination and want to make sure that | ||
// we do not allocate same register to the src/dest. We need to mark the | ||
// src as 'delayFree'. | ||
static unsafe int Main() | ||
{ | ||
if (Avx2.IsSupported) | ||
{ | ||
int* values = stackalloc int[256]; | ||
var vmsk = Vector256.Create(-1, -1, -1, 0, -1, -1, -1, 0); | ||
var vlu1 = Vector256.Create(0, 1, 2, 3, 4, 5, 6, 7); | ||
var vlu2 = Vector256.Create(7, 6, 5, 4, 3, 2, 1, 0); | ||
|
||
vlu1 = Avx2.GatherMaskVector256(vlu1, values, vlu1, vmsk, sizeof(int)); | ||
vlu2 = Avx2.GatherMaskVector256(vlu2, values, vlu2, vmsk, sizeof(int)); | ||
|
||
if (vlu1.GetElement(3) != 3 || vlu2.GetElement(3) != 4) | ||
{ | ||
return 1; | ||
} | ||
} | ||
|
||
return 100; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/tests/JIT/Regression/JitBlue/Runtime_56967/Runtime_56967.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,13 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<DebugType>None</DebugType> | ||
<Optimize>True</Optimize> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectName).cs" /> | ||
</ItemGroup> | ||
</Project> |