aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil/ws_mempbrk_sse42.c
AgeCommit message (Collapse)AuthorFilesLines
2015-09-02The official #define for 32-bit and 64-bit Windows is _WIN32.Guy Harris1-1/+1
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-02-21Remove tvb_ from the names of wsutil mempbrk routines.Guy Harris1-2/+2
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-21Rename the slower-but-portable mempbrk to ws_mempbrk_portable_exec().Guy Harris1-3/+3
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-21Move declarations of internal ws_mempbrk routines to a separate header.Guy Harris1-0/+1
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-12Fix crash at startup in SSE4.2 code when running a 32 bits Windows buildPascal Quantin1-11/+7
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-11Combine SSE and pre-compiled patterns for faster pbrkHadriel Kaplan1-83/+40
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>
2014-11-05ws_mempbrk_sse42.c: remove inclusion of stdint.h as it's no more required ↵Pascal Quantin1-1/+0
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-04Fix compilation error on FreeBSD 10.0-RELEASE (with clang): change int8_t toStephen Fisher1-1/+1
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-07-06Workaround for ASAN failure in _ws_mempbrk_sse42Peter Wu1-0/+25
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-06Add consts to casts to suppress warnings.Guy Harris1-8/+8
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-06-10Change HAVE_SSE42 to HAVE_SSE4_2 add $(SIMD_FLAGS)AndersBroman1-2/+2
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-10WS mempbrk SEE4.2: Fix indent (use 2spaces) and add Modelines infoAlexis La Goutte1-36/+48
Change-Id: I50c71401f46846a459b18347ef0b9793a2a05ea7 Reviewed-on: https://code.wireshark.org/review/2084 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-09We must include config.h to have HAVE_SSE42AndersBroman1-1/+2
Change-Id: I2b882b05b2864edbfef0ea03bc086efeaac84ad2 Reviewed-on: https://code.wireshark.org/review/2086 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-09Hopfully thiw will make the Solaris build going.AndersBroman1-1/+3
Change-Id: I44b93494f6d3cb0504517ab4581afeef180f1513 Reviewed-on: https://code.wireshark.org/review/2079 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-09Try to fix the builds.AndersBroman1-2/+5
Change-Id: I3ccb5c1b40504cd9314da5a09b225e3e2bf991b8 Reviewed-on: https://code.wireshark.org/review/2073 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-09Make buildbot Happy about shadow index variable...Alexis La Goutte1-9/+9
Change-Id: I4c93af520883235828a4bb1881c74035eace995d Reviewed-on: https://code.wireshark.org/review/2070 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-06-09Add sse4.2 optimized function ws_mempbrk_sse42()Jakub Zawadzki1-0/+188
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>