Skip to content

Commit 8ed6986

Browse files
QuietMisdreavusgnzlbg
authored andcommitted
document all arches when part of std
unfortunately, stdsimd's version of the documentation will be blanked out in favor of coresimd's version, but coresimd (when re-exported in libcore) will include all the arches
1 parent ab9356f commit 8ed6986

File tree

4 files changed

+59
-14
lines changed

4 files changed

+59
-14
lines changed

coresimd/mod.rs

+12-8
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,17 @@ pub mod arch {
3939
/// Platform-specific intrinsics for the `x86` platform.
4040
///
4141
/// See the [module documentation](../index.html) for more details.
42-
#[cfg(target_arch = "x86")]
42+
#[cfg(any(target_arch = "x86", dox))]
43+
#[doc(cfg(target_arch = "x86"))]
4344
pub mod x86 {
4445
pub use coresimd::x86::*;
4546
}
4647

4748
/// Platform-specific intrinsics for the `x86_64` platform.
4849
///
4950
/// See the [module documentation](../index.html) for more details.
50-
#[cfg(target_arch = "x86_64")]
51+
#[cfg(any(target_arch = "x86_64", dox))]
52+
#[doc(cfg(target_arch = "x86_64"))]
5153
pub mod x86_64 {
5254
pub use coresimd::x86::*;
5355
pub use coresimd::x86_64::*;
@@ -56,15 +58,17 @@ pub mod arch {
5658
/// Platform-specific intrinsics for the `arm` platform.
5759
///
5860
/// See the [module documentation](../index.html) for more details.
59-
#[cfg(target_arch = "arm")]
61+
#[cfg(any(target_arch = "arm", dox))]
62+
#[doc(cfg(target_arch = "arm"))]
6063
pub mod arm {
6164
pub use coresimd::arm::*;
6265
}
6366

6467
/// Platform-specific intrinsics for the `aarch64` platform.
6568
///
6669
/// See the [module documentation](../index.html) for more details.
67-
#[cfg(target_arch = "aarch64")]
70+
#[cfg(any(target_arch = "aarch64", dox))]
71+
#[doc(cfg(target_arch = "aarch64"))]
6872
pub mod aarch64 {
6973
pub use coresimd::arm::*;
7074
pub use coresimd::aarch64::*;
@@ -81,14 +85,14 @@ pub mod arch {
8185

8286
mod simd_llvm;
8387

84-
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
88+
#[cfg(any(target_arch = "x86", target_arch = "x86_64", dox))]
8589
mod x86;
86-
#[cfg(target_arch = "x86_64")]
90+
#[cfg(any(target_arch = "x86_64", dox))]
8791
mod x86_64;
8892

89-
#[cfg(any(target_arch = "arm", target_arch = "aarch64"))]
93+
#[cfg(any(target_arch = "arm", target_arch = "aarch64", dox))]
9094
mod arm;
91-
#[cfg(target_arch = "aarch64")]
95+
#[cfg(any(target_arch = "aarch64", dox))]
9296
mod aarch64;
9397
#[cfg(target_arch = "wasm32")]
9498
mod wasm32;

crates/coresimd/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
simd_ffi, target_feature, cfg_target_feature, i128_type, asm,
1414
integer_atomics, stmt_expr_attributes, core_intrinsics,
1515
crate_in_paths, no_core, attr_literals, rustc_attrs, stdsimd,
16-
staged_api, fn_must_use, core_float, core_slice_ext, align_offset)]
16+
staged_api, fn_must_use, core_float, core_slice_ext, align_offset,
17+
doc_cfg)]
1718
#![cfg_attr(test,
1819
feature(proc_macro, test, attr_literals, abi_vectorcall,
1920
untagged_unions))]

crates/stdsimd/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//! [stdsimd]: https://rust-lang-nursery.github.io/stdsimd/x86_64/stdsimd/
99
1010
#![feature(const_fn, integer_atomics, staged_api, stdsimd)]
11-
#![feature(cfg_target_feature)]
11+
#![feature(cfg_target_feature, doc_cfg)]
1212
#![cfg_attr(feature = "cargo-clippy", allow(shadow_reuse))]
1313
#![cfg_attr(target_os = "linux", feature(linkage))]
1414
#![no_std]

stdsimd/mod.rs

+44-4
Original file line numberDiff line numberDiff line change
@@ -341,23 +341,63 @@
341341
/// ```
342342
#[unstable(feature = "stdsimd", issue = "0")]
343343
pub mod arch {
344-
#[cfg(target_arch = "x86")]
344+
#[cfg(all(not(dox), target_arch = "x86"))]
345345
pub use coresimd::arch::x86;
346346

347-
#[cfg(target_arch = "x86_64")]
347+
#[cfg(all(not(dox), target_arch = "x86_64"))]
348348
pub use coresimd::arch::x86_64;
349349

350-
#[cfg(target_arch = "arm")]
350+
#[cfg(all(not(dox), target_arch = "arm"))]
351351
pub use coresimd::arch::arm;
352352

353-
#[cfg(target_arch = "aarch64")]
353+
#[cfg(all(not(dox), target_arch = "aarch64"))]
354354
pub use coresimd::arch::aarch64;
355355

356356
#[cfg(target_arch = "wasm32")]
357357
pub use coresimd::arch::wasm32;
358358

359359
#[doc(hidden)] // unstable implementation detail
360360
pub mod detect;
361+
362+
/// Platform-specific intrinsics for the `x86` platform.
363+
///
364+
/// The documentation with the full listing of `x86` intrinsics is available in [libcore], but
365+
/// the module is re-exported here in std as well.
366+
///
367+
/// [libcore]: ../../../core/arch/x86/index.html
368+
#[cfg(dox)]
369+
#[doc(cfg(target_arch = "x86"))]
370+
pub mod x86 {}
371+
372+
/// Platform-specific intrinsics for the `x86_64` platform.
373+
///
374+
/// The documentation with the full listing of `x86_64` intrinsics is available in [libcore],
375+
/// but the module is re-exported here in std as well.
376+
///
377+
/// [libcore]: ../../../core/arch/x86_64/index.html
378+
#[cfg(dox)]
379+
#[doc(cfg(target_arch = "x86_64"))]
380+
pub mod x86_64 {}
381+
382+
/// Platform-specific intrinsics for the `arm` platform.
383+
///
384+
/// The documentation with the full listing of `arm` intrinsics is available in [libcore], but
385+
/// the module is re-exported here in std as well.
386+
///
387+
/// [libcore]: ../../../core/arch/arm/index.html
388+
#[cfg(dox)]
389+
#[doc(cfg(target_arch = "arm"))]
390+
pub mod arm {}
391+
392+
/// Platform-specific intrinsics for the `aarch64` platform.
393+
///
394+
/// The documentation with the full listing of `aarch64` intrinsics is available in [libcore],
395+
/// but the module is re-exported here in std as well.
396+
///
397+
/// [libcore]: ../../../core/arch/aarch64/index.html
398+
#[cfg(dox)]
399+
#[doc(cfg(target_arch = "aarch64"))]
400+
pub mod aarch64 {}
361401
}
362402

363403
#[unstable(feature = "stdsimd", issue = "0")]

0 commit comments

Comments
 (0)