Debian Codegraph @

src/simd/x86_sse2.rs

raw symbols SCIP
1 #[cfg(target_arch = "x86")]
2 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::archrust-analyzer cargo std https://github.com/rust-lang/rust/library/std arch/::x86::{
3 __m128i,
4 _mm_and_si128,
5 _mm_cmpeq_epi8,
6 _mm_cvtsi128_si32,
7 _mm_loadu_si128,
8 _mm_sad_epu8,
9 _mm_set1_epi8,
10 _mm_setzero_si128,
11 _mm_shuffle_epi32,
12 _mm_sub_epi8,
13 _mm_xor_si128,
14 };
15
16 #[cfg(target_arch = "x86_64")]
17 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::archrust-analyzer cargo std https://github.com/rust-lang/rust/library/std arch/::x86_64rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/arch/x86_64/::{
18 __m128irust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128i#,
19 _mm_and_si128rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_and_si128().,
20 _mm_cmpeq_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_cmpeq_epi8().,
21 _mm_cvtsi128_si32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_cvtsi128_si32().,
22 _mm_loadu_si128rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_loadu_si128().,
23 _mm_sad_epu8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_sad_epu8().,
24 _mm_set1_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_set1_epi8().,
25 _mm_setzero_si128rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_setzero_si128().,
26 _mm_shuffle_epi32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_shuffle_epi32().,
27 _mm_sub_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_sub_epi8().,
28 _mm_xor_si128rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_xor_si128().,
29 };
30
31 #[target_feature(enable = "sse2")]
32 pub unsafe fn _mm_set1_epu8rust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/_mm_set1_epu8().(a: u8) -> __m128irust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128i# {
33 _mm_set1_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_set1_epi8().(a as i8)
34 }
35
36 #[target_feature(enable = "sse2")]
37 pub unsafe fn mm_cmpneq_epi8rust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/mm_cmpneq_epi8().(a: __m128irust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128i#, b: __m128irust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128i#) -> __m128irust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128i# {
38 _mm_xor_si128rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_xor_si128().(_mm_cmpeq_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_cmpeq_epi8().(a, b), _mm_set1_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_set1_epi8().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][Neg]neg().1))
39 }
40
41 const MASKrust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/MASK.: [u8; 32] = [
42 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
43 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
44 ];
45
46 #[target_feature(enable = "sse2")]
47 unsafe fn mm_from_offsetrust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/mm_from_offset().(slice: &[u8], offset: usize) -> __m128irust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128i# {
48 _mm_loadu_si128rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_loadu_si128().(slice.as_ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]as_ptr().().offsetrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/const_ptr/impl#[`*const T`]offset().(offset as isize) as *const _)
49 }
50
51 #[target_feature(enable = "sse2")]
52 unsafe fn sumrust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/sum().(u8s: &__m128irust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128i#) -> usize {
53 let sums = _mm_sad_epu8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_sad_epu8().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().u8s, _mm_setzero_si128rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_setzero_si128().());
54 (_mm_cvtsi128_si32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_cvtsi128_si32().(sums) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Add<Self>`]add()._mm_cvtsi128_si32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_cvtsi128_si32().(_mm_shuffle_epi32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_shuffle_epi32().(sums, 0xaa))) as usize
55 }
56
57 #[target_feature(enable = "sse2")]
58 pub unsafe fn chunk_countrust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/chunk_count().(haystack: &[u8], needle: u8) -> usize {
59 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(haystack.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() >= 16);
60
61 let mut offset = 0;
62 let mut count = 0;
63
64 let needles = _mm_set1_epu8rust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/_mm_set1_epu8().(needle);
65
66 // 4080
67 while haystack.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().offset rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().16 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().255 {
68 let mut counts = _mm_setzero_si128rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_setzero_si128().();
69 for _ in 0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#255 {
70 counts = _mm_sub_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_sub_epi8().(
71 counts,
72 _mm_cmpeq_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_cmpeq_epi8().(mm_from_offsetrust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/mm_from_offset().(haystack, offset), needles)
73 );
74 offset rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().16;
75 }
76 count rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().sumrust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/sum().(&counts);
77 }
78
79 // 2048
80 if haystack.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().offset rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().16 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().128 {
81 let mut counts = _mm_setzero_si128rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_setzero_si128().();
82 for _ in 0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#128 {
83 counts = _mm_sub_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_sub_epi8().(
84 counts,
85 _mm_cmpeq_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_cmpeq_epi8().(mm_from_offsetrust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/mm_from_offset().(haystack, offset), needles)
86 );
87 offset rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().16;
88 }
89 count rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().sumrust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/sum().(&counts);
90 }
91
92 // 16
93 let mut counts = _mm_setzero_si128rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_setzero_si128().();
94 for i in 0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#(haystack.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().offset) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Div<Self>`]div().16 {
95 counts = _mm_sub_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_sub_epi8().(
96 counts,
97 _mm_cmpeq_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_cmpeq_epi8().(mm_from_offsetrust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/mm_from_offset().(haystack, offset rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().16), needles)
98 );
99 }
100 if haystack.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Rem<Self>`]rem().%rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Rem<Self>`]rem(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Rem<Self>`]rem().16 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().0 {
101 counts = _mm_sub_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_sub_epi8().(
102 counts,
103 _mm_and_si128rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_and_si128().(
104 _mm_cmpeq_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_cmpeq_epi8().(mm_from_offsetrust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/mm_from_offset().(haystack, haystack.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().16), needles),
105 mm_from_offsetrust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/mm_from_offset().(&MASKrust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/MASK., haystack.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Rem<Self>`]rem().%rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Rem<Self>`]rem(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Rem<Self>`]rem().16)
106 )
107 );
108 }
109 count rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().sumrust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/sum().(&counts);
110
111 count
112 }
113
114 #[target_feature(enable = "sse2")]
115 unsafe fn is_leading_utf8_byterust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/is_leading_utf8_byte().(u8s: __m128irust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128i#) -> __m128irust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m128i# {
116 mm_cmpneq_epi8rust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/mm_cmpneq_epi8().(_mm_and_si128rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_and_si128().(u8s, _mm_set1_epu8rust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/_mm_set1_epu8().(0b1100_0000)), _mm_set1_epu8rust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/_mm_set1_epu8().(0b1000_0000))
117 }
118
119 #[target_feature(enable = "sse2")]
120 pub unsafe fn chunk_num_charsrust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/chunk_num_chars().(utf8_chars: &[u8]) -> usize {
121 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(utf8_chars.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() >= 16);
122
123 let mut offset = 0;
124 let mut count = 0;
125
126 // 4080
127 while utf8_chars.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().offset rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().16 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().255 {
128 let mut counts = _mm_setzero_si128rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_setzero_si128().();
129
130 for _ in 0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#255 {
131 counts = _mm_sub_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_sub_epi8().(
132 counts,
133 is_leading_utf8_byterust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/is_leading_utf8_byte().(mm_from_offsetrust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/mm_from_offset().(utf8_chars, offset))
134 );
135 offset rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().16;
136 }
137 count rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().sumrust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/sum().(&counts);
138 }
139
140 // 2048
141 if utf8_chars.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().offset rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().16 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().128 {
142 let mut counts = _mm_setzero_si128rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_setzero_si128().();
143 for _ in 0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#128 {
144 counts = _mm_sub_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_sub_epi8().(
145 counts,
146 is_leading_utf8_byterust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/is_leading_utf8_byte().(mm_from_offsetrust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/mm_from_offset().(utf8_chars, offset))
147 );
148 offset rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().16;
149 }
150 count rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().sumrust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/sum().(&counts);
151 }
152
153 // 16
154 let mut counts = _mm_setzero_si128rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_setzero_si128().();
155 for i in 0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#(utf8_chars.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().offset) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Div<Self>`]div().16 {
156 counts = _mm_sub_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_sub_epi8().(
157 counts,
158 is_leading_utf8_byterust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/is_leading_utf8_byte().(mm_from_offsetrust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/mm_from_offset().(utf8_chars, offset rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().16))
159 );
160 }
161 if utf8_chars.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Rem<Self>`]rem().%rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Rem<Self>`]rem(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Rem<Self>`]rem().16 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().0 {
162 counts = _mm_sub_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_sub_epi8().(
163 counts,
164 _mm_and_si128rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_and_si128().(
165 is_leading_utf8_byterust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/is_leading_utf8_byte().(mm_from_offsetrust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/mm_from_offset().(utf8_chars, utf8_chars.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().16)),
166 mm_from_offsetrust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/mm_from_offset().(&MASKrust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/MASK., utf8_chars.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Rem<Self>`]rem().%rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Rem<Self>`]rem(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Rem<Self>`]rem().16)
167 )
168 );
169 }
170 count rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().sumrust-analyzer cargo bytecount 0.6.9 simd/x86_sse2/sum().(&counts);
171
172 count
173 }