Skip to content

Commit

Permalink
Simplify _mm_loadu_si64
Browse files Browse the repository at this point in the history
As suggested by @Amanieu
  • Loading branch information
pickfire committed Jul 11, 2020
1 parent 0490bcc commit a271ade
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions crates/core_arch/src/x86/sse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1259,15 +1259,10 @@ pub unsafe fn _mm_loadr_ps(p: *const f32) -> __m128 {
#[inline]
#[target_feature(enable = "sse")]
#[cfg_attr(test, assert_instr(movups))]
#[stable(feature = "simd_x86", since = "1.46.0")]
#[stable(feature = "simd_x86_mm_loadu_si64", since = "1.46.0")]
pub unsafe fn _mm_loadu_si64(mem_addr: *const u8) -> __m128i {
let mut dst = _mm_setzero_si128();
ptr::copy_nonoverlapping(
mem_addr,
&mut dst as *mut __m128i as *mut u8,
8, // == 64 bits == mem::size_of::<__m128i>() / 2
);
dst
let val = ptr::read_unaligned(mem_addr as *const i64);
_mm_set_epi64x(val, 0)
}

/// Stores the upper half of `a` (64 bits) into memory.
Expand Down

0 comments on commit a271ade

Please sign in to comment.