Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/coreclr/jit/codegenxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6293,6 +6293,18 @@ void CodeGen::genCallInstruction(GenTreeCall* call X86_ARG(target_ssize_t stackA
{
params.retSize = emitTypeSize(retTypeDesc->GetReturnRegType(0));
params.secondRetSize = emitTypeSize(retTypeDesc->GetReturnRegType(1));

if (retTypeDesc->GetABIReturnReg(1, call->GetUnmanagedCallConv()) == REG_INTRET)
{
// If the second return register is REG_INTRET, then the first
// return is expected to be in a SIMD register.
// The emitter has hardcoded belief that params.retSize corresponds to
// REG_INTRET and secondRetSize to REG_INTRET_1, so fix up the
// situation here.
assert(!EA_IS_GCREF_OR_BYREF(params.retSize));
params.retSize = params.secondRetSize;
params.secondRetSize = EA_UNKNOWN;
}
}
else
{
Expand Down
42 changes: 42 additions & 0 deletions src/tests/JIT/Regression/JitBlue/Runtime_115815/Runtime_115815.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Threading;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using Xunit;

public class Runtime_115815
{
[Fact]
public static void TestEntryPoint()
{
var destination = new KeyValuePair<Container, double>[1_000_000];

// loop to make this method fully interruptible + to get into OSR version
for (int i = 0; i < destination.Length; i++)
{
destination[i] = default;
}

for (int i = 0; i < 5; i++)
{
for (int j = 0; j < destination.Length; j++)
{
destination[j] = GetValue(j);
}

Thread.Sleep(10);
}
}

[MethodImpl(MethodImplOptions.NoInlining)]
private static KeyValuePair<Container, double> GetValue(int i)
=> KeyValuePair.Create(new Container(i.ToString()), (double)i);

private struct Container
{
public string Name;
public Container(string name) { this.Name = name; }
}
}
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>
Loading