Skip to content
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

[mono][interp] Fix calling of static delegates with simd arguments #92927

Merged
merged 3 commits into from
Oct 6, 2023

Conversation

BrzVlad
Copy link
Member

@BrzVlad BrzVlad commented Oct 3, 2023

If we do a delegate call that translates to a static call, the delegate pointer that was passed needs to be skipped and we need to pass the actual arguments. However, the following arguments might not come immediately after the delegate pointer, if the first argument is simd aligned. Pass this information to MINT_CALL_DELEGATE so the correct offset of the arguments can be computed.

Fixes #92925

Previous code was checking if we should have already pushed a dreg, to compute the correct position of the argument on the stack. Save pointer to args directly instead.
If we do a delegate call that translates to a static call, the delegate pointer that was passed needs to be skipped and we need to pass the actual arguments. However, the following arguments might not come immediately after the delegate pointer, if the first argument is simd aligned. Pass this information to MINT_CALL_DELEGATE so the correct offset of the arguments can be computed.
@ghost
Copy link

ghost commented Oct 3, 2023

Tagging subscribers to this area: @BrzVlad, @kotlarmilos
See info in area-owners.md if you want to be subscribed.

Issue Details

If we do a delegate call that translates to a static call, the delegate pointer that was passed needs to be skipped and we need to pass the actual arguments. However, the following arguments might not come immediately after the delegate pointer, if the first argument is simd aligned. Pass this information to MINT_CALL_DELEGATE so the correct offset of the arguments can be computed.

Fixes #92925

Author: BrzVlad
Assignees: BrzVlad
Labels:

area-Codegen-Interpreter-mono

Milestone: -

@BrzVlad
Copy link
Member Author

BrzVlad commented Oct 4, 2023

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@BrzVlad
Copy link
Member Author

BrzVlad commented Oct 4, 2023

This is actually a fix for a regression from .net7, so it is a backport candidate, which can be reproduced with a trivial sample:

using System;
using System.Runtime.Intrinsics;

public class Program {

	public static void Method (Vector128<int> v)
	{
		Console.WriteLine (v);
	}

	public static void Main (string[] args)
	{
		Vector128<int> v = Vector128.Create (1, 2, 3, 4);
		Action<Vector128<int>> act = Method;

		act (v);
	}
}

On .net8 rc1 this prints <1711280944, 32733, 1, 2>

@BrzVlad
Copy link
Member Author

BrzVlad commented Oct 5, 2023

@matouskozak could you take a look at the extra platforms failures to see if everything looks ok ?

@matouskozak
Copy link
Member

@matouskozak could you take a look at the extra platforms failures to see if everything looks ok ?

The failures seem unrelated.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JIT/SIMD/CircleInConvex_[r]/[ro] are failing on arm64 Mono interpreter
3 participants