Skip to content

Start adding stability attributes #327

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 1 commit into from
Feb 24, 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
31 changes: 20 additions & 11 deletions coresimd/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/// Platform independent SIMD vector types and operations.
#[unstable(feature = "stdsimd", issue = "0")]
pub mod simd {
pub use coresimd::v128::*;
pub use coresimd::v256::*;
Expand All @@ -7,20 +8,28 @@ pub mod simd {
}

/// Platform dependent vendor intrinsics.
pub mod vendor {
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub use coresimd::x86::*;
#[unstable(feature = "stdsimd", issue = "0")]
pub mod arch {
#[cfg(target_arch = "x86")]
pub mod x86 {
pub use coresimd::x86::*;
}

#[cfg(any(target_arch = "arm", target_arch = "aarch64"))]
pub use coresimd::arm::*;
#[cfg(target_arch = "x86_64")]
pub mod x86_64 {
pub use coresimd::x86::*;
}

#[cfg(target_arch = "aarch64")]
pub use coresimd::aarch64::*;
#[cfg(target_arch = "arm")]
pub mod arm {
pub use coresimd::arm::*;
}

// FIXME: rust does not expose the nvptx and nvptx64 targets yet
#[cfg(not(any(target_arch = "x86", target_arch = "x86_64",
target_arch = "arm", target_arch = "aarch64")))]
pub use coresimd::nvptx::*;
#[cfg(target_arch = "aarch64")]
pub mod aarch64 {
pub use coresimd::arm::*;
pub use coresimd::aarch64::*;
}
}

