summaryrefslogtreecommitdiffstats
path: root/vendor/bytecount/src/simd/x86_sse2.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
commitef24de24a82fe681581cc130f342363c47c0969a (patch)
tree0d494f7e1a38b95c92426f58fe6eaa877303a86c /vendor/bytecount/src/simd/x86_sse2.rs
parentReleasing progress-linux version 1.74.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-ef24de24a82fe681581cc130f342363c47c0969a.tar.xz
rustc-ef24de24a82fe681581cc130f342363c47c0969a.zip
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/bytecount/src/simd/x86_sse2.rs')
-rw-r--r--vendor/bytecount/src/simd/x86_sse2.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/vendor/bytecount/src/simd/x86_sse2.rs b/vendor/bytecount/src/simd/x86_sse2.rs
index 63d295eae..59c7d8d1e 100644
--- a/vendor/bytecount/src/simd/x86_sse2.rs
+++ b/vendor/bytecount/src/simd/x86_sse2.rs
@@ -3,11 +3,12 @@ use std::arch::x86::{
__m128i,
_mm_and_si128,
_mm_cmpeq_epi8,
- _mm_extract_epi32,
+ _mm_cvtsi128_si32,
_mm_loadu_si128,
_mm_sad_epu8,
_mm_set1_epi8,
_mm_setzero_si128,
+ _mm_shuffle_epi32,
_mm_sub_epi8,
_mm_xor_si128,
};
@@ -17,11 +18,12 @@ use std::arch::x86_64::{
__m128i,
_mm_and_si128,
_mm_cmpeq_epi8,
- _mm_extract_epi32,
+ _mm_cvtsi128_si32,
_mm_loadu_si128,
_mm_sad_epu8,
_mm_set1_epi8,
_mm_setzero_si128,
+ _mm_shuffle_epi32,
_mm_sub_epi8,
_mm_xor_si128,
};
@@ -49,7 +51,7 @@ unsafe fn mm_from_offset(slice: &[u8], offset: usize) -> __m128i {
#[target_feature(enable = "sse2")]
unsafe fn sum(u8s: &__m128i) -> usize {
let sums = _mm_sad_epu8(*u8s, _mm_setzero_si128());
- (_mm_extract_epi32(sums, 0) + _mm_extract_epi32(sums, 2)) as usize
+ (_mm_cvtsi128_si32(sums) + _mm_cvtsi128_si32(_mm_shuffle_epi32(sums, 0xaa))) as usize
}
#[target_feature(enable = "sse2")]