-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure to use float reserved register for TYP_SIMD12 #108629
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d20a56a
Use Float reserved registers
kunalspathak 2fd3389
add test case
kunalspathak 580e370
Use consistent internal register requirement for TYP_SIMD12
kunalspathak 147f189
Also do in loongarch and risc
kunalspathak 4d885bb
Use Extract to retrieve internal register for SIMD12
kunalspathak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
101 changes: 101 additions & 0 deletions
101
src/tests/JIT/Regression/JitBlue/Runtime_108609/Runtime_108609.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,101 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
// Found by Antigen | ||
// Reduced from 50.05 KB to 4.88 KB. | ||
// Assertion failed 'genExactlyOneBit(availableSet)' in 'TestClass:Method0():this' during 'Generate code' (IL size 782; hash 0x46e9aa75; FullOpts) | ||
// | ||
// File: /Users/runner/work/1/s/src/coreclr/jit/codegencommon.cpp Line: 133 | ||
|
||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.Intrinsics; | ||
using System.Runtime.Intrinsics.Arm; | ||
using System.Numerics; | ||
using Xunit; | ||
|
||
public class Runtime_108609 | ||
{ | ||
public struct S1 | ||
{ | ||
public Vector3 v3_0; | ||
public short short_1; | ||
} | ||
static bool s_bool_4 = true; | ||
static int s_int_10 = 5; | ||
static sbyte s_sbyte_12 = -5; | ||
static Vector64<int> s_v64_int_23 = Vector64<int>.Zero; | ||
static Vector64<double> s_v64_double_28 = Vector64.Create(-4.956521739130435); | ||
static Vector128<sbyte> s_v128_sbyte_30 = Vector128<sbyte>.Zero; | ||
static Vector128<short> s_v128_short_31 = Vector128.Create(0, 2, -5, 0, 1, 0, 2, 2); | ||
static Vector128<ulong> s_v128_ulong_36 = Vector128<ulong>.Zero; | ||
static Vector128<double> s_v128_double_38 = Vector128.Create(1.0769230769230769, 72.01666666666667); | ||
static Vector<ulong> s_v_ulong_46 = Vector.Create((ulong)1); | ||
static Vector<float> s_v_float_47 = Vector<float>.Zero; | ||
static S1 s_s1_52 = new S1(); | ||
char char_56 = 'K'; | ||
int int_60 = -1; | ||
Vector64<int> v64_int_73 = Vector64.Create(2147483646, -1); | ||
Vector64<double> v64_double_78 = Vector64.Create(-0.9420289855072463); | ||
Vector128<sbyte> v128_sbyte_80 = Vector128.Create(-2, -2, -1, 0, 5, -1, -1, -1, 1, 2, -1, 0, -1, 72, -5, 0); | ||
Vector128<short> v128_short_81 = Vector128.CreateScalar((short)-1); | ||
Vector128<ulong> v128_ulong_86 = Vector128<ulong>.AllBitsSet; | ||
Vector<ulong> v_ulong_96 = Vector.Create((ulong)1); | ||
Vector<float> v_float_97 = Vector.Create(2f); | ||
Vector3 v3_100 = Vector3.Create(0.09090909f, 2.4f, -0.94f); | ||
S1 s1_102 = new S1(); | ||
static int s_loopInvariant = 4; | ||
private static List<string> toPrint = new List<string>(); | ||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
private decimal LeafMethod3() | ||
{ | ||
return 19; | ||
} | ||
|
||
private Vector<float> Method2(decimal p_decimal_130, decimal p_decimal_131, sbyte p_sbyte_132, out Vector128<ulong> p_v128_ulong_133, S1 p_s1_134) | ||
{ | ||
p_v128_ulong_133 = s_v128_ulong_36; | ||
return Vector<float>.Zero; | ||
} | ||
|
||
private Vector128<sbyte> Method3(sbyte p_sbyte_152, Vector<ulong> p_v_ulong_153, S1 p_s1_154, uint p_uint_155, S1 p_s1_156, decimal p_decimal_157, Vector64<double> p_v64_double_158) | ||
{ | ||
unchecked | ||
{ | ||
return s_v128_sbyte_30 = s_v128_sbyte_30; | ||
} | ||
} | ||
|
||
private void Method0() | ||
{ | ||
unchecked | ||
{ | ||
S1 s1_218 = new S1(); | ||
if (!s_bool_4) | ||
{ | ||
int __loopvar0 = s_loopInvariant; | ||
for (int __loopSecondaryVar0_0 = 15 - 4; s_int_10 < Vector64.GetElement(s_v64_int_23 - Vector64<int>.Zero * (15 + 4) | (s_v64_int_23 += AdvSimd.Max(Vector64<int>.Zero, v64_int_73)), 15 & 4); __loopvar0--, __loopSecondaryVar0_0++, s_s1_52.short_1 = Vector128.Sum(AdvSimd.ShiftLogicalRoundedSaturate(Vector128<short>.AllBitsSet, v128_short_81) & Vector128.AsInt16(s_v128_double_38) - (15 | 4) * (v128_short_81 *= s_v128_short_31))) | ||
{ | ||
v3_100 *= s1_218.v3_0 - (s1_218.v3_0 = s1_218.v3_0 = s1_218.v3_0 *= s1_218.v3_0) * Vector3.RadiansToDegrees(Vector3.Zero + s_s1_52.v3_0 + v3_100 * v3_100) - Vector3.Sin(s1_218.v3_0 *= v3_100 * (s1_218.v3_0 *= s1_218.v3_0) - v3_100 * s_s1_52.v3_0); | ||
} | ||
} | ||
v_float_97 = Method2(15 % 4, LeafMethod3(), s_sbyte_12, out v128_ulong_86, s1_218); | ||
v128_sbyte_80 = Method3(15 % 4, s_v_ulong_46 *= s_v_ulong_46 += v_ulong_96 = s_v_ulong_46 ^ v_ulong_96 * (15 - 4), s1_218, 15 & 4, s1_102, LeafMethod3(), v64_double_78 * s_v64_double_28 - (s_v64_double_28 = v64_double_78) | Vector64.GreaterThan(v64_double_78, v64_double_78) | (s_v64_double_28 = Vector64<double>.Zero + v64_double_78) | (s_v64_double_28 = v64_double_78) | Vector64.GreaterThan(v64_double_78, v64_double_78) | (s_v64_double_28 = Vector64<double>.Zero + v64_double_78) | s_v64_double_28); | ||
return; | ||
} | ||
} | ||
|
||
[Fact] | ||
public static void TestEntryPoint() | ||
{ | ||
Antigen(); | ||
} | ||
|
||
private static int Antigen() | ||
{ | ||
new Runtime_108609().Method0(); | ||
return string.Join(Environment.NewLine, toPrint).GetHashCode(); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/tests/JIT/Regression/JitBlue/Runtime_108609/Runtime_108609.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> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, this function checks whether we don't have any spare temps at all - it does the store using two shuffles without temps, otherwise, do a simpler routine with temp, but looks like in some cases we over-allocate temps for it? Given that diffs are fine I guess it's ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, we may have more than 1 temps and
Extract
make sure to get the first available and remove it from the pool.