Skip to content

Commit c546604

Browse files
RalfJungalexcrichton
authored andcommitted
MaybeUninit: update to into_initialized (#679)
* MaybeUninit: update to into_initialized * fix unused import
1 parent a9bcbf4 commit c546604

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

crates/core_arch/src/x86/avx.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2959,7 +2959,7 @@ pub unsafe fn _mm256_zextpd128_pd256(a: __m128d) -> __m256d {
29592959
#[stable(feature = "simd_x86", since = "1.27.0")]
29602960
pub unsafe fn _mm256_undefined_ps() -> __m256 {
29612961
// FIXME: this function should return MaybeUninit<__m256>
2962-
mem::MaybeUninit::<__m256>::uninitialized().into_inner()
2962+
mem::MaybeUninit::<__m256>::uninitialized().into_initialized()
29632963
}
29642964

29652965
/// Return vector of type `__m256d` with undefined elements.
@@ -2971,7 +2971,7 @@ pub unsafe fn _mm256_undefined_ps() -> __m256 {
29712971
#[stable(feature = "simd_x86", since = "1.27.0")]
29722972
pub unsafe fn _mm256_undefined_pd() -> __m256d {
29732973
// FIXME: this function should return MaybeUninit<__m256d>
2974-
mem::MaybeUninit::<__m256d>::uninitialized().into_inner()
2974+
mem::MaybeUninit::<__m256d>::uninitialized().into_initialized()
29752975
}
29762976

29772977
/// Return vector of type __m256i with undefined elements.
@@ -2983,7 +2983,7 @@ pub unsafe fn _mm256_undefined_pd() -> __m256d {
29832983
#[stable(feature = "simd_x86", since = "1.27.0")]
29842984
pub unsafe fn _mm256_undefined_si256() -> __m256i {
29852985
// FIXME: this function should return MaybeUninit<__m256i>
2986-
mem::MaybeUninit::<__m256i>::uninitialized().into_inner()
2986+
mem::MaybeUninit::<__m256i>::uninitialized().into_initialized()
29872987
}
29882988

29892989
/// Set packed __m256 returned vector with the supplied values.

crates/core_arch/src/x86/avx512f.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use core_arch::simd::*;
22
use core_arch::simd_llvm::*;
33
use core_arch::x86::*;
4-
use mem::{self, MaybeUninit};
4+
use mem;
55

66
#[cfg(test)]
77
use stdsimd_test::assert_instr;
@@ -15,7 +15,7 @@ use stdsimd_test::assert_instr;
1515
pub unsafe fn _mm512_abs_epi32(a: __m512i) -> __m512i {
1616
let a = a.as_i32x16();
1717
// all-0 is a properly initialized i32x16
18-
let zero: i32x16 = MaybeUninit::zeroed().into_inner();
18+
let zero: i32x16 = mem::zeroed();
1919
let sub = simd_sub(zero, a);
2020
let cmp: i32x16 = simd_gt(a, zero);
2121
mem::transmute(simd_select(cmp, a, sub))
@@ -56,7 +56,7 @@ pub unsafe fn _mm512_maskz_abs_epi32(k: __mmask16, a: __m512i) -> __m512i {
5656
#[cfg_attr(test, assert_instr(vxorps))]
5757
pub unsafe fn _mm512_setzero_si512() -> __m512i {
5858
// All-0 is a properly initialized __m512i
59-
MaybeUninit::zeroed().into_inner()
59+
mem::zeroed()
6060
}
6161

6262
/// Set packed 32-bit integers in `dst` with the supplied values in reverse

crates/core_arch/src/x86/sse.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1886,7 +1886,7 @@ pub unsafe fn _mm_prefetch(p: *const i8, strategy: i32) {
18861886
#[stable(feature = "simd_x86", since = "1.27.0")]
18871887
pub unsafe fn _mm_undefined_ps() -> __m128 {
18881888
// FIXME: this function should return MaybeUninit<__m128>
1889-
mem::MaybeUninit::<__m128>::uninitialized().into_inner()
1889+
mem::MaybeUninit::<__m128>::uninitialized().into_initialized()
18901890
}
18911891

18921892
/// Transpose the 4x4 matrix formed by 4 rows of __m128 in place.

crates/core_arch/src/x86/sse2.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2856,7 +2856,7 @@ pub unsafe fn _mm_castsi128_ps(a: __m128i) -> __m128 {
28562856
#[stable(feature = "simd_x86", since = "1.27.0")]
28572857
pub unsafe fn _mm_undefined_pd() -> __m128d {
28582858
// FIXME: this function should return MaybeUninit<__m128d>
2859-
mem::MaybeUninit::<__m128d>::uninitialized().into_inner()
2859+
mem::MaybeUninit::<__m128d>::uninitialized().into_initialized()
28602860
}
28612861

28622862
/// Return vector of type __m128i with undefined elements.
@@ -2867,7 +2867,7 @@ pub unsafe fn _mm_undefined_pd() -> __m128d {
28672867
#[stable(feature = "simd_x86", since = "1.27.0")]
28682868
pub unsafe fn _mm_undefined_si128() -> __m128i {
28692869
// FIXME: this function should return MaybeUninit<__m128i>
2870-
mem::MaybeUninit::<__m128i>::uninitialized().into_inner()
2870+
mem::MaybeUninit::<__m128i>::uninitialized().into_initialized()
28712871
}
28722872

28732873
/// The resulting `__m128d` element is composed by the low-order values of

0 commit comments

Comments
 (0)