Skip to content
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

avoid deprecated mem::zeroed #628

Merged
merged 1 commit into from
Dec 28, 2018
Merged
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
8 changes: 5 additions & 3 deletions coresimd/x86/avx512f.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use coresimd::simd::*;
use coresimd::simd_llvm::*;
use coresimd::x86::*;
use mem;
use mem::{self, MaybeUninit};

#[cfg(test)]
use stdsimd_test::assert_instr;
Expand All @@ -14,7 +14,8 @@ use stdsimd_test::assert_instr;
#[cfg_attr(test, assert_instr(vpabsd))]
pub unsafe fn _mm512_abs_epi32(a: __m512i) -> __m512i {
let a = a.as_i32x16();
let zero: i32x16 = mem::zeroed();
// all-0 is a properly initialized i32x16
let zero: i32x16 = MaybeUninit::zeroed().into_inner();
let sub = simd_sub(zero, a);
let cmp: i32x16 = simd_gt(a, zero);
mem::transmute(simd_select(cmp, a, sub))
Expand Down Expand Up @@ -54,7 +55,8 @@ pub unsafe fn _mm512_maskz_abs_epi32(k: __mmask16, a: __m512i) -> __m512i {
#[target_feature(enable = "avx512f")]
#[cfg_attr(test, assert_instr(vxorps))]
pub unsafe fn _mm512_setzero_si512() -> __m512i {
mem::zeroed()
// All-0 is a properly initialized __m512i
MaybeUninit::zeroed().into_inner()
}

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