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 x86/x86_64 SIMD #49664

Merged
merged 2 commits into from
Apr 17, 2018
Merged

Stabilize x86/x86_64 SIMD #49664

merged 2 commits into from
Apr 17, 2018

Conversation

alexcrichton
Copy link
Member

This commit stabilizes the SIMD in Rust for the x86/x86_64 platforms. Notably
this commit is stabilizing:

  • The std::arch::{x86, x86_64} modules and the intrinsics contained inside.
  • The is_x86_feature_detected! macro in the standard library
  • The #[target_feature(enable = "...")] attribute
  • The #[cfg(target_feature = "...")] matcher

Stabilization of the module and intrinsics were primarily done in
rust-lang/stdarch#414 and the two attribute stabilizations are done in
this commit. The standard library is also tweaked a bit with the new way that
stdsimd is integrated.

Note that other architectures like std::arch::arm are not stabilized as part
of this commit, they will likely stabilize in the future after they've been
implemented and fleshed out. Similarly the std::simd module is also not being
stabilized in this commit, only std::arch. Finally, nothing related to __m64
is stabilized in this commit either (MMX), only SSE and up types and intrinsics
are stabilized.

Closes #29717
Closes #44839
Closes #48556

@alexcrichton
Copy link
Member Author

Note it's not intended that this should merge before the FCP lapses in #48556, but rather this is submitted early to get some more time for review

@alexcrichton alexcrichton added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Apr 4, 2018
@TimNN
Copy link
Contributor

TimNN commented Apr 4, 2018

Your PR failed on Travis. 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.
Resolving deltas: 100% (611497/611497), completed with 4859 local objects.

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.

@TimNN
Copy link
Contributor

TimNN commented Apr 4, 2018

