Commit Graph

21 Commits

Author SHA1 Message Date
Роман Донченко 69e1aa860b Fix many spelling errors 2020-10-11 08:35:55 +00:00
Dario Lombardo 2fe46f29c4 ws_mempbrk_sse42: use same var names.
Found by clang-tidy.

Change-Id: I2f89c6860d591c5c1563b9ca01306bb3d9e5e42c
Reviewed-on: https://code.wireshark.org/review/31359
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-04 11:33:32 +00:00
Dario Lombardo c9cb93acfc wsutil: add CR to license.
Change-Id: Ibef7761410cd4d653be0d87c2bd39c040da62e08
Reviewed-on: https://code.wireshark.org/review/26385
Reviewed-by: Dario Lombardo <lomato@gmail.com>
2018-03-09 08:52:17 +00:00
Dario Lombardo e7ab7a907c spdx: more licenses converted.
Change-Id: I8f6693108c43959e54911d35b4fbf730c59add60
Reviewed-on: https://code.wireshark.org/review/26361
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-09 04:50:23 +00:00
Guy Harris 32e785f813 The official #define for 32-bit and 64-bit Windows is _WIN32.
It's _WIN32, with a leading underscore, not WIN32.  See, for example:

    https://sourceforge.net/p/predef/wiki/OperatingSystems/

and

    https://msdn.microsoft.com/en-us/library/b0084kay.aspx

*Some* environments may also define WIN32, but we shouldn't depend on
that.

Replace all-caps "WIN32" referring to Windows in comments and other text
with "Windows" or "Win32".  (The two are pretty much equivalent, these
days; nobody much cares about Win16, not that we ever ran on it, and
64-bit Windows is just a 64-bitified Win32.)

Change-Id: Id327bcd4b1e9baa4f27055eff08c2d9e594d6f70
Reviewed-on: https://code.wireshark.org/review/10367
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-09-02 22:59:10 +00:00
Guy Harris bfb4327291 Remove tvb_ from the names of wsutil mempbrk routines.
Routines that don't take a tvbuff as an argument shouldn't have tvb_ in
the name.

Change-Id: I3550256551e30b3f329cbbfca71ef27c727d29c0
Reviewed-on: https://code.wireshark.org/review/7302
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-21 20:39:25 +00:00
Guy Harris f3a68f00a1 Rename the slower-but-portable mempbrk to ws_mempbrk_portable_exec().
That parallels ws_mempbrk_sse42_exec().

Change-Id: I1662badc6d1efab5bdd827f29bbad3712464ec43
Reviewed-on: https://code.wireshark.org/review/7301
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-21 20:18:02 +00:00
Guy Harris e35aa1ff48 Move declarations of internal ws_mempbrk routines to a separate header.
Put the internal routines, which are only to be used by the
implementation of the mempbrk functions, to a separate header file, so
that they're not exported even in the standard header file.

Change-Id: I92c39b138de3e4f9da1b102210b39d50728e2fd6
Reviewed-on: https://code.wireshark.org/review/7300
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-21 20:14:24 +00:00
Pascal Quantin bdcac172ea Fix crash at startup in SSE4.2 code when running a 32 bits Windows build
There is no guarantee that a g_malloc'ed memory block will be aligned on a 128 bits boundary
Instead use a static variable definition (at the cost of exposing the HAVE_SSE4_2 compilation flag in ws_mempbrk.h)

Change-Id: I661bf479a9d458d64c96bafc940c519d29a4780b
Reviewed-on: https://code.wireshark.org/review/7070
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-02-12 16:37:55 +00:00
Hadriel Kaplan a837570d02 Combine SSE and pre-compiled patterns for faster pbrk
This combines the SSE4.2 instructions usage, with pre-compiled
pattern searching usage, for a faster pbrk search method.

Testing against large files of HTTP and SIP, there is about
a 5% performance improvement by using pre-"compiled" patterns
for guint8_pbrk() instead of passing it the search string and
having it build the match array every time.
Similar to regular expressions, "compiling" the pattern match array
in advance only once and using the "compiled" patterns for
the searches is faster than compiling it every time.

Change-Id: Ifcbc14a6c93f32d15663a10d974bacdca5119a8e
Ping-Bug: 10798
Reviewed-on: https://code.wireshark.org/review/6990
Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-11 09:14:50 +00:00
Pascal Quantin 85aa1bcc75 ws_mempbrk_sse42.c: remove inclusion of stdint.h as it's no more required after g79e4da4
Change-Id: I48776a286ba1d412ecda55857938d9daa77fd3f7
Reviewed-on: https://code.wireshark.org/review/5136
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-11-05 12:38:06 +00:00
Stephen Fisher 79e4da4d63 Fix compilation error on FreeBSD 10.0-RELEASE (with clang): change int8_t to
gint.

