forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JIT: Fix containment of extract intrinsics as STOREIND sources (dotne…
…t#92634) Fix dotnet#92590
- Loading branch information
1 parent
b417004
commit 0311aa8
Showing
3 changed files
with
73 additions
and
1 deletion.
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
63 changes: 63 additions & 0 deletions
63
src/tests/JIT/Regression/JitBlue/Runtime_92590/Runtime_92590.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,63 @@ | ||
// 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.Runtime.CompilerServices; | ||
using System.Runtime.Intrinsics; | ||
using Xunit; | ||
|
||
public class Runtime_92590 | ||
{ | ||
[Fact] | ||
public static void TestEntryPoint() | ||
{ | ||
Span<byte> bytes = stackalloc byte[4]; | ||
bytes.Fill(0xff); | ||
TestByteByte(ref bytes[0], 0, Vector256.Create((byte)1)); | ||
|
||
Assert.True(bytes.SequenceEqual(stackalloc byte[] { 0x2, 0xff, 0xff, 0xff })); | ||
|
||
bytes.Fill(0xff); | ||
TestByteInt(ref bytes[0], 0, Vector256.Create(1)); | ||
|
||
Assert.True(bytes.SequenceEqual(stackalloc byte[] { 0x2, 0xff, 0xff, 0xff })); | ||
|
||
int i = int.MaxValue; | ||
TestIntByte(ref i, 0, Vector256.Create((byte)1)); | ||
|
||
Assert.Equal(2, i); | ||
|
||
i = int.MaxValue; | ||
TestIntInt(ref i, 0, Vector256.Create(1)); | ||
|
||
Assert.Equal(2, i); | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
private static void TestByteByte(ref byte b, int x, Vector256<byte> vin) | ||
{ | ||
Vector256<byte> v = vin + vin; | ||
Unsafe.Add(ref b, x) = v[3]; | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
private static void TestByteInt(ref byte b, int x, Vector256<int> vin) | ||
{ | ||
Vector256<int> v = vin + vin; | ||
Unsafe.Add(ref b, x) = (byte)v[3]; | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
private static void TestIntByte(ref int b, int x, Vector256<byte> vin) | ||
{ | ||
Vector256<byte> v = vin + vin; | ||
Unsafe.Add(ref b, x) = v[3]; | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
private static void TestIntInt(ref int b, int x, Vector256<int> vin) | ||
{ | ||
Vector256<int> v = vin + vin; | ||
Unsafe.Add(ref b, x) = v[3]; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/tests/JIT/Regression/JitBlue/Runtime_92590/Runtime_92590.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> |