Skip to content

Commit 5344baf

Browse files
committed
cleanup: don't use aligned buffers
1 parent 8a22e8a commit 5344baf

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

portable/src/implementation/simd.rs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,6 @@ const HAS_FAST_REDUCE_MAX: bool = false;
2323

2424
const HAS_FAST_MASKED_LOAD: bool = false; // FIXME avx512, avx2 (32-bit chunks only?)
2525

26-
#[repr(C, align(32))]
27-
#[allow(dead_code)] // only used if a 128-bit SIMD implementation is used
28-
pub(crate) struct TempSimdChunk(pub(crate) [u8; SIMD_CHUNK_SIZE]);
29-
30-
#[allow(dead_code)] // only used if there is a SIMD implementation
31-
impl TempSimdChunk {
32-
#[expect(clippy::inline_always)]
33-
#[inline(always)] // FIXME needs to be forced because otherwise it is not inlined on armv7 neo
34-
pub(crate) const fn new() -> Self {
35-
Self([0; SIMD_CHUNK_SIZE])
36-
}
37-
}
38-
3926
#[repr(C)]
4027
struct SimdInput<const N: usize, const O: usize>
4128
where
@@ -944,9 +931,7 @@ impl basic::imp::ChunkedUtf8Validator for ChunkedUtf8ValidatorImp {
944931
let rem = len - chunks_lim;
945932
if rem > 0 {
946933
remaining_input = &remaining_input[chunks_lim..];
947-
let mut tmpbuf = TempSimdChunk::new();
948-
tmpbuf.0[..remaining_input.len()].copy_from_slice(remaining_input);
949-
let simd_input = SimdInput::new(&tmpbuf.0);
934+
let simd_input = SimdInput::new_partial(remaining_input);
950935
self.algorithm.check_utf8(&simd_input);
951936
}
952937
}

0 commit comments

Comments
 (0)