diff --git a/textproc/krep/Makefile b/textproc/krep/Makefile index 000f9c2c2e70..ea8965e9c32e 100644 --- a/textproc/krep/Makefile +++ b/textproc/krep/Makefile @@ -1,21 +1,21 @@ PORTNAME= krep DISTVERSIONPREFIX= v -DISTVERSION= 2.3.0 +DISTVERSION= 2.4.0 CATEGORIES= textproc MAINTAINER= alven@FreeBSD.org COMMENT= High-performance string search utility WWW= https://github.com/davidesantangelo/krep/ LICENSE= BSD2CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE USES= gmake USE_GITHUB= yes GH_ACCOUNT= davidesantangelo TEST_TARGET= test PLIST_FILES= bin/krep .include diff --git a/textproc/krep/distinfo b/textproc/krep/distinfo index 46beadf789ff..8443b1e45453 100644 --- a/textproc/krep/distinfo +++ b/textproc/krep/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1776331755 -SHA256 (davidesantangelo-krep-v2.3.0_GH0.tar.gz) = 058d02e9a34861b92695073ccc3243ca79bdc9b0dcc5b9e798720a22786d5ae6 -SIZE (davidesantangelo-krep-v2.3.0_GH0.tar.gz) = 80293 +TIMESTAMP = 1779654012 +SHA256 (davidesantangelo-krep-v2.4.0_GH0.tar.gz) = 1b0648938dae88b17c80108a6df83768beb5f061c5bbb65edeafd169c799ea8c +SIZE (davidesantangelo-krep-v2.4.0_GH0.tar.gz) = 83147 diff --git a/textproc/krep/files/patch-krep.c b/textproc/krep/files/patch-krep.c index f0215d13d627..1d6dbad2b9aa 100644 --- a/textproc/krep/files/patch-krep.c +++ b/textproc/krep/files/patch-krep.c @@ -1,39 +1,30 @@ ---- krep.c.orig 2026-03-18 19:36:12 UTC +--- krep.c.orig 2026-05-19 07:06:16 UTC +++ krep.c -@@ -4503,6 +4503,27 @@ uint64_t memchr_short_search(const search_params_t *pa - } - - #ifdef __ARM_NEON +@@ -4925,6 +4925,27 @@ uint64_t memchr_short_search(const search_params_t *pa + // Handles case-sensitive patterns of any length. + // Uses 2x 16-byte loads per iteration with fast mask extraction via + // vshrn/vmovn instead of store-to-memory. + +#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.