#[macro_use]
Expand Down
18 changes: 9 additions & 9 deletions coresimd/x86/i586/avx2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2017,7 +2017,7 @@ pub unsafe fn _mm256_shuffle_epi8(a: __m256i, b: __m256i) -> __m256i {
///
/// ```rust
/// # #![feature(cfg_target_feature)]
/// # #![feature(target_feature)]
/// # #![feature(target_feature, stdsimd)]
/// #
/// # #[macro_use] extern crate stdsimd;
/// #
Expand Down Expand Up @@ -2623,7 +2623,7 @@ pub unsafe fn _mm256_subs_epu8(a: __m256i, b: __m256i) -> __m256i {
///
/// ```rust
/// # #![feature(cfg_target_feature)]
/// # #![feature(target_feature)]
/// # #![feature(target_feature, stdsimd)]
/// #
/// # #[macro_use] extern crate stdsimd;
/// #
Expand Down Expand Up @@ -2672,7 +2672,7 @@ pub unsafe fn _mm256_unpackhi_epi8(a: __m256i, b: __m256i) -> __m256i {
///
/// ```rust
/// # #![feature(cfg_target_feature)]
/// # #![feature(target_feature)]
/// # #![feature(target_feature, stdsimd)]
/// #
/// # #[macro_use] extern crate stdsimd;
/// #
Expand Down Expand Up @@ -2720,7 +2720,7 @@ pub unsafe fn _mm256_unpacklo_epi8(a: __m256i, b: __m256i) -> __m256i {
///
/// ```rust
/// # #![feature(cfg_target_feature)]
/// # #![feature(target_feature)]
/// # #![feature(target_feature, stdsimd)]
/// #
/// # #[macro_use] extern crate stdsimd;
/// #
Expand Down Expand Up @@ -2764,7 +2764,7 @@ pub unsafe fn _mm256_unpackhi_epi16(a: __m256i, b: __m256i) -> __m256i {
///
/// ```rust
/// # #![feature(cfg_target_feature)]
/// # #![feature(target_feature)]
/// # #![feature(target_feature, stdsimd)]
/// #
/// # #[macro_use] extern crate stdsimd;
/// #
Expand Down Expand Up @@ -2808,7 +2808,7 @@ pub unsafe fn _mm256_unpacklo_epi16(a: __m256i, b: __m256i) -> __m256i {
///
/// ```rust
/// # #![feature(cfg_target_feature)]
/// # #![feature(target_feature)]
/// # #![feature(target_feature, stdsimd)]
/// #
/// # #[macro_use] extern crate stdsimd;
/// #
Expand Down Expand Up @@ -2851,7 +2851,7 @@ pub unsafe fn _mm256_unpackhi_epi32(a: __m256i, b: __m256i) -> __m256i {
///
/// ```rust
/// # #![feature(cfg_target_feature)]
/// # #![feature(target_feature)]
/// # #![feature(target_feature, stdsimd)]
/// #
/// # #[macro_use] extern crate stdsimd;
/// #
Expand Down Expand Up @@ -2891,7 +2891,7 @@ pub unsafe fn _mm256_unpacklo_epi32(a: __m256i, b: __m256i) -> __m256i {
///
/// ```rust
/// # #![feature(cfg_target_feature)]
/// # #![feature(target_feature)]
/// # #![feature(target_feature, stdsimd)]
/// #
/// # #[macro_use] extern crate stdsimd;
/// #
Expand Down Expand Up @@ -2930,7 +2930,7 @@ pub unsafe fn _mm256_unpackhi_epi64(a: __m256i, b: __m256i) -> __m256i {
///
/// ```rust
/// # #![feature(cfg_target_feature)]
/// # #![feature(target_feature)]
/// # #![feature(target_feature, stdsimd)]
/// #
/// # #[macro_use] extern crate stdsimd;
/// #
Expand Down
4 changes: 2 additions & 2 deletions coresimd/x86/i586/sse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ pub unsafe fn _mm_movemask_ps(a: __m128) -> i32 {
///
/// ```rust
/// # #![feature(cfg_target_feature)]
/// # #![feature(target_feature)]
/// # #![feature(target_feature, stdsimd)]
/// #
/// # #[macro_use] extern crate stdsimd;
/// #
Expand Down Expand Up @@ -921,7 +921,7 @@ pub unsafe fn _mm_loadh_pi(a: __m128, p: *const __m64) -> __m128 {
///
/// ```rust
/// # #![feature(cfg_target_feature)]
/// # #![feature(target_feature)]
/// # #![feature(target_feature, stdsimd)]
/// #
/// # #[macro_use] extern crate stdsimd;
/// #
Expand Down
8 changes: 8 additions & 0 deletions coresimd/x86/i586/sse41.rs
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,8 @@ pub unsafe fn _mm_ceil_ss(a: __m128, b: __m128) -> __m128 {
/// Rounding is done according to the rounding parameter, which can be one of:
///
/// ```
/// #![feature(stdsimd)]
///
/// extern crate stdsimd;
///
/// #[cfg(target_arch = "x86")]
Expand Down Expand Up @@ -588,6 +590,8 @@ pub unsafe fn _mm_round_pd(a: __m128d, rounding: i32) -> __m128d {
/// Rounding is done according to the rounding parameter, which can be one of:
///
/// ```
/// #![feature(stdsimd)]
///
/// extern crate stdsimd;
///
/// #[cfg(target_arch = "x86")]
Expand Down Expand Up @@ -627,6 +631,8 @@ pub unsafe fn _mm_round_ps(a: __m128, rounding: i32) -> __m128 {
/// Rounding is done according to the rounding parameter, which can be one of:
///
/// ```
/// #![feature(stdsimd)]
///
/// extern crate stdsimd;
///
/// #[cfg(target_arch = "x86")]
Expand Down Expand Up @@ -666,6 +672,8 @@ pub unsafe fn _mm_round_sd(a: __m128d, b: __m128d, rounding: i32) -> __m128d {
/// Rounding is done according to the rounding parameter, which can be one of:
///
/// ```
/// #![feature(stdsimd)]
///
/// extern crate stdsimd;
///
/// #[cfg(target_arch = "x86")]
Expand Down
5 changes: 5 additions & 0 deletions coresimd/x86/i586/sse42.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ pub unsafe fn _mm_cmpistrm(a: __m128i, b: __m128i, imm8: i32) -> __m128i {
/// ```
/// # #![feature(cfg_target_feature)]
/// # #![feature(target_feature)]
/// # #![feature(stdsimd)]
/// #
/// # #[macro_use] extern crate stdsimd;
/// #
Expand Down Expand Up @@ -141,6 +142,7 @@ pub unsafe fn _mm_cmpistrm(a: __m128i, b: __m128i, imm8: i32) -> __m128i {
/// ```
/// # #![feature(cfg_target_feature)]
/// # #![feature(target_feature)]
/// # #![feature(stdsimd)]
/// #
/// # #[macro_use] extern crate stdsimd;
/// #
Expand Down Expand Up @@ -182,6 +184,7 @@ pub unsafe fn _mm_cmpistrm(a: __m128i, b: __m128i, imm8: i32) -> __m128i {
/// ```
/// # #![feature(cfg_target_feature)]
/// # #![feature(target_feature)]
/// # #![feature(stdsimd)]
/// #
/// # #[macro_use] extern crate stdsimd;
/// #
Expand Down Expand Up @@ -223,6 +226,7 @@ pub unsafe fn _mm_cmpistrm(a: __m128i, b: __m128i, imm8: i32) -> __m128i {
/// ```
/// # #![feature(cfg_target_feature)]
/// # #![feature(target_feature)]
/// # #![feature(stdsimd)]
/// #
/// # #[macro_use] extern crate stdsimd;
/// #
Expand Down Expand Up @@ -416,6 +420,7 @@ pub unsafe fn _mm_cmpestrm(
/// ```
/// # #![feature(cfg_target_feature)]
/// # #![feature(target_feature)]
/// # #![feature(stdsimd)]
/// #
/// # #[macro_use] extern crate stdsimd;
/// #
Expand Down
14 changes: 7 additions & 7 deletions coresimd/x86/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ types! {
/// # Examples
///
/// ```
/// # #![feature(cfg_target_feature, target_feature)]
/// # #![feature(cfg_target_feature, target_feature, stdsimd)]
/// # #[macro_use]
/// # extern crate stdsimd;
/// # fn main() {
Expand Down Expand Up @@ -100,7 +100,7 @@ types! {
/// # Examples
///
/// ```
/// # #![feature(cfg_target_feature, target_feature)]
/// # #![feature(cfg_target_feature, target_feature, stdsimd)]
/// # #[macro_use]
/// # extern crate stdsimd;
/// # fn main() {
Expand Down Expand Up @@ -139,7 +139,7 @@ types! {
/// # Examples
///
/// ```
/// # #![feature(cfg_target_feature, target_feature)]
/// # #![feature(cfg_target_feature, target_feature, stdsimd)]
/// # #[macro_use]
/// # extern crate stdsimd;
/// # fn main() {
Expand Down Expand Up @@ -178,7 +178,7 @@ types! {
/// # Examples
///
/// ```
/// # #![feature(cfg_target_feature, target_feature)]
/// # #![feature(cfg_target_feature, target_feature, stdsimd)]
/// # #[macro_use]
/// # extern crate stdsimd;
/// # fn main() {
Expand Down Expand Up @@ -221,7 +221,7 @@ types! {
/// # Examples
///
/// ```
/// # #![feature(cfg_target_feature, target_feature)]
/// # #![feature(cfg_target_feature, target_feature, stdsimd)]
/// # #[macro_use]
/// # extern crate stdsimd;
/// # fn main() {
Expand Down Expand Up @@ -260,7 +260,7 @@ types! {
/// # Examples
///
/// ```
/// # #![feature(cfg_target_feature, target_feature)]
/// # #![feature(cfg_target_feature, target_feature, stdsimd)]
/// # #[macro_use]
/// # extern crate stdsimd;
/// # fn main() {
Expand Down Expand Up @@ -299,7 +299,7 @@ types! {
/// # Examples
///
/// ```
/// # #![feature(cfg_target_feature, target_feature)]
/// # #![feature(cfg_target_feature, target_feature, stdsimd)]
/// # #[macro_use]
/// # extern crate stdsimd;
/// # fn main() {
Expand Down
16 changes: 4 additions & 12 deletions crates/coresimd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
#![feature(const_fn, link_llvm_intrinsics, platform_intrinsics, repr_simd,
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)]
crate_in_paths, no_core, attr_literals, rustc_attrs, stdsimd,
staged_api)]
#![cfg_attr(test, feature(proc_macro, test, attr_literals, abi_vectorcall))]
#![cfg_attr(feature = "cargo-clippy",
allow(inline_always, too_many_arguments, cast_sign_loss,
Expand All @@ -24,6 +25,7 @@
many_single_char_names))]
#![cfg_attr(test, allow(unused_imports))]
#![no_core]
#![unstable(feature = "stdsimd", issue = "0")]

#[cfg_attr(not(test), macro_use)]
extern crate core as _core;
Expand All @@ -41,19 +43,9 @@ extern crate stdsimd;
#[path = "../../../coresimd/mod.rs"]
mod coresimd;

pub use coresimd::arch;
pub use coresimd::simd;

pub mod arch {
#[cfg(target_arch = "x86")]
pub mod x86 { pub use coresimd::vendor::*; }
#[cfg(target_arch = "x86_64")]
pub mod x86_64 { pub use coresimd::vendor::*; }
#[cfg(target_arch = "arm")]
pub mod arm { pub use coresimd::vendor::*; }
#[cfg(target_arch = "aarch64")]
pub mod aarch64 { pub use coresimd::vendor::*; }
}

#[allow(unused_imports)]
use _core::clone;
#[allow(unused_imports)]
Expand Down
2 changes: 1 addition & 1 deletion crates/coresimd/tests/cpu-detection.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(cfg_target_feature)]
#![feature(cfg_target_feature, stdsimd)]
#![cfg_attr(feature = "strict", deny(warnings))]
#![cfg_attr(feature = "cargo-clippy",
allow(option_unwrap_used, print_stdout, use_debug))]
Expand Down
5 changes: 3 additions & 2 deletions crates/stdsimd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
//! # Example
//!
//! ```rust
//! #![feature(cfg_target_feature, target_feature)]
//! #![feature(cfg_target_feature, target_feature, stdsimd)]
//!
//! #[macro_use]
//! extern crate stdsimd;
Expand Down Expand Up @@ -132,9 +132,10 @@
//! [simd_soundness_bug]: https://github.com/rust-lang/rust/issues/44367
//! [target_feature_impr]: https://github.com/rust-lang/rust/issues/44839

#![feature(const_fn, integer_atomics)]
#![feature(const_fn, integer_atomics, staged_api, stdsimd)]
#![cfg_attr(target_os = "linux", feature(linkage))]
#![no_std]
#![unstable(feature = "stdsimd", issue = "0")]

extern crate std as _std;
extern crate coresimd;
Expand Down
2 changes: 1 addition & 1 deletion crates/stdsimd/tests/cpu-detection.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(cfg_target_feature)]
#![feature(cfg_target_feature, stdsimd)]
#![cfg_attr(feature = "strict", deny(warnings))]
#![cfg_attr(feature = "cargo-clippy",
allow(option_unwrap_used, use_debug, print_stdout))]
Expand Down
1 change: 1 addition & 0 deletions stdsimd/arch/detect/aarch64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use super::cache;
use super::linux;

#[macro_export]
#[unstable(feature = "stdsimd", issue = "0")]
macro_rules! is_target_feature_detected {
("neon") => {
// FIXME: this should be removed once we rename Aarch64 neon to asimd
Expand Down
1 change: 1 addition & 0 deletions stdsimd/arch/detect/arm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use super::cache;
use super::linux;

#[macro_export]
#[unstable(feature = "stdsimd", issue = "0")]
macro_rules! is_target_feature_detected {
("neon") => {
$crate::arch::detect::check_for($crate::arch::detect::Feature::neon)
Expand Down
1 change: 1 addition & 0 deletions stdsimd/arch/detect/powerpc64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use super::cache;
use super::linux;

#[macro_export]
#[unstable(feature = "stdsimd", issue = "0")]
macro_rules! is_target_feature_detected {
("altivec") => {
$crate::arch::detect::check_for($crate::arch::detect::Feature::altivec)
Expand Down
1 change: 1 addition & 0 deletions stdsimd/arch/detect/x86.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ use coresimd::arch::x86_64::*;
use super::{bit, cache};

#[macro_export]
#[unstable(feature = "stdsimd", issue = "0")]
macro_rules! is_target_feature_detected {
("aes") => {
$crate::arch::detect::check_for(
Expand Down
2 changes: 2 additions & 0 deletions stdsimd/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#[unstable(feature = "stdsimd", issue = "0")]
pub mod arch {
pub use coresimd::arch::*;
pub mod detect;
}

#[unstable(feature = "stdsimd", issue = "0")]
pub use coresimd::simd;