This intrinsic isn't actually specified by Intel, but it's something gated with CPUID and can otherwise be a useful thing to have when building primitives! There exists an `AtomicU128` type in the standard library but it's only exposed currently (and it's unstable) when a platform fully supports 128-bit atomics. The x86_64 architecture does not support it *unless* the `cmpxchg16b` instruction is available, and it isn't always available! This commit is also a proposal for how we can include support for 128-bit atomics in the standard library on relevant platforms. I'm thinking that we'll expose this one low-level intrinsic in `std::arch::x86_64`, and then if desired a crate on crates.io can build `AtomicU128` from this API. In any case this is all unstable regardless!
stdsimd - Rust's standard library SIMD components
Usage
stdsimd is now shipped with Rust's std library - its is part of libcore
and libstd.
The easiest way to use it is just to import it via use std::arch.
The std::arch component for x86 is available in stable Rust. The std::arch
components for other architectures and the std::simd component require nightly
Rust.
Using stdsimd master branch is not recommended. It requires nightly Rust, it
only works with particular Rust nightly versions, and it can (and does) break
often. If you need to use stdsimd master branch, you can add it to your
Cargo.toml as follows:
#[dependencies]
stdsimd = { git = "https://github.com/rust-lang-nursery/stdsimd.git" }
Documentation
- Documentation - i686
- Documentation - x86_64
- Documentation - arm
- Documentation - aarch64
- Documentation - powerpc
- Documentation - powerpc64
- How to get started
- How to help implement intrinsics
Approach
The main goal is to expose APIs defined by vendors with the least amount of
abstraction possible. On x86, for example, the API should correspond to that
provided by emmintrin.h.
License
stdsimd is primarily distributed under the terms of both the MIT license and
the Apache License (Version 2.0), with portions covered by various BSD-like
licenses.
See LICENSE-APACHE, and LICENSE-MIT for details.