From df538288e09a45483a56a9af99fb7fd5333d53d8 Mon Sep 17 00:00:00 2001 From: roife Date: Fri, 12 Jan 2024 20:27:49 +0800 Subject: [PATCH] internal: add inline for move_mask in line-index --- lib/line-index/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/line-index/src/lib.rs b/lib/line-index/src/lib.rs index 42be26f572..1614504f80 100644 --- a/lib/line-index/src/lib.rs +++ b/lib/line-index/src/lib.rs @@ -340,6 +340,7 @@ unsafe fn analyze_source_file_sse2( #[target_feature(enable = "neon")] #[cfg(any(target_arch = "aarch64"))] +#[inline] // See https://community.arm.com/arm-community-blogs/b/infrastructure-solutions-blog/posts/porting-x86-vector-bitmask-optimizations-to-arm-neon // // The mask is a 64-bit integer, where each 4-bit corresponds to a u8 in the @@ -393,7 +394,7 @@ unsafe fn analyze_source_file_neon( let newlines_test = vceqq_s8(chunk, newline); let mut newlines_mask = move_mask(newlines_test); - // If the bit mask is all zero, there are no newlines in this chunk. + // If the bit mask is not all zero, there are newlines in this chunk. if newlines_mask != 0 { let output_offset = TextSize::from((chunk_index * CHUNK_SIZE + 1) as u32);