Commit Graph

361 Commits

Author SHA1 Message Date
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
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
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
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
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
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
a846d496b4 deadcode.DeadStores 2024-05-30 16:40:18 +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
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
23a2b4e830 cstylecasts and suppressions 2024-05-22 10:16:56 +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
Konstantinos Margaritis
1fc353efa6 Merge pull request #283 from isildur-g/wip-cppcheck271-part2
Wip cppcheck271 useStlAlgorithm part2
2024-05-21 15:52:15 +03:00
gtsoul-tech
d7dc3ec916 cstylecasts suppress,fixes 2024-05-20 17:09:30 +03:00
gtsoul-tech
cb8808619e fix cStyleCasts 2024-05-20 14:54:35 +03:00
Konstantinos Margaritis
c01df9dfac Fix typo 2024-05-18 22:52:17 +03:00
Konstantinos Margaritis
b07f527f2e Add more C style casts fixes and suppressions 2024-05-18 21:49:54 +03:00
Konstantinos Margaritis
8b93f44856 remove unneeded suppression 2024-05-18 21:47:47 +03:00
Konstantinos Margaritis
ac5018cdcf Fix more C-style casts 2024-05-18 15:10:34 +03:00
Konstantinos Margaritis
3bcf7e81e3 Fix casts 2024-05-18 14:58:11 +03:00
G.E
44b05fc6c0 clean up comments 2024-05-17 11:27:43 +03:00
g. economou
45de972f44 Merge branch 'develop' into wip-cppcheck271-part2 2024-05-17 11:08:09 +03:00
G.E
d78cfb922e first batch of cppcheck disables and a few more stl-ifications,
involving use of accumulate() .
2024-05-16 23:01:17 +03:00
Konstantinos Margaritis
258197eb54 add alternative macro without C casts to avoid Cppcheck warnings 2024-05-16 15:58:02 +03:00
Konstantinos Margaritis
4f3f25fa54 Fix C style casts in mcsheng_compile.cpp 2024-05-16 15:57:39 +03:00
Konstantinos Margaritis
e39db866ce Fix C-style casts 2024-05-16 12:03:42 +03:00
Konstantinos Margaritis
afd03a3d85 Merge pull request #279 from VectorCamp/bugfix/cppcheck-unreadVariable-others
Fix marked as done cppcheck warnings unreadVariable & others
2024-05-15 23:18:02 +03:00
Konstantinos Margaritis
4bb3f4445f Fix unreadVariable warning 2024-05-15 17:05:50 +03:00
Konstantinos Margaritis
8336b0860b Fix variableScope 2024-05-15 17:04:11 +03:00
Konstantinos Margaritis
141b282595 False positives duplicateExpression 2024-05-15 17:00:28 +03:00
Konstantinos Margaritis
129df24422 Fix remaining marked as done const* cppcheck warnings 2024-05-15 10:52:31 +03:00
Konstantinos Margaritis
93239afa3a Merge pull request #277 from isildur-g/wip-cppcheck271
phase 1 of addressing cppcheck useStlAlgorithm warnings for fill and copy operations
2024-05-15 10:44:15 +03:00
G.E
b541288cd5 phase 1 of addressing cppcheck useStlAlgorithm warnings,
this set only includes fill and copy operations.
2024-05-14 17:37:38 +03:00
Konstantinos Margaritis
876a59deff Merge pull request #274 from gtsoul-tech/bugFix/cppcheckError-noexplicitConstructor
Bug fix/cppcheck error noexplicitconstructor
2024-05-13 21:52:55 +03:00
gtsoul-tech
e8850987d0 Merge branch 'develop' into bugFix/cppcheckError-noexplicitConstructor 2024-05-13 09:13:28 +03:00
Konstantinos Margaritis
2b76edee4a Fix marked as false positive knownConditionTrueFalse cppcheck warnings
std::make_shared<> does not return null, it throws std::bad_alloc.
2024-05-12 20:24:00 +03:00
gtsoul-tech
b3a9366442 Merge branch 'develop' into test-noExplicitConstructor 2024-05-10 12:46:44 +03:00
gtsoul-tech
1986280b41 noExplicitConstructor 2024-05-10 10:07:47 +03:00
g. economou
3e395a9d1e Merge branch 'develop' into wip-isildur-g-cppcheck66 2024-05-09 10:28:25 +03:00
Konstantinos Margaritis
edd9b9e4e1 Merge pull request #264 from gtsoul-tech/bugFix/cppcheck-constVariablePointer
Cppcheck constVariablePointer error
2024-05-08 10:28:24 +03:00
g. economou
c979e4ac11 Merge branch 'develop' into wip-isildur-g-cppcheck66 2024-05-02 18:37:46 +03:00
G.E
33f80d3261 addressing cppcheck shadowFunction warnings 2024-05-02 18:00:03 +03:00
Konstantinos Margaritis
851de33405 Merge pull request #263 from gtsoul-tech/bug/cppcheck-61
Cppcheck knownConditionTrueFalse error
2024-05-02 16:50:16 +03:00
gtsoul-tech
2903681129 constVariablePointer 2024-05-02 14:30:18 +03:00
gtsoul-tech
51ce67be3d knownConditionTrueFalse fixes previously fp 2024-05-02 10:13:55 +03:00
gtsoul-tech
312b77202c knownConditionTrueFalse 2024-05-01 13:04:51 +03:00
g. economou
583e1d576a Merge branch 'develop' into wip-isildur-g-cppcheck-47-48-58 2024-05-01 10:59:59 +03:00
G.E
98243a6a08 addressing 47 [constParameterReference],48 [constVariableReference],58
[constVariable]
2024-05-01 10:54:15 +03:00