@@ -92,17 +92,13 @@ pub mod arch {
9292 /// The [simd proposal][simd] for WebAssembly adds a new `v128` type for a
9393 /// 128-bit SIMD register. It also adds a large array of instructions to
9494 /// 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
9899 /// issue](https://github.com/rust-lang/stdarch/issues/new).
99100 ///
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
106102 ///
107103 /// Using SIMD is intended to be similar to as you would on `x86_64`, for
108104 /// example. You'd write a function such as:
@@ -118,15 +114,17 @@ pub mod arch {
118114 ///
119115 /// Unlike `x86_64`, however, WebAssembly does not currently have dynamic
120116 /// 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.
128125 ///
129126 /// [condsections]: https://github.com/webassembly/conditional-sections
127+ /// [feature detection]: https://github.com/WebAssembly/feature-detection
130128 ///
131129 /// To enable SIMD support at compile time you need to do one of two things:
132130 ///
@@ -138,7 +136,9 @@ pub mod arch {
138136 /// * Second you can compile your program with `-Ctarget-feature=+simd128`.
139137 /// This compilation flag blanket enables SIMD support for your entire
140138 /// 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
142142 ///
143143 /// If you enable SIMD via either of these routes then you'll have a
144144 /// WebAssembly binary that uses SIMD instructions, and you'll need to ship
@@ -147,21 +147,6 @@ pub mod arch {
147147 /// generated in your program. This means to generate a binary without SIMD
148148 /// you'll need to avoid both options above plus calling into any intrinsics
149149 /// 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.
165150 #[ cfg( any( target_arch = "wasm32" , doc) ) ]
166151 #[ doc( cfg( target_arch = "wasm32" ) ) ]
167152 #[ stable( feature = "simd_wasm32" , since = "1.33.0" ) ]
0 commit comments