Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Simplify and unify Vector64/128/256 platform-agnostic intrinsic handling#23028

Merged
tannergooding merged 2 commits intodotnet:masterfrom
fiigii:simplifyIntrinsicLookup
Mar 29, 2019
Merged

Simplify and unify Vector64/128/256 platform-agnostic intrinsic handling#23028
tannergooding merged 2 commits intodotnet:masterfrom
fiigii:simplifyIntrinsicLookup

Conversation

@fiigii
Copy link

@fiigii fiigii commented Mar 5, 2019

This PR unify Vector64/128/256 platform-agnostic intrinsic recognition to use the table-driven framework instead of the current big if-sequence in importer.cpp. And more important, we have discussed several times that we want to improve the intrinsic recognition perf, so a unified name lookup is desired.

close https://github.com/dotnet/coreclr/issues/22537

cc @CarolEidt @tannergooding

@fiigii fiigii force-pushed the simplifyIntrinsicLookup branch 2 times, most recently from 34eb362 to a24837c Compare March 12, 2019 05:47
@tannergooding
Copy link
Member

@fiigii, what is the status here? Is it still WIP?

Also, I think the linked bug (which is about emitter cleanup) is wrong.

@fiigii
Copy link
Author

fiigii commented Mar 13, 2019

@tannergooding The x86 side is done. ARM64 JIT changes are also finished, but I did not verify it. Do you know how to get JITDump of ARM64 programs without ARM device?

I think the linked bug (which is about emitter cleanup) is wrong.

Ah, thanks, fixed!

@tannergooding
Copy link
Member

I think you can use the AltJit functionality, but someone else may know of a better way.

@fiigii
Copy link
Author

fiigii commented Mar 13, 2019

Thanks, will try to get done tonight.

@fiigii fiigii force-pushed the simplifyIntrinsicLookup branch 2 times, most recently from b4d7502 to 0a35bb6 Compare March 14, 2019 08:45
@fiigii fiigii closed this Mar 15, 2019
@fiigii fiigii reopened this Mar 15, 2019
@fiigii fiigii changed the title [WIP] Simplify and unify Vector64/128/256 platform-agnostic intrinsic handling Simplify and unify Vector64/128/256 platform-agnostic intrinsic handling Mar 15, 2019
@fiigii
Copy link
Author

fiigii commented Mar 15, 2019

@dotnet-bot test this please

@fiigii fiigii force-pushed the simplifyIntrinsicLookup branch from 0a35bb6 to 07cc90c Compare March 16, 2019 06:33
@fiigii
Copy link
Author

fiigii commented Mar 18, 2019

@dotnet-bot test Ubuntu x64 Formatting
@dotnet-bot test OSX10.12 x64 Checked Innerloop Build and Test

@fiigii
Copy link
Author

fiigii commented Mar 26, 2019

I have checked ARM64 codegen with altjit. This PR is ready for review.
The two Azure Pipeline failures seem not related? It does not have detailed error messages.

@CarolEidt @tannergooding PTAL

Copy link

@CarolEidt CarolEidt left a comment

Choose a reason for hiding this comment

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

Nice, thanks!

result = HWIntrinsicInfo::lookupId(className, methodName, enclosingClassName);
}
assert(strcmp(namespaceName + 25, ".X86") == 0 || namespaceName[25] == '\0');
result = HWIntrinsicInfo::lookupId(className, methodName, enclosingClassName);
Copy link
Member

Choose a reason for hiding this comment

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

@CarolEidt, is this going to play well with the need for all IsSupported checks to be done (i.e. for Arm64 intrinsics to explicitly return false on x86).

Choose a reason for hiding this comment

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

I think that will require some separate work. I don't think that the VM even communicates the non-platform intrinsics to the JIT, so changes will be needed there.

Copy link
Author

@fiigii fiigii Mar 27, 2019

Choose a reason for hiding this comment

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

(i.e. for Arm64 intrinsics to explicitly return false on x86).

This is controlled by managed code, e.g., Arm64/Simd.PlatformNotSupported.cs.

Copy link
Member

Choose a reason for hiding this comment

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

@fiigii, there is an issue (https://github.com/dotnet/coreclr/issues/20379) tracking us needing to recognize the IsSupported flag for all ISAs, even those on unsupported platforms, to ensure that the constant folding always happens (otherwise it is dependent on several other JIT optimizations, like inlining, successfully happening).

Choose a reason for hiding this comment

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

Right. What's awkward is that we don't want System.Runtime.Intrinsics.Arm.Arm64.Simd to be marked as [Intrinsic], but we would like System.Runtime.Intrinsics.Arm.Arm64.Simd.IsSupported to be. I'm not sure whether that would be an issue.

Copy link
Author

Choose a reason for hiding this comment

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

Got it, thanks for explaining.

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.

Overall LGTM.

Just a couple nits and a question.

@fiigii
Copy link
Author

fiigii commented Mar 27, 2019

Thanks for review, will solve the table format issues soon.

@fiigii fiigii force-pushed the simplifyIntrinsicLookup branch 4 times, most recently from 2e63b8c to 486aa8c Compare March 27, 2019 17:50
@fiigii
Copy link
Author

fiigii commented Mar 27, 2019

CI tests seem failed by merge conflict, will rebase to try.

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.

LGTM, thanks for resolving the feedback.

Feel free to tag me when tests are done and we can get this merged

@fiigii fiigii force-pushed the simplifyIntrinsicLookup branch from 486aa8c to 2b32d41 Compare March 28, 2019 02:18
@fiigii fiigii force-pushed the simplifyIntrinsicLookup branch from 2b32d41 to d97dc20 Compare March 28, 2019 05:26
@fiigii
Copy link
Author

fiigii commented Mar 29, 2019

The traditional CI gets green. @tannergooding can this PR get merged?

@tannergooding
Copy link
Member

Yes, the failures look to be the ones @CarolEidt is addressing in #23558

@tannergooding tannergooding merged commit 4a4ba4d into dotnet:master Mar 29, 2019
@fiigii fiigii deleted the simplifyIntrinsicLookup branch March 30, 2019 01:47
buyaa-n pushed a commit to buyaa-n/coreclr that referenced this pull request Apr 1, 2019
…ing (dotnet#23028)

* Simplify and unify Vector64/128/256 platform-agnostic intrinsic handling

* Removed unsupported ISAs
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…ing (dotnet/coreclr#23028)

* Simplify and unify Vector64/128/256 platform-agnostic intrinsic handling

* Removed unsupported ISAs


Commit migrated from dotnet/coreclr@4a4ba4d
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RyuJIT] Refactoring Vector128/256 intrinsic importation into architecture-specific files

3 participants