Skip to content

Commit 174144a

Browse files
cleanup simd constant transmute => new
1 parent 0d55265 commit 174144a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/collect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ impl<I: ChunkIt<u32x8>> CollectAndDedup for PaddedIt<I> {
151151
let len = it.len();
152152
let lane_offsets: [u32x8; 8] = from_fn(|i| u32x8::splat((i * len) as u32));
153153
let offsets: [u32; 8] = from_fn(|i| i as u32);
154-
let mut offsets: u32x8 = unsafe { transmute(offsets) };
154+
let mut offsets: u32x8 = S::new(offsets);
155155

156156
let mut mask = u32x8::ZERO;
157157
let mut padding_i = 0;

src/intrinsics/dedup.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ use core::mem::transmute;
44
use packed_seq::L;
55

66
#[cfg(target_feature = "neon")]
7-
const OFFSET: S = unsafe { std::mem::transmute([0x03_02_01_00; 8]) };
7+
const OFFSET: S = S::new([0x03_02_01_00; 8]);
88
#[cfg(target_feature = "neon")]
9-
const MASK: S = unsafe { std::mem::transmute([0x04_04_04_04; 8]) };
9+
const MASK: S = S::new([0x04_04_04_04; 8]);
1010

1111
/// Dedup adjacent `new` values (starting with the last element of `old`).
1212
/// If an element is different from the preceding element, append the corresponding element of `vals` to `v[write_idx]`.

src/minimizers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use seq_hash::KmerHasher;
1616
use wide::u32x8;
1717

1818
pub const SKIPPED: u32 = u32::MAX - 1;
19-
pub(crate) const SIMD_SKIPPED: u32x8 = unsafe { std::mem::transmute([SKIPPED; 8]) };
19+
pub(crate) const SIMD_SKIPPED: u32x8 = u32x8::new([SKIPPED; 8]);
2020

2121
/// Minimizer position of a single window.
2222
pub fn one_minimizer<'s>(seq: impl Seq<'s>, hasher: &impl KmerHasher) -> usize {

0 commit comments

Comments
 (0)