Skip to content

Commit 4038d91

Browse files
committed
Stabilize x86/x86_64 intrinsics
This commit stabilizes all intrinsics in the `x86` and `x86_64` modules, namely allowing stabilization of the `arch::x86` and `arch::x86_64` module in libstd. Stabilizations here were applied in an automated fashion using [this script][scr], and notably everything related to `__m64` was omitted from this round of stabilization [scr]: https://gist.github.com/alexcrichton/5b456d495d6fe1df46a158754565c7a5
1 parent cd5b544 commit 4038d91

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2904
-11
lines changed

coresimd/arm/mod.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ pub use self::v7::*;
2020
// NEON is supported on AArch64, and on ARM when built with the v7 and neon
2121
// features. Building ARM without neon produces incorrect codegen.
2222
#[cfg(any(target_arch = "aarch64",
23-
all(target_feature = "v7", target_feature = "neon")))]
23+
all(target_feature = "v7", target_feature = "neon"),
24+
dox))]
2425
mod neon;
2526
#[cfg(any(target_arch = "aarch64",
26-
all(target_feature = "v7", target_feature = "neon")))]
27+
all(target_feature = "v7", target_feature = "neon"),
28+
dox))]
2729
pub use self::neon::*;

coresimd/mod.rs

+11-1
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,16 @@ pub mod simd {
4141
/// [`aarch64`]: https://rust-lang-nursery.github.io/stdsimd/aarch64/stdsimd/arch/index.html
4242
/// [`mips`]: https://rust-lang-nursery.github.io/stdsimd/mips/stdsimd/arch/index.html
4343
/// [`mips64`]: https://rust-lang-nursery.github.io/stdsimd/mips64/stdsimd/arch/index.html
44-
#[unstable(feature = "stdsimd", issue = "0")]
44+
#[stable(feature = "simd_arch", since = "1.27.0")]
4545
pub mod arch {
4646
/// Platform-specific intrinsics for the `x86` platform.
4747
///
4848
/// See the [module documentation](../index.html) for more details.
4949
#[cfg(any(target_arch = "x86", dox))]
5050
#[doc(cfg(target_arch = "x86"))]
51+
#[stable(feature = "simd_x86", since = "1.27.0")]
5152
pub mod x86 {
53+
#[stable(feature = "simd_x86", since = "1.27.0")]
5254
pub use coresimd::x86::*;
5355
}
5456

@@ -57,8 +59,11 @@ pub mod arch {
5759
/// See the [module documentation](../index.html) for more details.
5860
#[cfg(any(target_arch = "x86_64", dox))]
5961
#[doc(cfg(target_arch = "x86_64"))]
62+
#[stable(feature = "simd_x86", since = "1.27.0")]
6063
pub mod x86_64 {
64+
#[stable(feature = "simd_x86", since = "1.27.0")]
6165
pub use coresimd::x86::*;
66+
#[stable(feature = "simd_x86", since = "1.27.0")]
6267
pub use coresimd::x86_64::*;
6368
}
6469

@@ -67,6 +72,7 @@ pub mod arch {
6772
/// See the [module documentation](../index.html) for more details.
6873
#[cfg(any(target_arch = "arm", dox))]
6974
#[doc(cfg(target_arch = "arm"))]
75+
#[unstable(feature = "stdsimd", issue = "0")]
7076
pub mod arm {
7177
pub use coresimd::arm::*;
7278
}
@@ -76,6 +82,7 @@ pub mod arch {
7682
/// See the [module documentation](../index.html) for more details.
7783
#[cfg(any(target_arch = "aarch64", dox))]
7884
#[doc(cfg(target_arch = "aarch64"))]
85+
#[unstable(feature = "stdsimd", issue = "0")]
7986
pub mod aarch64 {
8087
pub use coresimd::aarch64::*;
8188
pub use coresimd::arm::*;
@@ -85,6 +92,7 @@ pub mod arch {
8592
///
8693
/// See the [module documentation](../index.html) for more details.
8794
#[cfg(target_arch = "wasm32")]
95+
#[unstable(feature = "stdsimd", issue = "0")]
8896
pub mod wasm32 {
8997
pub use coresimd::wasm32::*;
9098
}
@@ -94,6 +102,7 @@ pub mod arch {
94102
/// See the [module documentation](../index.html) for more details.
95103
#[cfg(any(target_arch = "mips", dox))]
96104
#[doc(cfg(target_arch = "mips"))]
105+
#[unstable(feature = "stdsimd", issue = "0")]
97106
pub mod mips {
98107
pub use coresimd::mips::*;
99108
}
@@ -103,6 +112,7 @@ pub mod arch {
103112
/// See the [module documentation](../index.html) for more details.
104113
#[cfg(any(target_arch = "mips64", dox))]
105114
#[doc(cfg(target_arch = "mips64"))]
115+
#[unstable(feature = "stdsimd", issue = "0")]
106116
pub mod mips64 {
107117
pub use coresimd::mips::*;
108118
}

coresimd/x86/abm.rs

+6
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,23 @@ use stdsimd_test::assert_instr;
2323
/// Counts the leading most significant zero bits.
2424
///
2525
/// When the operand is zero, it returns its size in bits.
26+
///
27+
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_lzcnt_u32)
2628
#[inline]
2729
#[target_feature(enable = "lzcnt")]
2830
#[cfg_attr(test, assert_instr(lzcnt))]
31+
#[stable(feature = "simd_x86", since = "1.27.0")]
2932
pub unsafe fn _lzcnt_u32(x: u32) -> u32 {
3033
x.leading_zeros()
3134
}
3235

3336
/// Counts the bits that are set.
37+
///
38+
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_popcnt32)
3439
#[inline]
3540
#[target_feature(enable = "popcnt")]
3641
#[cfg_attr(test, assert_instr(popcnt))]
42+
#[stable(feature = "simd_x86", since = "1.27.0")]
3743
pub unsafe fn _popcnt32(x: i32) -> i32 {
3844
x.count_ones() as i32
3945
}

coresimd/x86/aes.rs

+18
Original file line numberDiff line numberDiff line change
@@ -29,41 +29,56 @@ extern "C" {
2929
}
3030

3131
/// Perform one round of an AES decryption flow on data (state) in `a`.
32+
///
33+
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_aesdec_si128)
3234
#[inline]
3335
#[target_feature(enable = "aes")]
3436
#[cfg_attr(test, assert_instr(aesdec))]
37+
#[stable(feature = "simd_x86", since = "1.27.0")]
3538
pub unsafe fn _mm_aesdec_si128(a: __m128i, round_key: __m128i) -> __m128i {
3639
aesdec(a, round_key)
3740
}
3841

3942
/// Perform the last round of an AES decryption flow on data (state) in `a`.
43+
///
44+
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_aesdeclast_si128)
4045
#[inline]
4146
#[target_feature(enable = "aes")]
4247
#[cfg_attr(test, assert_instr(aesdeclast))]
48+
#[stable(feature = "simd_x86", since = "1.27.0")]
4349
pub unsafe fn _mm_aesdeclast_si128(a: __m128i, round_key: __m128i) -> __m128i {
4450
aesdeclast(a, round_key)
4551
}
4652

4753
/// Perform one round of an AES encryption flow on data (state) in `a`.
54+
///
55+
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_aesenc_si128)
4856
#[inline]
4957
#[target_feature(enable = "aes")]
5058
#[cfg_attr(test, assert_instr(aesenc))]
59+
#[stable(feature = "simd_x86", since = "1.27.0")]
5160
pub unsafe fn _mm_aesenc_si128(a: __m128i, round_key: __m128i) -> __m128i {
5261
aesenc(a, round_key)
5362
}
5463

5564
/// Perform the last round of an AES encryption flow on data (state) in `a`.
65+
///
66+
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_aesenclast_si128)
5667
#[inline]
5768
#[target_feature(enable = "aes")]
5869
#[cfg_attr(test, assert_instr(aesenclast))]
70+
#[stable(feature = "simd_x86", since = "1.27.0")]
5971
pub unsafe fn _mm_aesenclast_si128(a: __m128i, round_key: __m128i) -> __m128i {
6072
aesenclast(a, round_key)
6173
}
6274

6375
/// Perform the `InvMixColumns` transformation on `a`.
76+
///
77+
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_aesimc_si128)
6478
#[inline]
6579
#[target_feature(enable = "aes")]
6680
#[cfg_attr(test, assert_instr(aesimc))]
81+
#[stable(feature = "simd_x86", since = "1.27.0")]
6782
pub unsafe fn _mm_aesimc_si128(a: __m128i) -> __m128i {
6883
aesimc(a)
6984
}
@@ -73,10 +88,13 @@ pub unsafe fn _mm_aesimc_si128(a: __m128i) -> __m128i {
7388
/// Assist in expanding the AES cipher key by computing steps towards
7489
/// generating a round key for encryption cipher using data from `a` and an
7590
/// 8-bit round constant `imm8`.
91+
///
92+
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_aeskeygenassist_si128)
7693
#[inline]
7794
#[target_feature(enable = "aes")]
7895
#[cfg_attr(test, assert_instr(aeskeygenassist, imm8 = 0))]
7996
#[rustc_args_required_const(1)]
97+
#[stable(feature = "simd_x86", since = "1.27.0")]
8098
pub unsafe fn _mm_aeskeygenassist_si128(a: __m128i, imm8: i32) -> __m128i {
8199
macro_rules! call {
82100
($imm8:expr) => {

0 commit comments

Comments
 (0)