| 1 | #[allow(dead_code)] |
| 2 | pub(craterust-analyzer cargo simdutf8 0.1.5 crate/) mod avx2rust-analyzer cargo simdutf8 0.1.5 implementation/x86/avx2/; |
| 3 | |
| 4 | #[allow(dead_code)] |
| 5 | pub(craterust-analyzer cargo simdutf8 0.1.5 crate/) mod sse42rust-analyzer cargo simdutf8 0.1.5 implementation/x86/sse42/; |
| 6 | |
| 7 | #[allow(unused_imports)] |
| 8 | use superrust-analyzer cargo simdutf8 0.1.5 implementation/::helpersrust-analyzer cargo simdutf8 0.1.5 implementation/helpers/::SIMD_CHUNK_SIZErust-analyzer cargo simdutf8 0.1.5 implementation/helpers/SIMD_CHUNK_SIZE.; |
| 9 | |
| 10 | // validate_utf8_basic() std: implementation auto-selection |
| 11 | |
| 12 | #[cfg(all(feature = "std", not(target_feature = "avx2")))] |
| 13 | #[inline] |
| 14 | pub(craterust-analyzer cargo simdutf8 0.1.5 crate/) unsafe fn validate_utf8_basicrust-analyzer cargo simdutf8 0.1.5 implementation/x86/validate_utf8_basic().( |
| 15 | input: &[u8], |
| 16 | ) -> corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), craterust-analyzer cargo simdutf8 0.1.5 crate/::basicrust-analyzer cargo simdutf8 0.1.5 basic/::Utf8Errorrust-analyzer cargo simdutf8 0.1.5 basic/Utf8Error#> { |
| 17 | use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/; |
| 18 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::syncrust-analyzer cargo std https://github.com/rust-lang/rust/library/std sync/::atomicrust-analyzer cargo core https://github.com/rust-lang/rust/library/core sync/atomic/::{AtomicPtrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core sync/atomic/AtomicPtr#, Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core sync/atomic/Ordering#}; |
| 19 | |
| 20 | type FnRawrust-analyzer cargo simdutf8 0.1.5 implementation/x86/FnRaw# = *mut (); |
| 21 | |
| 22 | static FNrust-analyzer cargo simdutf8 0.1.5 implementation/x86/FN.: AtomicPtrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core sync/atomic/AtomicPtr#<()> = AtomicPtrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core sync/atomic/AtomicPtr#::newrust-analyzer cargo core https://github.com/rust-lang/rust/library/core sync/atomic/impl#[`AtomicPtr<T>`]new().(get_fastestrust-analyzer cargo simdutf8 0.1.5 implementation/x86/get_fastest(). as FnRawrust-analyzer cargo simdutf8 0.1.5 implementation/x86/FnRaw#); |
| 23 | |
| 24 | unsafe fn get_fastestrust-analyzer cargo simdutf8 0.1.5 implementation/x86/get_fastest().(input: &[u8]) -> corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), craterust-analyzer cargo simdutf8 0.1.5 crate/::basicrust-analyzer cargo simdutf8 0.1.5 basic/::Utf8Errorrust-analyzer cargo simdutf8 0.1.5 basic/Utf8Error#> { |
| 25 | let fun = get_fastest_available_implementation_basicrust-analyzer cargo simdutf8 0.1.5 implementation/x86/get_fastest_available_implementation_basic().(); |
| 26 | FNrust-analyzer cargo simdutf8 0.1.5 implementation/x86/FN..storerust-analyzer cargo core https://github.com/rust-lang/rust/library/core sync/atomic/impl#[`AtomicPtr<T>`]store().(fun as FnRawrust-analyzer cargo simdutf8 0.1.5 implementation/x86/FnRaw#, Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core sync/atomic/Ordering#::Relaxedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core sync/atomic/Ordering#Relaxed#); |
| 27 | (fun)(input) |
| 28 | } |
| 29 | |
| 30 | if input.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>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().SIMD_CHUNK_SIZErust-analyzer cargo simdutf8 0.1.5 implementation/helpers/SIMD_CHUNK_SIZE. { |
| 31 | return superrust-analyzer cargo simdutf8 0.1.5 implementation/::validate_utf8_basic_fallbackrust-analyzer cargo simdutf8 0.1.5 implementation/validate_utf8_basic_fallback().(input); |
| 32 | } |
| 33 | |
| 34 | let fun = FNrust-analyzer cargo simdutf8 0.1.5 implementation/x86/FN..loadrust-analyzer cargo core https://github.com/rust-lang/rust/library/core sync/atomic/impl#[`AtomicPtr<T>`]load().(Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core sync/atomic/Ordering#::Relaxedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core sync/atomic/Ordering#Relaxed#); |
| 35 | memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::transmuterust-analyzer cargo core https://github.com/rust-lang/rust/library/core intrinsics/transmute().::<FnRawrust-analyzer cargo simdutf8 0.1.5 implementation/x86/FnRaw#, superrust-analyzer cargo simdutf8 0.1.5 implementation/::ValidateUtf8Fnrust-analyzer cargo simdutf8 0.1.5 implementation/ValidateUtf8Fn#>(fun)(input) |
| 36 | } |
| 37 | |
| 38 | #[cfg(all(feature = "std", not(target_feature = "avx2")))] |
| 39 | #[inline] |
| 40 | fn get_fastest_available_implementation_basicrust-analyzer cargo simdutf8 0.1.5 implementation/x86/get_fastest_available_implementation_basic().() -> superrust-analyzer cargo simdutf8 0.1.5 implementation/::ValidateUtf8Fnrust-analyzer cargo simdutf8 0.1.5 implementation/ValidateUtf8Fn# { |
| 41 | if stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::is_x86_feature_detectedrust-analyzer cargo std_detect https://github.com/rust-lang/rust/library/ detect/arch/x86/is_x86_feature_detected!!("avx2") { |
| 42 | avx2rust-analyzer cargo simdutf8 0.1.5 implementation/x86/avx2/::validate_utf8_basicrust-analyzer cargo simdutf8 0.1.5 implementation/x86/avx2/validate_utf8_basic(). |
| 43 | } else if stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::is_x86_feature_detectedrust-analyzer cargo std_detect https://github.com/rust-lang/rust/library/ detect/arch/x86/is_x86_feature_detected!!("sse4.2") { |
| 44 | sse42rust-analyzer cargo simdutf8 0.1.5 implementation/x86/sse42/::validate_utf8_basicrust-analyzer cargo simdutf8 0.1.5 implementation/x86/sse42/validate_utf8_basic(). |
| 45 | } else { |
| 46 | superrust-analyzer cargo simdutf8 0.1.5 implementation/::validate_utf8_basic_fallbackrust-analyzer cargo simdutf8 0.1.5 implementation/validate_utf8_basic_fallback(). |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | // validate_utf8_basic() no-std: implementation selection by config |
| 51 | |
| 52 | #[cfg(target_feature = "avx2")] |
| 53 | pub(craterust-analyzer cargo simdutf8 0.1.5 crate/) unsafe fn validate_utf8_basic( |
| 54 | input: &[u8], |
| 55 | ) -> corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), craterust-analyzer cargo simdutf8 0.1.5 crate/::basicrust-analyzer cargo simdutf8 0.1.5 basic/::Utf8Errorrust-analyzer cargo simdutf8 0.1.5 basic/Utf8Error#> { |
| 56 | if input.len() < SIMD_CHUNK_SIZErust-analyzer cargo simdutf8 0.1.5 implementation/helpers/SIMD_CHUNK_SIZE. { |
| 57 | return superrust-analyzer cargo simdutf8 0.1.5 implementation/::validate_utf8_basic_fallbackrust-analyzer cargo simdutf8 0.1.5 implementation/validate_utf8_basic_fallback().(input); |
| 58 | } |
| 59 | |
| 60 | validate_utf8_basic_avx2(input) |
| 61 | } |
| 62 | |
| 63 | #[cfg(target_feature = "avx2")] |
| 64 | #[inline(never)] |
| 65 | unsafe fn validate_utf8_basic_avx2( |
| 66 | input: &[u8], |
| 67 | ) -> corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), craterust-analyzer cargo simdutf8 0.1.5 crate/::basicrust-analyzer cargo simdutf8 0.1.5 basic/::Utf8Errorrust-analyzer cargo simdutf8 0.1.5 basic/Utf8Error#> { |
| 68 | avx2rust-analyzer cargo simdutf8 0.1.5 implementation/x86/avx2/::validate_utf8_basicrust-analyzer cargo simdutf8 0.1.5 implementation/x86/avx2/validate_utf8_basic().(input) |
| 69 | } |
| 70 | |
| 71 | #[cfg(all( |
| 72 | not(feature = "std"), |
| 73 | not(target_feature = "avx2"), |
| 74 | target_feature = "sse4.2" |
| 75 | ))] |
| 76 | pub(craterust-analyzer cargo simdutf8 0.1.5 crate/) unsafe fn validate_utf8_basic( |
| 77 | input: &[u8], |
| 78 | ) -> corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), craterust-analyzer cargo simdutf8 0.1.5 crate/::basicrust-analyzer cargo simdutf8 0.1.5 basic/::Utf8Errorrust-analyzer cargo simdutf8 0.1.5 basic/Utf8Error#> { |
| 79 | if input.len() < SIMD_CHUNK_SIZErust-analyzer cargo simdutf8 0.1.5 implementation/helpers/SIMD_CHUNK_SIZE. { |
| 80 | return superrust-analyzer cargo simdutf8 0.1.5 implementation/::validate_utf8_basic_fallbackrust-analyzer cargo simdutf8 0.1.5 implementation/validate_utf8_basic_fallback().(input); |
| 81 | } |
| 82 | |
| 83 | validate_utf8_basic_sse42(input) |
| 84 | } |
| 85 | |
| 86 | #[cfg(all( |
| 87 | not(feature = "std"), |
| 88 | not(target_feature = "avx2"), |
| 89 | target_feature = "sse4.2" |
| 90 | ))] |
| 91 | #[inline(never)] |
| 92 | unsafe fn validate_utf8_basic_sse42( |
| 93 | input: &[u8], |
| 94 | ) -> corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), craterust-analyzer cargo simdutf8 0.1.5 crate/::basicrust-analyzer cargo simdutf8 0.1.5 basic/::Utf8Errorrust-analyzer cargo simdutf8 0.1.5 basic/Utf8Error#> { |
| 95 | sse42rust-analyzer cargo simdutf8 0.1.5 implementation/x86/sse42/::validate_utf8_basicrust-analyzer cargo simdutf8 0.1.5 implementation/x86/sse42/validate_utf8_basic().(input) |
| 96 | } |
| 97 | |
| 98 | #[cfg(all( |
| 99 | not(feature = "std"), |
| 100 | not(target_feature = "avx2"), |
| 101 | not(target_feature = "sse4.2") |
| 102 | ))] |
| 103 | pub(craterust-analyzer cargo simdutf8 0.1.5 crate/) use superrust-analyzer cargo simdutf8 0.1.5 implementation/::validate_utf8_basic_fallbackrust-analyzer cargo simdutf8 0.1.5 implementation/validate_utf8_basic_fallback(). as validate_utf8_basicrust-analyzer cargo simdutf8 0.1.5 implementation/validate_utf8_basic_fallback().; |
| 104 | |
| 105 | // validate_utf8_compat() std: implementation auto-selection |
| 106 | |
| 107 | #[cfg(all(feature = "std", not(target_feature = "avx2")))] |
| 108 | #[cfg(feature = "std")] |
| 109 | #[inline] |
| 110 | pub(craterust-analyzer cargo simdutf8 0.1.5 crate/) unsafe fn validate_utf8_compatrust-analyzer cargo simdutf8 0.1.5 implementation/x86/validate_utf8_compat().( |
| 111 | input: &[u8], |
| 112 | ) -> corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), craterust-analyzer cargo simdutf8 0.1.5 crate/::compatrust-analyzer cargo simdutf8 0.1.5 compat/::Utf8Errorrust-analyzer cargo simdutf8 0.1.5 compat/Utf8Error#> { |
| 113 | use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/; |
| 114 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::syncrust-analyzer cargo std https://github.com/rust-lang/rust/library/std sync/::atomicrust-analyzer cargo core https://github.com/rust-lang/rust/library/core sync/atomic/::{AtomicPtrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core sync/atomic/AtomicPtr#, Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core sync/atomic/Ordering#}; |
| 115 | |
| 116 | type FnRawrust-analyzer cargo simdutf8 0.1.5 implementation/x86/FnRaw# = *mut (); |
| 117 | |
| 118 | static FNrust-analyzer cargo simdutf8 0.1.5 implementation/x86/FN.: AtomicPtrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core sync/atomic/AtomicPtr#<()> = AtomicPtrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core sync/atomic/AtomicPtr#::newrust-analyzer cargo core https://github.com/rust-lang/rust/library/core sync/atomic/impl#[`AtomicPtr<T>`]new().(get_fastestrust-analyzer cargo simdutf8 0.1.5 implementation/x86/get_fastest(). as FnRawrust-analyzer cargo simdutf8 0.1.5 implementation/x86/FnRaw#); |
| 119 | |
| 120 | unsafe fn get_fastestrust-analyzer cargo simdutf8 0.1.5 implementation/x86/get_fastest().(input: &[u8]) -> corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), craterust-analyzer cargo simdutf8 0.1.5 crate/::compatrust-analyzer cargo simdutf8 0.1.5 compat/::Utf8Errorrust-analyzer cargo simdutf8 0.1.5 compat/Utf8Error#> { |
| 121 | let fun = get_fastest_available_implementation_compatrust-analyzer cargo simdutf8 0.1.5 implementation/x86/get_fastest_available_implementation_compat().(); |
| 122 | FNrust-analyzer cargo simdutf8 0.1.5 implementation/x86/FN..storerust-analyzer cargo core https://github.com/rust-lang/rust/library/core sync/atomic/impl#[`AtomicPtr<T>`]store().(fun as FnRawrust-analyzer cargo simdutf8 0.1.5 implementation/x86/FnRaw#, Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core sync/atomic/Ordering#::Relaxedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core sync/atomic/Ordering#Relaxed#); |
| 123 | (fun)(input) |
| 124 | } |
| 125 | |
| 126 | if input.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>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().SIMD_CHUNK_SIZErust-analyzer cargo simdutf8 0.1.5 implementation/helpers/SIMD_CHUNK_SIZE. { |
| 127 | return superrust-analyzer cargo simdutf8 0.1.5 implementation/::validate_utf8_compat_fallbackrust-analyzer cargo simdutf8 0.1.5 implementation/validate_utf8_compat_fallback().(input); |
| 128 | } |
| 129 | |
| 130 | let fun = FNrust-analyzer cargo simdutf8 0.1.5 implementation/x86/FN..loadrust-analyzer cargo core https://github.com/rust-lang/rust/library/core sync/atomic/impl#[`AtomicPtr<T>`]load().(Orderingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core sync/atomic/Ordering#::Relaxedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core sync/atomic/Ordering#Relaxed#); |
| 131 | memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::transmuterust-analyzer cargo core https://github.com/rust-lang/rust/library/core intrinsics/transmute().::<FnRawrust-analyzer cargo simdutf8 0.1.5 implementation/x86/FnRaw#, superrust-analyzer cargo simdutf8 0.1.5 implementation/::ValidateUtf8CompatFnrust-analyzer cargo simdutf8 0.1.5 implementation/ValidateUtf8CompatFn#>(fun)(input) |
| 132 | } |
| 133 | |
| 134 | #[cfg(all(feature = "std", not(target_feature = "avx2")))] |
| 135 | #[inline] |
| 136 | fn get_fastest_available_implementation_compatrust-analyzer cargo simdutf8 0.1.5 implementation/x86/get_fastest_available_implementation_compat().() -> superrust-analyzer cargo simdutf8 0.1.5 implementation/::ValidateUtf8CompatFnrust-analyzer cargo simdutf8 0.1.5 implementation/ValidateUtf8CompatFn# { |
| 137 | if stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::is_x86_feature_detectedrust-analyzer cargo std_detect https://github.com/rust-lang/rust/library/ detect/arch/x86/is_x86_feature_detected!!("avx2") { |
| 138 | avx2rust-analyzer cargo simdutf8 0.1.5 implementation/x86/avx2/::validate_utf8_compatrust-analyzer cargo simdutf8 0.1.5 implementation/x86/avx2/validate_utf8_compat(). |
| 139 | } else if stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::is_x86_feature_detectedrust-analyzer cargo std_detect https://github.com/rust-lang/rust/library/ detect/arch/x86/is_x86_feature_detected!!("sse4.2") { |
| 140 | sse42rust-analyzer cargo simdutf8 0.1.5 implementation/x86/sse42/::validate_utf8_compatrust-analyzer cargo simdutf8 0.1.5 implementation/x86/sse42/validate_utf8_compat(). |
| 141 | } else { |
| 142 | superrust-analyzer cargo simdutf8 0.1.5 implementation/::validate_utf8_compat_fallbackrust-analyzer cargo simdutf8 0.1.5 implementation/validate_utf8_compat_fallback(). |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | // validate_utf8_basic() no-std: implementation selection by config |
| 147 | |
| 148 | #[cfg(target_feature = "avx2")] |
| 149 | pub(craterust-analyzer cargo simdutf8 0.1.5 crate/) unsafe fn validate_utf8_compat( |
| 150 | input: &[u8], |
| 151 | ) -> corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), craterust-analyzer cargo simdutf8 0.1.5 crate/::compatrust-analyzer cargo simdutf8 0.1.5 compat/::Utf8Errorrust-analyzer cargo simdutf8 0.1.5 compat/Utf8Error#> { |
| 152 | if input.len() < SIMD_CHUNK_SIZErust-analyzer cargo simdutf8 0.1.5 implementation/helpers/SIMD_CHUNK_SIZE. { |
| 153 | return superrust-analyzer cargo simdutf8 0.1.5 implementation/::validate_utf8_compat_fallbackrust-analyzer cargo simdutf8 0.1.5 implementation/validate_utf8_compat_fallback().(input); |
| 154 | } |
| 155 | |
| 156 | validate_utf8_compat_avx2(input) |
| 157 | } |
| 158 | |
| 159 | #[cfg(target_feature = "avx2")] |
| 160 | #[inline(never)] |
| 161 | unsafe fn validate_utf8_compat_avx2( |
| 162 | input: &[u8], |
| 163 | ) -> corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), craterust-analyzer cargo simdutf8 0.1.5 crate/::compatrust-analyzer cargo simdutf8 0.1.5 compat/::Utf8Errorrust-analyzer cargo simdutf8 0.1.5 compat/Utf8Error#> { |
| 164 | avx2rust-analyzer cargo simdutf8 0.1.5 implementation/x86/avx2/::validate_utf8_compatrust-analyzer cargo simdutf8 0.1.5 implementation/x86/avx2/validate_utf8_compat().(input) |
| 165 | } |
| 166 | |
| 167 | #[cfg(all( |
| 168 | not(feature = "std"), |
| 169 | not(target_feature = "avx2"), |
| 170 | target_feature = "sse4.2" |
| 171 | ))] |
| 172 | pub(craterust-analyzer cargo simdutf8 0.1.5 crate/) unsafe fn validate_utf8_compat( |
| 173 | input: &[u8], |
| 174 | ) -> corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), craterust-analyzer cargo simdutf8 0.1.5 crate/::compatrust-analyzer cargo simdutf8 0.1.5 compat/::Utf8Errorrust-analyzer cargo simdutf8 0.1.5 compat/Utf8Error#> { |
| 175 | if input.len() < SIMD_CHUNK_SIZErust-analyzer cargo simdutf8 0.1.5 implementation/helpers/SIMD_CHUNK_SIZE. { |
| 176 | return superrust-analyzer cargo simdutf8 0.1.5 implementation/::validate_utf8_compat_fallbackrust-analyzer cargo simdutf8 0.1.5 implementation/validate_utf8_compat_fallback().(input); |
| 177 | } |
| 178 | |
| 179 | validate_utf8_compat_sse42(input) |
| 180 | } |
| 181 | |
| 182 | #[cfg(all( |
| 183 | not(feature = "std"), |
| 184 | not(target_feature = "avx2"), |
| 185 | target_feature = "sse4.2" |
| 186 | ))] |
| 187 | #[inline(never)] |
| 188 | pub(craterust-analyzer cargo simdutf8 0.1.5 crate/) unsafe fn validate_utf8_compat_sse42( |
| 189 | input: &[u8], |
| 190 | ) -> corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), craterust-analyzer cargo simdutf8 0.1.5 crate/::compatrust-analyzer cargo simdutf8 0.1.5 compat/::Utf8Errorrust-analyzer cargo simdutf8 0.1.5 compat/Utf8Error#> { |
| 191 | sse42rust-analyzer cargo simdutf8 0.1.5 implementation/x86/sse42/::validate_utf8_compatrust-analyzer cargo simdutf8 0.1.5 implementation/x86/sse42/validate_utf8_compat().(input) |
| 192 | } |
| 193 | |
| 194 | #[cfg(all( |
| 195 | not(feature = "std"), |
| 196 | not(target_feature = "avx2"), |
| 197 | not(target_feature = "sse4.2") |
| 198 | ))] |
| 199 | pub(craterust-analyzer cargo simdutf8 0.1.5 crate/) use superrust-analyzer cargo simdutf8 0.1.5 implementation/::validate_utf8_compat_fallbackrust-analyzer cargo simdutf8 0.1.5 implementation/validate_utf8_compat_fallback(). as validate_utf8_compatrust-analyzer cargo simdutf8 0.1.5 implementation/validate_utf8_compat_fallback().; |