Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions src/implementation/aarch64/neon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,6 @@ impl From<uint8x16_t> for SimdU8Value {
}
}

impl Utf8CheckAlgorithm<SimdU8Value> {
#[inline]
unsafe fn must_be_2_3_continuation(prev2: SimdU8Value, prev3: SimdU8Value) -> SimdU8Value {
let is_third_byte = prev2.saturating_sub(SimdU8Value::splat(0xe0 - 0x80));
let is_fourth_byte = prev3.saturating_sub(SimdU8Value::splat(0xf0 - 0x80));
is_third_byte.or(is_fourth_byte)
}
}

#[inline]
#[cfg(feature = "aarch64_neon_prefetch")]
unsafe fn simd_prefetch(ptr: *const u8) {
Expand Down
8 changes: 8 additions & 0 deletions src/implementation/algorithm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,14 @@ macro_rules! algorithm_simd {
byte_1_high.and(byte_1_low).and(byte_2_high)
}

$(#[$feat])*
#[inline]
unsafe fn must_be_2_3_continuation(prev2: SimdU8Value, prev3: SimdU8Value) -> SimdU8Value {
let is_third_byte = prev2.saturating_sub(SimdU8Value::splat(0xe0 - 0x80));
let is_fourth_byte = prev3.saturating_sub(SimdU8Value::splat(0xf0 - 0x80));
is_third_byte.or(is_fourth_byte)
}

$(#[$feat])*
#[inline]
unsafe fn check_multibyte_lengths(
Expand Down
10 changes: 0 additions & 10 deletions src/implementation/armv7/neon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,16 +237,6 @@ impl From<uint8x16_t> for SimdU8Value {
}
}

impl Utf8CheckAlgorithm<SimdU8Value> {
#[inline]
#[target_feature(enable = "neon")]
unsafe fn must_be_2_3_continuation(prev2: SimdU8Value, prev3: SimdU8Value) -> SimdU8Value {
let is_third_byte = prev2.saturating_sub(SimdU8Value::splat(0xe0 - 0x80));
let is_fourth_byte = prev3.saturating_sub(SimdU8Value::splat(0xf0 - 0x80));
is_third_byte.or(is_fourth_byte)
}
}

#[inline]
unsafe fn simd_prefetch(_ptr: *const u8) {}

Expand Down
9 changes: 0 additions & 9 deletions src/implementation/portable/simd128.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,6 @@ impl From<u8x16> for SimdU8Value {
}
}

impl Utf8CheckAlgorithm<SimdU8Value> {
#[inline]
fn must_be_2_3_continuation(prev2: SimdU8Value, prev3: SimdU8Value) -> SimdU8Value {
let is_third_byte = prev2.saturating_sub(SimdU8Value::splat(0xe0 - 0x80));
let is_fourth_byte = prev3.saturating_sub(SimdU8Value::splat(0xf0 - 0x80));
is_third_byte.or(is_fourth_byte)
}
}

#[inline]
unsafe fn simd_prefetch(_ptr: *const u8) {}

Expand Down
9 changes: 0 additions & 9 deletions src/implementation/portable/simd256.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,6 @@ impl From<u8x32> for SimdU8Value {
}
}

impl Utf8CheckAlgorithm<SimdU8Value> {
#[inline]
fn must_be_2_3_continuation(prev2: SimdU8Value, prev3: SimdU8Value) -> SimdU8Value {
let is_third_byte = prev2.saturating_sub(SimdU8Value::splat(0xe0 - 0x80));
let is_fourth_byte = prev3.saturating_sub(SimdU8Value::splat(0xf0 - 0x80));
is_third_byte.or(is_fourth_byte)
}
}

#[inline]
unsafe fn simd_prefetch(_ptr: *const u8) {}

Expand Down
9 changes: 0 additions & 9 deletions src/implementation/wasm32/simd128.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,6 @@ impl From<v128> for SimdU8Value {
}
}

impl Utf8CheckAlgorithm<SimdU8Value> {
#[inline]
unsafe fn must_be_2_3_continuation(prev2: SimdU8Value, prev3: SimdU8Value) -> SimdU8Value {
let is_third_byte = prev2.saturating_sub(SimdU8Value::splat(0xe0 - 0x80));
let is_fourth_byte = prev3.saturating_sub(SimdU8Value::splat(0xf0 - 0x80));
is_third_byte.or(is_fourth_byte)
}
}

#[inline]
const fn simd_prefetch(_ptr: *const u8) {
// no-op
Expand Down
10 changes: 0 additions & 10 deletions src/implementation/x86/avx2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,16 +230,6 @@ impl From<__m256i> for SimdU8Value {
}
}

impl Utf8CheckAlgorithm<SimdU8Value> {
#[target_feature(enable = "avx2")]
#[inline]
unsafe fn must_be_2_3_continuation(prev2: SimdU8Value, prev3: SimdU8Value) -> SimdU8Value {
let is_third_byte = prev2.saturating_sub(SimdU8Value::splat(0xe0 - 0x80));
let is_fourth_byte = prev3.saturating_sub(SimdU8Value::splat(0xf0 - 0x80));
is_third_byte.or(is_fourth_byte)
}
}

#[target_feature(enable = "avx2")]
#[inline]
unsafe fn simd_prefetch(ptr: *const u8) {
Expand Down
10 changes: 0 additions & 10 deletions src/implementation/x86/avx512.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,16 +253,6 @@ impl From<__m512i> for SimdU8Value {
}
}

impl Utf8CheckAlgorithm<SimdU8Value> {
#[target_feature(enable = "avx512f,avx512bw,avx512vbmi")]
#[inline]
unsafe fn must_be_2_3_continuation(prev2: SimdU8Value, prev3: SimdU8Value) -> SimdU8Value {
let is_third_byte = prev2.saturating_sub(SimdU8Value::splat(0xe0 - 0x80));
let is_fourth_byte = prev3.saturating_sub(SimdU8Value::splat(0xf0 - 0x80));
is_third_byte.or(is_fourth_byte)
}
}

#[target_feature(enable = "avx512f,avx512bw,avx512vbmi")]
#[inline]
unsafe fn simd_prefetch(ptr: *const u8) {
Expand Down
10 changes: 0 additions & 10 deletions src/implementation/x86/sse42.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,16 +215,6 @@ impl From<__m128i> for SimdU8Value {
}
}

impl Utf8CheckAlgorithm<SimdU8Value> {
#[target_feature(enable = "sse4.2")]
#[inline]
unsafe fn must_be_2_3_continuation(prev2: SimdU8Value, prev3: SimdU8Value) -> SimdU8Value {
let is_third_byte = prev2.saturating_sub(SimdU8Value::splat(0xe0 - 0x80));
let is_fourth_byte = prev3.saturating_sub(SimdU8Value::splat(0xf0 - 0x80));
is_third_byte.or(is_fourth_byte)
}
}

#[target_feature(enable = "sse4.2")]
#[inline]
unsafe fn simd_prefetch(ptr: *const u8) {
Expand Down
Loading