-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[release/8.0-rc2] Ensure that embedded broadcast checks the base type…
… of the parent node (#92459) * Ensure that embedded broadcast checks the base type of the parent node * Ensure the regression test exits if AVX2 is not supported * Also handle embedded broadcasts for mismatched memory sizes --------- Co-authored-by: Tanner Gooding <tagoo@outlook.com>
- Loading branch information
1 parent
fed0f78
commit 0717e52
Showing
3 changed files
with
70 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
47 changes: 47 additions & 0 deletions
47
src/tests/JIT/Regression/JitBlue/Runtime_92357/Runtime_92357.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,47 @@ | ||
// 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 System.Runtime.Intrinsics.X86; | ||
using Xunit; | ||
|
||
public static class Runtime_92357 | ||
{ | ||
[Fact] | ||
[MethodImpl(MethodImplOptions.AggressiveOptimization)] | ||
public static void Problem() | ||
{ | ||
if (!Avx2.IsSupported) | ||
{ | ||
return; | ||
} | ||
|
||
int y1 = 5; | ||
|
||
Vector256<short> actual1 = Test1(Vector256.Create((short)1), ref y1); | ||
Vector256<short> expected1 = Vector256.Create(10, 0, 10, 0, 10, 0, 10, 0, 10, 0, 10, 0, 10, 0, 10, 0); | ||
|
||
Assert.Equal(expected1, actual1); | ||
|
||
long y2 = 5; | ||
|
||
Vector256<int> actual2 = Test2(Vector256.Create((int)1), ref y2); | ||
Vector256<int> expected2 = Vector256.Create(10, 0, 10, 0, 10, 0, 10, 0); | ||
|
||
Assert.Equal(expected2, actual2); | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] | ||
public static Vector256<short> Test1(Vector256<short> x, ref int y) | ||
{ | ||
return Avx2.MultiplyLow(x + x, Vector256.Create(y).AsInt16()); | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)] | ||
public static Vector256<int> Test2(Vector256<int> x, ref long y) | ||
{ | ||
return Avx2.MultiplyLow(x + x, Vector256.Create(y).AsInt32()); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/tests/JIT/Regression/JitBlue/Runtime_92357/Runtime_92357.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> |