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] Intrinsify Unsafe API's #105150

Merged
merged 8 commits into from
Jul 26, 2024
Merged

Conversation

fanyang-mono
Copy link
Member

@fanyang-mono fanyang-mono commented Jul 19, 2024

Fixes #101495

The implementation of Unsafe.BitCast was extracted from #103915

Copy link
Contributor

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

@xtqqczze
Copy link
Contributor

Make sure to add comments to Unsafe.cs, e.g. // Mono:SubtractByteOffset as below:

// CoreCLR:METHOD__UNSAFE__AS_POINTER
// AOT:AsPointer
// Mono:AsPointer
[NonVersionable]
[CLSCompliant(false)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void* AsPointer<T>(ref T value)

Copy link
Member

@tannergooding tannergooding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Add/Subtract and Read/Write changes LGTM

BitCast also LGTM, but I'm probably not the right person to review that since I wrote some of the code in a previous prototype

@fanyang-mono
Copy link
Member Author

runtime/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/Unsafe.cs

This seems to be a very fragile way of keeping track which methods are intrinsified by each runtime. We probably should come up a better way of doing it.

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.

[mono] Intrinsify Unsafe API's
4 participants