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

Stabilize ADX, TBM, and SSE4a target features #60109

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
8 participants
@gnzlbg
Copy link
Contributor

commented Apr 19, 2019

This PR stabilizes the ADX, TBM, and SSE4a target features.

We stabilized the ADX core::arch intrinsics in Rust 1.33, and the TBM and SSE4a intrinsics have been accidentally stabilized since Rust 1.27. AFAICT there is no good reason to leave those as stabilized (we got lucky I guess), and while we could unstabilize them, it seems that they are worth stabilizing right after, so that would just introduce unnecessary churn.

It seems that when we stabilized the ADX intrinsics, we just forgot to also stabilize the ADX target feature attribute.

r? @alexcrichton

cc @jethrogb @Centril @rust-lang/libs (for the decision of not unstabilizing the accidentally stabilized intrinsics) @rust-lang/lang (for the decision of stabilizing the #[target_feature(enable = "adx,sse4a,tbm")] target features).

cc #44839 - tracking issue for target feature

@gnzlbg

This comment has been minimized.

Copy link
Contributor Author

commented Apr 19, 2019

The ui tests will probably need updating. Also, I'm not sure if Rust 1.35.0 is the right version to use here.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Apr 19, 2019

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:17178c00:start=1555666307213947243,finish=1555666307974453291,duration=760506048
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
[00:08:18]    Compiling syntax_ext v0.0.0 (/checkout/src/libsyntax_ext)
[00:13:31]    Compiling rustc_mir v0.0.0 (/checkout/src/librustc_mir)
[00:13:31]    Compiling rustc_typeck v0.0.0 (/checkout/src/librustc_typeck)
[00:13:31]    Compiling rustc_traits v0.0.0 (/checkout/src/librustc_traits)
[00:13:38] error[E0609]: no field `sse4a_target_feature` on type `std::rc::Rc<syntax::feature_gate::Features>`
[00:13:38]     --> src/librustc_typeck/collect.rs:2429:63
[00:13:38]      |
[00:13:38] 2429 |                 Some("sse4a_target_feature") => rust_features.sse4a_target_feature,
[00:13:38] 
[00:13:38] 
[00:13:38] error[E0609]: no field `tbm_target_feature` on type `std::rc::Rc<syntax::feature_gate::Features>`
[00:13:38]     --> src/librustc_typeck/collect.rs:2430:61
[00:13:38]      |
[00:13:38] 2430 |                 Some("tbm_target_feature") => rust_features.tbm_target_feature,
[00:13:38] 
[00:13:38] 
[00:13:38] error[E0609]: no field `adx_target_feature` on type `std::rc::Rc<syntax::feature_gate::Features>`
[00:13:38]     --> src/librustc_typeck/collect.rs:2433:61
[00:13:38]      |
[00:13:38] 2433 |                 Some("adx_target_feature") => rust_features.adx_target_feature,
[00:13:38] 
[00:13:39] error: aborting due to 3 previous errors
[00:13:39] 
[00:13:39] For more information about this error, try `rustc --explain E0609`.
---
159652 ./obj/build/x86_64-unknown-linux-gnu/stage0-rustc
157492 ./obj/build/bootstrap/debug/incremental
156496 ./src/llvm-project/clang
142508 ./obj/build/bootstrap/debug/incremental/bootstrap-hfsog967tquc
142504 ./obj/build/bootstrap/debug/incremental/bootstrap-hfsog967tquc/s-fbfrbdhss0-4y1omn-3k7gym5px36ja
108532 ./src/llvm-project/lldb
100608 ./obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu
100604 ./obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release
98060 ./obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@Centril

This comment has been minimized.

Copy link
Member

commented Apr 19, 2019

@gnzlbg Looks good, tho the docs of https://doc.rust-lang.org/nightly/core/arch/x86_64/fn._mm_stream_ss.html could be a bit more illuminating for the unfamiliar but curious reader. MSDN provides more elaboration: https://docs.microsoft.com/en-us/cpp/intrinsics/mm-stream-ss?view=vs-2019.

An idea for the future: Can we feasibly link to the relevant vendor documentation for each function, e.g. Intel's docs for a specific intrinsic?

Also, the current nightly is 1.36 so 1.35 seems wrong?

@alexcrichton shall we start FCP?

@alexcrichton

This comment has been minimized.

Copy link
Member

commented Apr 19, 2019

@rfcbot fcp merge

@rfcbot

This comment has been minimized.

Copy link

commented Apr 19, 2019

Team member @alexcrichton has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@jethrogb

This comment has been minimized.

Copy link
Contributor

commented Apr 19, 2019

Can we feasibly link to the relevant vendor documentation for each function, e.g. Intel's docs for a specific intrinsic?

Not really. Intel provides two types of documentation: the intrinsics guide, which is often not very informative, and the software developer's manual, which is a many-1000 page PDF document, so it's not easy to link to.

@gnzlbg

This comment has been minimized.

Copy link
Contributor Author

commented Apr 20, 2019

Agree with @jethrogb . In this case, SSE4a is not an Intel intrinsic, but an AMD one, and AMD does the exact same thing (1000s of pages long pdfs). These pdfs are not designed with tools that want to parse them in mind, so I don't think it's a feasible thing to do.

The Intel Intrinsics guide is available in XML format, and we do parse that for automatic verification of the intrinsics names/type signatures/instructions/etc. but the docs in there are not very good. The clang docs are better, and the MSVC docs are even better (they often contain working examples for each intrinsic), so maybe we could automatically parse those and use them to generate documentation (at least under the assumption that we could sort out licensing issues).

If somebody wants to work on doing this I'll be very happy to mentor.

@gnzlbg

This comment has been minimized.

Copy link
Contributor Author

commented Apr 20, 2019

Also, the current nightly is 1.36 so 1.35 seems wrong?

I'll fix the tests and set this to 1.36.0!

@Centril Centril added this to the 1.36 milestone Apr 22, 2019

@bors

This comment has been minimized.

Copy link
Contributor

commented Apr 30, 2019

☔️ The latest upstream changes (presumably #60416) made this pull request unmergeable. Please resolve the merge conflicts.

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

commented May 9, 2019

NB: I checked @aturon's box as he is presently on leave.

@rfcbot

This comment has been minimized.

Copy link

commented May 9, 2019

🔔 This is now entering its final comment period, as per the review above. 🔔

@rfcbot

This comment has been minimized.

Copy link

commented May 19, 2019

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

The RFC will be merged soon.

@alexcrichton

This comment has been minimized.

Copy link
Member

commented May 20, 2019

@gnzlbg want to rebase and I'll r+?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.