202 Commits

Author SHA1 Message Date
ypicchi-arm
9e9a10ad01
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
f7d5546fe5
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
689556d5f9
Various cppcheck fixes (#337) 2025-05-30 12:27:28 +03:00
gtsoul-tech
9a3268b047
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
aa6acaec84 optin.performance.Padding 2024-05-27 15:41:57 +03:00
Konstantinos Margaritis
c837925087
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
Yoan Picchi
938c026256 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
Konstantinos Margaritis
2ec64b6f07
Merge pull request #283 from isildur-g/wip-cppcheck271-part2
Wip cppcheck271 useStlAlgorithm part2
2024-05-21 15:52:15 +03:00
Konstantinos Margaritis
40da067b4f Add more C style casts fixes and suppressions 2024-05-18 21:49:54 +03:00
Konstantinos Margaritis
a8373df48b
Merge pull request #285 from gtsoul-tech/bugFix/cppcheck-cStylecasts-Part3
Part 3 of C-style cast cppcheck
2024-05-18 09:43:25 +03:00
gtsoul-tech
e261f286da cStyleCasts 2024-05-17 16:58:08 +03:00
gtsoul-tech
2fa06dd9ed cStyleCasts 2024-05-17 13:57:12 +03:00
g. economou
22c3e3da6e
Merge branch 'develop' into wip-cppcheck271-part2 2024-05-17 11:08:09 +03:00
G.E
f2cecfd0e2 next batch 2024-05-17 10:44:28 +03:00
Konstantinos Margaritis
59a098504e remove unused variables 2024-05-15 17:18:53 +03:00
Konstantinos Margaritis
6d6d4e1013 Fix unreadVariable warning 2024-05-15 17:05:50 +03:00
gtsoul-tech
0258606df3 explicit constructor Supervector 2024-05-14 13:32:50 +03:00
gtsoul-tech
9798b57f9e most ptr.get() conversion 2024-05-13 14:24:16 +03:00
gtsoul-tech
753c7de002 Merge branch 'develop' into test-noExplicitConstructor 2024-05-10 12:46:44 +03:00
gtsoul-tech
bdffbde80f noExplicitConstructor 1 more 2024-05-10 10:08:14 +03:00
gtsoul-tech
94b17ecaf2 noExplicitConstructor 2024-05-10 10:07:47 +03:00
Konstantinos Margaritis
7dd2135b80
Merge pull request #264 from gtsoul-tech/bugFix/cppcheck-constVariablePointer
Cppcheck constVariablePointer error
2024-05-08 10:28:24 +03:00
Konstantinos Margaritis
692a63c8ca
Merge pull request #263 from gtsoul-tech/bug/cppcheck-61
Cppcheck knownConditionTrueFalse error
2024-05-02 16:50:16 +03:00
gtsoul-tech
5ad1f2127f constVariablePointer 2024-05-02 14:30:18 +03:00
gtsoul-tech
a634d57b2d knownConditionTrueFalse fixes previously fp 2024-05-02 10:13:55 +03:00
g. economou
727cff3621
Merge branch 'develop' into wip-isildur-g-cppcheck-47-48-58 2024-05-01 10:59:59 +03:00
G.E
9902ca0e34 addressing 47 [constParameterReference],48 [constVariableReference],58
[constVariable]
2024-05-01 10:54:15 +03:00
Konstantinos Margaritis
27bb2b9134
Merge pull request #239 from ypicchi-arm/feature/add-sheng-unit-tests
Feature/add sheng unit tests
2024-05-01 00:07:14 +03:00
Yoan Picchi
f2d8d63793 Add sheng tests
Signed-off-by: Yoan Picchi <yoan.picchi@arm.com>
2024-04-30 14:34:14 +00:00
gtsoul-tech
b5bf3d8d31 unreadVariable 2024-04-30 13:36:39 +03:00
gtsoul-tech
bb6464431f new variableScope 2024-04-29 15:09:55 +03:00
gtsoul-tech
987cd17160 variableScope 2024-04-29 13:13:07 +03:00
gtsoul-tech
adda613f51 shiftTooManyBitsSigned 2024-04-24 11:13:28 +03:00
gtsoul-tech
e6c884358e uninitvar 2024-04-24 11:13:02 +03:00
gtsoul-tech
9b9df1b397 invalidPrintfArgType_sint 2024-04-24 11:07:23 +03:00
Konstantinos Margaritis
f57928ea08 fix SIMDe emulation builds on Arm, add native translation from x86 for comparison 2023-11-27 12:21:58 +00:00
Konstantnos Margaritis
62cb8d6c2d fix test for SIMDe 2023-11-23 16:07:58 +00:00
Konstantinos Margaritis
35c0711689 use the right type of cast 2023-10-04 23:35:10 +03:00
Konstantinos Margaritis
72afe16452 clang 16 as well 2023-10-04 22:07:34 +03:00
Konstantinos Margaritis
2e88df1a89 use the conditional in the right way 2023-10-04 20:35:58 +03:00
Konstantinos Margaritis
354fda48fb add conditional for __clang__ 2023-10-04 20:28:35 +03:00
Konstantinos Margaritis
b7d1bc0298 clang 15 (but not 16) fails on ppc64le with -Wdeprecate-lax-vec-conv-all 2023-10-04 20:09:45 +03:00
Konstantinos Margaritis
9aa61440ea Reduce unit test runtimes dramatically for debug builds 2023-10-04 19:21:30 +03:00
Hong, Yang A
4fb3a48dfd bugfix: add vbmi case for test in database.cpp 2023-09-05 13:52:10 +03:00
Hong, Yang A
b7ee9102ee update year 2022 2023-09-05 13:49:52 +03:00
Hong, Yang A
684f0ce2cb UTF-8 validation: fix one cotec check corner issue
fix github issue #362
2023-09-05 13:49:41 +03:00
Konstantinos Margaritis
94fe406f0c [VSX] correct lshiftbyte_m128/rshiftbyte_m128, variable_byte_shift 2022-09-06 23:59:51 +03:00
Konstantinos Margaritis
74ab41897c Add missing <memory> header 2022-08-30 20:40:23 +03:00
Danila Kutenin
db52ce6f08 Fix avx512 movemask call 2022-07-20 09:03:50 +01:00
Danila Kutenin
49eb18ee4f Optimize vectorscan for aarch64 by using shrn instruction
This optimization is based on the thread
https://twitter.com/Danlark1/status/1539344279268691970 and uses
shift right and narrow by 4 instruction https://developer.arm.com/documentation/ddi0596/2020-12/SIMD-FP-Instructions/SHRN--SHRN2--Shift-Right-Narrow--immediate--

To achieve that, I needed to redesign a little movemask into comparemask
and have an additional step towards mask iteration. Our benchmarks
showed 10-15% improvement on average for long matches.
2022-06-26 22:55:45 +00:00