aboutsummaryrefslogtreecommitdiff
path: root/src/raw/sse2.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/raw/sse2.rs')
-rw-r--r--src/raw/sse2.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/raw/sse2.rs b/src/raw/sse2.rs
index a27bc09..eed9684 100644
--- a/src/raw/sse2.rs
+++ b/src/raw/sse2.rs
@@ -28,12 +28,13 @@ impl Group {
/// value for an empty hash table.
///
/// This is guaranteed to be aligned to the group size.
+ #[allow(clippy::items_after_statements)]
pub const fn static_empty() -> &'static [u8; Group::WIDTH] {
#[repr(C)]
struct AlignedBytes {
_align: [Group; 0],
bytes: [u8; Group::WIDTH],
- };
+ }
const ALIGNED_BYTES: AlignedBytes = AlignedBytes {
_align: [],
bytes: [EMPTY; Group::WIDTH],
@@ -45,7 +46,7 @@ impl Group {
#[inline]
#[allow(clippy::cast_ptr_alignment)] // unaligned load
pub unsafe fn load(ptr: *const u8) -> Self {
- Group(x86::_mm_loadu_si128(ptr as *const _))
+ Group(x86::_mm_loadu_si128(ptr.cast()))
}
/// Loads a group of bytes starting at the given address, which must be
@@ -55,7 +56,7 @@ impl Group {
pub unsafe fn load_aligned(ptr: *const u8) -> Self {
// FIXME: use align_offset once it stabilizes
debug_assert_eq!(ptr as usize & (mem::align_of::<Self>() - 1), 0);
- Group(x86::_mm_load_si128(ptr as *const _))
+ Group(x86::_mm_load_si128(ptr.cast()))
}
/// Stores the group of bytes to the given address, which must be
@@ -65,7 +66,7 @@ impl Group {
pub unsafe fn store_aligned(self, ptr: *mut u8) {
// FIXME: use align_offset once it stabilizes
debug_assert_eq!(ptr as usize & (mem::align_of::<Self>() - 1), 0);
- x86::_mm_store_si128(ptr as *mut _, self.0);
+ x86::_mm_store_si128(ptr.cast(), self.0);
}
/// Returns a `BitMask` indicating all bytes in the group which have