Skip to content

document all arches when part of std #367

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions coresimd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,17 @@ pub mod arch {
/// Platform-specific intrinsics for the `x86` platform.
///
/// See the [module documentation](../index.html) for more details.
#[cfg(target_arch = "x86")]
#[cfg(any(target_arch = "x86", dox))]
#[doc(cfg(target_arch = "x86"))]
pub mod x86 {
pub use coresimd::x86::*;
}

/// Platform-specific intrinsics for the `x86_64` platform.
///
/// See the [module documentation](../index.html) for more details.
#[cfg(target_arch = "x86_64")]
#[cfg(any(target_arch = "x86_64", dox))]
#[doc(cfg(target_arch = "x86_64"))]
pub mod x86_64 {
pub use coresimd::x86::*;
pub use coresimd::x86_64::*;
Expand All @@ -56,15 +58,17 @@ pub mod arch {
/// Platform-specific intrinsics for the `arm` platform.
///
/// See the [module documentation](../index.html) for more details.
#[cfg(target_arch = "arm")]
#[cfg(any(target_arch = "arm", dox))]
#[doc(cfg(target_arch = "arm"))]
pub mod arm {
pub use coresimd::arm::*;
}

/// Platform-specific intrinsics for the `aarch64` platform.
///
/// See the [module documentation](../index.html) for more details.
#[cfg(target_arch = "aarch64")]
#[cfg(any(target_arch = "aarch64", dox))]
#[doc(cfg(target_arch = "aarch64"))]
pub mod aarch64 {
pub use coresimd::arm::*;
pub use coresimd::aarch64::*;
Expand All @@ -81,14 +85,14 @@ pub mod arch {

mod simd_llvm;

#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
#[cfg(any(target_arch = "x86", target_arch = "x86_64", dox))]
mod x86;
#[cfg(target_arch = "x86_64")]
#[cfg(any(target_arch = "x86_64", dox))]
mod x86_64;

#[cfg(any(target_arch = "arm", target_arch = "aarch64"))]
#[cfg(any(target_arch = "arm", target_arch = "aarch64", dox))]
mod arm;
#[cfg(target_arch = "aarch64")]
#[cfg(any(target_arch = "aarch64", dox))]
mod aarch64;
#[cfg(target_arch = "wasm32")]
mod wasm32;
Expand Down
3 changes: 2 additions & 1 deletion crates/coresimd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
simd_ffi, target_feature, cfg_target_feature, i128_type, asm,
integer_atomics, stmt_expr_attributes, core_intrinsics,
crate_in_paths, no_core, attr_literals, rustc_attrs, stdsimd,
staged_api, fn_must_use, core_float, core_slice_ext, align_offset)]
staged_api, fn_must_use, core_float, core_slice_ext, align_offset,
doc_cfg)]
#![cfg_attr(test,
feature(proc_macro, test, attr_literals, abi_vectorcall,
untagged_unions))]
Expand Down
2 changes: 1 addition & 1 deletion crates/stdsimd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//! [stdsimd]: https://rust-lang-nursery.github.io/stdsimd/x86_64/stdsimd/

#![feature(const_fn, integer_atomics, staged_api, stdsimd)]
#![feature(cfg_target_feature)]
#![feature(cfg_target_feature, doc_cfg)]
#![cfg_attr(feature = "cargo-clippy", allow(shadow_reuse))]
#![cfg_attr(target_os = "linux", feature(linkage))]
#![no_std]
Expand Down
52 changes: 48 additions & 4 deletions stdsimd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,23 +341,67 @@
/// ```
#[unstable(feature = "stdsimd", issue = "0")]
pub mod arch {
#[cfg(target_arch = "x86")]
#[cfg(all(not(dox), target_arch = "x86"))]
pub use coresimd::arch::x86;

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

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

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

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

#[doc(hidden)] // unstable implementation detail
pub mod detect;

/// Platform-specific intrinsics for the `x86` platform.
///
/// The documentation with the full listing of `x86` intrinsics is
/// available in [libcore], but the module is re-exported here in std
/// as well.
///
/// [libcore]: ../../../core/arch/x86/index.html
#[cfg(dox)]
#[doc(cfg(target_arch = "x86"))]
pub mod x86 {}

/// Platform-specific intrinsics for the `x86_64` platform.
///
/// The documentation with the full listing of `x86_64` intrinsics is
/// available in [libcore], but the module is re-exported here in std
/// as well.
///
/// [libcore]: ../../../core/arch/x86_64/index.html
#[cfg(dox)]
#[doc(cfg(target_arch = "x86_64"))]
pub mod x86_64 {}

/// Platform-specific intrinsics for the `arm` platform.
///
/// The documentation with the full listing of `arm` intrinsics is
/// available in [libcore], but the module is re-exported here in std
/// as well.
///
/// [libcore]: ../../../core/arch/arm/index.html
#[cfg(dox)]
#[doc(cfg(target_arch = "arm"))]
pub mod arm {}

/// Platform-specific intrinsics for the `aarch64` platform.
///
/// The documentation with the full listing of `aarch64` intrinsics is
/// available in [libcore], but the module is re-exported here in std
/// as well.
///
/// [libcore]: ../../../core/arch/aarch64/index.html
#[cfg(dox)]
#[doc(cfg(target_arch = "aarch64"))]
pub mod aarch64 {}
}

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