Skip to content

Commit ee6e4c8

Browse files
RalfJunggnzlbg
authored andcommitted
avoid deprecated mem::zeroed
1 parent 18ea4e0 commit ee6e4c8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

coresimd/x86/avx512f.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use coresimd::simd::*;
22
use coresimd::simd_llvm::*;
33
use coresimd::x86::*;
4-
use mem;
4+
use mem::{self, MaybeUninit};
55

66
#[cfg(test)]
77
use stdsimd_test::assert_instr;
@@ -14,7 +14,8 @@ use stdsimd_test::assert_instr;
1414
#[cfg_attr(test, assert_instr(vpabsd))]
1515
pub unsafe fn _mm512_abs_epi32(a: __m512i) -> __m512i {
1616
let a = a.as_i32x16();
17-
let zero: i32x16 = mem::zeroed();
17+
// all-0 is a properly initialized i32x16
18+
let zero: i32x16 = MaybeUninit::zeroed().into_inner();
1819
let sub = simd_sub(zero, a);
1920
let cmp: i32x16 = simd_gt(a, zero);
2021
mem::transmute(simd_select(cmp, a, sub))
@@ -54,7 +55,8 @@ pub unsafe fn _mm512_maskz_abs_epi32(k: __mmask16, a: __m512i) -> __m512i {
5455
#[target_feature(enable = "avx512f")]
5556
#[cfg_attr(test, assert_instr(vxorps))]
5657
pub unsafe fn _mm512_setzero_si512() -> __m512i {
57-
mem::zeroed()
58+
// All-0 is a properly initialized __m512i
59+
MaybeUninit::zeroed().into_inner()
5860
}
5961

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

0 commit comments

Comments
 (0)