Your PR failed on Travis. 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.
W: GPG error: https://dl.hhvm.com/ubuntu trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B4112585D386EB94
W: The repository 'https://dl.hhvm.com/ubuntu trusty InRelease' is not signed.
W: There is no public key available for the following key IDs:
---
Resolving deltas: 100% (611526/611526), completed with 4863 local objects.
---
[00:00:48] configure: rust.quiet-tests     := True
---
[00:37:53] ..........................................................................i.........................
[00:37:59] .................i..................................................................................
---
[00:38:33] ..........................................................................................i.........
[00:38:40] ..............................................................i.....................................
---
[00:39:30] .............................................i......................................................
---
[00:43:06] .............................i......................................................................
[00:43:20] ..............................................................i.....................................
[00:43:35] ...............................................i....................................................
[00:43:53] ....................................................................................................
[00:44:14] ....................................................................................................
[00:44:34] ....................................................................................................
[00:44:57] .i...............................................................................................i..
[00:45:26] ..........................................................................................test [run-pass] run-pass/mir_heavy_promoted.rs has been running for over 60 seconds
[00:45:31] ..........
[00:45:59] ....................................................................................................
[00:46:32] .............................................................ii.....................................
[00:47:18] ........................i....................................................i.ii...............test [run-pass] run-pass/saturating-float-casts.rs has been running for over 60 seconds
[00:47:20] ....
[00:47:57] .....................................................................................iiiiiii........
---
[00:49:53] ....................................i...............................................................
[00:50:01] ....................................................................................................
[00:50:08] ..................i............................................................ii.iii...............
[00:50:15] ....................................................................................................
[00:50:22] ........i..............................i............................................................
[00:50:29] ....................................................................................................
[00:50:36] ....................i...............................................................................
[00:50:43] ....................................................................................................
[00:50:53] ....................................................................................................
[00:51:03] ....................................................................................................
[00:51:13] ....................................................................................................
[00:51:26] ....................................................................................................
[00:51:34] .............i......................................................................................
[00:51:43] ................i..ii...............................................................................
[00:51:53] ....................................................................................................
[00:52:02] ....................................................................................................
[00:52:11] ..................................................................................i.................
[00:52:22] ............................i.......................................................................
---
[00:52:57] ............................i.......................................................................
[00:52:58] ....................................................................i...............................
[00:52:59] ................i.......................................................
---
[00:53:13] ...........i........................
---
[00:53:41] i...i..ii....i.............ii........iii......i..i...i...ii..i..i..ii.....
---
[00:53:43] i.......i......................i......
---
[00:54:19] iiii.......i..i........i..i.i.............i..........iiii...........i...i..........ii.i.i.......ii..
[00:54:20] ....ii...
---
[01:02:45] ...i................................................................................................
---
[01:04:32] .....................................i..............................................................
[01:04:50] ....................................................................................................
[01:05:08] ..........................................i.........................................................
---
[01:06:28] .........................................................ii.........................................
---
[01:06:54] FFFFFFF.............................................................................................
[01:07:10] ....................................................................................................
[01:07:28] ..............................................................i.....................................
---
[01:10:18] ---- ../stdsimd/coresimd/macros.rs - coresimd::x86::__m128 (line 27) stdout ----
[01:10:18]  error: this feature has been stable since 1.27.0. Attribute no longer needed
[01:10:18]  --> ../stdsimd/coresimd/macros.rs:28:12
[01:10:18]   |
[01:10:18] 3 | #![feature(cfg_target_feature, target_feature, stdsimd)]
---
[01:10:18]   = note: #[deny(stable_features)] implied by #[deny(warnings)]
[01:10:18]
[01:10:18] error: this feature has been stable since 1.27.0. Attribute no longer needed
[01:10:18]  --> ../stdsimd/coresimd/macros.rs:28:32
[01:10:18]   |
[01:10:18] 3 | #![feature(cfg_target_feature, target_feature, stdsimd)]
[01:10:18]   |                                ^^^^^^^^^^^^^^
[01:10:18]
[01:10:18] thread '../stdsimd/coresimd/macros.rs - coresimd::x86::__m128 (line 27)' panicked at 'couldn't compile the test', librustdoc/test.rs:306:13
[01:10:18] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[01:10:18]
[01:10:18] ---- ../stdsimd/coresimd/macros.rs - coresimd::x86::__m128d (line 27) stdout ----
[01:10:18]  error: this feature has been stable since 1.27.0. Attribute no longer needed
[01:10:18]  --> ../stdsimd/coresimd/macros.rs:28:12
[01:10:18]   |
[01:10:18] 3 | #![feature(cfg_target_feature, target_feature, stdsimd)]
---
[01:10:18]   = note: #[deny(stable_features)] implied by #[deny(warnings)]
[01:10:18]
[01:10:18] error: this feature has been stable since 1.27.0. Attribute no longer needed
[01:10:18]  --> ../stdsimd/coresimd/macros.rs:28:32
[01:10:18]   |
[01:10:18] 3 | #![feature(cfg_target_feature, target_feature, stdsimd)]
[01:10:18]   |                                ^^^^^^^^^^^^^^
[01:10:18]
[01:10:18] thread '../stdsimd/coresimd/macros.rs - coresimd::x86::__m128d (line 27)' panicked at 'couldn't compile the test', librustdoc/test.rs:306:13
[01:10:18]
[01:10:18] ---- ../stdsimd/coresimd/macros.rs - coresimd::x86::__m128i (line 34) stdout ----
[01:10:18]  error: this feature has been stable since 1.27.0. Attribute no longer needed
[01:10:18]  --> ../stdsimd/coresimd/macros.rs:35:12
[01:10:18]   |
[01:10:18] 3 | #![feature(cfg_target_feature, target_feature, stdsimd)]
---
[01:10:18]   = note: #[deny(stable_features)] implied by #[deny(warnings)]
[01:10:18]
[01:10:18] error: this feature has been stable since 1.27.0. Attribute no longer needed
[01:10:18]  --> ../stdsimd/coresimd/macros.rs:35:32
[01:10:18]   |
[01:10:18] 3 | #![feature(cfg_target_feature, target_feature, stdsimd)]
[01:10:18]   |                                ^^^^^^^^^^^^^^
[01:10:18]
[01:10:18] thread '../stdsimd/coresimd/macros.rs - coresimd::x86::__m128i (line 34)' panicked at 'couldn't compile the test', librustdoc/test.rs:306:13
[01:10:18]
[01:10:18] ---- ../stdsimd/coresimd/macros.rs - coresimd::x86::__m256 (line 27) stdout ----
[01:10:18]  error: this feature has been stable since 1.27.0. Attribute no longer needed
[01:10:18]  --> ../stdsimd/coresimd/macros.rs:28:12
[01:10:18]   |
[01:10:18] 3 | #![feature(cfg_target_feature, target_feature, stdsimd)]
---
[01:10:18]   = note: #[deny(stable_features)] implied by #[deny(warnings)]
[01:10:18]
[01:10:18] error: this feature has been stable since 1.27.0. Attribute no longer needed
[01:10:18]  --> ../stdsimd/coresimd/macros.rs:28:32
[01:10:18]   |
[01:10:18] 3 | #![feature(cfg_target_feature, target_feature, stdsimd)]
[01:10:18]   |                                ^^^^^^^^^^^^^^
[01:10:18]
[01:10:18] thread '../stdsimd/coresimd/macros.rs - coresimd::x86::__m256 (line 27)' panicked at 'couldn't compile the test', librustdoc/test.rs:306:13
[01:10:18]
[01:10:18] ---- ../stdsimd/coresimd/macros.rs - coresimd::x86::__m64 (line 34) stdout ----
[01:10:18]  error: this feature has been stable since 1.27.0. Attribute no longer needed
[01:10:18]  --> ../stdsimd/coresimd/macros.rs:35:12
[01:10:18]   |
[01:10:18] 3 | #![feature(cfg_target_feature, target_feature, stdsimd)]
---
[01:10:18]   = note: #[deny(stable_features)] implied by #[deny(warnings)]
[01:10:18]
[01:10:18] error: this feature has been stable since 1.27.0. Attribute no longer needed
[01:10:18]  --> ../stdsimd/coresimd/macros.rs:35:32
[01:10:18]   |
[01:10:18] 3 | #![feature(cfg_target_feature, target_feature, stdsimd)]
[01:10:18]   |                                ^^^^^^^^^^^^^^
[01:10:18]
[01:10:18] thread '../stdsimd/coresimd/macros.rs - coresimd::x86::__m64 (line 34)' panicked at 'couldn't compile the test', librustdoc/test.rs:306:13
[01:10:18]
[01:10:18] ---- ../stdsimd/coresimd/macros.rs - coresimd::x86::__m256d (line 27) stdout ----
[01:10:18]  error: this feature has been stable since 1.27.0. Attribute no longer needed
[01:10:18]  --> ../stdsimd/coresimd/macros.rs:28:12
[01:10:18]   |
[01:10:18] 3 | #![feature(cfg_target_feature, target_feature, stdsimd)]
---
[01:10:18]   = note: #[deny(stable_features)] implied by #[deny(warnings)]
[01:10:18]
[01:10:18] error: this feature has been stable since 1.27.0. Attribute no longer needed
[01:10:18]  --> ../stdsimd/coresimd/macros.rs:28:32
[01:10:18]   |
[01:10:18] 3 | #![feature(cfg_target_feature, target_feature, stdsimd)]
[01:10:18]   |                                ^^^^^^^^^^^^^^
[01:10:18]
[01:10:18] thread '../stdsimd/coresimd/macros.rs - coresimd::x86::__m256d (line 27)' panicked at 'couldn't compile the test', librustdoc/test.rs:306:13
[01:10:18]
[01:10:18] ---- ../stdsimd/coresimd/macros.rs - coresimd::x86::__m256i (line 31) stdout ----
[01:10:18]  error: this feature has been stable since 1.27.0. Attribute no longer needed
[01:10:18]  --> ../stdsimd/coresimd/macros.rs:32:12
[01:10:18]   |
[01:10:18] 3 | #![feature(cfg_target_feature, target_feature, stdsimd)]
---
[01:10:18]   = note: #[deny(stable_features)] implied by #[deny(warnings)]
[01:10:18]
[01:10:18] error: this feature has been stable since 1.27.0. Attribute no longer needed
[01:10:18]  --> ../stdsimd/coresimd/macros.rs:32:32
[01:10:18]   |
[01:10:18] 3 | #![feature(cfg_target_feature, target_feature, stdsimd)]
[01:10:18]   |                                ^^^^^^^^^^^^^^
[01:10:18]
[01:10:18] thread '../stdsimd/coresimd/macros.rs - coresimd::x86::__m256i (line 31)' panicked at 'couldn't compile the test', librustdoc/test.rs:306:13
---
[01:10:18] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-gnu" "--release" "--locked" "--color" "always" "--features" "panic-unwind jemalloc backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "-p" "core" "--" "--quiet"
[01:10:18] expected success, got: exit code: 101
[01:10:18]
[01:10:18]
[01:10:18] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:10:18] Build completed unsuccessfully in 0:33:32
[01:10:18] Makefile:58: recipe for target 'check' failed
[01:10:18] make: *** [check] Error 1
---
$ dmesg | grep -i kill
[   10.853990] init: failsafe main process (1093) killed by TERM signal

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.

