@@ -92,17 +92,13 @@ pub mod arch {
92
92
/// The [simd proposal][simd] for WebAssembly adds a new `v128` type for a
93
93
/// 128-bit SIMD register. It also adds a large array of instructions to
94
94
/// operate on the `v128` type to perform data processing. The SIMD proposal
95
- /// has been in progress for quite some time and many instructions have come
96
- /// and gone. This module attempts to keep up with the proposal, but if you
97
- /// notice anything awry please feel free to [open an
95
+ /// at the time of this writing is in [phase 4] which means that it's in the
96
+ /// standardization phase. It's expected that once some testing on nightly
97
+ /// has happened a stabilization proposal will be made for the Rust
98
+ /// intrinsics. If you notice anything awry please feel free to [open an
98
99
/// issue](https://github.com/rust-lang/stdarch/issues/new).
99
100
///
100
- /// It's important to be aware that the current state of development of SIMD
101
- /// in WebAssembly is still somewhat early days. There's lots of pieces to
102
- /// demo and prototype with, but discussions and support are still in
103
- /// progress. There's a number of pitfalls and gotchas in various places,
104
- /// which will attempt to be documented here, but there may be others
105
- /// lurking!
101
+ /// [phase 4]: https://github.com/webassembly/proposals
106
102
///
107
103
/// Using SIMD is intended to be similar to as you would on `x86_64`, for
108
104
/// example. You'd write a function such as:
@@ -118,15 +114,17 @@ pub mod arch {
118
114
///
119
115
/// Unlike `x86_64`, however, WebAssembly does not currently have dynamic
120
116
/// detection at runtime as to whether SIMD is supported (this is one of the
121
- /// motivators for the [conditional sections proposal][condsections], but
122
- /// that is still pretty early days). This means that your binary will
123
- /// either have SIMD and can only run on engines which support SIMD, or it
124
- /// will not have SIMD at all. For compatibility the standard library itself
125
- /// does not use any SIMD internally. Determining how best to ship your
126
- /// WebAssembly binary with SIMD is largely left up to you as it can can be
127
- /// pretty nuanced depending on your situation.
117
+ /// motivators for the [conditional sections][condsections] and [feature
118
+ /// detection] proposals, but that is still pretty early days). This means
119
+ /// that your binary will either have SIMD and can only run on engines
120
+ /// which support SIMD, or it will not have SIMD at all. For compatibility
121
+ /// the standard library itself does not use any SIMD internally.
122
+ /// Determining how best to ship your WebAssembly binary with SIMD is
123
+ /// largely left up to you as it can can be pretty nuanced depending on
124
+ /// your situation.
128
125
///
129
126
/// [condsections]: https://github.com/webassembly/conditional-sections
127
+ /// [feature detection]: https://github.com/WebAssembly/feature-detection
130
128
///
131
129
/// To enable SIMD support at compile time you need to do one of two things:
132
130
///
@@ -138,7 +136,9 @@ pub mod arch {
138
136
/// * Second you can compile your program with `-Ctarget-feature=+simd128`.
139
137
/// This compilation flag blanket enables SIMD support for your entire
140
138
/// compilation. Note that this does not include the standard library
141
- /// unless you recompile the standard library.
139
+ /// unless you [recompile the standard library][buildstd].
140
+ ///
141
+ /// [buildstd]: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#build-std
142
142
///
143
143
/// If you enable SIMD via either of these routes then you'll have a
144
144
/// WebAssembly binary that uses SIMD instructions, and you'll need to ship
@@ -147,21 +147,6 @@ pub mod arch {
147
147
/// generated in your program. This means to generate a binary without SIMD
148
148
/// you'll need to avoid both options above plus calling into any intrinsics
149
149
/// in this module.
150
- ///
151
- /// > **Note**: Due to
152
- /// > [rust-lang/rust#74320](https://github.com/rust-lang/rust/issues/74320)
153
- /// > it's recommended to compile your entire program with SIMD support
154
- /// > (using `RUSTFLAGS`) or otherwise functions may not be inlined
155
- /// > correctly.
156
- ///
157
- /// > **Note**: LLVM's SIMD support is actually split into two features:
158
- /// > `simd128` and `unimplemented-simd128`. Rust code can enable `simd128`
159
- /// > with `#[target_feature]` (and test for it with `#[cfg(target_feature =
160
- /// > "simd128")]`, but it cannot enable `unimplemented-simd128`. The only
161
- /// > way to enable this feature is to compile with
162
- /// > `-Ctarget-feature=+simd128,+unimplemented-simd128`. This second
163
- /// > feature enables more recent instructions implemented in LLVM which
164
- /// > haven't always had enough time to make their way to runtimes.
165
150
#[ cfg( any( target_arch = "wasm32" , doc) ) ]
166
151
#[ doc( cfg( target_arch = "wasm32" ) ) ]
167
152
#[ stable( feature = "simd_wasm32" , since = "1.33.0" ) ]
0 commit comments