Add wasm intrinsics to documentation
This commit is contained in:
parent
f8d3a9a1ee
commit
0e673facfb
2 changed files with 29 additions and 3 deletions
|
|
@ -26,6 +26,7 @@ mod simd;
|
|||
/// * [`PowerPC`]
|
||||
/// * [`PowerPC64`]
|
||||
/// * [`NVPTX`]
|
||||
/// * [`wasm32`]
|
||||
///
|
||||
/// [`x86`]: https://rust-lang-nursery.github.io/stdsimd/x86/stdsimd/arch/index.html
|
||||
/// [`x86_64`]: https://rust-lang-nursery.github.io/stdsimd/x86_64/stdsimd/arch/index.html
|
||||
|
|
@ -36,6 +37,7 @@ mod simd;
|
|||
/// [`PowerPC`]: https://rust-lang-nursery.github.io/stdsimd/powerpc/stdsimd/arch/index.html
|
||||
/// [`PowerPC64`]: https://rust-lang-nursery.github.io/stdsimd/powerpc64/stdsimd/arch/index.html
|
||||
/// [`NVPTX`]: https://rust-lang-nursery.github.io/stdsimd/nvptx/stdsimd/arch/index.html
|
||||
/// [`wasm32`]: https://rust-lang-nursery.github.io/stdsimd/wasm32/stdsimd/arch/index.html
|
||||
#[stable(feature = "simd_arch", since = "1.27.0")]
|
||||
pub mod arch {
|
||||
/// Platform-specific intrinsics for the `x86` platform.
|
||||
|
|
@ -86,6 +88,7 @@ pub mod arch {
|
|||
/// Platform-specific intrinsics for the `wasm32` platform.
|
||||
///
|
||||
/// See the [module documentation](../index.html) for more details.
|
||||
#[cfg(any(target_arch = "wasm32", dox))]
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
#[unstable(feature = "stdsimd", issue = "27731")]
|
||||
pub mod wasm32 {
|
||||
|
|
@ -131,7 +134,7 @@ pub mod arch {
|
|||
pub mod powerpc64 {
|
||||
pub use coresimd::powerpc64::*;
|
||||
}
|
||||
|
||||
|
||||
/// Platform-specific intrinsics for the `NVPTX` platform.
|
||||
///
|
||||
/// See the [module documentation](../index.html) for more details.
|
||||
|
|
@ -158,7 +161,9 @@ mod aarch64;
|
|||
#[cfg(any(target_arch = "arm", target_arch = "aarch64", dox))]
|
||||
#[doc(cfg(any(target_arch = "arm", target_arch = "aarch64")))]
|
||||
mod arm;
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
|
||||
#[cfg(any(target_arch = "wasm32", dox))]
|
||||
#[doc(cfg(target_arch = "wasm32"))]
|
||||
mod wasm32;
|
||||
|
||||
#[cfg(any(target_arch = "mips", target_arch = "mips64", dox))]
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
//!
|
||||
//! [spec]: https://github.com/WebAssembly/threads
|
||||
|
||||
#![cfg(target_feature = "atomics")]
|
||||
#![cfg(any(target_feature = "atomics", dox))]
|
||||
|
||||
#[cfg(test)]
|
||||
use stdsimd_test::assert_instr;
|
||||
|
|
@ -43,6 +43,13 @@ extern "C" {
|
|||
/// didn't block
|
||||
/// * 2 - the thread blocked, but the timeout expired.
|
||||
///
|
||||
/// # Availability
|
||||
///
|
||||
/// This intrinsic is only available **when the standard library itself is
|
||||
/// compiled with the `atomics` target feature**. This version of the standard
|
||||
/// library is not obtainable via `rustup`, but rather will require the standard
|
||||
/// library to be compiled from source.
|
||||
///
|
||||
/// [instr]: https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#wait
|
||||
#[inline]
|
||||
#[cfg_attr(test, assert_instr("i32.atomic.wait"))]
|
||||
|
|
@ -71,6 +78,13 @@ pub unsafe fn wait_i32(ptr: *mut i32, expression: i32, timeout_ns: i64) -> i32 {
|
|||
/// didn't block
|
||||
/// * 2 - the thread blocked, but the timeout expired.
|
||||
///
|
||||
/// # Availability
|
||||
///
|
||||
/// This intrinsic is only available **when the standard library itself is
|
||||
/// compiled with the `atomics` target feature**. This version of the standard
|
||||
/// library is not obtainable via `rustup`, but rather will require the standard
|
||||
/// library to be compiled from source.
|
||||
///
|
||||
/// [instr]: https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#wait
|
||||
#[inline]
|
||||
#[cfg_attr(test, assert_instr("i64.atomic.wait"))]
|
||||
|
|
@ -92,6 +106,13 @@ pub unsafe fn wait_i64(ptr: *mut i64, expression: i64, timeout_ns: i64) -> i32 {
|
|||
///
|
||||
/// Returns the number of waiters which were actually woken up.
|
||||
///
|
||||
/// # Availability
|
||||
///
|
||||
/// This intrinsic is only available **when the standard library itself is
|
||||
/// compiled with the `atomics` target feature**. This version of the standard
|
||||
/// library is not obtainable via `rustup`, but rather will require the standard
|
||||
/// library to be compiled from source.
|
||||
///
|
||||
/// [instr]: https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#wake
|
||||
#[inline]
|
||||
#[cfg_attr(test, assert_instr("atomic.wake"))]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue