Skip to content

Commit d27e3b9

Browse files
gnzlbgalexcrichton
authored andcommitted
update docs (rust-lang#217)
* update docs * cargo clean deletes previous docs * remove stdsimd from coresimd examples * use stdsimd instead of coresimd in core docs * add stdsimd as a dev-dependency of coresimd
1 parent 5c57be9 commit d27e3b9

File tree

7 files changed

+94
-193
lines changed

7 files changed

+94
-193
lines changed

ci/dox.sh

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ dox() {
2222
rm -rf target/doc/$arch
2323
mkdir target/doc/$arch
2424

25-
cargo clean
2625
cargo build --target $target
2726

2827
rustdoc --target $target -o target/doc/$arch src/lib.rs --crate-name stdsimd --library-path target/$target/debug/deps

coresimd/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ maintenance = { status = "experimental" }
2121
[dev-dependencies]
2222
cupid = "0.5.0"
2323
stdsimd-test = { version = "0.*", path = "../stdsimd-test" }
24+
stdsimd = { version = "0.0.3", path = ".." }
2425

2526
[features]
2627
# Internal-usage only: denies all warnings.

coresimd/src/lib.rs

+1-108
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,4 @@
1-
//! SIMD support
2-
//!
3-
//! This crate provides the fundamentals of supporting SIMD in Rust. This crate
4-
//! should compile on all platforms and provide `simd` and `vendor` modules at
5-
//! the top-level. The `simd` module contains *portable vector types* which
6-
//! should work across all platforms and be implemented in the most efficient
7-
//! manner possible for the platform at hand. The `vendor` module contains
8-
//! vendor intrinsics that operate over these SIMD types, typically
9-
//! corresponding to a particular CPU instruction
10-
//!
11-
//! ```rust
12-
//! extern crate coresimd as stdsimd;
13-
//! use stdsimd::simd::u32x4;
14-
//!
15-
//! fn main() {
16-
//! let a = u32x4::new(1, 2, 3, 4);
17-
//! let b = u32x4::splat(10);
18-
//! assert_eq!(a + b, u32x4::new(11, 12, 13, 14));
19-
//! }
20-
//! ```
21-
//!
22-
//! > **Note**: This crate is *nightly only* at the moment, and requires a
23-
//! > nightly rust toolchain to compile.
1+
//! SIMD and vendor intrinsics support library.
242
//!
253
//! This documentation is only for one particular architecture, you can find
264
//! others at:
@@ -29,91 +7,6 @@
297
//! * [`x86_64`](https://rust-lang-nursery.github.io/stdsimd/x86_64/stdsimd/)
308
//! * [arm](https://rust-lang-nursery.github.io/stdsimd/arm/stdsimd/)
319
//! * [aarch64](https://rust-lang-nursery.github.io/stdsimd/aarch64/stdsimd/)
32-
//!
33-
//! ## Portability
34-
//!
35-
//! The `simd` module and its types should be portable to all platforms. The
36-
//! runtime characteristics of these types may vary per platform and per CPU
37-
//! feature enabled, but they should always have the most optimized
38-
//! implementation for the target at hand.
39-
//!
40-
//! The `vendor` module provides no portability guarantees. The `vendor` module
41-
//! is per CPU architecture currently and provides intrinsics corresponding to
42-
//! functions for that particular CPU architecture. Note that the functions
43-
//! provided in this module are intended to correspond to CPU instructions and
44-
//! have no runtime support for whether you CPU actually supports the
45-
//! instruction.
46-
//!
47-
//! CPU target feature detection is done via the `cfg_feature_enabled!` macro
48-
//! at runtime. This macro will detect at runtime whether the specified feature
49-
//! is available or not, returning true or false depending on the current CPU.
50-
//!
51-
//! ```
52-
//! #![feature(cfg_target_feature)]
53-
//!
54-
//! #[macro_use]
55-
//! extern crate coresimd as stdsimd;
56-
//!
57-
//! fn main() {
58-
//! if cfg_feature_enabled!("avx2") {
59-
//! println!("avx2 intrinsics will work");
60-
//! } else {
61-
//! println!("avx2 intrinsics will not work");
62-
//! // undefined behavior: may generate a `SIGILL`.
63-
//! }
64-
//! }
65-
//! ```
66-
//!
67-
//! After verifying that a specified feature is available, use `target_feature`
68-
//! to enable a given feature and use the desired intrinsic.
69-
//!
70-
//! ```ignore
71-
//! # #![feature(cfg_target_feature)]
72-
//! # #![feature(target_feature)]
73-
//! # #[macro_use]
74-
//! # extern crate coresimd as stdsimd;
75-
//! # fn main() {
76-
//! # if cfg_feature_enabled!("avx2") {
77-
//! // avx2 specific code may be used in this function
78-
//! #[target_feature = "+avx2"]
79-
//! fn and_256() {
80-
//! // avx2 feature specific intrinsics will work here!
81-
//! use stdsimd::vendor::{__m256i, _mm256_and_si256};
82-
//!
83-
//! let a = __m256i::splat(5);
84-
//! let b = __m256i::splat(3);
85-
//!
86-
//! let got = unsafe { _mm256_and_si256(a, b) };
87-
//!
88-
//! assert_eq!(got, __m256i::splat(1));
89-
//! }
90-
//! # and_256();
91-
//! # }
92-
//! # }
93-
//! ```
94-
//!
95-
//! # Status
96-
//!
97-
//! This crate is intended for eventual inclusion into the standard library,
98-
//! but some work and experimentation is needed to get there! First and
99-
//! foremost you can help out by kicking the tires on this crate and seeing if
100-
//! it works for your use case! Next up you can help us fill out the [vendor
101-
//! intrinsics][vendor] to ensure that we've got all the SIMD support
102-
//! necessary.
103-
//!
104-
//! The language support and status of SIMD is also still a little up in the
105-
//! air right now, you may be interested in a few issues along these lines:
106-
//!
107-
//! * [Overal tracking issue for SIMD support][simd_tracking_issue]
108-
//! * [`cfg_target_feature` tracking issue][cfg_target_feature_issue]
109-
//! * [SIMD types currently not sound][simd_soundness_bug]
110-
//! * [`#[target_feature]` improvements][target_feature_impr]
111-
//!
112-
//! [vendor]: https://github.com/rust-lang-nursery/stdsimd/issues/40
113-
//! [simd_tracking_issue]: https://github.com/rust-lang/rust/issues/27731
114-
//! [cfg_target_feature_issue]: https://github.com/rust-lang/rust/issues/29717
115-
//! [simd_soundness_bug]: https://github.com/rust-lang/rust/issues/44367
116-
//! [target_feature_impr]: https://github.com/rust-lang/rust/issues/44839
11710
11811
#![cfg_attr(feature = "strict", deny(warnings))]
11912
#![allow(dead_code)]

coresimd/src/x86/i586/avx2.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -1774,7 +1774,7 @@ pub unsafe fn _mm256_shuffle_epi8(a: u8x32, b: u8x32) -> u8x32 {
17741774
/// # #![feature(cfg_target_feature)]
17751775
/// # #![feature(target_feature)]
17761776
/// #
1777-
/// # #[macro_use] extern crate coresimd as stdsimd;
1777+
/// # #[macro_use] extern crate stdsimd;
17781778
/// #
17791779
/// # fn main() {
17801780
/// # if cfg_feature_enabled!("avx2") {
@@ -2318,7 +2318,7 @@ pub unsafe fn _mm256_subs_epu8(a: u8x32, b: u8x32) -> u8x32 {
23182318
/// # #![feature(cfg_target_feature)]
23192319
/// # #![feature(target_feature)]
23202320
/// #
2321-
/// # #[macro_use] extern crate coresimd as stdsimd;
2321+
/// # #[macro_use] extern crate stdsimd;
23222322
/// #
23232323
/// # fn main() {
23242324
/// # if cfg_feature_enabled!("avx2") {
@@ -2367,7 +2367,7 @@ pub unsafe fn _mm256_unpackhi_epi8(a: i8x32, b: i8x32) -> i8x32 {
23672367
/// # #![feature(cfg_target_feature)]
23682368
/// # #![feature(target_feature)]
23692369
/// #
2370-
/// # #[macro_use] extern crate coresimd as stdsimd;
2370+
/// # #[macro_use] extern crate stdsimd;
23712371
/// #
23722372
/// # fn main() {
23732373
/// # if cfg_feature_enabled!("avx2") {
@@ -2415,7 +2415,7 @@ pub unsafe fn _mm256_unpacklo_epi8(a: i8x32, b: i8x32) -> i8x32 {
24152415
/// # #![feature(cfg_target_feature)]
24162416
/// # #![feature(target_feature)]
24172417
/// #
2418-
/// # #[macro_use] extern crate coresimd as stdsimd;
2418+
/// # #[macro_use] extern crate stdsimd;
24192419
/// #
24202420
/// # fn main() {
24212421
/// # if cfg_feature_enabled!("avx2") {
@@ -2459,7 +2459,7 @@ pub unsafe fn _mm256_unpackhi_epi16(a: i16x16, b: i16x16) -> i16x16 {
24592459
/// # #![feature(cfg_target_feature)]
24602460
/// # #![feature(target_feature)]
24612461
/// #
2462-
/// # #[macro_use] extern crate coresimd as stdsimd;
2462+
/// # #[macro_use] extern crate stdsimd;
24632463
/// #
24642464
/// # fn main() {
24652465
/// # if cfg_feature_enabled!("avx2") {
@@ -2503,7 +2503,7 @@ pub unsafe fn _mm256_unpacklo_epi16(a: i16x16, b: i16x16) -> i16x16 {
25032503
/// # #![feature(cfg_target_feature)]
25042504
/// # #![feature(target_feature)]
25052505
/// #
2506-
/// # #[macro_use] extern crate coresimd as stdsimd;
2506+
/// # #[macro_use] extern crate stdsimd;
25072507
/// #
25082508
/// # fn main() {
25092509
/// # if cfg_feature_enabled!("avx2") {
@@ -2542,7 +2542,7 @@ pub unsafe fn _mm256_unpackhi_epi32(a: i32x8, b: i32x8) -> i32x8 {
25422542
/// # #![feature(cfg_target_feature)]
25432543
/// # #![feature(target_feature)]
25442544
/// #
2545-
/// # #[macro_use] extern crate coresimd as stdsimd;
2545+
/// # #[macro_use] extern crate stdsimd;
25462546
/// #
25472547
/// # fn main() {
25482548
/// # if cfg_feature_enabled!("avx2") {
@@ -2581,7 +2581,7 @@ pub unsafe fn _mm256_unpacklo_epi32(a: i32x8, b: i32x8) -> i32x8 {
25812581
/// # #![feature(cfg_target_feature)]
25822582
/// # #![feature(target_feature)]
25832583
/// #
2584-
/// # #[macro_use] extern crate coresimd as stdsimd;
2584+
/// # #[macro_use] extern crate stdsimd;
25852585
/// #
25862586
/// # fn main() {
25872587
/// # if cfg_feature_enabled!("avx2") {
@@ -2620,7 +2620,7 @@ pub unsafe fn _mm256_unpackhi_epi64(a: i64x4, b: i64x4) -> i64x4 {
26202620
/// # #![feature(cfg_target_feature)]
26212621
/// # #![feature(target_feature)]
26222622
/// #
2623-
/// # #[macro_use] extern crate coresimd as stdsimd;
2623+
/// # #[macro_use] extern crate stdsimd;
26242624
/// #
26252625
/// # fn main() {
26262626
/// # if cfg_feature_enabled!("avx2") {

coresimd/src/x86/i586/sse.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ pub unsafe fn _mm_movemask_ps(a: f32x4) -> i32 {
884884
/// # #![feature(cfg_target_feature)]
885885
/// # #![feature(target_feature)]
886886
/// #
887-
/// # #[macro_use] extern crate coresimd as stdsimd;
887+
/// # #[macro_use] extern crate stdsimd;
888888
/// #
889889
/// # // The real main function
890890
/// # fn main() {
@@ -936,7 +936,7 @@ pub unsafe fn _mm_loadh_pi(a: f32x4, p: *const f32) -> f32x4 {
936936
/// # #![feature(cfg_target_feature)]
937937
/// # #![feature(target_feature)]
938938
/// #
939-
/// # #[macro_use] extern crate coresimd as stdsimd;
939+
/// # #[macro_use] extern crate stdsimd;
940940
/// #
941941
/// # // The real main function
942942
/// # fn main() {

coresimd/src/x86/i586/sse42.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ pub unsafe fn _mm_cmpistrm(a: __m128i, b: __m128i, imm8: i8) -> u8x16 {
9696
/// # #![feature(cfg_target_feature)]
9797
/// # #![feature(target_feature)]
9898
/// #
99-
/// # #[macro_use] extern crate coresimd as stdsimd;
99+
/// # #[macro_use] extern crate stdsimd;
100100
/// #
101101
/// # fn main() {
102102
/// # if cfg_feature_enabled!("sse4.2") {
@@ -139,7 +139,7 @@ pub unsafe fn _mm_cmpistrm(a: __m128i, b: __m128i, imm8: i8) -> u8x16 {
139139
/// # #![feature(cfg_target_feature)]
140140
/// # #![feature(target_feature)]
141141
/// #
142-
/// # #[macro_use] extern crate coresimd as stdsimd;
142+
/// # #[macro_use] extern crate stdsimd;
143143
/// #
144144
/// # fn main() {
145145
/// # if cfg_feature_enabled!("sse4.2") {
@@ -180,7 +180,7 @@ pub unsafe fn _mm_cmpistrm(a: __m128i, b: __m128i, imm8: i8) -> u8x16 {
180180
/// # #![feature(cfg_target_feature)]
181181
/// # #![feature(target_feature)]
182182
/// #
183-
/// # #[macro_use] extern crate coresimd as stdsimd;
183+
/// # #[macro_use] extern crate stdsimd;
184184
/// #
185185
/// # fn main() {
186186
/// # if cfg_feature_enabled!("sse4.2") {
@@ -219,7 +219,7 @@ pub unsafe fn _mm_cmpistrm(a: __m128i, b: __m128i, imm8: i8) -> u8x16 {
219219
/// # #![feature(cfg_target_feature)]
220220
/// # #![feature(target_feature)]
221221
/// #
222-
/// # #[macro_use] extern crate coresimd as stdsimd;
222+
/// # #[macro_use] extern crate stdsimd;
223223
/// #
224224
/// # fn main() {
225225
/// # if cfg_feature_enabled!("sse4.2") {
@@ -392,7 +392,7 @@ pub unsafe fn _mm_cmpestrm(
392392
/// # #![feature(cfg_target_feature)]
393393
/// # #![feature(target_feature)]
394394
/// #
395-
/// # #[macro_use] extern crate coresimd as stdsimd;
395+
/// # #[macro_use] extern crate stdsimd;
396396
/// #
397397
/// # fn main() {
398398
/// # if cfg_feature_enabled!("sse4.2") {

0 commit comments

Comments
 (0)