@pietroalbini pietroalbini added relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 5, 2018
@parched
Copy link
Contributor

parched commented Apr 5, 2018

Doesn't this stabilise all the (whitelisted) feature names for all the architectures, or am I mistaken? The RFC mentioned this specific set https://github.com/rust-lang/rfcs/blob/master/text/2325-stable-simd.md#the-target_feature-attribute.

@bors
Copy link
Contributor

bors commented Apr 5, 2018

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

.gitmodules Outdated
@@ -49,7 +49,7 @@
url = https://github.com/rust-lang/llvm
[submodule "src/stdsimd"]
path = src/stdsimd
url = https://github.com/rust-lang-nursery/stdsimd
url = https://github.com/alexcrichton/stdsimd
Copy link
Contributor

Choose a reason for hiding this comment

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

Why doesn't this still use rust-lang-nursery?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because this isn't ready to land yet, it's waiting on FCP to finish.

@Zoxc
Copy link
Contributor

Zoxc commented Apr 5, 2018

The std::arch::{x86, x86_64} modules and the intrinsics contained inside.

What is the difference between the std::arch::x86 and std::arch::x86_64? Typically x86 includes x86_64 so it seems odd that it is separate. Does x86 refer to 32-bit x86 only?

is_x86_feature_detected!

Why do we have a macro specific to x86? Does that also apply to the std::arch::x86_64 or just std::arch::x86? Do we no longer have a global namespace of CPU features?

