| 1 | 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/::{ |
| 2 | __m256irust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m256i#, _mm256_and_si256rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx2/_mm256_and_si256()., _mm256_cmpeq_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx2/_mm256_cmpeq_epi8()., _mm256_extract_epi64rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86_64/avx/_mm256_extract_epi64()., _mm256_loadu_si256rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx/_mm256_loadu_si256()., |
| 3 | _mm256_sad_epu8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx2/_mm256_sad_epu8()., _mm256_set1_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx/_mm256_set1_epi8()., _mm256_setzero_si256rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx/_mm256_setzero_si256()., _mm256_sub_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx2/_mm256_sub_epi8()., _mm256_xor_si256rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx2/_mm256_xor_si256()., |
| 4 | }; |
| 5 | |
| 6 | #[target_feature(enable = "avx2")] |
| 7 | pub unsafe fn _mm256_set1_epu8rust-analyzer cargo bytecount 0.6.9 simd/x86_avx2/_mm256_set1_epu8().(a: u8) -> __m256irust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m256i# { |
| 8 | _mm256_set1_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx/_mm256_set1_epi8().(a as i8) |
| 9 | } |
| 10 | |
| 11 | #[target_feature(enable = "avx2")] |
| 12 | pub unsafe fn mm256_cmpneq_epi8rust-analyzer cargo bytecount 0.6.9 simd/x86_avx2/mm256_cmpneq_epi8().(a: __m256irust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m256i#, b: __m256irust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m256i#) -> __m256irust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m256i# { |
| 13 | _mm256_xor_si256rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx2/_mm256_xor_si256().(_mm256_cmpeq_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx2/_mm256_cmpeq_epi8().(a, b), _mm256_set1_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx/_mm256_set1_epi8().(-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i8][Neg]neg().1)) |
| 14 | } |
| 15 | |
| 16 | const MASKrust-analyzer cargo bytecount 0.6.9 simd/x86_avx2/MASK.: [u8; 64] = [ |
| 17 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 18 | 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, |
| 19 | 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, |
| 20 | ]; |
| 21 | |
| 22 | #[target_feature(enable = "avx2")] |
| 23 | unsafe fn mm256_from_offsetrust-analyzer cargo bytecount 0.6.9 simd/x86_avx2/mm256_from_offset().(slice: &[u8], offset: usize) -> __m256irust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m256i# { |
| 24 | _mm256_loadu_si256rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx/_mm256_loadu_si256().(slice.as_ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]as_ptr().().addrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ptr/const_ptr/impl#[`*const T`]add().(offset) as *const _) |
| 25 | } |
| 26 | |
| 27 | #[target_feature(enable = "avx2")] |
| 28 | unsafe fn sumrust-analyzer cargo bytecount 0.6.9 simd/x86_avx2/sum().(u8s: &__m256irust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m256i#) -> usize { |
| 29 | let sums = _mm256_sad_epu8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx2/_mm256_sad_epu8().(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().u8s, _mm256_setzero_si256rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx/_mm256_setzero_si256().()); |
| 30 | (_mm256_extract_epi64rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86_64/avx/_mm256_extract_epi64().(sums, 0) |
| 31 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add()._mm256_extract_epi64rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86_64/avx/_mm256_extract_epi64().(sums, 1) |
| 32 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add()._mm256_extract_epi64rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86_64/avx/_mm256_extract_epi64().(sums, 2) |
| 33 | +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i64][`Add<Self>`]add()._mm256_extract_epi64rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86_64/avx/_mm256_extract_epi64().(sums, 3)) as usize |
| 34 | } |
| 35 | |
| 36 | #[target_feature(enable = "avx2")] |
| 37 | pub unsafe fn chunk_countrust-analyzer cargo bytecount 0.6.9 simd/x86_avx2/chunk_count().(haystack: &[u8], needle: u8) -> usize { |
| 38 | 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().() >= 32); |
| 39 | |
| 40 | let mut offset = 0; |
| 41 | let mut count = 0; |
| 42 | |
| 43 | let needles = _mm256_set1_epu8rust-analyzer cargo bytecount 0.6.9 simd/x86_avx2/_mm256_set1_epu8().(needle); |
| 44 | |
| 45 | // 8160 |
| 46 | 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().32 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 { |
| 47 | let mut counts = _mm256_setzero_si256rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx/_mm256_setzero_si256().(); |
| 48 | for _ in 0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#255 { |
| 49 | counts = _mm256_sub_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx2/_mm256_sub_epi8().( |
| 50 | counts, |
| 51 | _mm256_cmpeq_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx2/_mm256_cmpeq_epi8().(mm256_from_offsetrust-analyzer cargo bytecount 0.6.9 simd/x86_avx2/mm256_from_offset().(haystack, offset), needles), |
| 52 | ); |
| 53 | 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().32; |
| 54 | } |
| 55 | 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_avx2/sum().(&counts); |
| 56 | } |
| 57 | |
| 58 | // 4096 |
| 59 | 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().32 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 { |
| 60 | let mut counts = _mm256_setzero_si256rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx/_mm256_setzero_si256().(); |
| 61 | for _ in 0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#128 { |
| 62 | counts = _mm256_sub_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx2/_mm256_sub_epi8().( |
| 63 | counts, |
| 64 | _mm256_cmpeq_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx2/_mm256_cmpeq_epi8().(mm256_from_offsetrust-analyzer cargo bytecount 0.6.9 simd/x86_avx2/mm256_from_offset().(haystack, offset), needles), |
| 65 | ); |
| 66 | 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().32; |
| 67 | } |
| 68 | 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_avx2/sum().(&counts); |
| 69 | } |
| 70 | |
| 71 | // 32 |
| 72 | let mut counts = _mm256_setzero_si256rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx/_mm256_setzero_si256().(); |
| 73 | 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().32 { |
| 74 | counts = _mm256_sub_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx2/_mm256_sub_epi8().( |
| 75 | counts, |
| 76 | _mm256_cmpeq_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx2/_mm256_cmpeq_epi8().(mm256_from_offsetrust-analyzer cargo bytecount 0.6.9 simd/x86_avx2/mm256_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().32), needles), |
| 77 | ); |
| 78 | } |
| 79 | 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().32 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 { |
| 80 | counts = _mm256_sub_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx2/_mm256_sub_epi8().( |
| 81 | counts, |
| 82 | _mm256_and_si256rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx2/_mm256_and_si256().( |
| 83 | _mm256_cmpeq_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx2/_mm256_cmpeq_epi8().(mm256_from_offsetrust-analyzer cargo bytecount 0.6.9 simd/x86_avx2/mm256_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().32), needles), |
| 84 | mm256_from_offsetrust-analyzer cargo bytecount 0.6.9 simd/x86_avx2/mm256_from_offset().(&MASKrust-analyzer cargo bytecount 0.6.9 simd/x86_avx2/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().32), |
| 85 | ), |
| 86 | ); |
| 87 | } |
| 88 | 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_avx2/sum().(&counts); |
| 89 | |
| 90 | count |
| 91 | } |
| 92 | |
| 93 | #[target_feature(enable = "avx2")] |
| 94 | unsafe fn is_leading_utf8_byterust-analyzer cargo bytecount 0.6.9 simd/x86_avx2/is_leading_utf8_byte().(u8s: __m256irust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m256i#) -> __m256irust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/__m256i# { |
| 95 | mm256_cmpneq_epi8rust-analyzer cargo bytecount 0.6.9 simd/x86_avx2/mm256_cmpneq_epi8().( |
| 96 | _mm256_and_si256rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx2/_mm256_and_si256().(u8s, _mm256_set1_epu8rust-analyzer cargo bytecount 0.6.9 simd/x86_avx2/_mm256_set1_epu8().(0b1100_0000)), |
| 97 | _mm256_set1_epu8rust-analyzer cargo bytecount 0.6.9 simd/x86_avx2/_mm256_set1_epu8().(0b1000_0000), |
| 98 | ) |
| 99 | } |
| 100 | |
| 101 | #[target_feature(enable = "avx2")] |
| 102 | pub unsafe fn chunk_num_charsrust-analyzer cargo bytecount 0.6.9 simd/x86_avx2/chunk_num_chars().(utf8_chars: &[u8]) -> usize { |
| 103 | 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().() >= 32); |
| 104 | |
| 105 | let mut offset = 0; |
| 106 | let mut count = 0; |
| 107 | |
| 108 | // 8160 |
| 109 | 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().32 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 { |
| 110 | let mut counts = _mm256_setzero_si256rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx/_mm256_setzero_si256().(); |
| 111 | |
| 112 | for _ in 0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#255 { |
| 113 | counts = _mm256_sub_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx2/_mm256_sub_epi8().( |
| 114 | counts, |
| 115 | is_leading_utf8_byterust-analyzer cargo bytecount 0.6.9 simd/x86_avx2/is_leading_utf8_byte().(mm256_from_offsetrust-analyzer cargo bytecount 0.6.9 simd/x86_avx2/mm256_from_offset().(utf8_chars, offset)), |
| 116 | ); |
| 117 | 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().32; |
| 118 | } |
| 119 | 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_avx2/sum().(&counts); |
| 120 | } |
| 121 | |
| 122 | // 4096 |
| 123 | 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().32 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 { |
| 124 | let mut counts = _mm256_setzero_si256rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx/_mm256_setzero_si256().(); |
| 125 | for _ in 0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#128 { |
| 126 | counts = _mm256_sub_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx2/_mm256_sub_epi8().( |
| 127 | counts, |
| 128 | is_leading_utf8_byterust-analyzer cargo bytecount 0.6.9 simd/x86_avx2/is_leading_utf8_byte().(mm256_from_offsetrust-analyzer cargo bytecount 0.6.9 simd/x86_avx2/mm256_from_offset().(utf8_chars, offset)), |
| 129 | ); |
| 130 | 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().32; |
| 131 | } |
| 132 | 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_avx2/sum().(&counts); |
| 133 | } |
| 134 | |
| 135 | // 32 |
| 136 | let mut counts = _mm256_setzero_si256rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx/_mm256_setzero_si256().(); |
| 137 | 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().32 { |
| 138 | counts = _mm256_sub_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx2/_mm256_sub_epi8().( |
| 139 | counts, |
| 140 | is_leading_utf8_byterust-analyzer cargo bytecount 0.6.9 simd/x86_avx2/is_leading_utf8_byte().(mm256_from_offsetrust-analyzer cargo bytecount 0.6.9 simd/x86_avx2/mm256_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().32)), |
| 141 | ); |
| 142 | } |
| 143 | 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().32 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 { |
| 144 | counts = _mm256_sub_epi8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx2/_mm256_sub_epi8().( |
| 145 | counts, |
| 146 | _mm256_and_si256rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/avx2/_mm256_and_si256().( |
| 147 | is_leading_utf8_byterust-analyzer cargo bytecount 0.6.9 simd/x86_avx2/is_leading_utf8_byte().(mm256_from_offsetrust-analyzer cargo bytecount 0.6.9 simd/x86_avx2/mm256_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().32)), |
| 148 | mm256_from_offsetrust-analyzer cargo bytecount 0.6.9 simd/x86_avx2/mm256_from_offset().(&MASKrust-analyzer cargo bytecount 0.6.9 simd/x86_avx2/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().32), |
| 149 | ), |
| 150 | ); |
| 151 | } |
| 152 | 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_avx2/sum().(&counts); |
| 153 | |
| 154 | count |
| 155 | } |