Skip to content

Commit 3d7886e

Browse files
committed
fix #486 problem in AVX2 SIMD
fix problem in AVX2 SIMD acceleration code for certain patterns, where SSE2 code is fine
1 parent e465a82 commit 3d7886e

File tree

14 files changed

+20
-18
lines changed

14 files changed

+20
-18
lines changed

bin/win32/ug.exe

0 Bytes
Binary file not shown.

bin/win32/ugrep-indexer.exe

0 Bytes
Binary file not shown.

bin/win32/ugrep.exe

0 Bytes
Binary file not shown.

bin/win64/ug.exe

0 Bytes
Binary file not shown.

bin/win64/ugrep-indexer.exe

0 Bytes
Binary file not shown.

bin/win64/ugrep.exe

0 Bytes
Binary file not shown.

configure

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.72 for ugrep 7.4.0.
3+
# Generated by GNU Autoconf 2.72 for ugrep 7.4.1.
44
#
55
# Report bugs to <https://github.com/Genivia/ugrep/issues>.
66
#
@@ -606,8 +606,8 @@ MAKEFLAGS=
606606
# Identity of this package.
607607
PACKAGE_NAME='ugrep'
608608
PACKAGE_TARNAME='ugrep'
609-
PACKAGE_VERSION='7.4.0'
610-
PACKAGE_STRING='ugrep 7.4.0'
609+
PACKAGE_VERSION='7.4.1'
610+
PACKAGE_STRING='ugrep 7.4.1'
611611
PACKAGE_BUGREPORT='https://github.com/Genivia/ugrep/issues'
612612
PACKAGE_URL='https://ugrep.com'
613613

@@ -1382,7 +1382,7 @@ if test "$ac_init_help" = "long"; then
13821382
# Omit some internal or obsolete options to make the list less imposing.
13831383
# This message is too long to be a string in the A/UX 3.1 sh.
13841384
cat <<_ACEOF
1385-
'configure' configures ugrep 7.4.0 to adapt to many kinds of systems.
1385+
'configure' configures ugrep 7.4.1 to adapt to many kinds of systems.
13861386
13871387
Usage: $0 [OPTION]... [VAR=VALUE]...
13881388
@@ -1453,7 +1453,7 @@ fi
14531453

14541454
if test -n "$ac_init_help"; then
14551455
case $ac_init_help in
1456-
short | recursive ) echo "Configuration of ugrep 7.4.0:";;
1456+
short | recursive ) echo "Configuration of ugrep 7.4.1:";;
14571457
esac
14581458
cat <<\_ACEOF
14591459
@@ -1630,7 +1630,7 @@ fi
16301630
test -n "$ac_init_help" && exit $ac_status
16311631
if $ac_init_version; then
16321632
cat <<\_ACEOF
1633-
ugrep configure 7.4.0
1633+
ugrep configure 7.4.1
16341634
generated by GNU Autoconf 2.72
16351635
16361636
Copyright (C) 2023 Free Software Foundation, Inc.
@@ -2184,7 +2184,7 @@ cat >config.log <<_ACEOF
21842184
This file contains any messages produced by compilers while
21852185
running configure, to aid debugging if configure makes a mistake.
21862186
2187-
It was created by ugrep $as_me 7.4.0, which was
2187+
It was created by ugrep $as_me 7.4.1, which was
21882188
generated by GNU Autoconf 2.72. Invocation command line was
21892189
21902190
$ $0$ac_configure_args_raw
@@ -3694,7 +3694,7 @@ fi
36943694

36953695
# Define the identity of the package.
36963696
PACKAGE='ugrep'
3697-
VERSION='7.4.0'
3697+
VERSION='7.4.1'
36983698

36993699

37003700
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@@ -11808,7 +11808,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
1180811808
# report actual input values of CONFIG_FILES etc. instead of their
1180911809
# values after options handling.
1181011810
ac_log="
11811-
This file was extended by ugrep $as_me 7.4.0, which was
11811+
This file was extended by ugrep $as_me 7.4.1, which was
1181211812
generated by GNU Autoconf 2.72. Invocation command line was
1181311813
1181411814
CONFIG_FILES = $CONFIG_FILES
@@ -11881,7 +11881,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
1188111881
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1188211882
ac_cs_config='$ac_cs_config_escaped'
1188311883
ac_cs_version="\\
11884-
ugrep config.status 7.4.0
11884+
ugrep config.status 7.4.1
1188511885
configured by $0, generated by GNU Autoconf 2.72,
1188611886
with options \\"\$ac_cs_config\\"
1188711887

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
AC_INIT([ugrep],[7.4.0],[https://github.com/Genivia/ugrep/issues],[ugrep],[https://ugrep.com])
1+
AC_INIT([ugrep],[7.4.1],[https://github.com/Genivia/ugrep/issues],[ugrep],[https://ugrep.com])
22
AM_INIT_AUTOMAKE([foreign subdir-objects dist-xz no-dist-gzip])
33
AC_CONFIG_HEADERS([config.h])
44
AC_COPYRIGHT([Copyright (C) 2019-2025 Robert van Engelen, Genivia Inc.])

lib/matcher_avx2.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,8 @@ bool Matcher::simd_advance_pattern_pin1_pma_avx2(size_t loc)
232232
}
233233
else
234234
{
235-
loc = std::max<size_t>(loc, e - lcp - buf_);
235+
if (e > buf_ + loc + lcp)
236+
loc = e - buf_ - lcp;
236237
set_current_and_peek_more(loc);
237238
loc = cur_;
238239
if (loc + min > end_ && eof_)
@@ -288,7 +289,8 @@ bool Matcher::simd_advance_pattern_pin1_pmh_avx2(size_t loc)
288289
}
289290
else
290291
{
291-
loc = std::max<size_t>(loc, e - lcp - buf_);
292+
if (e > buf_ + loc + lcp)
293+
loc = e - buf_ - lcp;
292294
set_current_and_peek_more(loc);
293295
loc = cur_;
294296
if (loc + MIN > end_ && eof_)

man/ug.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH UGREP "1" "April 21, 2025" "ugrep 7.4.0" "User Commands"
1+
.TH UGREP "1" "April 24, 2025" "ugrep 7.4.1" "User Commands"
22
.SH NAME
33
\fBugrep\fR, \fBug\fR -- file pattern searcher
44
.SH SYNOPSIS

0 commit comments

Comments
 (0)