Skip to content

[builtins][arm64] Implement __init_cpu_features_resolver on Apple platforms #75636

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

Conversation

jroelofs
Copy link
Contributor

This is a re-land of #73685

Copy link

github-actions bot commented Dec 15, 2023

✅ With the latest revision this PR passed the C/C++ code formatter.

Created using spr 1.3.4

[skip ci]
Created using spr 1.3.4
Created using spr 1.3.4

[skip ci]
Created using spr 1.3.4
Created using spr 1.3.4

[skip ci]
Created using spr 1.3.4
Created using spr 1.3.4

[skip ci]
Created using spr 1.3.4
static struct {
const char *sysctl_name;
enum CPUFeatures feature;
} features[] = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you need support for AdvSIMD_HPFPCvt, FEAT_LSE2, FEAT_SHA512 or for other feature in Function Multi Versioning? Specification is not final yet and open to proposals.

Copy link
Contributor Author

@jroelofs jroelofs Dec 19, 2023

Choose a reason for hiding this comment

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

Sure, I can add entries for those. Looks like I missed them in my manual intersection of the sysctl docs with the FEAT_* table.

edit: I see you're asking a different question than I thought. Yeah, those three would probably be useful.

Specification is not final yet and open to proposals.

Any word on when FMV might come out of beta?

Copy link
Contributor Author

@jroelofs jroelofs Dec 19, 2023

Choose a reason for hiding this comment

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

Looks like we're just about out of bits in __aarch64_cpu_features.features.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Another thing that came up when discussing the frontend attributes for these: we may want to have user-selectable overrides for the priorities for (hypothetical) cases where the prescribed numbers in the table don't match the selection behavior we need at runtime. I don't have a concrete example in mind yet.

Copy link
Contributor

@ilinpv ilinpv Dec 19, 2023

Choose a reason for hiding this comment

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

Looks like we're just about out of bits in __aarch64_cpu_features.features.

Next field features2 can be added to __aarch64_cpu_features with setting FEAT_EXT bit to 1 and changing initialization condition to if (__aarch64_cpu_features.features & (1ULL << FEAT_INIT) )

Copy link
Contributor

Choose a reason for hiding this comment

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

Any word on when FMV might come out of beta?

There's no specific deadline right now, possibly within a year or half - we want to collect and address all feedback on FMV from partners and compilers communities.

Created using spr 1.3.4

[skip ci]
Created using spr 1.3.4
Created using spr 1.3.4

[skip ci]
Created using spr 1.3.4
Created using spr 1.3.4

[skip ci]
Created using spr 1.3.4
@jroelofs jroelofs changed the base branch from users/jroelofs/spr/main.builtinsarm64-implement-__init_cpu_features_resolver-on-apple-platforms to main December 19, 2023 18:11
@jroelofs jroelofs merged commit 17aa520 into main Dec 19, 2023
@jroelofs jroelofs deleted the users/jroelofs/spr/builtinsarm64-implement-__init_cpu_features_resolver-on-apple-platforms branch December 19, 2023 18:11
jroelofs added a commit that referenced this pull request Dec 19, 2023
jroelofs added a commit that referenced this pull request Dec 19, 2023
jroelofs added a commit to swiftlang/llvm-project that referenced this pull request Jan 10, 2024
jroelofs added a commit to swiftlang/llvm-project that referenced this pull request Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants