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

Mark DivRem with RequiresPreviewFeatures #82221

Merged
merged 4 commits into from
Feb 16, 2023

Conversation

kunalspathak
Copy link
Member

  • Adds back DivRem APIs in ref
  • Also reverts fake corelib from test project.
  • Marks DivRem with [RequiresPreviewFeatures]

@dotnet-issue-labeler
Copy link

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@ghost
Copy link

ghost commented Feb 16, 2023

Tagging subscribers to this area: @dotnet/area-system-runtime-intrinsics
See info in area-owners.md if you want to be subscribed.

Issue Details
  • Adds back DivRem APIs in ref
  • Also reverts fake corelib from test project.
  • Marks DivRem with [RequiresPreviewFeatures]
Author: kunalspathak
Assignees: kunalspathak
Labels:

area-System.Runtime.Intrinsics, new-api-needs-documentation

Milestone: -

[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("DivRem is in preview.")]
public static (nuint Quotient, nuint Remainder) DivRem(nuint lower, nuint upper, nuint divisor) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("DivRem is in preview.")]
public static (nint Quotient, nint Remainder) DivRem(nuint lower, nint upper, nint divisor) { throw null; }
Copy link
Member

Choose a reason for hiding this comment

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

Have these APIs gone through API review?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

@jkotas jkotas Feb 16, 2023

Choose a reason for hiding this comment

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

I assume that you are asking about this specific overload - I do not see it in the approved set. All overloads are in the approved set - I was looking in a wrong place.

Copy link
Member

Choose a reason for hiding this comment

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

The general premise of extending the intrinsics to support nint/nuint was reviewed and approved already: #52021

AFAIR, we covered at the time in API review that any other already approved but NYI APIs were also covered by that.

Copy link
Member

Choose a reason for hiding this comment

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

The same general approval for nint/nuint for Arm64 was done here: #52027

Copy link
Member

Choose a reason for hiding this comment

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

Indeed, it's covered in the approval explicitly: #27292 (comment)

@@ -5217,11 +5217,23 @@ public abstract partial class X86Base
internal X86Base() { }
public static bool IsSupported { get { throw null; } }
public static (int Eax, int Ebx, int Ecx, int Edx) CpuId(int functionId, int subFunctionId) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("DivRem is in preview.")]
Copy link
Member

Choose a reason for hiding this comment

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

Is the plan that we ship these in .NET 8 as preview, or is the plan that by the time we ship .NET 8 it's fully supported?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, we plan to address it in .NET 8. Tracking issue #82194

Copy link
Member

Choose a reason for hiding this comment

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

Ok. Technically every new API we add in previews is preview and doesn't require such attribution; this attribute was really intended to be used for things to remain in preview in supported releases. If we're just trying to scare people off from using it in previews, I guess it's ok, but it seems superfluous to me.

Copy link
Member

Choose a reason for hiding this comment

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

I agree that this would be superfluous for ordinary APIs.

This is codegen intrinsic that may require non-trivial work to complete. Tagging it as preview makes us "ready to ship" without any additional changes, even in the case we do not have a chance to complete the work for some reason. Deleting the tag once the work is complete is a small clean change.

Copy link
Member

Choose a reason for hiding this comment

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

Fair enough. Of course, we still need to remember to remove the attribute when we complete that additional work. Let's make sure to track that somewhere.

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated #82194 to capture it.

@jkotas
Copy link
Member

jkotas commented Feb 16, 2023

@kunalspathak kunalspathak marked this pull request as ready for review February 16, 2023 18:05
@kunalspathak
Copy link
Member Author

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

Thanks

@kunalspathak
Copy link
Member Author

Failures seems to be known issue.
image

@kunalspathak kunalspathak merged commit d4c46d5 into dotnet:main Feb 16, 2023
@kunalspathak kunalspathak deleted the divrem_fix branch February 16, 2023 21:09
@jeffhandley jeffhandley added the blog-candidate Completed PRs that are candidate topics for blog post coverage label Mar 14, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Apr 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Runtime.Intrinsics blog-candidate Completed PRs that are candidate topics for blog post coverage new-api-needs-documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants