From 2297b70956d994259ab7578b7f5fe00d5bee711c Mon Sep 17 00:00:00 2001 From: Brian Armstrong Date: Sat, 27 Oct 2018 12:34:48 -0700 Subject: [PATCH 1/2] allow unaligned reads with _mm_loadl_epi64 --- coresimd/x86/sse2.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coresimd/x86/sse2.rs b/coresimd/x86/sse2.rs index 3a141aaaf9..9ee708503d 100644 --- a/coresimd/x86/sse2.rs +++ b/coresimd/x86/sse2.rs @@ -1145,7 +1145,7 @@ pub unsafe fn _mm_setzero_si128() -> __m128i { )] #[stable(feature = "simd_x86", since = "1.27.0")] pub unsafe fn _mm_loadl_epi64(mem_addr: *const __m128i) -> __m128i { - _mm_set_epi64x(0, simd_extract((*mem_addr).as_i64x2(), 0)) + _mm_set_epi64x(0, simd_extract(ptr::read_unaligned::<__m128i >(mem_addr).as_i64x2(), 0)) } /// Load 128-bits of integer data from memory into a new vector. From f6ae5219ed7652fe0cc47222f5a28b0c04c815d8 Mon Sep 17 00:00:00 2001 From: Brian Armstrong Date: Sat, 27 Oct 2018 12:51:37 -0700 Subject: [PATCH 2/2] no type annotation --- coresimd/x86/sse2.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coresimd/x86/sse2.rs b/coresimd/x86/sse2.rs index 9ee708503d..740e7d064b 100644 --- a/coresimd/x86/sse2.rs +++ b/coresimd/x86/sse2.rs @@ -1145,7 +1145,7 @@ pub unsafe fn _mm_setzero_si128() -> __m128i { )] #[stable(feature = "simd_x86", since = "1.27.0")] pub unsafe fn _mm_loadl_epi64(mem_addr: *const __m128i) -> __m128i { - _mm_set_epi64x(0, simd_extract(ptr::read_unaligned::<__m128i >(mem_addr).as_i64x2(), 0)) + _mm_set_epi64x(0, simd_extract(ptr::read_unaligned(mem_addr).as_i64x2(), 0)) } /// Load 128-bits of integer data from memory into a new vector.