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

Unify hardware feature detection between CoreCLR JIT and AOT #89342

Merged
merged 2 commits into from
Jul 23, 2023

Conversation

jkotas
Copy link
Member

@jkotas jkotas commented Jul 22, 2023

Follow up on #87865

if (hMod == NULL)
return 0;

pfnGetEnabledXStateFeatures = (PGETENABLEDXSTATEFEATURES)GetProcAddress(hMod, "GetEnabledXStateFeatures");
Copy link
Member Author

Choose a reason for hiding this comment

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

DWORD64 FeatureMask = GetEnabledXStateFeatures();
links to GetEnabledXStateFeatures directly, so it is safe to delete the dynamic linking here.

Copy link
Member

Choose a reason for hiding this comment

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

It's worth noting that the original reason for the dynamic linking was to support Windows 7 prior to SP1.

With Win7 support having been dropped and us just not regressing Win 7 SP1 and later, this is fine.

@@ -1,148 +0,0 @@
;; Licensed to the .NET Foundation under one or more agreements.
Copy link
Member Author

Choose a reason for hiding this comment

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

I have noticed these unused files thanks to IsProcessorFeaturePresent call.

@jkotas jkotas changed the title Unity hardware feature detection between CoreCLR JIT and AOT Unify hardware feature detection between CoreCLR JIT and AOT Jul 22, 2023
@am11
Copy link
Member

am11 commented Jul 22, 2023

cc @gbalykov, if we ever added RISC-V support in src/native/minipal/cpufeatures.c, I think we can make it return the features per-hart (as each hardware thread in RISC-V can technically have different features, e.g. virtual memory range sizes; for which GC can be fine-tuned).

@jkotas jkotas merged commit 66556c4 into dotnet:main Jul 23, 2023
174 of 178 checks passed
@jkotas jkotas deleted the intrinsic-detection branch July 23, 2023 04:13
@ghost ghost locked as resolved and limited conversation to collaborators Aug 22, 2023
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.

None yet

3 participants