Change-Id: I7974497a8f50e5d18ec74aa7554f058056a6022c
Reviewed-on: https://code.wireshark.org/review/5115
Petri-Dish: Stephen Fisher <stephenfisher@centurylink.net>
Reviewed-by: Stephen Fisher <stephenfisher@centurylink.net>
2014-11-04 20:02:34 +00:00
Peter Wu ec6a22dc3b Workaround for ASAN failure in _ws_mempbrk_sse42
When ASAN is enabled, a false buffer overflow warning is raised. It is
a false positive since everything starting at '\0' will get ignored by
the PCMPISTRI instruction (see Intel(r) SSE4 Programming Reference,
5.3.1.5 "Valid/Invalid Override of Comparisons", and 5.3.1.2
"Aggregrate Operation", case "Equal any").

Concerns about reading past the end of the page turns out to be false,
there always seem to be a valid page after the current one (for static
and heap memory at least). It is an non-issue since strlen also does
not have issues with this.

Rather than fully disabling SSE 4.2 and using the fallback
implementation for ASAN-enabled builds, read the set of characters from
'a' into the mask without a 128-bit read and then still use SSE 4.2
for the actual query.

Bug: 10214
Change-Id: Ie4a526e60b43bfc08dd1d821556766f14a49be4d
Reviewed-on: https://code.wireshark.org/review/2618
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-06 22:53:34 +00:00
Guy Harris c654add76c Add consts to casts to suppress warnings.
Pull the "cast this to a pointer to an __m128i" idiom into a macro, and
use the macro; have that macro use "const" in the casts.

Change-Id: Ife90b7daef2f09368790f3b2ffbb227d6d794dea
Reviewed-on: https://code.wireshark.org/review/2871
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-06 01:30:18 +00:00
AndersBroman fcb019acb8 Change HAVE_SSE42 to HAVE_SSE4_2 add $(SIMD_FLAGS)
Add autotools macros to distribution
Call AX_EXT to define HAVE_SSE4_2

Change-Id: I9ff085d923dfafb32510cdd14290e74a2aaea302
Reviewed-on: https://code.wireshark.org/review/2110
Tested-by: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-10 14:51:26 +00:00
Alexis La Goutte d041b1e91b WS mempbrk SEE4.2: Fix indent (use 2spaces) and add Modelines info
Change-Id: I50c71401f46846a459b18347ef0b9793a2a05ea7
Reviewed-on: https://code.wireshark.org/review/2084
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-10 08:13:54 +00:00
AndersBroman c9621e2bef We must include config.h to have HAVE_SSE42
Change-Id: I2b882b05b2864edbfef0ea03bc086efeaac84ad2
Reviewed-on: https://code.wireshark.org/review/2086
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-09 19:30:17 +00:00
AndersBroman 618187a777 Hopfully thiw will make the Solaris build going.
Change-Id: I44b93494f6d3cb0504517ab4581afeef180f1513
Reviewed-on: https://code.wireshark.org/review/2079
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-09 16:36:29 +00:00
AndersBroman 8e8a4ceba3 Try to fix the builds.
Change-Id: I3ccb5c1b40504cd9314da5a09b225e3e2bf991b8
Reviewed-on: https://code.wireshark.org/review/2073
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-09 15:31:45 +00:00
Alexis La Goutte d3104c228e Make buildbot Happy about shadow index variable...
Change-Id: I4c93af520883235828a4bb1881c74035eace995d
Reviewed-on: https://code.wireshark.org/review/2070
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-06-09 13:33:33 +00:00
Jakub Zawadzki fcb710baec Add sse4.2 optimized function ws_mempbrk_sse42()
In text protocols, like SIP, lot of time is spend guint8_pbrk(),
assume that text is not binary (no NULs), and use SSE4.2 pcmpistri
instruction.

Also move & rename guint8_pbrk() from tvbuff.c as _ws_mempbrk.

HAVE_SSE42 must be defined to use _ws_mempbrk_sse42() only activaded for
Windows currently.

Change-Id: Ic853d84805bdb6492c4f45d2bcc79a973fd9804e
Reviewed-on: https://code.wireshark.org/review/1730
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-09 12:02:27 +00:00