@steveklabnik
Copy link
Member

Why do we have a macro specific to x86? Does that also apply to the std::arch::x86_64 or just std::arch::x86? Do we no longer have a global namespace of CPU features?

From IRC last night:

20:51 < Gankro> acrichto: why is the is_x86_feature_detected! so precisely named? Why can't it be is_feature_detected?
20:55 <~acrichto> Gankro: it doesn't work on other paltforms
20:55 <~acrichto> in that the arguments are x86-specific
20:55 <~acrichto> (so there's a macro for each arch)
20:56 < Gankro> acrichto: why couldn't it just return false on the plats?
20:57 < Gankro> *other plats
20:57 <~acrichto> Gankro: catches typos and such
20:57 <~acrichto> in that it's currently a deliberate decision
20:57 <~acrichto> (we've discussed this a bunch historically)
20:57 < Gankro> ok
20:57 <~acrichto> it turns out that if the macros is cross paltform it doesn't really help at all
20:57 <~acrichto> it's only invoked in platform-specific contexts anyway

@alexcrichton
Copy link
Member Author

alexcrichton commented Apr 5, 2018

@Zoxc

What is the difference between the std::arch::x86 and std::arch::x86_64? Typically x86 includes x86_64 so it seems odd that it is separate. Does x86 refer to 32-bit x86 only?

There is a module per target_arch which is used conditionally, and the module name, like std::os, indicates the non-portability. The std::arch::x86 std::arch::x86_64 module is not defined on i686-unknown-linux-gnu, for example.

Why do we have a macro specific to x86? Does that also apply to the std::arch::x86_64 or just std::arch::x86? Do we no longer have a global namespace of CPU features?

As explained by @steveklabnik the macro is x86-specific in its feature detection and list of accepted features. For convenience there is no is_x86_64_feature_detected! macro as it's much more difficult to conditionally invoke macros than work with use. Each platform has its own macro with its own accepted set of arguments, again indicated by the name of the macro.

@alexcrichton alexcrichton force-pushed the stable-simd branch 2 times, most recently from ffcd619 to 8a02174 Compare April 5, 2018 14:06
@Zoxc
Copy link
Contributor

Zoxc commented Apr 5, 2018

There is a module per target_arch which is used conditionally, and the module name, like std::os, indicates the non-portability. The std::arch::x86 module is not defined on i686-unknown-linux-gnu, for example.

So are there modules for i286, i386, i486, i586, i786 too? It doesn't seem terribly useful to have this many variants of x86. What is the justification for this?

As explained by @steveklabnik the macro is x86-specific in its feature detection and list of accepted features.

That doesn't answer the question. Why do we have platform specific macros instead of a single macro? and why does the justification for that not apply to #target_feature(..) or #[cfg(target_feature = ..))?

@alexcrichton
Copy link
Member Author

@parched ah yes, thanks! I've pushed a commit which should allow us to tweak the stability of each target feature.

@Zoxc

So are there modules for i286, i386, i486, i586, i786 too? It doesn't seem terribly useful to have this many variants of x86. What is the justification for this?

No, there are not all those modules. I'd recommend reading the RFC and the issue tracker for stdsimd for rationale here. There are only modules for each target_arch, similar to how std::os has only the modules that match #[cfg] like unix/windows/linux/...

That doesn't answer the question. Why do we have platform specific macros instead of a single macro? and why does the justification for that not apply to #target_feature(..) or #[cfg(target_feature = ..))?

The answer to your question was indicated in the IRC logs, a platform-independent macro in no way makes SIMD easier to use. Previous attempts at using the same name and same namespace for attributes didn't provide any ergonomics so a platform-specific macro is the conservative option.

@TimNN
Copy link
Contributor

TimNN commented Apr 5, 2018

Your PR failed on Travis. 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.
[00:01:29] configure: rust.quiet-tests     := True
---
]       in the 'ui' test suite, with its failures due to
[00:05:07]       missing usage of #![feature(aarch64_target_feature)].
[00:05:07] Hint: If you already have such a test and don't want to rename it,
[00:05:07]       you can also add a // gate-test-aarch64_target_feature line to the test file.
[00:05:07] Expected a gate test for the feature 'mmx_target_feature'.
[00:05:07] Hint: create a failing test file named 'feature-gate-mmx_target_feature.rs'
[00:05:07]       in the 'ui' test suite, with its failures due to
[00:05:07]       missing usage of #![feature(mmx_target_feature)].
[00:05:07] Hint: If you already have such a test and don't want to rename it,
[00:05:07]       you can also add a // gate-test-mmx_target_feature line to the test file.
[00:05:07] Expected a gate test for the feature 'powerpc_target_feature'.
[00:05:07] Hint: create a failing test file named 'feature-gate-powerpc_target_feature.rs'
[00:05:07]       in the 'ui' test suite, with its failures due to
[00:05:07]       missing usage of #![feature(powerpc_target_feature)].
[00:05:07] Hint: If you already have such a test and don't want to rename it,
[00:05:07]       you can also add a // gate-test-powerpc_target_feature line to the test file.
[00:05:07] Expected a gate test for the feature 'sse4a_target_feature'.
[00:05:07] Hint: create a failing test file named 'feature-gate-sse4a_target_feature.rs'
[00:05:07]       in the 'ui' test suite, with its failures due to
[00:05:07]       missing usage of #![feature(sse4a_target_feature)].
[00:05:07] Hint: If you already have such a test and don't want to rename it,
[00:05:07]       you can also add a // gate-test-sse4a_target_feature line to the test file.
[00:05:07] Expected a gate test for the feature 'avx512_target_feature'.
[00:05:07] Hint: create a failing test file named 'feature-gate-avx512_target_feature.rs'
[00:05:07]       in the 'ui' test suite, with its failures due to
[00:05:07]       missing usage of #![feature(avx512_target_feature)].
[00:05:07] Hint: If you already have such a test and don't want to rename it,
[00:05:07]       you can also add a // gate-test-avx512_target_feature line to the test file.
[00:05:07] Expected a gate test for the feature 'tbm_target_feature'.
[00:05:07] Hint: create a failing test file named 'feature-gate-tbm_target_feature.rs'
[00:05:07]       in the 'ui' test suite, with its failures due to
[00:05:07]       missing usage of #![feature(tbm_target_feature)].
[00:05:07] Hint: If you already have such a test and don't want to rename it,
[00:05:07]       you can also add a // gate-test-tbm_target_feature line to the test file.
---
$ ls -lat $HOME/Library/Logs/DiagnosticReports/
ls: cannot access /home/travis/Library/Logs/DiagnosticReports/: No such file or directory
travis_time:end:3995dc75:start=1522941035763776228,finish=1522941035769506889,duration=5730661
travis_fold:end:after_failure.2
travis_fold:start:after_failure.3
travis_time:start:1833ec00
$ find $HOME/Library/Logs/DiagnosticReports -type f -name '*.crash' -not -name '*.stage2-*.crash' -not -name 'com.apple.CoreSimulator.CoreSimulatorService-*.crash' -exec printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" {} \; -exec head -750 {} \; -exec echo travis_fold":"end:crashlog \; || true
find: `/home/travis/Library/Logs/DiagnosticReports': No such file or directory
travis_time:end:1833ec00:start=1522941035774367335,finish=1522941035779994962,duration=5627627
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0fb35062
$ dmesg | grep -i kill
[   10.571310] init: failsafe main process (1093) killed by TERM signal

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.

@hanna-kruppe
Copy link
Contributor

@alexcrichton Did you have a typo in this sentence?

The std::arch::x86 module is not defined on i686-unknown-linux-gnu, for example.

I would have expected either of:

  1. The std::arch::x86 module is not defined on x86_64-unknonw-linux-gnu
  2. The std::arch::x86_64 module is not defined on i686-unknown-linux-gnu

@TimNN
Copy link
Contributor

TimNN commented Apr 5, 2018

Your PR failed on Travis. 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.
[00:00:46] configure: rust.quiet-tests     := True
---
[00:37:24] ..........................................................................i.........................
[00:37:29] .................i..................................................................................
---
[00:38:03] ...........................................................................................i........
[00:38:09] .................................................................i..................................
---
[00:38:59] .............................................i......................................................
---
[00:42:31] .............................i......................................................................
[00:42:44] ..............................................................i.....................................
[00:42:59] ...............................................i....................................................
[00:43:17] ....................................................................................................
[00:43:37] ....................................................................................................
[00:43:57] ....................................................................................................
[00:44:20] .i...............................................................................................i..
[00:44:49] ............................................................................................test [run-pass] run-pass/mir_heavy_promoted.rs has been running for over 60 seconds
[00:44:53] ........
[00:45:21] ....................................................................................................
[00:45:54] .............................................................ii.....................................
[00:46:40] ........................i....................................................i.ii................test [run-pass] run-pass/saturating-float-casts.rs has been running for over 60 seconds
[00:46:41] ...
[00:47:18] .....................................................................................iiiiiii........
---
[00:49:27] ..................i............................................................ii.iii...............
[00:49:34] ....................................................................................................
[00:49:42] ........i..............................i............................................................
[00:49:49] ....................................................................................................
[00:49:56] ....................i...............................................................................
[00:50:03] ....................................................................................................
[00:50:13] ....................................................................................................
[00:50:23] ....................................................................................................
[00:50:33] ....................................................................................................
[00:50:46] ....................................................................................................
[00:50:54] .............i......................................................................................
[00:51:03] ................i..ii...............................................................................
[00:51:12] ....................................................................................................
[00:51:22] ....................................................................................................
[00:51:31] ..................................................................................i.................
[00:51:41] ............................i.......................................................................
---
[00:52:16] ...........................i........................................................................
[00:52:18] ....................................................................i...............................
[00:52:19] ................i.......................................................
---
[00:52:32] ...........i........................
---
[00:53:00] i....i.ii....i.............ii........iii......i..i...i...ii..i..i..ii.....
---
[00:53:03] i.......i......................i......
---
[00:53:37] iiii.......i..i........i..i.i.............i..........iiii...........i...i..........ii.i.i.......ii..
[00:53:38] ....ii...
---
[01:01:52] .....i..............................................................................................
---
[01:03:35] .....................................i..............................................................
[01:03:53] ....................................................................................................
[01:04:10] ..........................................i.........................................................
---
[01:05:28] .........................................................ii.........................................
---
[01:06:26] ..............................................................i.....................................
---
[01:10:52] iiFF................................................................................................
[01:11:10] ....................................................................................................
[01:11:25] ...................iii......i......i...i......i.....................................................
[01:11:35] ....................................................................................................
[01:11:49] .........................................iiii........ii.............................................
[01:12:00] ....................................................................................................
[01:12:16] ........................................................................................i...........
[01:12:38] ....................................................................................................
[01:12:48] ..................................................................................................ii
[01:12:57] ii...............................................
[01:12:57] failures:
[01:12:57]
[01:12:57] ---- ../stdsimd/stdsimd/mod.rs - stdsimd::arch (line 207) stdout ----
[01:12:57]  error: this feature has been stable since 1.27.0. Attribute no longer needed
[01:12:57]  --> ../stdsimd/stdsimd/mod.rs:208:12
[01:12:57]   |
[01:12:57] 3 | #![feature(cfg_target_feature, target_feature, stdsimd)]
---
[01:12:57]   = note: #[deny(stable_features)] implied by #[deny(warnings)]
[01:12:57]
[01:12:57] error: this feature has been stable since 1.27.0. Attribute no longer needed
[01:12:57]  --> ../stdsimd/stdsimd/mod.rs:208:32
[01:12:57]   |
[01:12:57] 3 | #![feature(cfg_target_feature, target_feature, stdsimd)]
[01:12:57]   |                                ^^^^^^^^^^^^^^
[01:12:57]
[01:12:57] thread '../stdsimd/stdsimd/mod.rs - stdsimd::arch (line 207)' panicked at 'couldn't compile the test', librustdoc/test.rs:306:13
[01:12:57] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[01:12:57]
[01:12:57] ---- ../stdsimd/stdsimd/mod.rs - stdsimd::arch (line 249) stdout ----
[01:12:57]  error: this feature has been stable since 1.27.0. Attribute no longer needed
[01:12:57]  --> ../stdsimd/stdsimd/mod.rs:250:12
[01:12:57]   |
[01:12:57] 3 | #![feature(cfg_target_feature, target_feature, stdsimd)]
---
[01:12:57]   = note: #[deny(stable_features)] implied by #[deny(warnings)]
[01:12:57]
[01:12:57] error: this feature has been stable since 1.27.0. Attribute no longer needed
[01:12:57]  --> ../stdsimd/stdsimd/mod.rs:250:32
[01:12:57]   |
[01:12:57] 3 | #![feature(cfg_target_feature, target_feature, stdsimd)]
[01:12:57]   |                                ^^^^^^^^^^^^^^
[01:12:57]
[01:12:57] thread '../stdsimd/stdsimd/mod.rs - stdsimd::arch (line 249)' panicked at 'couldn't compile the test', librustdoc/test.rs:306:13
---
[01:12:57] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-gnu" "--release" "--locked" "--color" "always" "--features" "panic-unwind jemalloc backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "-p" "std" "--" "--quiet"
[01:12:57] expected success, got: exit code: 101
[01:12:57]
[01:12:57]
[01:12:57] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:12:57] Build completed unsuccessfully in 0:36:39
[01:12:57] make: *** [check] Error 1
[01:12:57] Makefile:58: recipe for target 'check' failed
---
$ ls -lat $HOME/Library/Logs/DiagnosticReports/
ls: cannot access /home/travis/Library/Logs/DiagnosticReports/: No such file or directory
travis_time:end:00701732:start=1522942702499426526,finish=1522942702506606725,duration=7180199
travis_fold:end:after_failure.2
travis_fold:start:after_failure.3
travis_time:start:13db3254
$ find $HOME/Library/Logs/DiagnosticReports -type f -name '*.crash' -not -name '*.stage2-*.crash' -not -name 'com.apple.CoreSimulator.CoreSimulatorService-*.crash' -exec printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" {} \; -exec head -750 {} \; -exec echo travis_fold":"end:crashlog \; || true
find: `/home/travis/Library/Logs/DiagnosticReports': No such file or directory
travis_time:end:13db3254:start=1522942702512819864,finish=1522942702520055466,duration=7235602
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:015d41a2
$ dmesg | grep -i kill
[   10.213694] init: failsafe main process (1096) killed by TERM signal

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.

@alexcrichton
Copy link
Member Author

Er oops sorry yeah, @rkruppe you are correct! (both of those alternatives are true)

@Zoxc
Copy link
Contributor

Zoxc commented Apr 5, 2018

I'd expect to have std::arch::x86_16, std::arch::x86_32 and std::arch::x86_64 for x86 or just a single std::arch::x86 which covers all modes. Similarly for ARM std::arch::aarch32, std::arch::aarch64 and possibly std::arch::t32 or something for Thumb.

The answer to your question was indicated in the IRC logs, a platform-independent macro in no way makes SIMD easier to use.

How does having a platform-independent macro make SIMD harder to use?

Previous attempts at using the same name and same namespace for attributes didn't provide any ergonomics so a platform-specific macro is the conservative option.

By that logic we should also have platform-specific versions of #[target_feature(..)] and #[cfg(target_feature = ..)). Using a platform-specific macro doesn't necessary in other to be conservative, just having a namespace per architecture should suffice.

@TimNN
Copy link
Contributor

TimNN commented Apr 5, 2018

Your PR failed on Travis. 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.
[00:00:46] configure: rust.quiet-tests     := True

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.

@alexcrichton
Copy link
Member Author

I'd expect to have std::arch::x86_16, std::arch::x86_32 and std::arch::x86_64 for x86 or just a single std::arch::x86 which covers all modes. Similarly for ARM std::arch::aarch32, std::arch::aarch64 and possibly std::arch::t32 or something for Thumb.

This does not match #[cfg(target_arch)], the modules match the well-established convention in Rust with #[cfg(target_arch)]

How does having a platform-independent macro make SIMD harder to use?

You've misread that, I said that it wasn't easier to use, not harder to use.

@bors
Copy link
Contributor

bors commented Apr 16, 2018

📌 Commit b7a4532 has been approved by BurntSushi

@bors
Copy link
Contributor

bors commented Apr 16, 2018

⌛ Testing commit b7a453287867cfc10d6d03bfccad00aad09e711f with merge 2d76bee9ca65c77b4f42a13ced55d2f43b5e03ef...

@bors
Copy link
Contributor

bors commented Apr 16, 2018

💔 Test failed - status-appveyor

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 16, 2018
Use an explicit whitelist for what features are actually stable and can be
enabled.
@alexcrichton
Copy link
Member Author

@bors: r=BurntSushi

@bors
Copy link
Contributor

bors commented Apr 16, 2018

📌 Commit 1217d70 has been approved by BurntSushi

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 16, 2018
@bors
Copy link
Contributor

bors commented Apr 17, 2018

⌛ Testing commit 1217d70 with merge 186db76...

bors added a commit that referenced this pull request Apr 17, 2018
Stabilize x86/x86_64 SIMD

This commit stabilizes the SIMD in Rust for the x86/x86_64 platforms. Notably
this commit is stabilizing:

* The `std::arch::{x86, x86_64}` modules and the intrinsics contained inside.
* The `is_x86_feature_detected!` macro in the standard library
* The `#[target_feature(enable = "...")]` attribute
* The `#[cfg(target_feature = "...")]` matcher

Stabilization of the module and intrinsics were primarily done in
rust-lang/stdarch#414 and the two attribute stabilizations are done in
this commit. The standard library is also tweaked a bit with the new way that
stdsimd is integrated.

Note that other architectures like `std::arch::arm` are not stabilized as part
of this commit, they will likely stabilize in the future after they've been
implemented and fleshed out. Similarly the `std::simd` module is also not being
stabilized in this commit, only `std::arch`. Finally, nothing related to `__m64`
is stabilized in this commit either (MMX), only SSE and up types and intrinsics
are stabilized.

Closes #29717
Closes #44839
Closes #48556
@bors
Copy link
Contributor

bors commented Apr 17, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: BurntSushi
Pushing 186db76 to master...

@bors bors merged commit 1217d70 into rust-lang:master Apr 17, 2018
@alexcrichton alexcrichton deleted the stable-simd branch April 17, 2018 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.