Skip to content

Commit eea66e1

Browse files
committed
core: Document simd mod
1 parent 8e58ec5 commit eea66e1

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

src/libcore/simd.rs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,31 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! SIMD vectors
11+
//! SIMD vectors.
12+
//!
13+
//! These types can be used for accessing basic SIMD operations. Each of them
14+
//! implements the standard arithmetic operator traits (Add, Sub, Mul, Div,
15+
//! Rem, Shl, Shr) through compiler magic, rather than explicitly. Currently
16+
//! comparison operators are not implemented. To use SSE3+, you must enable
17+
//! the features, like `-C target-feature=sse3,sse4.1,sse4.2`, or a more
18+
//! specific `target-cpu`. No other SIMD intrinsics or high-level wrappers are
19+
//! provided beyond this module.
20+
//!
21+
//! ```rust
22+
//! #[allow(experimental)];
23+
//!
24+
//! fn main() {
25+
//! use std::simd::f32x4;
26+
//! let a = f32x4(40.0, 41.0, 42.0, 43.0);
27+
//! let b = f32x4(1.0, 1.1, 3.4, 9.8);
28+
//! println!("{}", a + b);
29+
//! }
30+
//! ```
31+
//!
32+
//! ## Stability Note
33+
//!
34+
//! These are all experimental. The inferface may change entirely, without
35+
//! warning.
1236
1337
#![allow(non_camel_case_types)]
1438
#![allow(missing_doc)]

0 commit comments

Comments
 (0)