Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Expose theConvertToIntegerNative APIs#100993

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
carlossanlop merged 6 commits intodotnet:mainfromtannergooding:convert-unsafe
Apr 24, 2024

Conversation

@tannergooding
Copy link
Member

Thisresolves#61885

@ghost
Copy link

Note regarding thenew-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, 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.

@tannergoodingtannergoodingforce-pushed theconvert-unsafe branch 2 times, most recently fromaea06be to160402eCompareApril 13, 2024 04:59
@tannergoodingtannergoodingforce-pushed theconvert-unsafe branch 2 times, most recently from6a06e7b to272b8f6CompareApril 13, 2024 11:03
@tannergooding
Copy link
MemberAuthor

CC. @dotnet/jit-contrib, @dotnet/avx512-contrib

This exposes the APIs that allow people to opt-in to the platform specific floating-point conversion behavior. It is a continuation of#97529

@tannergooding
Copy link
MemberAuthor

Ping @dotnet/jit-contrib

@JulieLeeMSFTJulieLeeMSFT added this to the9.0.0 milestoneApr 18, 2024
@JulieLeeMSFT
Copy link
Member

@BruceForstall,@anthonycanino, PTAL.

@tannergooding
Copy link
MemberAuthor

It'd be nice to get this in before the snap tomorrow, so that we have a complete experience for the standardization around floating-point conversions that was done and users have the escape hatch to get access to the prior behavior.

Copy link
Contributor

@DeepakRajendrakumaranDeepakRajendrakumaran left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@kunalspathakkunalspathak left a comment

Choose a reason for hiding this comment

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

JIT changes LGTM, with some questions.


if (!varTypeIsArithmetic(retType))
{
assert((intrinsic == NI_PRIMITIVE_ConvertToInteger) || (intrinsic == NI_PRIMITIVE_ConvertToIntegerNative));
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not too familiar with "named intrinsics", but aren't there more intrinsics likeConvertToInt64 that returns VectorT, although not sure why its entry is not innamedintrinsiclist.h. Can you please explain?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

They are, they are just included indirectly via the tables. That's what this region is for:https://github.com/dotnet/runtime/blob/main/src/coreclr/jit/namedintrinsiclist.h#L140-L164

We basically just have 6 categories within the list:

  • NI_SYSTEM_MATH
  • NI_HW_INTRINSIC
  • NI_SIMD_AS_HWINTRINSIC
  • NI_SRCS_UNSAFE
  • NI_PRIMITIVE
  • general intrinsics not in another list

Each of the first 5 categories are just groups of intrinsics that generally get handled together via some central function for that group.

So theConvertToInt64 forVector<T> is handled byNI_SIMD_AS_HWINTRINSIC and won't hit this path.


var_types tgtType =JitType2PreciseVarType(sig->retType);
retType =genActualType(retType);
bool uns =varTypeIsUnsigned(tgtType) && !varTypeIsSmall(tgtType);
Copy link
Contributor

Choose a reason for hiding this comment

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

why we do not set this forvarTypeIsSmall(tgtType)?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

That's just how IL importation works for conversions in general (seeCEE_CONV inimporter.cpp) and we're matching that.

I imagine it has to do with the fact that the "evaluation stack" type is never a small type.

@tannergooding
Copy link
MemberAuthor

Rerunning CI one more time before merging. Not expecting any changes

@carlossanlop
Copy link
Contributor

We need this change included in the Preview4 snap and the merge-on-green restriction is blocking us because a couple of failures are not getting linked to KnownBuildError issues as expected.@tannergooding has confirmed the failures are all unrelated, so I will bypass the requirements and merge it.

cc@JulieLeeMSFT

@carlossanlopcarlossanlop merged commitf55c5a8 intodotnet:mainApr 24, 2024
@tannergoodingtannergooding deleted the convert-unsafe branchApril 24, 2024 01:17
matouskozak pushed a commit to matouskozak/runtime that referenced this pull requestApr 30, 2024
* Expose the ConvertToIntegerNative APIs for the floating-point types* Accelerate the ConvertToInteger and related APIs* Applying formatting patch* Fixing some tests for x86 and skipping some tests on Mono
michaelgsharp pushed a commit to michaelgsharp/runtime that referenced this pull requestMay 9, 2024
* Expose the ConvertToIntegerNative APIs for the floating-point types* Accelerate the ConvertToInteger and related APIs* Applying formatting patch* Fixing some tests for x86 and skipping some tests on Mono
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMay 24, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@BruceForstallBruceForstallAwaiting requested review from BruceForstall

@anthonycaninoanthonycaninoAwaiting requested review from anthonycanino

2 more reviewers

@kunalspathakkunalspathakkunalspathak approved these changes

@DeepakRajendrakumaranDeepakRajendrakumaranDeepakRajendrakumaran approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

@tannergoodingtannergooding

Projects

None yet

Milestone

9.0.0

Development

Successfully merging this pull request may close these issues.

Update the runtime to have deterministic floating-point to integer conversions

5 participants

@tannergooding@JulieLeeMSFT@carlossanlop@kunalspathak@DeepakRajendrakumaran

[8]ページ先頭

©2009-2025 Movatter.jp