Commit Graph

2158 Commits

Author SHA1 Message Date
Josef Schlehofer
bc6bee8eb5 gcc does not recognize armv7a, but it recognizes armv7-a (#348)
arch
____
Fixes:
arm-openwrt-linux-muslgnueabi-gcc: error: unrecognized -march target: armv7a
arm-openwrt-linux-muslgnueabi-gcc: note: valid arguments are: armv4 armv4t armv5t armv5te armv5tej armv6 armv6j armv6k armv6z armv6kz armv6zk armv6t2 armv6-m armv6s-m armv7 armv7-a armv7ve armv7-r armv7-m armv7e-m armv8-a armv8.1-a armv8.2-a armv8.3-a armv8.4-a armv8.5-a armv8.6-a armv8-m.base armv8-m.main armv8-r armv8.1-m.main armv9-a iwmmxt iwmmxt2; did you mean 'armv7'?
arm-openwrt-linux-muslgnueabi-gcc: error: missing argument to '-march='

Reference in Linux kernel for the same change:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/arm/Makefile?h=v6.17-rc7&id=76ebc6a429ec2becc2fa738c85ab9688ea4b9006

flag
----
generic flag for armv7-a does not exist

Fixes:
2025-09-26T08:57:44.2958982Z cc1: error: unrecognized -mtune target: generic
2025-09-26T08:57:44.2965968Z cc1: note: valid arguments are: arm8 arm810 strongarm strongarm110 fa526 fa626 arm7tdmi arm7tdmi-s arm710t arm720t arm740t arm9 arm9tdmi arm920t arm920 arm922t arm940t ep9312 arm10tdmi arm1020t arm9e arm946e-s arm966e-s arm968e-s arm10e arm1020e arm1022e xscale iwmmxt iwmmxt2 fa606te fa626te fmp626 fa726te arm926ej-s arm1026ej-s arm1136j-s arm1136jf-s arm1176jz-s arm1176jzf-s mpcorenovfp mpcore arm1156t2-s arm1156t2f-s cortex-m1 cortex-m0 cortex-m0plus cortex-m1.small-multiply cortex-m0.small-multiply cortex-m0plus.small-multiply generic-armv7-a cortex-a5 cortex-a7 cortex-a8 cortex-a9 cortex-a12 cortex-a15 cortex-a17 cortex-r4 cortex-r4f cortex-r5 cortex-r7 cortex-r8 cortex-m7 cortex-m4 cortex-m3 marvell-pj4 cortex-a15.cortex-a7 cortex-a17.cortex-a7 cortex-a32 cortex-a35 cortex-a53 cortex-a57 cortex-a72 cortex-a73 exynos-m1 xgene1 cortex-a57.cortex-a53 cortex-a72.cortex-a53 cortex-a73.cortex-a35 cortex-a73.cortex-a53 cortex-a55 cortex-a75 cortex-a76 cortex-a76ae cortex-a77 cortex-a78 cortex-a78ae cortex-a78c cortex-a710 cortex-x1 cortex-x1c neoverse-n1 cortex-a75.cortex-a55 cortex-a76.cortex-a55 neoverse-v1 neoverse-n2 cortex-m23 cortex-m33 cortex-m35p cortex-m52 cortex-m55 star-mc1 cortex-m85 cortex-r52 cortex-r52plus
2025-10-30 00:05:00 +02:00
graysky
9d10ab756d README: update for Arch Linux and OpenWrt (#347)
Co-authored-by: graysky <therealgraysky AT proton DOT me>
2025-10-30 00:05:00 +02:00
Konstantinos Margaritis
483ad92e4b Release 5.4.12 (#341)
Multiple changes since last release, this will be the last 100% ABI and
API compatible with Hyperscan release.
Next versions will include major refactors and API extensions, it will
be mostly backwards compatible however.
Without particular order, platform support is now:

* Linux (x86, Arm, Power)
* FreeBSD 14 (x86, Arm, Power)
* MacOS 14+ (x86, Arm)

In total more than 200 configurations in the CI are tested for every PR.

Other features:
- Fat Runtime supported for Arm as well (ASIMD/SVE/SVE2).
- Initial implementations for Arm SVE/SVE2 algorithms added, thanks to
Yoan Picchi from Arm.
- SIMDe support added, used as an alternative backend for existing
platforms, but mostly interesting for allowing Vectorscan to build in
new platforms without a supported SIMD engine.
- Various speedups and optimizations.
- Cppcheck and clang-tidy fixes throughout the code, both have been
added to CI for multiple configurations, but only cppcheck triggers a
build failure for now.

Various bugfixes, most important listed:
- Speed up truffle with 256b TBL instructions (#290)
- Fix Clang Tidy warnings (#295)
- Clang 17+ is more restrictive on rebind<T> on MacOS/Boost, remove
warning (#332)
- partial_load_u64 will fail if buf == NULL/c_len == 0 (#331)
- Bugfix/fix avx512vbmi regressions (#335)
- fix missing hs_version.h header (closes #198)
- hs_valid_platform: Fix check for SSE4.2 (#310)
- Fixed out of bounds read in AVX512VBMI version of fdr_exec_fat_teddy …
(#333)
- Fix noodle SVE2 off by one bug (#313)
- Make vectorscan accept \0 starting pattern (#312)
- Fix 5.4.11's config step regression (#327)
- Fix double shufti's vector end false positive (#325)
2025-07-22 18:09:14 +03:00
Konstantinos Margaritis
ec336bad53 Feature/prepare 5.4.12 (#340)
* Add entry for Changelog
* Add new contributors
* Bump library version
2025-07-22 14:04:53 +03:00
ibrkas01arm
14eb7c3f40 cmake - guard against failed GNUCC_ARCH extraction (#339)
Prevents overwriting GNUCC_ARCH with an empty value when parsing output
of gcc -Q --help=target. Ensures robustness if detection fails and
returns an empty string.

Signed-off-by: Ibrahim Kashif <ibrahim.kashif@arm.com>
2025-07-21 14:36:59 +03:00
ypicchi-arm
ca70a3d9be Fix double shufti's vector end false positive (#325)
* Add regression test for double shufti

It tests for false positive at vector edges.

Signed-off-by: Yoan Picchi <yoan.picchi@arm.com>

* Fix double shufti reporting false positives

Double shufti used to offset one vector, resulting in losing one character
at the end of every vector. This was replaced by a magic value indicating a
match. This meant that if the first char of a pattern fell on the last char of
a vector, double shufti would assume the second character is present and
report a match.
This patch fixes it by keeping the previous vector and feeding its data to the
new one when we shift it, preventing any loss of data.

Signed-off-by: Yoan Picchi <yoan.picchi@arm.com>

* vshl() will call the correct implementation

* implement missing vshr_512_imm(), simplifies caller x86 code

* Fix x86 case, use alignr instead

* it's the reverse, the avx512 alignr is incorrect, need to fix

* Make shufti's OR reduce size agnostic

Signed-off-by: Yoan Picchi <yoan.picchi@arm.com>

* Fix test's array size

Signed-off-by: Yoan Picchi <yoan.picchi@arm.com>

* Fix AVX2/AVX512 alignr implementations and unit tests

* Fix Power VSX alignr

---------

Signed-off-by: Yoan Picchi <yoan.picchi@arm.com>
Co-authored-by: Konstantinos Margaritis <konstantinos@vectorcamp.gr>
2025-06-11 18:55:10 +03:00
Chrysovalantis - Michail Liakopoulos
8a44a6eda2 Fix/fbsd gcc13 error (#338)
* added static libraries in cmake to fix unit-internal seg fault in freebsd, ppc64le, gcc13 error
* Moved gcc13 flags for freebsd-gcc13 in cmake/cflags-ppc64le.make
2025-05-31 11:46:22 +03:00
Konstantinos Margaritis
7737104585 Bugfix/fix avx512vbmi regressions (#335)
Multiple AVX512VBMI-related fixes:

src/nfa/mcsheng_compile.cpp: No need for an assert here, impl_id can be set to 0
src/nfa/nfa_api_queue.h: Make sure this compiles on both C++ and C
src/nfagraph/ng_fuzzy.cpp: Fix compilation error when DEBUG_OUTPUT=on
src/runtime.c: Fix crash when data == NULL
unit/internal/sheng.cpp: Unit test has to enable AVX512VBMI manually as autodetection does not get trigger, this causes test to fail
src/fdr/teddy_fat.cpp: AVX512 loads need to be 64-bit aligned, caused a crash on clang-18
2025-05-30 21:08:55 +03:00
Konstantinos Margaritis
7b505226ed Various cppcheck fixes (#337) 2025-05-30 12:27:28 +03:00
Rafał Dowgird
4f40db0755 Fixed out of bounds read in AVX512VBMI version of fdr_exec_fat_teddy … (#333)
Fixed out of bounds read in AVX512VBMI version of fdr_exec_fat_teddy (#322)

  * Replaced the 32 byte read with a properly truncated mapped read
  * Added a unit test

Co-authored-by: Rafał Dowgird <rafal.dowgird@rtbhouse.com>
2025-05-18 11:01:10 +03:00
Konstantinos Margaritis
eecad13b13 partial_load_u64 will fail if buf == NULL/c_len == 0 (#331) 2025-05-16 13:44:36 +03:00
Konstantinos Margaritis
400468bbfa Clang 17+ is more restrictive on rebind<T> on MacOS/Boost, remove warning (#332)
* Clang 17+ is more restrictive on rebind<T> on MacOS/Boost, remove warning

* More clang/boost warnings on MacOS, disable for now
2025-05-16 13:44:20 +03:00
ypicchi-arm
55512704ed Fix 5.4.11's config step regression (#327)
An old commit (24ae1670d) had the side effect of moving cmake defines after
they were being used. This patch move them back to be defined before being used.
Speed hsbench back up by ~ 0.8%

Signed-off-by: Yoan Picchi <yoan.picchi@arm.com>
2025-05-15 00:58:01 +03:00
HelixHexagon
749ec1bc44 Fix typo in build instructions (#315) 2025-05-14 23:49:07 +03:00
gtsoul-tech
50bcb90f8d Fix regression error #317 and add unit test (#318)
Revert the code that produced the regression error in #317 
Add the regression error to a unit test regressions.cpp along with the rebar tests

---------

Co-authored-by: gtsoul-tech <gtsoulkanakis@gmail.com>
2024-11-13 10:43:23 +02:00
gtsoul-tech
79b016a6e8 Cppcheck errors fixed and suppressed (#319)
* supress knownConditionTrueFalse

* cppcheck suppress redundantInitialization

* cppcheck solve stlcstrStream

* cppcheck suppress useStlAlgorithm

* cppcheck-suppress derefInvalidIteratorRedundantCheck

* cppcheck solvwe constParameterReference

* const parameter reference cppcheck

* removed wrong fix

* cppcheck-suppress memsetClassFloat

* cppcheck fix memsetClassFloat

* cppcheck fix unsignedLessThanZero

* supressing all errors on simde gitmodule

* fix typo (unsignedLessThanZero)

* fix cppcheck suppress simde gitmodule

* cppcheck-suppress unsignedLessThanZero

---------

Co-authored-by: gtsoul-tech <gtsoulkanakis@gmail.com>
2024-11-12 10:01:11 +02:00
ypicchi-arm
7146d5e225 Fix noodle sve2 off by one (#313)
* Revert "Fix noodle SVE2 off by one bug"

This patch was fixing the bug when it happens at the end of the buffer
but it wasn't fixing it when we do scanDoubleOnce before the main loop

The next patch fix this bug for both case instead

This reverts commit 48dd0e5ff0.

* Fix noodle spurious match with \0 chars for SVE2

When sve2's noodle process a non full vector (before the main loop or
at the end of it), a fake \0 was being parsed, trigerring a match for
pattern that ended with \0. This patch fix this.

Signed-off-by: Yoan Picchi <yoan.picchi@arm.com>

---------

Signed-off-by: Yoan Picchi <yoan.picchi@arm.com>
2024-08-29 13:49:29 +03:00
Michael Tremer
1c1ff6f279 hs_valid_platform: Fix check for SSE4.2 (#310)
Vectorscan requires SSE4.2 as a minimum on x86_64. For Hyperscan this
used to be SSSE3.

Applications that use the library call hs_valid_platform() to check if
the CPU fulfils this minimum requirement. However, when Vectorscan
upgraded to SSE4.2, the check was not updated. This leads to the library
trying to execute instructions that are not supported, resulting in the
application to crash.

This might not have been noticed as the CPUs that do not support SSE4.2
are rather old and unlikely to run any load where performance is an
issue. However, I believe that the library should not let the
application crash.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-08-22 10:34:05 +03:00
ypicchi-arm
d05f95d65f Make vectorscan accept \0 starting pattern (#312)
Vectorscan used to reject such pattern because they were being compared
to "" and found to be an empty string. We now check the pattern length
instead.

Signed-off-by: Yoan Picchi <yoan.picchi@arm.com>
2024-08-22 10:32:53 +03:00
ypicchi-arm
2a4b9d1c78 Fix noodle SVE2 off by one bug (#309)
By using svmatch on 16 bit lanes with a 8 bit predicate, we end up
including an undefined character in the pattern checks. The inactive
lane after load contains an undefined value, usually \0. Patterns
using \0 as the last character would then match this spurious
character, returning a match beyond the buffer's end. The fix checks
for such matches and rejects them.

Signed-off-by: Yoan Picchi <yoan.picchi@arm.com>
2024-08-05 09:42:56 +03:00
gtsoul-tech
dbb830acd1 Bug fix/rebar tests (#307)
* fixed paths and utf8-lossy=true

* revert to maskz (its the bug)

* cppcheck fix

---------

Co-authored-by: gtsoul-tech <gtsoulkanakis@gmail.com>
2024-07-29 11:49:25 +03:00
gtsoul-tech
ca568477a8 Rebar based Unit tests (#305)
* rebar based unit tests

* fixing paths

---------

Co-authored-by: gtsoul-tech <gtsoulkanakis@gmail.com>
2024-07-24 10:39:24 +03:00
g. economou
baeb884d22 maybe fix the hsbench issue (check_ssse3 again) in sse2/simde env (#306)
* maybe fix the hsbench issue (check_ssse3 again) in sse2/simde env

* fix the last failing unit test with fat

---------

Co-authored-by: G.E. <gregory.economou@vectorcamp.gr>
2024-07-12 15:23:07 +03:00
g. economou
f1e0977f07 build/run on machines that only have SSE2 with SIMDE (#303)
This allows the use of SIMDE library to emulate SSSE3/SSE4.2 instructions on SSE2-only (x86-64-v2) hardware.

---------

Co-authored-by: G.E <gregory.economou@vectorcamp.gr>
Co-authored-by: Konstantinos Margaritis <konstantinos@vectorcamp.gr>
2024-07-10 21:20:17 +03:00
g. economou
328b74656b Teddy macros unrolling - initial PR to test in CI (#294)
Major refactoring of teddy and teddy_avx2, unrolling macros to C++ templated functions

---------

Co-authored-by: G.E <gregory.economou@vectorcamp.gr>
2024-06-26 22:35:33 +03:00
gtsoul-tech
30dd577126 Bug fix/clang-tidy-performance (#300)
Various clang-tidy-performance fixes:
* noexcept
* performance-noexcept-swap
* performance
* performance-move-const-arg
* performance-unnecessary-value-param
* performance-inefficient-vector-operation
* performance-no-int-to-ptr
* add performance
* performance-inefficient-string-concatenation
* clang-analyzer-deadcode.DeadStores
* performance-inefficient-vector-operation
* clang-analyzer-core.NullDereference
* clang-analyzer-core.UndefinedBinaryOperatorResult
* clang-analyzer-core.CallAndMessage

---------

Co-authored-by: gtsoul-tech <gtsoulkanakis@gmail.com>
2024-06-20 14:57:19 +03:00
gtsoul-tech
e7e65b1aae Script for the clang-tidy CI (#299)
script to clang-tidy CI

Co-authored-by: gtsoul-tech <gtsoulkanakis@gmail.com>
2024-06-11 15:05:52 +03:00
gtsoul-tech
502c0f863a Bug fix/clang tidy warnings part3 (#298)
* clang-analyzer-deadcode.DeadStores

* clang-analyzer-optin.performance.Padding

---------

Co-authored-by: gtsoul-tech <gtsoulkanakis@gmail.com>
2024-06-10 10:08:54 +03:00
gtsoul-tech
44e2d3bfc1 Clang-tidy config (#297)
clang-tidy config

Co-authored-by: gtsoul-tech <gtsoulkanakis@gmail.com>
2024-06-07 17:10:32 +03:00
gtsoul-tech
999263d140 Bug fix/clang tidy warnings part2 (#296)
* core.StackAddressEscape

* cplusplus.VirtualCall

* clang-analyzer-deadcode.DeadStores

* clang-analyzer-core.NullDereference

* clang-analyzer-core.NonNullParamChecker

* change to nolint

---------

Co-authored-by: gtsoul-tech <gtsoulkanakis@gmail.com>
2024-06-04 16:18:17 +03:00
Konstantinos Margaritis
79443a96f4 Fix Clang Tidy warnings (#295)
Fixes some of the clang-tidy warnings
clang-analyzer-deadcode.DeadStores
clang-analyzer-cplusplus.NewDelete
clang-analyzer-core.uninitialized.UndefReturn

closes some:#253

ignored in this pr:
/usr/include/boost/smart_ptr/detail/shared_count.hpp:432:24
/usr/include/boost/smart_ptr/detail/shared_count.hpp:443:24
51 in build/src/parser
gtest ones
src/fdr/teddy_compile.cpp:600:5 refactoring on way
src/fdr/fdr_compile.cpp:209:5 refactoring on way
2024-05-31 18:23:16 +03:00
gtsoul-tech
bfcc696320 clang-analyzer-cplusplus.Move 2024-05-31 10:34:55 +03:00
gtsoul-tech
b4a176738a clang-analyzer-core.uninitialized.UndefReturn 2024-05-31 10:24:44 +03:00
gtsoul-tech
829b2d75fd remove comment 2024-05-31 09:47:45 +03:00
Konstantinos Margaritis
6c6f7ba2fa Fix Clang Tidy warning optin.performance.Padding (#293)
Fixes some optin.performance.Padding

closes some: #253
2024-05-30 17:24:14 +03:00
gtsoul-tech
120e896691 clang-analyzer-cplusplus.NewDelete 2024-05-30 16:40:55 +03:00
gtsoul-tech
d1ffb09774 deadcode.DeadStores 2024-05-30 16:40:47 +03:00
gtsoul-tech
a846d496b4 deadcode.DeadStores 2024-05-30 16:40:18 +03:00
gtsoul-tech
793025fab6 uninitialized.UndefReturn 2024-05-29 11:51:06 +03:00
gtsoul-tech
9dd241e979 cplusplus.Move 2024-05-28 14:15:03 +03:00
gtsoul-tech
a2071582d5 optin.performance.Padding 2024-05-27 15:41:57 +03:00
Konstantinos Margaritis
02fc8e3b1c Fix/Suppress remaining Cppcheck warnings (#291)
Fix/suppress the following cppcheck warnings:

* arithOperationsOnVoidPointer
* uninitMember
* const*
* shadowVariable
* assignmentIntegerToAddress
* containerOutOfBounds
* pointer-related warnings in Ragel source
* missingOverride
* memleak
* knownConditionTrueFalse
* noExplicitConstructor
* invalidPrintfArgType_sint
* useStlAlgorithm
* cstyleCast
* clarifyCondition
* VSX-related cstyleCast
* unsignedLessThanZero 

Furthermore, we added a suppression list to be used, which also includes the following:
* missingIncludeSystem
* missingInclude
* unmatchedSuppression
2024-05-27 12:23:02 +03:00
Konstantinos Margaritis
a8e43a4c0b Part 5 of C-style cast cppcheck (#289)
Fixes some cstyleCasts part 5

closes some: #252
2024-05-24 23:24:58 +03:00
gtsoul-tech
7f67cfae50 revert uniform cstyle suppress 2024-05-24 10:12:15 +03:00
Konstantinos Margaritis
b94f220a4d Speed up truffle with 256b TBL instructions (#290)
256b wide SVE vectors allow some simplification of truffle. Up to 40%
speedup on graviton3. Going from 12500 MB/s to 17000 MB/s onhe
microbenchmark.
SVE2 also offer this capability for 128b vector with a speedup around
25% compared to normal SVE

Add unit tests and benchmark for this wide variant
2024-05-23 09:38:24 +03:00
Yoan Picchi
7054378c93 Speed up truffle with 256b TBL instructions
256b wide SVE vectors allow some simplification of truffle.
Up to 40% speedup on graviton3. Going from 12500 MB/s to 17000 MB/s
onhe microbenchmark.
SVE2 also offer this capability for 128b vector with a speedup around
25% compared to normal SVE

Add unit tests and benchmark for this wide variant

Signed-off-by: Yoan Picchi <yoan.picchi@arm.com>
2024-05-22 16:13:53 +00:00
gtsoul-tech
2042ef50a0 cstylecast parser 2024-05-22 11:11:13 +03:00
gtsoul-tech
23a2b4e830 cstylecasts and suppressions 2024-05-22 10:16:56 +03:00
Konstantinos Margaritis
154cb6333b Merge pull request #288 from isildur-g/bugfix-assert
revert a change to assert
2024-05-21 23:43:04 +03:00
Konstantinos Margaritis
23e05ec443 Merge pull request #287 from gtsoul-tech/bugFix/cppcheck-cStylecasts-Part4
Part 4 of C-style cast cppcheck
2024-05-21 15:59:51 +03:00