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

Add x86-64-v2, x86-64-v3, and x86-64-v4 as available target_cpus #82024

Closed
hsivonen opened this issue Feb 12, 2021 · 7 comments
Closed

Add x86-64-v2, x86-64-v3, and x86-64-v4 as available target_cpus #82024

hsivonen opened this issue Feb 12, 2021 · 7 comments
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-feature-request Category: A feature request, i.e: not implemented / a PR. O-x86_64 Target: x86-64 processors (like x86_64-*) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@hsivonen
Copy link
Member

hsivonen commented Feb 12, 2021

Page 14 of the 2020-08-31 version of the AMD64 supplement to the System V ABI defines new microarchitecture levels that bundle instruction set extensions: x86-64-v2, x86-64-v3, and x86-64-v4. According to a Red Hat blog post, LLVM 12 will support these.

rustc should support these as target_cpu values, enable the right target_features, and pass them appropriately to LLVM.

Internals thread

@jonas-schievink jonas-schievink added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-feature-request Category: A feature request, i.e: not implemented / a PR. O-x86_64 Target: x86-64 processors (like x86_64-*) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 12, 2021
@IsaacWoods
Copy link
Contributor

The link to the internals thread also points to RedHat's blog. I'm guessing this is the internals thread.

@hsivonen
Copy link
Member Author

Oops. Updated the link. Thanks.

@ojeda
Copy link
Contributor

ojeda commented Feb 12, 2021

rustc does not manage these options, LLVM does. Thus when we move to LLVM 12, we will get these.

@est31
Copy link
Member

est31 commented Feb 12, 2021

LLVM commit for reference: llvm/llvm-project@012dd42e027e

@est31
Copy link
Member

est31 commented Feb 12, 2021

Also I confirm what @ojeda said. In #79043, all I had to do was patch LLVM to add availability of these target_cpus. No changes in rustc were neccessary.

@jyn514
Copy link
Member

jyn514 commented Jun 25, 2021

The compiler is now using LLVM 12.0.1, so this might be fixed?

@hsivonen
Copy link
Member Author

hsivonen commented Jul 5, 2021

Indeed, this is now fixed. Thanks.

@hsivonen hsivonen closed this as completed Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-feature-request Category: A feature request, i.e: not implemented / a PR. O-x86_64 Target: x86-64 processors (like x86_64-*) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants