git: a002d848b52b - main - textproc/krep: fix build on armv7
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 24 Mar 2026 19:17:05 UTC
The branch main has been updated by fuz:
URL: https://cgit.FreeBSD.org/ports/commit/?id=a002d848b52bda537a6d0a90da4616001303f80b
commit a002d848b52bda537a6d0a90da4616001303f80b
Author: Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2026-03-18 19:53:07 +0000
Commit: Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2026-03-24 19:12:37 +0000
textproc/krep: fix build on armv7
Add polyfill for the vmaxvq_u8() intrinsic only available on AArch64.
This should probably be upstreamed.
Approved by: portmgr (build fix blanket)
---
textproc/krep/files/patch-krep.c | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/textproc/krep/files/patch-krep.c b/textproc/krep/files/patch-krep.c
new file mode 100644
index 000000000000..f0215d13d627
--- /dev/null
+++ b/textproc/krep/files/patch-krep.c
@@ -0,0 +1,39 @@
+--- krep.c.orig 2026-03-18 19:36:12 UTC
++++ krep.c
+@@ -4503,6 +4503,27 @@ uint64_t memchr_short_search(const search_params_t *pa
+ }
+
+ #ifdef __ARM_NEON
++
++#ifdef __aarch64__
++static inline bool
++is_nonzero(uint8x16_t a)
++{
++ return (vmaxvq_u8(a) != 0);
++}
++#else
++/* no vmaxvq_u8() on AArch32 */
++static inline bool
++is_nonzero(uint8x16_t a)
++{
++ uint8x8_t a8, a4;
++
++ a8 = vmax_u8(vget_low_u8(a), vget_high_u8(a));
++ a4 = vpmax_u8(a8, a8);
++
++ return (vget_lane_u32(a4, 0) != 0);
++}
++#endif /* defined(__aarch64__) */
++
+ uint64_t neon_search(const search_params_t *params,
+ const char *text_start,
+ size_t text_len,
+@@ -4541,7 +4562,7 @@ uint64_t neon_search(const search_params_t *params,
+
+ // Check if any match found
+ // vmaxvq_u8 returns the maximum value across the vector. If any byte matched (0xFF), result is 0xFF.
+- if (vmaxvq_u8(cmp) != 0)
++ if (is_nonzero(cmp))
+ {
+ // Extract mask to find exact positions
+ // Since NEON doesn't have a direct movemask, we simulate it or iterate.