diff options
author | thegeorg <thegeorg@yandex-team.ru> | 2022-02-10 16:45:12 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:12 +0300 |
commit | 49116032d905455a7b1c994e4a696afc885c1e71 (patch) | |
tree | be835aa92c6248212e705f25388ebafcf84bc7a1 /contrib/libs/hyperscan/runtime_avx2 | |
parent | 4e839db24a3bbc9f1c610c43d6faaaa99824dcca (diff) | |
download | ydb-49116032d905455a7b1c994e4a696afc885c1e71.tar.gz |
Restoring authorship annotation for <thegeorg@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/hyperscan/runtime_avx2')
-rw-r--r-- | contrib/libs/hyperscan/runtime_avx2/.yandex_meta/licenses.list.txt | 64 | ||||
-rw-r--r-- | contrib/libs/hyperscan/runtime_avx2/hs_common.h | 1192 | ||||
-rw-r--r-- | contrib/libs/hyperscan/runtime_avx2/hs_runtime.h | 1242 | ||||
-rw-r--r-- | contrib/libs/hyperscan/runtime_avx2/ya.make | 996 |
4 files changed, 1747 insertions, 1747 deletions
diff --git a/contrib/libs/hyperscan/runtime_avx2/.yandex_meta/licenses.list.txt b/contrib/libs/hyperscan/runtime_avx2/.yandex_meta/licenses.list.txt index 358c19fe4a..b2ced66bbd 100644 --- a/contrib/libs/hyperscan/runtime_avx2/.yandex_meta/licenses.list.txt +++ b/contrib/libs/hyperscan/runtime_avx2/.yandex_meta/licenses.list.txt @@ -1,32 +1,32 @@ -====================BSD-3-Clause==================== - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Intel Corporation nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - - -====================COPYRIGHT==================== - * Copyright (c) 2015-2018, Intel Corporation - - -====================COPYRIGHT==================== - * Copyright (c) 2015-2019, Intel Corporation +====================BSD-3-Clause==================== + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Intel Corporation nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + + +====================COPYRIGHT==================== + * Copyright (c) 2015-2018, Intel Corporation + + +====================COPYRIGHT==================== + * Copyright (c) 2015-2019, Intel Corporation diff --git a/contrib/libs/hyperscan/runtime_avx2/hs_common.h b/contrib/libs/hyperscan/runtime_avx2/hs_common.h index 597a341396..c19b8f0149 100644 --- a/contrib/libs/hyperscan/runtime_avx2/hs_common.h +++ b/contrib/libs/hyperscan/runtime_avx2/hs_common.h @@ -1,596 +1,596 @@ -/* - * Copyright (c) 2015-2019, Intel Corporation - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Intel Corporation nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef HS_AVX2_COMMON_H -#define HS_AVX2_COMMON_H - -#if defined(_WIN32) -#define HS_CDECL __cdecl -#else -#define HS_CDECL -#endif -#include <stdlib.h> - -/** - * @file - * @brief The Hyperscan common API definition. - * - * Hyperscan is a high speed regular expression engine. - * - * This header contains functions available to both the Hyperscan compiler and - * runtime. - */ - -#ifdef __cplusplus -extern "C" -{ -#endif - -struct hs_database; - -/** - * A Hyperscan pattern database. - * - * Generated by one of the Hyperscan compiler functions: - * - @ref hs_compile() - * - @ref hs_compile_multi() - * - @ref hs_compile_ext_multi() - */ -typedef struct hs_database hs_database_t; - -/** - * A type for errors returned by Hyperscan functions. - */ -typedef int hs_error_t; - -/** - * Free a compiled pattern database. - * - * The free callback set by @ref hs_set_database_allocator() (or @ref - * hs_set_allocator()) will be used by this function. - * - * @param db - * A compiled pattern database. NULL may also be safely provided, in which - * case the function does nothing. - * - * @return - * @ref HS_SUCCESS on success, other values on failure. - */ -hs_error_t avx2_hs_free_database(hs_database_t *db); - -/** - * Serialize a pattern database to a stream of bytes. - * - * The allocator callback set by @ref hs_set_misc_allocator() (or @ref - * hs_set_allocator()) will be used by this function. - * - * @param db - * A compiled pattern database. - * - * @param bytes - * On success, a pointer to an array of bytes will be returned here. - * These bytes can be subsequently relocated or written to disk. The - * caller is responsible for freeing this block. - * - * @param length - * On success, the number of bytes in the generated byte array will be - * returned here. - * - * @return - * @ref HS_SUCCESS on success, @ref HS_NOMEM if the byte array cannot be - * allocated, other values may be returned if errors are detected. - */ -hs_error_t avx2_hs_serialize_database(const hs_database_t *db, char **bytes, - size_t *length); - -/** - * Reconstruct a pattern database from a stream of bytes previously generated - * by @ref hs_serialize_database(). - * - * This function will allocate sufficient space for the database using the - * allocator set with @ref hs_set_database_allocator() (or @ref - * hs_set_allocator()); to use a pre-allocated region of memory, use the @ref - * hs_deserialize_database_at() function. - * - * @param bytes - * A byte array generated by @ref hs_serialize_database() representing a - * compiled pattern database. - * - * @param length - * The length of the byte array generated by @ref hs_serialize_database(). - * This should be the same value as that returned by @ref - * hs_serialize_database(). - * - * @param db - * On success, a pointer to a newly allocated @ref hs_database_t will be - * returned here. This database can then be used for scanning, and - * eventually freed by the caller using @ref hs_free_database(). - * - * @return - * @ref HS_SUCCESS on success, other values on failure. - */ -hs_error_t avx2_hs_deserialize_database(const char *bytes, - const size_t length, - hs_database_t **db); - -/** - * Reconstruct a pattern database from a stream of bytes previously generated - * by @ref hs_serialize_database() at a given memory location. - * - * This function (unlike @ref hs_deserialize_database()) will write the - * reconstructed database to the memory location given in the @p db parameter. - * The amount of space required at this location can be determined with the - * @ref hs_serialized_database_size() function. - * - * @param bytes - * A byte array generated by @ref hs_serialize_database() representing a - * compiled pattern database. - * - * @param length - * The length of the byte array generated by @ref hs_serialize_database(). - * This should be the same value as that returned by @ref - * hs_serialize_database(). - * - * @param db - * Pointer to an 8-byte aligned block of memory of sufficient size to hold - * the deserialized database. On success, the reconstructed database will - * be written to this location. This database can then be used for pattern - * matching. The user is responsible for freeing this memory; the @ref - * hs_free_database() call should not be used. - * - * @return - * @ref HS_SUCCESS on success, other values on failure. - */ -hs_error_t avx2_hs_deserialize_database_at(const char *bytes, - const size_t length, - hs_database_t *db); - -/** - * Provides the size of the stream state allocated by a single stream opened - * against the given database. - * - * @param database - * Pointer to a compiled (streaming mode) pattern database. - * - * @param stream_size - * On success, the size in bytes of an individual stream opened against the - * given database is placed in this parameter. - * - * @return - * @ref HS_SUCCESS on success, other values on failure. - */ -hs_error_t avx2_hs_stream_size(const hs_database_t *database, - size_t *stream_size); - -/** - * Provides the size of the given database in bytes. - * - * @param database - * Pointer to compiled pattern database. - * - * @param database_size - * On success, the size of the compiled database in bytes is placed in this - * parameter. - * - * @return - * @ref HS_SUCCESS on success, other values on failure. - */ -hs_error_t avx2_hs_database_size(const hs_database_t *database, - size_t *database_size); - -/** - * Utility function for reporting the size that would be required by a - * database if it were deserialized. - * - * This can be used to allocate a shared memory region or other "special" - * allocation prior to deserializing with the @ref hs_deserialize_database_at() - * function. - * - * @param bytes - * Pointer to a byte array generated by @ref hs_serialize_database() - * representing a compiled pattern database. - * - * @param length - * The length of the byte array generated by @ref hs_serialize_database(). - * This should be the same value as that returned by @ref - * hs_serialize_database(). - * - * @param deserialized_size - * On success, the size of the compiled database that would be generated - * by @ref hs_deserialize_database_at() is returned here. - * - * @return - * @ref HS_SUCCESS on success, other values on failure. - */ -hs_error_t avx2_hs_serialized_database_size(const char *bytes, - const size_t length, - size_t *deserialized_size); - -/** - * Utility function providing information about a database. - * - * @param database - * Pointer to a compiled database. - * - * @param info - * On success, a string containing the version and platform information for - * the supplied database is placed in the parameter. The string is - * allocated using the allocator supplied in @ref hs_set_misc_allocator() - * (or malloc() if no allocator was set) and should be freed by the caller. - * - * @return - * @ref HS_SUCCESS on success, other values on failure. - */ -hs_error_t avx2_hs_database_info(const hs_database_t *database, - char **info); - -/** - * Utility function providing information about a serialized database. - * - * @param bytes - * Pointer to a serialized database. - * - * @param length - * Length in bytes of the serialized database. - * - * @param info - * On success, a string containing the version and platform information - * for the supplied serialized database is placed in the parameter. The - * string is allocated using the allocator supplied in @ref - * hs_set_misc_allocator() (or malloc() if no allocator was set) and - * should be freed by the caller. - * - * @return - * @ref HS_SUCCESS on success, other values on failure. - */ -hs_error_t avx2_hs_serialized_database_info(const char *bytes, - size_t length, char **info); - -/** - * The type of the callback function that will be used by Hyperscan to allocate - * more memory at runtime as required, for example in @ref hs_open_stream() to - * allocate stream state. - * - * If Hyperscan is to be used in a multi-threaded, or similarly concurrent - * environment, the allocation function will need to be re-entrant, or - * similarly safe for concurrent use. - * - * @param size - * The number of bytes to allocate. - * @return - * A pointer to the region of memory allocated, or NULL on error. - */ -typedef void *(HS_CDECL *hs_alloc_t)(size_t size); - -/** - * The type of the callback function that will be used by Hyperscan to free - * memory regions previously allocated using the @ref hs_alloc_t function. - * - * @param ptr - * The region of memory to be freed. - */ -typedef void (HS_CDECL *hs_free_t)(void *ptr); - -/** - * Set the allocate and free functions used by Hyperscan for allocating - * memory at runtime for stream state, scratch space, database bytecode, - * and various other data structure returned by the Hyperscan API. - * - * The function is equivalent to calling @ref hs_set_stream_allocator(), - * @ref hs_set_scratch_allocator(), @ref hs_set_database_allocator() and - * @ref hs_set_misc_allocator() with the provided parameters. - * - * This call will override any previous allocators that have been set. - * - * Note: there is no way to change the allocator used for temporary objects - * created during the various compile calls (@ref hs_compile(), @ref - * hs_compile_multi(), @ref hs_compile_ext_multi()). - * - * @param alloc_func - * A callback function pointer that allocates memory. This function must - * return memory suitably aligned for the largest representable data type - * on this platform. - * - * @param free_func - * A callback function pointer that frees allocated memory. - * - * @return - * @ref HS_SUCCESS on success, other values on failure. - */ -hs_error_t avx2_hs_set_allocator(hs_alloc_t alloc_func, - hs_free_t free_func); - -/** - * Set the allocate and free functions used by Hyperscan for allocating memory - * for database bytecode produced by the compile calls (@ref hs_compile(), @ref - * hs_compile_multi(), @ref hs_compile_ext_multi()) and by database - * deserialization (@ref hs_deserialize_database()). - * - * If no database allocation functions are set, or if NULL is used in place of - * both parameters, then memory allocation will default to standard methods - * (such as the system malloc() and free() calls). - * - * This call will override any previous database allocators that have been set. - * - * Note: the database allocator may also be set by calling @ref - * hs_set_allocator(). - * - * Note: there is no way to change how temporary objects created during the - * various compile calls (@ref hs_compile(), @ref hs_compile_multi(), @ref - * hs_compile_ext_multi()) are allocated. - * - * @param alloc_func - * A callback function pointer that allocates memory. This function must - * return memory suitably aligned for the largest representable data type - * on this platform. - * - * @param free_func - * A callback function pointer that frees allocated memory. - * - * @return - * @ref HS_SUCCESS on success, other values on failure. - */ -hs_error_t avx2_hs_set_database_allocator(hs_alloc_t alloc_func, - hs_free_t free_func); - -/** - * Set the allocate and free functions used by Hyperscan for allocating memory - * for items returned by the Hyperscan API such as @ref hs_compile_error_t, @ref - * hs_expr_info_t and serialized databases. - * - * If no misc allocation functions are set, or if NULL is used in place of both - * parameters, then memory allocation will default to standard methods (such as - * the system malloc() and free() calls). - * - * This call will override any previous misc allocators that have been set. - * - * Note: the misc allocator may also be set by calling @ref hs_set_allocator(). - * - * @param alloc_func - * A callback function pointer that allocates memory. This function must - * return memory suitably aligned for the largest representable data type - * on this platform. - * - * @param free_func - * A callback function pointer that frees allocated memory. - * - * @return - * @ref HS_SUCCESS on success, other values on failure. - */ -hs_error_t avx2_hs_set_misc_allocator(hs_alloc_t alloc_func, - hs_free_t free_func); - -/** - * Set the allocate and free functions used by Hyperscan for allocating memory - * for scratch space by @ref hs_alloc_scratch() and @ref hs_clone_scratch(). - * - * If no scratch allocation functions are set, or if NULL is used in place of - * both parameters, then memory allocation will default to standard methods - * (such as the system malloc() and free() calls). - * - * This call will override any previous scratch allocators that have been set. - * - * Note: the scratch allocator may also be set by calling @ref - * hs_set_allocator(). - * - * @param alloc_func - * A callback function pointer that allocates memory. This function must - * return memory suitably aligned for the largest representable data type - * on this platform. - * - * @param free_func - * A callback function pointer that frees allocated memory. - * - * @return - * @ref HS_SUCCESS on success, other values on failure. - */ -hs_error_t avx2_hs_set_scratch_allocator(hs_alloc_t alloc_func, - hs_free_t free_func); - -/** - * Set the allocate and free functions used by Hyperscan for allocating memory - * for stream state by @ref hs_open_stream(). - * - * If no stream allocation functions are set, or if NULL is used in place of - * both parameters, then memory allocation will default to standard methods - * (such as the system malloc() and free() calls). - * - * This call will override any previous stream allocators that have been set. - * - * Note: the stream allocator may also be set by calling @ref - * hs_set_allocator(). - * - * @param alloc_func - * A callback function pointer that allocates memory. This function must - * return memory suitably aligned for the largest representable data type - * on this platform. - * - * @param free_func - * A callback function pointer that frees allocated memory. - * - * @return - * @ref HS_SUCCESS on success, other values on failure. - */ -hs_error_t avx2_hs_set_stream_allocator(hs_alloc_t alloc_func, - hs_free_t free_func); - -/** - * Utility function for identifying this release version. - * - * @return - * A string containing the version number of this release build and the - * date of the build. It is allocated statically, so it does not need to - * be freed by the caller. - */ -const char * avx2_hs_version(void); - -/** - * Utility function to test the current system architecture. - * - * Hyperscan requires the Supplemental Streaming SIMD Extensions 3 instruction - * set. This function can be called on any x86 platform to determine if the - * system provides the required instruction set. - * - * This function does not test for more advanced features if Hyperscan has - * been built for a more specific architecture, for example the AVX2 - * instruction set. - * - * @return - * @ref HS_SUCCESS on success, @ref HS_ARCH_ERROR if system does not - * support Hyperscan. - */ -hs_error_t avx2_hs_valid_platform(void); - -/** - * @defgroup HS_ERROR hs_error_t values - * - * @{ - */ - -/** - * The engine completed normally. - */ -#define HS_SUCCESS 0 - -/** - * A parameter passed to this function was invalid. - * - * This error is only returned in cases where the function can detect an - * invalid parameter -- it cannot be relied upon to detect (for example) - * pointers to freed memory or other invalid data. - */ -#define HS_INVALID (-1) - -/** - * A memory allocation failed. - */ -#define HS_NOMEM (-2) - -/** - * The engine was terminated by callback. - * - * This return value indicates that the target buffer was partially scanned, - * but that the callback function requested that scanning cease after a match - * was located. - */ -#define HS_SCAN_TERMINATED (-3) - -/** - * The pattern compiler failed, and the @ref hs_compile_error_t should be - * inspected for more detail. - */ -#define HS_COMPILER_ERROR (-4) - -/** - * The given database was built for a different version of Hyperscan. - */ -#define HS_DB_VERSION_ERROR (-5) - -/** - * The given database was built for a different platform (i.e., CPU type). - */ -#define HS_DB_PLATFORM_ERROR (-6) - -/** - * The given database was built for a different mode of operation. This error - * is returned when streaming calls are used with a block or vectored database - * and vice versa. - */ -#define HS_DB_MODE_ERROR (-7) - -/** - * A parameter passed to this function was not correctly aligned. - */ -#define HS_BAD_ALIGN (-8) - -/** - * The memory allocator (either malloc() or the allocator set with @ref - * hs_set_allocator()) did not correctly return memory suitably aligned for the - * largest representable data type on this platform. - */ -#define HS_BAD_ALLOC (-9) - -/** - * The scratch region was already in use. - * - * This error is returned when Hyperscan is able to detect that the scratch - * region given is already in use by another Hyperscan API call. - * - * A separate scratch region, allocated with @ref hs_alloc_scratch() or @ref - * hs_clone_scratch(), is required for every concurrent caller of the Hyperscan - * API. - * - * For example, this error might be returned when @ref hs_scan() has been - * called inside a callback delivered by a currently-executing @ref hs_scan() - * call using the same scratch region. - * - * Note: Not all concurrent uses of scratch regions may be detected. This error - * is intended as a best-effort debugging tool, not a guarantee. - */ -#define HS_SCRATCH_IN_USE (-10) - -/** - * Unsupported CPU architecture. - * - * This error is returned when Hyperscan is able to detect that the current - * system does not support the required instruction set. - * - * At a minimum, Hyperscan requires Supplemental Streaming SIMD Extensions 3 - * (SSSE3). - */ -#define HS_ARCH_ERROR (-11) - -/** - * Provided buffer was too small. - * - * This error indicates that there was insufficient space in the buffer. The - * call should be repeated with a larger provided buffer. - * - * Note: in this situation, it is normal for the amount of space required to be - * returned in the same manner as the used space would have been returned if the - * call was successful. - */ -#define HS_INSUFFICIENT_SPACE (-12) - -/** - * Unexpected internal error. - * - * This error indicates that there was unexpected matching behaviors. This - * could be related to invalid usage of stream and scratch space or invalid memory - * operations by users. - * - */ -#define HS_UNKNOWN_ERROR (-13) - -/** @} */ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* HS_AVX2_COMMON_H */ +/* + * Copyright (c) 2015-2019, Intel Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Intel Corporation nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef HS_AVX2_COMMON_H +#define HS_AVX2_COMMON_H + +#if defined(_WIN32) +#define HS_CDECL __cdecl +#else +#define HS_CDECL +#endif +#include <stdlib.h> + +/** + * @file + * @brief The Hyperscan common API definition. + * + * Hyperscan is a high speed regular expression engine. + * + * This header contains functions available to both the Hyperscan compiler and + * runtime. + */ + +#ifdef __cplusplus +extern "C" +{ +#endif + +struct hs_database; + +/** + * A Hyperscan pattern database. + * + * Generated by one of the Hyperscan compiler functions: + * - @ref hs_compile() + * - @ref hs_compile_multi() + * - @ref hs_compile_ext_multi() + */ +typedef struct hs_database hs_database_t; + +/** + * A type for errors returned by Hyperscan functions. + */ +typedef int hs_error_t; + +/** + * Free a compiled pattern database. + * + * The free callback set by @ref hs_set_database_allocator() (or @ref + * hs_set_allocator()) will be used by this function. + * + * @param db + * A compiled pattern database. NULL may also be safely provided, in which + * case the function does nothing. + * + * @return + * @ref HS_SUCCESS on success, other values on failure. + */ +hs_error_t avx2_hs_free_database(hs_database_t *db); + +/** + * Serialize a pattern database to a stream of bytes. + * + * The allocator callback set by @ref hs_set_misc_allocator() (or @ref + * hs_set_allocator()) will be used by this function. + * + * @param db + * A compiled pattern database. + * + * @param bytes + * On success, a pointer to an array of bytes will be returned here. + * These bytes can be subsequently relocated or written to disk. The + * caller is responsible for freeing this block. + * + * @param length + * On success, the number of bytes in the generated byte array will be + * returned here. + * + * @return + * @ref HS_SUCCESS on success, @ref HS_NOMEM if the byte array cannot be + * allocated, other values may be returned if errors are detected. + */ +hs_error_t avx2_hs_serialize_database(const hs_database_t *db, char **bytes, + size_t *length); + +/** + * Reconstruct a pattern database from a stream of bytes previously generated + * by @ref hs_serialize_database(). + * + * This function will allocate sufficient space for the database using the + * allocator set with @ref hs_set_database_allocator() (or @ref + * hs_set_allocator()); to use a pre-allocated region of memory, use the @ref + * hs_deserialize_database_at() function. + * + * @param bytes + * A byte array generated by @ref hs_serialize_database() representing a + * compiled pattern database. + * + * @param length + * The length of the byte array generated by @ref hs_serialize_database(). + * This should be the same value as that returned by @ref + * hs_serialize_database(). + * + * @param db + * On success, a pointer to a newly allocated @ref hs_database_t will be + * returned here. This database can then be used for scanning, and + * eventually freed by the caller using @ref hs_free_database(). + * + * @return + * @ref HS_SUCCESS on success, other values on failure. + */ +hs_error_t avx2_hs_deserialize_database(const char *bytes, + const size_t length, + hs_database_t **db); + +/** + * Reconstruct a pattern database from a stream of bytes previously generated + * by @ref hs_serialize_database() at a given memory location. + * + * This function (unlike @ref hs_deserialize_database()) will write the + * reconstructed database to the memory location given in the @p db parameter. + * The amount of space required at this location can be determined with the + * @ref hs_serialized_database_size() function. + * + * @param bytes + * A byte array generated by @ref hs_serialize_database() representing a + * compiled pattern database. + * + * @param length + * The length of the byte array generated by @ref hs_serialize_database(). + * This should be the same value as that returned by @ref + * hs_serialize_database(). + * + * @param db + * Pointer to an 8-byte aligned block of memory of sufficient size to hold + * the deserialized database. On success, the reconstructed database will + * be written to this location. This database can then be used for pattern + * matching. The user is responsible for freeing this memory; the @ref + * hs_free_database() call should not be used. + * + * @return + * @ref HS_SUCCESS on success, other values on failure. + */ +hs_error_t avx2_hs_deserialize_database_at(const char *bytes, + const size_t length, + hs_database_t *db); + +/** + * Provides the size of the stream state allocated by a single stream opened + * against the given database. + * + * @param database + * Pointer to a compiled (streaming mode) pattern database. + * + * @param stream_size + * On success, the size in bytes of an individual stream opened against the + * given database is placed in this parameter. + * + * @return + * @ref HS_SUCCESS on success, other values on failure. + */ +hs_error_t avx2_hs_stream_size(const hs_database_t *database, + size_t *stream_size); + +/** + * Provides the size of the given database in bytes. + * + * @param database + * Pointer to compiled pattern database. + * + * @param database_size + * On success, the size of the compiled database in bytes is placed in this + * parameter. + * + * @return + * @ref HS_SUCCESS on success, other values on failure. + */ +hs_error_t avx2_hs_database_size(const hs_database_t *database, + size_t *database_size); + +/** + * Utility function for reporting the size that would be required by a + * database if it were deserialized. + * + * This can be used to allocate a shared memory region or other "special" + * allocation prior to deserializing with the @ref hs_deserialize_database_at() + * function. + * + * @param bytes + * Pointer to a byte array generated by @ref hs_serialize_database() + * representing a compiled pattern database. + * + * @param length + * The length of the byte array generated by @ref hs_serialize_database(). + * This should be the same value as that returned by @ref + * hs_serialize_database(). + * + * @param deserialized_size + * On success, the size of the compiled database that would be generated + * by @ref hs_deserialize_database_at() is returned here. + * + * @return + * @ref HS_SUCCESS on success, other values on failure. + */ +hs_error_t avx2_hs_serialized_database_size(const char *bytes, + const size_t length, + size_t *deserialized_size); + +/** + * Utility function providing information about a database. + * + * @param database + * Pointer to a compiled database. + * + * @param info + * On success, a string containing the version and platform information for + * the supplied database is placed in the parameter. The string is + * allocated using the allocator supplied in @ref hs_set_misc_allocator() + * (or malloc() if no allocator was set) and should be freed by the caller. + * + * @return + * @ref HS_SUCCESS on success, other values on failure. + */ +hs_error_t avx2_hs_database_info(const hs_database_t *database, + char **info); + +/** + * Utility function providing information about a serialized database. + * + * @param bytes + * Pointer to a serialized database. + * + * @param length + * Length in bytes of the serialized database. + * + * @param info + * On success, a string containing the version and platform information + * for the supplied serialized database is placed in the parameter. The + * string is allocated using the allocator supplied in @ref + * hs_set_misc_allocator() (or malloc() if no allocator was set) and + * should be freed by the caller. + * + * @return + * @ref HS_SUCCESS on success, other values on failure. + */ +hs_error_t avx2_hs_serialized_database_info(const char *bytes, + size_t length, char **info); + +/** + * The type of the callback function that will be used by Hyperscan to allocate + * more memory at runtime as required, for example in @ref hs_open_stream() to + * allocate stream state. + * + * If Hyperscan is to be used in a multi-threaded, or similarly concurrent + * environment, the allocation function will need to be re-entrant, or + * similarly safe for concurrent use. + * + * @param size + * The number of bytes to allocate. + * @return + * A pointer to the region of memory allocated, or NULL on error. + */ +typedef void *(HS_CDECL *hs_alloc_t)(size_t size); + +/** + * The type of the callback function that will be used by Hyperscan to free + * memory regions previously allocated using the @ref hs_alloc_t function. + * + * @param ptr + * The region of memory to be freed. + */ +typedef void (HS_CDECL *hs_free_t)(void *ptr); + +/** + * Set the allocate and free functions used by Hyperscan for allocating + * memory at runtime for stream state, scratch space, database bytecode, + * and various other data structure returned by the Hyperscan API. + * + * The function is equivalent to calling @ref hs_set_stream_allocator(), + * @ref hs_set_scratch_allocator(), @ref hs_set_database_allocator() and + * @ref hs_set_misc_allocator() with the provided parameters. + * + * This call will override any previous allocators that have been set. + * + * Note: there is no way to change the allocator used for temporary objects + * created during the various compile calls (@ref hs_compile(), @ref + * hs_compile_multi(), @ref hs_compile_ext_multi()). + * + * @param alloc_func + * A callback function pointer that allocates memory. This function must + * return memory suitably aligned for the largest representable data type + * on this platform. + * + * @param free_func + * A callback function pointer that frees allocated memory. + * + * @return + * @ref HS_SUCCESS on success, other values on failure. + */ +hs_error_t avx2_hs_set_allocator(hs_alloc_t alloc_func, + hs_free_t free_func); + +/** + * Set the allocate and free functions used by Hyperscan for allocating memory + * for database bytecode produced by the compile calls (@ref hs_compile(), @ref + * hs_compile_multi(), @ref hs_compile_ext_multi()) and by database + * deserialization (@ref hs_deserialize_database()). + * + * If no database allocation functions are set, or if NULL is used in place of + * both parameters, then memory allocation will default to standard methods + * (such as the system malloc() and free() calls). + * + * This call will override any previous database allocators that have been set. + * + * Note: the database allocator may also be set by calling @ref + * hs_set_allocator(). + * + * Note: there is no way to change how temporary objects created during the + * various compile calls (@ref hs_compile(), @ref hs_compile_multi(), @ref + * hs_compile_ext_multi()) are allocated. + * + * @param alloc_func + * A callback function pointer that allocates memory. This function must + * return memory suitably aligned for the largest representable data type + * on this platform. + * + * @param free_func + * A callback function pointer that frees allocated memory. + * + * @return + * @ref HS_SUCCESS on success, other values on failure. + */ +hs_error_t avx2_hs_set_database_allocator(hs_alloc_t alloc_func, + hs_free_t free_func); + +/** + * Set the allocate and free functions used by Hyperscan for allocating memory + * for items returned by the Hyperscan API such as @ref hs_compile_error_t, @ref + * hs_expr_info_t and serialized databases. + * + * If no misc allocation functions are set, or if NULL is used in place of both + * parameters, then memory allocation will default to standard methods (such as + * the system malloc() and free() calls). + * + * This call will override any previous misc allocators that have been set. + * + * Note: the misc allocator may also be set by calling @ref hs_set_allocator(). + * + * @param alloc_func + * A callback function pointer that allocates memory. This function must + * return memory suitably aligned for the largest representable data type + * on this platform. + * + * @param free_func + * A callback function pointer that frees allocated memory. + * + * @return + * @ref HS_SUCCESS on success, other values on failure. + */ +hs_error_t avx2_hs_set_misc_allocator(hs_alloc_t alloc_func, + hs_free_t free_func); + +/** + * Set the allocate and free functions used by Hyperscan for allocating memory + * for scratch space by @ref hs_alloc_scratch() and @ref hs_clone_scratch(). + * + * If no scratch allocation functions are set, or if NULL is used in place of + * both parameters, then memory allocation will default to standard methods + * (such as the system malloc() and free() calls). + * + * This call will override any previous scratch allocators that have been set. + * + * Note: the scratch allocator may also be set by calling @ref + * hs_set_allocator(). + * + * @param alloc_func + * A callback function pointer that allocates memory. This function must + * return memory suitably aligned for the largest representable data type + * on this platform. + * + * @param free_func + * A callback function pointer that frees allocated memory. + * + * @return + * @ref HS_SUCCESS on success, other values on failure. + */ +hs_error_t avx2_hs_set_scratch_allocator(hs_alloc_t alloc_func, + hs_free_t free_func); + +/** + * Set the allocate and free functions used by Hyperscan for allocating memory + * for stream state by @ref hs_open_stream(). + * + * If no stream allocation functions are set, or if NULL is used in place of + * both parameters, then memory allocation will default to standard methods + * (such as the system malloc() and free() calls). + * + * This call will override any previous stream allocators that have been set. + * + * Note: the stream allocator may also be set by calling @ref + * hs_set_allocator(). + * + * @param alloc_func + * A callback function pointer that allocates memory. This function must + * return memory suitably aligned for the largest representable data type + * on this platform. + * + * @param free_func + * A callback function pointer that frees allocated memory. + * + * @return + * @ref HS_SUCCESS on success, other values on failure. + */ +hs_error_t avx2_hs_set_stream_allocator(hs_alloc_t alloc_func, + hs_free_t free_func); + +/** + * Utility function for identifying this release version. + * + * @return + * A string containing the version number of this release build and the + * date of the build. It is allocated statically, so it does not need to + * be freed by the caller. + */ +const char * avx2_hs_version(void); + +/** + * Utility function to test the current system architecture. + * + * Hyperscan requires the Supplemental Streaming SIMD Extensions 3 instruction + * set. This function can be called on any x86 platform to determine if the + * system provides the required instruction set. + * + * This function does not test for more advanced features if Hyperscan has + * been built for a more specific architecture, for example the AVX2 + * instruction set. + * + * @return + * @ref HS_SUCCESS on success, @ref HS_ARCH_ERROR if system does not + * support Hyperscan. + */ +hs_error_t avx2_hs_valid_platform(void); + +/** + * @defgroup HS_ERROR hs_error_t values + * + * @{ + */ + +/** + * The engine completed normally. + */ +#define HS_SUCCESS 0 + +/** + * A parameter passed to this function was invalid. + * + * This error is only returned in cases where the function can detect an + * invalid parameter -- it cannot be relied upon to detect (for example) + * pointers to freed memory or other invalid data. + */ +#define HS_INVALID (-1) + +/** + * A memory allocation failed. + */ +#define HS_NOMEM (-2) + +/** + * The engine was terminated by callback. + * + * This return value indicates that the target buffer was partially scanned, + * but that the callback function requested that scanning cease after a match + * was located. + */ +#define HS_SCAN_TERMINATED (-3) + +/** + * The pattern compiler failed, and the @ref hs_compile_error_t should be + * inspected for more detail. + */ +#define HS_COMPILER_ERROR (-4) + +/** + * The given database was built for a different version of Hyperscan. + */ +#define HS_DB_VERSION_ERROR (-5) + +/** + * The given database was built for a different platform (i.e., CPU type). + */ +#define HS_DB_PLATFORM_ERROR (-6) + +/** + * The given database was built for a different mode of operation. This error + * is returned when streaming calls are used with a block or vectored database + * and vice versa. + */ +#define HS_DB_MODE_ERROR (-7) + +/** + * A parameter passed to this function was not correctly aligned. + */ +#define HS_BAD_ALIGN (-8) + +/** + * The memory allocator (either malloc() or the allocator set with @ref + * hs_set_allocator()) did not correctly return memory suitably aligned for the + * largest representable data type on this platform. + */ +#define HS_BAD_ALLOC (-9) + +/** + * The scratch region was already in use. + * + * This error is returned when Hyperscan is able to detect that the scratch + * region given is already in use by another Hyperscan API call. + * + * A separate scratch region, allocated with @ref hs_alloc_scratch() or @ref + * hs_clone_scratch(), is required for every concurrent caller of the Hyperscan + * API. + * + * For example, this error might be returned when @ref hs_scan() has been + * called inside a callback delivered by a currently-executing @ref hs_scan() + * call using the same scratch region. + * + * Note: Not all concurrent uses of scratch regions may be detected. This error + * is intended as a best-effort debugging tool, not a guarantee. + */ +#define HS_SCRATCH_IN_USE (-10) + +/** + * Unsupported CPU architecture. + * + * This error is returned when Hyperscan is able to detect that the current + * system does not support the required instruction set. + * + * At a minimum, Hyperscan requires Supplemental Streaming SIMD Extensions 3 + * (SSSE3). + */ +#define HS_ARCH_ERROR (-11) + +/** + * Provided buffer was too small. + * + * This error indicates that there was insufficient space in the buffer. The + * call should be repeated with a larger provided buffer. + * + * Note: in this situation, it is normal for the amount of space required to be + * returned in the same manner as the used space would have been returned if the + * call was successful. + */ +#define HS_INSUFFICIENT_SPACE (-12) + +/** + * Unexpected internal error. + * + * This error indicates that there was unexpected matching behaviors. This + * could be related to invalid usage of stream and scratch space or invalid memory + * operations by users. + * + */ +#define HS_UNKNOWN_ERROR (-13) + +/** @} */ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* HS_AVX2_COMMON_H */ diff --git a/contrib/libs/hyperscan/runtime_avx2/hs_runtime.h b/contrib/libs/hyperscan/runtime_avx2/hs_runtime.h index 4e35c9e3f8..8f4dcc1a60 100644 --- a/contrib/libs/hyperscan/runtime_avx2/hs_runtime.h +++ b/contrib/libs/hyperscan/runtime_avx2/hs_runtime.h @@ -1,621 +1,621 @@ -/* - * Copyright (c) 2015-2018, Intel Corporation - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Intel Corporation nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef HS_AVX2_RUNTIME_H -#define HS_AVX2_RUNTIME_H - -#include <stdlib.h> - -/** - * @file - * @brief The Hyperscan runtime API definition. - * - * Hyperscan is a high speed regular expression engine. - * - * This header contains functions for using compiled Hyperscan databases for - * scanning data at runtime. - */ - -#include "hs_common.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** - * Definition of the stream identifier type. - */ -struct hs_stream; - -/** - * The stream identifier returned by @ref hs_open_stream(). - */ -typedef struct hs_stream hs_stream_t; - -struct hs_scratch; - -/** - * A Hyperscan scratch space. - */ -typedef struct hs_scratch hs_scratch_t; - -/** - * Definition of the match event callback function type. - * - * A callback function matching the defined type must be provided by the - * application calling the @ref hs_scan(), @ref hs_scan_vector() or @ref - * hs_scan_stream() functions (or other streaming calls which can produce - * matches). - * - * This callback function will be invoked whenever a match is located in the - * target data during the execution of a scan. The details of the match are - * passed in as parameters to the callback function, and the callback function - * should return a value indicating whether or not matching should continue on - * the target data. If no callbacks are desired from a scan call, NULL may be - * provided in order to suppress match production. - * - * This callback function should not attempt to call Hyperscan API functions on - * the same stream nor should it attempt to reuse the scratch space allocated - * for the API calls that caused it to be triggered. Making another call to the - * Hyperscan library with completely independent parameters should work (for - * example, scanning a different database in a new stream and with new scratch - * space), but reusing data structures like stream state and/or scratch space - * will produce undefined behavior. - * - * @param id - * The ID number of the expression that matched. If the expression was a - * single expression compiled with @ref hs_compile(), this value will be - * zero. - * - * @param from - * - If a start of match flag is enabled for the current pattern, this - * argument will be set to the start of match for the pattern assuming - * that that start of match value lies within the current 'start of match - * horizon' chosen by one of the SOM_HORIZON mode flags. - - * - If the start of match value lies outside this horizon (possible only - * when the SOM_HORIZON value is not @ref HS_MODE_SOM_HORIZON_LARGE), - * the @p from value will be set to @ref HS_OFFSET_PAST_HORIZON. - - * - This argument will be set to zero if the Start of Match flag is not - * enabled for the given pattern. - * - * @param to - * The offset after the last byte that matches the expression. - * - * @param flags - * This is provided for future use and is unused at present. - * - * @param context - * The pointer supplied by the user to the @ref hs_scan(), @ref - * hs_scan_vector() or @ref hs_scan_stream() function. - * - * @return - * Non-zero if the matching should cease, else zero. If scanning is - * performed in streaming mode and a non-zero value is returned, any - * subsequent calls to @ref hs_scan_stream() for that stream will - * immediately return with @ref HS_SCAN_TERMINATED. - */ -typedef int (HS_CDECL *match_event_handler)(unsigned int id, - unsigned long long from, - unsigned long long to, - unsigned int flags, - void *context); - -/** - * Open and initialise a stream. - * - * @param db - * A compiled pattern database. - * - * @param flags - * Flags modifying the behaviour of the stream. This parameter is provided - * for future use and is unused at present. - * - * @param stream - * On success, a pointer to the generated @ref hs_stream_t will be - * returned; NULL on failure. - * - * @return - * @ref HS_SUCCESS on success, other values on failure. - */ -hs_error_t avx2_hs_open_stream(const hs_database_t *db, unsigned int flags, - hs_stream_t **stream); - -/** - * Write data to be scanned to the opened stream. - * - * This is the function call in which the actual pattern matching takes place - * as data is written to the stream. Matches will be returned via the @ref - * match_event_handler callback supplied. - * - * @param id - * The stream ID (returned by @ref hs_open_stream()) to which the data - * will be written. - * - * @param data - * Pointer to the data to be scanned. - * - * @param length - * The number of bytes to scan. - * - * @param flags - * Flags modifying the behaviour of the stream. This parameter is provided - * for future use and is unused at present. - * - * @param scratch - * A per-thread scratch space allocated by @ref hs_alloc_scratch(). - * - * @param onEvent - * Pointer to a match event callback function. If a NULL pointer is given, - * no matches will be returned. - * - * @param ctxt - * The user defined pointer which will be passed to the callback function - * when a match occurs. - * - * @return - * Returns @ref HS_SUCCESS on success; @ref HS_SCAN_TERMINATED if the - * match callback indicated that scanning should stop; other values on - * error. - */ -hs_error_t avx2_hs_scan_stream(hs_stream_t *id, const char *data, - unsigned int length, unsigned int flags, - hs_scratch_t *scratch, - match_event_handler onEvent, void *ctxt); - -/** - * Close a stream. - * - * This function completes matching on the given stream and frees the memory - * associated with the stream state. After this call, the stream pointed to by - * @p id is invalid and can no longer be used. To reuse the stream state after - * completion, rather than closing it, the @ref hs_reset_stream function can be - * used. - * - * This function must be called for any stream created with @ref - * hs_open_stream(), even if scanning has been terminated by a non-zero return - * from the match callback function. - * - * Note: This operation may result in matches being returned (via calls to the - * match event callback) for expressions anchored to the end of the data stream - * (for example, via the use of the `$` meta-character). If these matches are - * not desired, NULL may be provided as the @ref match_event_handler callback. - * - * If NULL is provided as the @ref match_event_handler callback, it is - * permissible to provide a NULL scratch. - * - * @param id - * The stream ID returned by @ref hs_open_stream(). - * - * @param scratch - * A per-thread scratch space allocated by @ref hs_alloc_scratch(). This is - * allowed to be NULL only if the @p onEvent callback is also NULL. - * - * @param onEvent - * Pointer to a match event callback function. If a NULL pointer is given, - * no matches will be returned. - * - * @param ctxt - * The user defined pointer which will be passed to the callback function - * when a match occurs. - * - * @return - * Returns @ref HS_SUCCESS on success, other values on failure. - */ -hs_error_t avx2_hs_close_stream(hs_stream_t *id, hs_scratch_t *scratch, - match_event_handler onEvent, void *ctxt); - -/** - * Reset a stream to an initial state. - * - * Conceptually, this is equivalent to performing @ref hs_close_stream() on the - * given stream, followed by a @ref hs_open_stream(). This new stream replaces - * the original stream in memory, avoiding the overhead of freeing the old - * stream and allocating the new one. - * - * Note: This operation may result in matches being returned (via calls to the - * match event callback) for expressions anchored to the end of the original - * data stream (for example, via the use of the `$` meta-character). If these - * matches are not desired, NULL may be provided as the @ref match_event_handler - * callback. - * - * Note: the stream will also be tied to the same database. - * - * @param id - * The stream (as created by @ref hs_open_stream()) to be replaced. - * - * @param flags - * Flags modifying the behaviour of the stream. This parameter is provided - * for future use and is unused at present. - * - * @param scratch - * A per-thread scratch space allocated by @ref hs_alloc_scratch(). This is - * allowed to be NULL only if the @p onEvent callback is also NULL. - * - * @param onEvent - * Pointer to a match event callback function. If a NULL pointer is given, - * no matches will be returned. - * - * @param context - * The user defined pointer which will be passed to the callback function - * when a match occurs. - * - * @return - * @ref HS_SUCCESS on success, other values on failure. - */ -hs_error_t avx2_hs_reset_stream(hs_stream_t *id, unsigned int flags, - hs_scratch_t *scratch, - match_event_handler onEvent, void *context); - -/** - * Duplicate the given stream. The new stream will have the same state as the - * original including the current stream offset. - * - * @param to_id - * On success, a pointer to the new, copied @ref hs_stream_t will be - * returned; NULL on failure. - * - * @param from_id - * The stream (as created by @ref hs_open_stream()) to be copied. - * - * @return - * @ref HS_SUCCESS on success, other values on failure. - */ -hs_error_t avx2_hs_copy_stream(hs_stream_t **to_id, - const hs_stream_t *from_id); - -/** - * Duplicate the given 'from' stream state onto the 'to' stream. The 'to' stream - * will first be reset (reporting any EOD matches if a non-NULL @p onEvent - * callback handler is provided). - * - * Note: the 'to' stream and the 'from' stream must be open against the same - * database. - * - * @param to_id - * On success, a pointer to the new, copied @ref hs_stream_t will be - * returned; NULL on failure. - * - * @param from_id - * The stream (as created by @ref hs_open_stream()) to be copied. - * - * @param scratch - * A per-thread scratch space allocated by @ref hs_alloc_scratch(). This is - * allowed to be NULL only if the @p onEvent callback is also NULL. - * - * @param onEvent - * Pointer to a match event callback function. If a NULL pointer is given, - * no matches will be returned. - * - * @param context - * The user defined pointer which will be passed to the callback function - * when a match occurs. - * - * @return - * @ref HS_SUCCESS on success, other values on failure. - */ -hs_error_t avx2_hs_reset_and_copy_stream(hs_stream_t *to_id, - const hs_stream_t *from_id, - hs_scratch_t *scratch, - match_event_handler onEvent, - void *context); - -/** - * Creates a compressed representation of the provided stream in the buffer - * provided. This compressed representation can be converted back into a stream - * state by using @ref hs_expand_stream() or @ref hs_reset_and_expand_stream(). - * The size of the compressed representation will be placed into @p used_space. - * - * If there is not sufficient space in the buffer to hold the compressed - * representation, @ref HS_INSUFFICIENT_SPACE will be returned and @p used_space - * will be populated with the amount of space required. - * - * Note: this function does not close the provided stream, you may continue to - * use the stream or to free it with @ref hs_close_stream(). - * - * @param stream - * The stream (as created by @ref hs_open_stream()) to be compressed. - * - * @param buf - * Buffer to write the compressed representation into. Note: if the call is - * just being used to determine the amount of space required, it is allowed - * to pass NULL here and @p buf_space as 0. - * - * @param buf_space - * The number of bytes in @p buf. If buf_space is too small, the call will - * fail with @ref HS_INSUFFICIENT_SPACE. - * - * @param used_space - * Pointer to where the amount of used space will be written to. The used - * buffer space is always less than or equal to @p buf_space. If the call - * fails with @ref HS_INSUFFICIENT_SPACE, this pointer will be used to - * write out the amount of buffer space required. - * - * @return - * @ref HS_SUCCESS on success, @ref HS_INSUFFICIENT_SPACE if the provided - * buffer is too small. - */ -hs_error_t avx2_hs_compress_stream(const hs_stream_t *stream, char *buf, - size_t buf_space, size_t *used_space); - -/** - * Decompresses a compressed representation created by @ref hs_compress_stream() - * into a new stream. - * - * Note: @p buf must correspond to a complete compressed representation created - * by @ref hs_compress_stream() of a stream that was opened against @p db. It is - * not always possible to detect misuse of this API and behaviour is undefined - * if these properties are not satisfied. - * - * @param db - * The compiled pattern database that the compressed stream was opened - * against. - * - * @param stream - * On success, a pointer to the expanded @ref hs_stream_t will be - * returned; NULL on failure. - * - * @param buf - * A compressed representation of a stream. These compressed forms are - * created by @ref hs_compress_stream(). - * - * @param buf_size - * The size in bytes of the compressed representation. - * - * @return - * @ref HS_SUCCESS on success, other values on failure. - */ -hs_error_t avx2_hs_expand_stream(const hs_database_t *db, - hs_stream_t **stream, const char *buf, - size_t buf_size); - -/** - * Decompresses a compressed representation created by @ref hs_compress_stream() - * on top of the 'to' stream. The 'to' stream will first be reset (reporting - * any EOD matches if a non-NULL @p onEvent callback handler is provided). - * - * Note: the 'to' stream must be opened against the same database as the - * compressed stream. - * - * Note: @p buf must correspond to a complete compressed representation created - * by @ref hs_compress_stream() of a stream that was opened against @p db. It is - * not always possible to detect misuse of this API and behaviour is undefined - * if these properties are not satisfied. - * - * @param to_stream - * A pointer to a valid stream state. A pointer to the expanded @ref - * hs_stream_t will be returned; NULL on failure. - * - * @param buf - * A compressed representation of a stream. These compressed forms are - * created by @ref hs_compress_stream(). - * - * @param buf_size - * The size in bytes of the compressed representation. - * - * @param scratch - * A per-thread scratch space allocated by @ref hs_alloc_scratch(). This is - * allowed to be NULL only if the @p onEvent callback is also NULL. - * - * @param onEvent - * Pointer to a match event callback function. If a NULL pointer is given, - * no matches will be returned. - * - * @param context - * The user defined pointer which will be passed to the callback function - * when a match occurs. - * - * @return - * @ref HS_SUCCESS on success, other values on failure. - */ -hs_error_t avx2_hs_reset_and_expand_stream(hs_stream_t *to_stream, - const char *buf, size_t buf_size, - hs_scratch_t *scratch, - match_event_handler onEvent, - void *context); - -/** - * The block (non-streaming) regular expression scanner. - * - * This is the function call in which the actual pattern matching takes place - * for block-mode pattern databases. - * - * @param db - * A compiled pattern database. - * - * @param data - * Pointer to the data to be scanned. - * - * @param length - * The number of bytes to scan. - * - * @param flags - * Flags modifying the behaviour of this function. This parameter is - * provided for future use and is unused at present. - * - * @param scratch - * A per-thread scratch space allocated by @ref hs_alloc_scratch() for this - * database. - * - * @param onEvent - * Pointer to a match event callback function. If a NULL pointer is given, - * no matches will be returned. - * - * @param context - * The user defined pointer which will be passed to the callback function. - * - * @return - * Returns @ref HS_SUCCESS on success; @ref HS_SCAN_TERMINATED if the - * match callback indicated that scanning should stop; other values on - * error. - */ -hs_error_t avx2_hs_scan(const hs_database_t *db, const char *data, - unsigned int length, unsigned int flags, - hs_scratch_t *scratch, match_event_handler onEvent, - void *context); - -/** - * The vectored regular expression scanner. - * - * This is the function call in which the actual pattern matching takes place - * for vectoring-mode pattern databases. - * - * @param db - * A compiled pattern database. - * - * @param data - * An array of pointers to the data blocks to be scanned. - * - * @param length - * An array of lengths (in bytes) of each data block to scan. - * - * @param count - * Number of data blocks to scan. This should correspond to the size of - * of the @p data and @p length arrays. - * - * @param flags - * Flags modifying the behaviour of this function. This parameter is - * provided for future use and is unused at present. - * - * @param scratch - * A per-thread scratch space allocated by @ref hs_alloc_scratch() for - * this database. - * - * @param onEvent - * Pointer to a match event callback function. If a NULL pointer is given, - * no matches will be returned. - * - * @param context - * The user defined pointer which will be passed to the callback function. - * - * @return - * Returns @ref HS_SUCCESS on success; @ref HS_SCAN_TERMINATED if the match - * callback indicated that scanning should stop; other values on error. - */ -hs_error_t avx2_hs_scan_vector(const hs_database_t *db, - const char *const *data, - const unsigned int *length, - unsigned int count, unsigned int flags, - hs_scratch_t *scratch, - match_event_handler onEvent, void *context); - -/** - * Allocate a "scratch" space for use by Hyperscan. - * - * This is required for runtime use, and one scratch space per thread, or - * concurrent caller, is required. Any allocator callback set by @ref - * hs_set_scratch_allocator() or @ref hs_set_allocator() will be used by this - * function. - * - * @param db - * The database, as produced by @ref hs_compile(). - * - * @param scratch - * On first allocation, a pointer to NULL should be provided so a new - * scratch can be allocated. If a scratch block has been previously - * allocated, then a pointer to it should be passed back in to see if it - * is valid for this database block. If a new scratch block is required, - * the original will be freed and the new one returned, otherwise the - * previous scratch block will be returned. On success, the scratch block - * will be suitable for use with the provided database in addition to any - * databases that original scratch space was suitable for. - * - * @return - * @ref HS_SUCCESS on successful allocation; @ref HS_NOMEM if the - * allocation fails. Other errors may be returned if invalid parameters - * are specified. - */ -hs_error_t avx2_hs_alloc_scratch(const hs_database_t *db, - hs_scratch_t **scratch); - -/** - * Allocate a scratch space that is a clone of an existing scratch space. - * - * This is useful when multiple concurrent threads will be using the same set - * of compiled databases, and another scratch space is required. Any allocator - * callback set by @ref hs_set_scratch_allocator() or @ref hs_set_allocator() - * will be used by this function. - * - * @param src - * The existing @ref hs_scratch_t to be cloned. - * - * @param dest - * A pointer to the new scratch space will be returned here. - * - * @return - * @ref HS_SUCCESS on success; @ref HS_NOMEM if the allocation fails. - * Other errors may be returned if invalid parameters are specified. - */ -hs_error_t avx2_hs_clone_scratch(const hs_scratch_t *src, - hs_scratch_t **dest); - -/** - * Provides the size of the given scratch space. - * - * @param scratch - * A per-thread scratch space allocated by @ref hs_alloc_scratch() or @ref - * hs_clone_scratch(). - * - * @param scratch_size - * On success, the size of the scratch space in bytes is placed in this - * parameter. - * - * @return - * @ref HS_SUCCESS on success, other values on failure. - */ -hs_error_t avx2_hs_scratch_size(const hs_scratch_t *scratch, - size_t *scratch_size); - -/** - * Free a scratch block previously allocated by @ref hs_alloc_scratch() or @ref - * hs_clone_scratch(). - * - * The free callback set by @ref hs_set_scratch_allocator() or @ref - * hs_set_allocator() will be used by this function. - * - * @param scratch - * The scratch block to be freed. NULL may also be safely provided. - * - * @return - * @ref HS_SUCCESS on success, other values on failure. - */ -hs_error_t avx2_hs_free_scratch(hs_scratch_t *scratch); - -/** - * Callback 'from' return value, indicating that the start of this match was - * too early to be tracked with the requested SOM_HORIZON precision. - */ -#define HS_OFFSET_PAST_HORIZON (~0ULL) - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* HS_AVX2_RUNTIME_H */ +/* + * Copyright (c) 2015-2018, Intel Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Intel Corporation nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef HS_AVX2_RUNTIME_H +#define HS_AVX2_RUNTIME_H + +#include <stdlib.h> + +/** + * @file + * @brief The Hyperscan runtime API definition. + * + * Hyperscan is a high speed regular expression engine. + * + * This header contains functions for using compiled Hyperscan databases for + * scanning data at runtime. + */ + +#include "hs_common.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * Definition of the stream identifier type. + */ +struct hs_stream; + +/** + * The stream identifier returned by @ref hs_open_stream(). + */ +typedef struct hs_stream hs_stream_t; + +struct hs_scratch; + +/** + * A Hyperscan scratch space. + */ +typedef struct hs_scratch hs_scratch_t; + +/** + * Definition of the match event callback function type. + * + * A callback function matching the defined type must be provided by the + * application calling the @ref hs_scan(), @ref hs_scan_vector() or @ref + * hs_scan_stream() functions (or other streaming calls which can produce + * matches). + * + * This callback function will be invoked whenever a match is located in the + * target data during the execution of a scan. The details of the match are + * passed in as parameters to the callback function, and the callback function + * should return a value indicating whether or not matching should continue on + * the target data. If no callbacks are desired from a scan call, NULL may be + * provided in order to suppress match production. + * + * This callback function should not attempt to call Hyperscan API functions on + * the same stream nor should it attempt to reuse the scratch space allocated + * for the API calls that caused it to be triggered. Making another call to the + * Hyperscan library with completely independent parameters should work (for + * example, scanning a different database in a new stream and with new scratch + * space), but reusing data structures like stream state and/or scratch space + * will produce undefined behavior. + * + * @param id + * The ID number of the expression that matched. If the expression was a + * single expression compiled with @ref hs_compile(), this value will be + * zero. + * + * @param from + * - If a start of match flag is enabled for the current pattern, this + * argument will be set to the start of match for the pattern assuming + * that that start of match value lies within the current 'start of match + * horizon' chosen by one of the SOM_HORIZON mode flags. + + * - If the start of match value lies outside this horizon (possible only + * when the SOM_HORIZON value is not @ref HS_MODE_SOM_HORIZON_LARGE), + * the @p from value will be set to @ref HS_OFFSET_PAST_HORIZON. + + * - This argument will be set to zero if the Start of Match flag is not + * enabled for the given pattern. + * + * @param to + * The offset after the last byte that matches the expression. + * + * @param flags + * This is provided for future use and is unused at present. + * + * @param context + * The pointer supplied by the user to the @ref hs_scan(), @ref + * hs_scan_vector() or @ref hs_scan_stream() function. + * + * @return + * Non-zero if the matching should cease, else zero. If scanning is + * performed in streaming mode and a non-zero value is returned, any + * subsequent calls to @ref hs_scan_stream() for that stream will + * immediately return with @ref HS_SCAN_TERMINATED. + */ +typedef int (HS_CDECL *match_event_handler)(unsigned int id, + unsigned long long from, + unsigned long long to, + unsigned int flags, + void *context); + +/** + * Open and initialise a stream. + * + * @param db + * A compiled pattern database. + * + * @param flags + * Flags modifying the behaviour of the stream. This parameter is provided + * for future use and is unused at present. + * + * @param stream + * On success, a pointer to the generated @ref hs_stream_t will be + * returned; NULL on failure. + * + * @return + * @ref HS_SUCCESS on success, other values on failure. + */ +hs_error_t avx2_hs_open_stream(const hs_database_t *db, unsigned int flags, + hs_stream_t **stream); + +/** + * Write data to be scanned to the opened stream. + * + * This is the function call in which the actual pattern matching takes place + * as data is written to the stream. Matches will be returned via the @ref + * match_event_handler callback supplied. + * + * @param id + * The stream ID (returned by @ref hs_open_stream()) to which the data + * will be written. + * + * @param data + * Pointer to the data to be scanned. + * + * @param length + * The number of bytes to scan. + * + * @param flags + * Flags modifying the behaviour of the stream. This parameter is provided + * for future use and is unused at present. + * + * @param scratch + * A per-thread scratch space allocated by @ref hs_alloc_scratch(). + * + * @param onEvent + * Pointer to a match event callback function. If a NULL pointer is given, + * no matches will be returned. + * + * @param ctxt + * The user defined pointer which will be passed to the callback function + * when a match occurs. + * + * @return + * Returns @ref HS_SUCCESS on success; @ref HS_SCAN_TERMINATED if the + * match callback indicated that scanning should stop; other values on + * error. + */ +hs_error_t avx2_hs_scan_stream(hs_stream_t *id, const char *data, + unsigned int length, unsigned int flags, + hs_scratch_t *scratch, + match_event_handler onEvent, void *ctxt); + +/** + * Close a stream. + * + * This function completes matching on the given stream and frees the memory + * associated with the stream state. After this call, the stream pointed to by + * @p id is invalid and can no longer be used. To reuse the stream state after + * completion, rather than closing it, the @ref hs_reset_stream function can be + * used. + * + * This function must be called for any stream created with @ref + * hs_open_stream(), even if scanning has been terminated by a non-zero return + * from the match callback function. + * + * Note: This operation may result in matches being returned (via calls to the + * match event callback) for expressions anchored to the end of the data stream + * (for example, via the use of the `$` meta-character). If these matches are + * not desired, NULL may be provided as the @ref match_event_handler callback. + * + * If NULL is provided as the @ref match_event_handler callback, it is + * permissible to provide a NULL scratch. + * + * @param id + * The stream ID returned by @ref hs_open_stream(). + * + * @param scratch + * A per-thread scratch space allocated by @ref hs_alloc_scratch(). This is + * allowed to be NULL only if the @p onEvent callback is also NULL. + * + * @param onEvent + * Pointer to a match event callback function. If a NULL pointer is given, + * no matches will be returned. + * + * @param ctxt + * The user defined pointer which will be passed to the callback function + * when a match occurs. + * + * @return + * Returns @ref HS_SUCCESS on success, other values on failure. + */ +hs_error_t avx2_hs_close_stream(hs_stream_t *id, hs_scratch_t *scratch, + match_event_handler onEvent, void *ctxt); + +/** + * Reset a stream to an initial state. + * + * Conceptually, this is equivalent to performing @ref hs_close_stream() on the + * given stream, followed by a @ref hs_open_stream(). This new stream replaces + * the original stream in memory, avoiding the overhead of freeing the old + * stream and allocating the new one. + * + * Note: This operation may result in matches being returned (via calls to the + * match event callback) for expressions anchored to the end of the original + * data stream (for example, via the use of the `$` meta-character). If these + * matches are not desired, NULL may be provided as the @ref match_event_handler + * callback. + * + * Note: the stream will also be tied to the same database. + * + * @param id + * The stream (as created by @ref hs_open_stream()) to be replaced. + * + * @param flags + * Flags modifying the behaviour of the stream. This parameter is provided + * for future use and is unused at present. + * + * @param scratch + * A per-thread scratch space allocated by @ref hs_alloc_scratch(). This is + * allowed to be NULL only if the @p onEvent callback is also NULL. + * + * @param onEvent + * Pointer to a match event callback function. If a NULL pointer is given, + * no matches will be returned. + * + * @param context + * The user defined pointer which will be passed to the callback function + * when a match occurs. + * + * @return + * @ref HS_SUCCESS on success, other values on failure. + */ +hs_error_t avx2_hs_reset_stream(hs_stream_t *id, unsigned int flags, + hs_scratch_t *scratch, + match_event_handler onEvent, void *context); + +/** + * Duplicate the given stream. The new stream will have the same state as the + * original including the current stream offset. + * + * @param to_id + * On success, a pointer to the new, copied @ref hs_stream_t will be + * returned; NULL on failure. + * + * @param from_id + * The stream (as created by @ref hs_open_stream()) to be copied. + * + * @return + * @ref HS_SUCCESS on success, other values on failure. + */ +hs_error_t avx2_hs_copy_stream(hs_stream_t **to_id, + const hs_stream_t *from_id); + +/** + * Duplicate the given 'from' stream state onto the 'to' stream. The 'to' stream + * will first be reset (reporting any EOD matches if a non-NULL @p onEvent + * callback handler is provided). + * + * Note: the 'to' stream and the 'from' stream must be open against the same + * database. + * + * @param to_id + * On success, a pointer to the new, copied @ref hs_stream_t will be + * returned; NULL on failure. + * + * @param from_id + * The stream (as created by @ref hs_open_stream()) to be copied. + * + * @param scratch + * A per-thread scratch space allocated by @ref hs_alloc_scratch(). This is + * allowed to be NULL only if the @p onEvent callback is also NULL. + * + * @param onEvent + * Pointer to a match event callback function. If a NULL pointer is given, + * no matches will be returned. + * + * @param context + * The user defined pointer which will be passed to the callback function + * when a match occurs. + * + * @return + * @ref HS_SUCCESS on success, other values on failure. + */ +hs_error_t avx2_hs_reset_and_copy_stream(hs_stream_t *to_id, + const hs_stream_t *from_id, + hs_scratch_t *scratch, + match_event_handler onEvent, + void *context); + +/** + * Creates a compressed representation of the provided stream in the buffer + * provided. This compressed representation can be converted back into a stream + * state by using @ref hs_expand_stream() or @ref hs_reset_and_expand_stream(). + * The size of the compressed representation will be placed into @p used_space. + * + * If there is not sufficient space in the buffer to hold the compressed + * representation, @ref HS_INSUFFICIENT_SPACE will be returned and @p used_space + * will be populated with the amount of space required. + * + * Note: this function does not close the provided stream, you may continue to + * use the stream or to free it with @ref hs_close_stream(). + * + * @param stream + * The stream (as created by @ref hs_open_stream()) to be compressed. + * + * @param buf + * Buffer to write the compressed representation into. Note: if the call is + * just being used to determine the amount of space required, it is allowed + * to pass NULL here and @p buf_space as 0. + * + * @param buf_space + * The number of bytes in @p buf. If buf_space is too small, the call will + * fail with @ref HS_INSUFFICIENT_SPACE. + * + * @param used_space + * Pointer to where the amount of used space will be written to. The used + * buffer space is always less than or equal to @p buf_space. If the call + * fails with @ref HS_INSUFFICIENT_SPACE, this pointer will be used to + * write out the amount of buffer space required. + * + * @return + * @ref HS_SUCCESS on success, @ref HS_INSUFFICIENT_SPACE if the provided + * buffer is too small. + */ +hs_error_t avx2_hs_compress_stream(const hs_stream_t *stream, char *buf, + size_t buf_space, size_t *used_space); + +/** + * Decompresses a compressed representation created by @ref hs_compress_stream() + * into a new stream. + * + * Note: @p buf must correspond to a complete compressed representation created + * by @ref hs_compress_stream() of a stream that was opened against @p db. It is + * not always possible to detect misuse of this API and behaviour is undefined + * if these properties are not satisfied. + * + * @param db + * The compiled pattern database that the compressed stream was opened + * against. + * + * @param stream + * On success, a pointer to the expanded @ref hs_stream_t will be + * returned; NULL on failure. + * + * @param buf + * A compressed representation of a stream. These compressed forms are + * created by @ref hs_compress_stream(). + * + * @param buf_size + * The size in bytes of the compressed representation. + * + * @return + * @ref HS_SUCCESS on success, other values on failure. + */ +hs_error_t avx2_hs_expand_stream(const hs_database_t *db, + hs_stream_t **stream, const char *buf, + size_t buf_size); + +/** + * Decompresses a compressed representation created by @ref hs_compress_stream() + * on top of the 'to' stream. The 'to' stream will first be reset (reporting + * any EOD matches if a non-NULL @p onEvent callback handler is provided). + * + * Note: the 'to' stream must be opened against the same database as the + * compressed stream. + * + * Note: @p buf must correspond to a complete compressed representation created + * by @ref hs_compress_stream() of a stream that was opened against @p db. It is + * not always possible to detect misuse of this API and behaviour is undefined + * if these properties are not satisfied. + * + * @param to_stream + * A pointer to a valid stream state. A pointer to the expanded @ref + * hs_stream_t will be returned; NULL on failure. + * + * @param buf + * A compressed representation of a stream. These compressed forms are + * created by @ref hs_compress_stream(). + * + * @param buf_size + * The size in bytes of the compressed representation. + * + * @param scratch + * A per-thread scratch space allocated by @ref hs_alloc_scratch(). This is + * allowed to be NULL only if the @p onEvent callback is also NULL. + * + * @param onEvent + * Pointer to a match event callback function. If a NULL pointer is given, + * no matches will be returned. + * + * @param context + * The user defined pointer which will be passed to the callback function + * when a match occurs. + * + * @return + * @ref HS_SUCCESS on success, other values on failure. + */ +hs_error_t avx2_hs_reset_and_expand_stream(hs_stream_t *to_stream, + const char *buf, size_t buf_size, + hs_scratch_t *scratch, + match_event_handler onEvent, + void *context); + +/** + * The block (non-streaming) regular expression scanner. + * + * This is the function call in which the actual pattern matching takes place + * for block-mode pattern databases. + * + * @param db + * A compiled pattern database. + * + * @param data + * Pointer to the data to be scanned. + * + * @param length + * The number of bytes to scan. + * + * @param flags + * Flags modifying the behaviour of this function. This parameter is + * provided for future use and is unused at present. + * + * @param scratch + * A per-thread scratch space allocated by @ref hs_alloc_scratch() for this + * database. + * + * @param onEvent + * Pointer to a match event callback function. If a NULL pointer is given, + * no matches will be returned. + * + * @param context + * The user defined pointer which will be passed to the callback function. + * + * @return + * Returns @ref HS_SUCCESS on success; @ref HS_SCAN_TERMINATED if the + * match callback indicated that scanning should stop; other values on + * error. + */ +hs_error_t avx2_hs_scan(const hs_database_t *db, const char *data, + unsigned int length, unsigned int flags, + hs_scratch_t *scratch, match_event_handler onEvent, + void *context); + +/** + * The vectored regular expression scanner. + * + * This is the function call in which the actual pattern matching takes place + * for vectoring-mode pattern databases. + * + * @param db + * A compiled pattern database. + * + * @param data + * An array of pointers to the data blocks to be scanned. + * + * @param length + * An array of lengths (in bytes) of each data block to scan. + * + * @param count + * Number of data blocks to scan. This should correspond to the size of + * of the @p data and @p length arrays. + * + * @param flags + * Flags modifying the behaviour of this function. This parameter is + * provided for future use and is unused at present. + * + * @param scratch + * A per-thread scratch space allocated by @ref hs_alloc_scratch() for + * this database. + * + * @param onEvent + * Pointer to a match event callback function. If a NULL pointer is given, + * no matches will be returned. + * + * @param context + * The user defined pointer which will be passed to the callback function. + * + * @return + * Returns @ref HS_SUCCESS on success; @ref HS_SCAN_TERMINATED if the match + * callback indicated that scanning should stop; other values on error. + */ +hs_error_t avx2_hs_scan_vector(const hs_database_t *db, + const char *const *data, + const unsigned int *length, + unsigned int count, unsigned int flags, + hs_scratch_t *scratch, + match_event_handler onEvent, void *context); + +/** + * Allocate a "scratch" space for use by Hyperscan. + * + * This is required for runtime use, and one scratch space per thread, or + * concurrent caller, is required. Any allocator callback set by @ref + * hs_set_scratch_allocator() or @ref hs_set_allocator() will be used by this + * function. + * + * @param db + * The database, as produced by @ref hs_compile(). + * + * @param scratch + * On first allocation, a pointer to NULL should be provided so a new + * scratch can be allocated. If a scratch block has been previously + * allocated, then a pointer to it should be passed back in to see if it + * is valid for this database block. If a new scratch block is required, + * the original will be freed and the new one returned, otherwise the + * previous scratch block will be returned. On success, the scratch block + * will be suitable for use with the provided database in addition to any + * databases that original scratch space was suitable for. + * + * @return + * @ref HS_SUCCESS on successful allocation; @ref HS_NOMEM if the + * allocation fails. Other errors may be returned if invalid parameters + * are specified. + */ +hs_error_t avx2_hs_alloc_scratch(const hs_database_t *db, + hs_scratch_t **scratch); + +/** + * Allocate a scratch space that is a clone of an existing scratch space. + * + * This is useful when multiple concurrent threads will be using the same set + * of compiled databases, and another scratch space is required. Any allocator + * callback set by @ref hs_set_scratch_allocator() or @ref hs_set_allocator() + * will be used by this function. + * + * @param src + * The existing @ref hs_scratch_t to be cloned. + * + * @param dest + * A pointer to the new scratch space will be returned here. + * + * @return + * @ref HS_SUCCESS on success; @ref HS_NOMEM if the allocation fails. + * Other errors may be returned if invalid parameters are specified. + */ +hs_error_t avx2_hs_clone_scratch(const hs_scratch_t *src, + hs_scratch_t **dest); + +/** + * Provides the size of the given scratch space. + * + * @param scratch + * A per-thread scratch space allocated by @ref hs_alloc_scratch() or @ref + * hs_clone_scratch(). + * + * @param scratch_size + * On success, the size of the scratch space in bytes is placed in this + * parameter. + * + * @return + * @ref HS_SUCCESS on success, other values on failure. + */ +hs_error_t avx2_hs_scratch_size(const hs_scratch_t *scratch, + size_t *scratch_size); + +/** + * Free a scratch block previously allocated by @ref hs_alloc_scratch() or @ref + * hs_clone_scratch(). + * + * The free callback set by @ref hs_set_scratch_allocator() or @ref + * hs_set_allocator() will be used by this function. + * + * @param scratch + * The scratch block to be freed. NULL may also be safely provided. + * + * @return + * @ref HS_SUCCESS on success, other values on failure. + */ +hs_error_t avx2_hs_free_scratch(hs_scratch_t *scratch); + +/** + * Callback 'from' return value, indicating that the start of this match was + * too early to be tracked with the requested SOM_HORIZON precision. + */ +#define HS_OFFSET_PAST_HORIZON (~0ULL) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* HS_AVX2_RUNTIME_H */ diff --git a/contrib/libs/hyperscan/runtime_avx2/ya.make b/contrib/libs/hyperscan/runtime_avx2/ya.make index c50690c5e9..2fc6d7f163 100644 --- a/contrib/libs/hyperscan/runtime_avx2/ya.make +++ b/contrib/libs/hyperscan/runtime_avx2/ya.make @@ -1,498 +1,498 @@ -# Generated by devtools/yamaker. - -LIBRARY() - -OWNER( - galtsev - g:antiinfra - g:cpp-contrib - g:yql -) - -LICENSE(BSD-3-Clause) - -LICENSE_TEXTS(.yandex_meta/licenses.list.txt) - -ADDINCL( - contrib/libs/hyperscan - contrib/libs/hyperscan/src -) - -NO_COMPILER_WARNINGS() - -NO_RUNTIME() - -CFLAGS( - ${SSE41_CFLAGS} - -DHAVE_SSE41 - ${SSE42_CFLAGS} - -DHAVE_SSE42 - ${POPCNT_CFLAGS} - -DHAVE_POPCOUNT_INSTR - ${AVX_CFLAGS} - -DHAVE_AVX - ${AVX2_CFLAGS} - -DHAVE_AVX2 - -DCrc32c_ComputeBuf=avx2_Crc32c_ComputeBuf - -DblockInitSufPQ=avx2_blockInitSufPQ - -Dcompress_stream=avx2_compress_stream - -Dcpuid_flags=avx2_cpuid_flags - -Dcpuid_tune=avx2_cpuid_tune - -DdbIsValid=avx2_dbIsValid - -DdoAccel128=avx2_doAccel128 - -DdoAccel256=avx2_doAccel256 - -DdoAccel32=avx2_doAccel32 - -DdoAccel384=avx2_doAccel384 - -DdoAccel512=avx2_doAccel512 - -DdoAccel64=avx2_doAccel64 - -Dexpand_stream=avx2_expand_stream - -DfdrExec=avx2_fdrExec - -DfdrExecStreaming=avx2_fdrExecStreaming - -Dfdr_exec_fat_teddy_msks1=avx2_fdr_exec_fat_teddy_msks1 - -Dfdr_exec_fat_teddy_msks1_pck=avx2_fdr_exec_fat_teddy_msks1_pck - -Dfdr_exec_fat_teddy_msks2=avx2_fdr_exec_fat_teddy_msks2 - -Dfdr_exec_fat_teddy_msks2_pck=avx2_fdr_exec_fat_teddy_msks2_pck - -Dfdr_exec_fat_teddy_msks3=avx2_fdr_exec_fat_teddy_msks3 - -Dfdr_exec_fat_teddy_msks3_pck=avx2_fdr_exec_fat_teddy_msks3_pck - -Dfdr_exec_fat_teddy_msks4=avx2_fdr_exec_fat_teddy_msks4 - -Dfdr_exec_fat_teddy_msks4_pck=avx2_fdr_exec_fat_teddy_msks4_pck - -Dfdr_exec_teddy_msks1=avx2_fdr_exec_teddy_msks1 - -Dfdr_exec_teddy_msks1_pck=avx2_fdr_exec_teddy_msks1_pck - -Dfdr_exec_teddy_msks2=avx2_fdr_exec_teddy_msks2 - -Dfdr_exec_teddy_msks2_pck=avx2_fdr_exec_teddy_msks2_pck - -Dfdr_exec_teddy_msks3=avx2_fdr_exec_teddy_msks3 - -Dfdr_exec_teddy_msks3_pck=avx2_fdr_exec_teddy_msks3_pck - -Dfdr_exec_teddy_msks4=avx2_fdr_exec_teddy_msks4 - -Dfdr_exec_teddy_msks4_pck=avx2_fdr_exec_teddy_msks4_pck - -DflushQueuedLiterals_i=avx2_flushQueuedLiterals_i - -DflushStoredSomMatches_i=avx2_flushStoredSomMatches_i - -DhandleSomExternal=avx2_handleSomExternal - -DhandleSomInternal=avx2_handleSomInternal - -Dhs_alloc_scratch=avx2_hs_alloc_scratch - -Dhs_clone_scratch=avx2_hs_clone_scratch - -Dhs_close_stream=avx2_hs_close_stream - -Dhs_compress_stream=avx2_hs_compress_stream - -Dhs_copy_stream=avx2_hs_copy_stream - -Dhs_database_alloc=avx2_hs_database_alloc - -Dhs_database_free=avx2_hs_database_free - -Dhs_database_info=avx2_hs_database_info - -Dhs_database_size=avx2_hs_database_size - -Dhs_deserialize_database=avx2_hs_deserialize_database - -Dhs_deserialize_database_at=avx2_hs_deserialize_database_at - -Dhs_expand_stream=avx2_hs_expand_stream - -Dhs_free_database=avx2_hs_free_database - -Dhs_free_scratch=avx2_hs_free_scratch - -Dhs_misc_alloc=avx2_hs_misc_alloc - -Dhs_misc_free=avx2_hs_misc_free - -Dhs_open_stream=avx2_hs_open_stream - -Dhs_reset_and_copy_stream=avx2_hs_reset_and_copy_stream - -Dhs_reset_and_expand_stream=avx2_hs_reset_and_expand_stream - -Dhs_reset_stream=avx2_hs_reset_stream - -Dhs_scan=avx2_hs_scan - -Dhs_scan_stream=avx2_hs_scan_stream - -Dhs_scan_vector=avx2_hs_scan_vector - -Dhs_scratch_alloc=avx2_hs_scratch_alloc - -Dhs_scratch_free=avx2_hs_scratch_free - -Dhs_scratch_size=avx2_hs_scratch_size - -Dhs_serialize_database=avx2_hs_serialize_database - -Dhs_serialized_database_info=avx2_hs_serialized_database_info - -Dhs_serialized_database_size=avx2_hs_serialized_database_size - -Dhs_set_allocator=avx2_hs_set_allocator - -Dhs_set_database_allocator=avx2_hs_set_database_allocator - -Dhs_set_misc_allocator=avx2_hs_set_misc_allocator - -Dhs_set_scratch_allocator=avx2_hs_set_scratch_allocator - -Dhs_set_stream_allocator=avx2_hs_set_stream_allocator - -Dhs_stream_alloc=avx2_hs_stream_alloc - -Dhs_stream_free=avx2_hs_stream_free - -Dhs_stream_size=avx2_hs_stream_size - -Dhs_valid_platform=avx2_hs_valid_platform - -Dhs_version=avx2_hs_version - -DhwlmExec=avx2_hwlmExec - -DhwlmExecStreaming=avx2_hwlmExecStreaming - -DloadSomFromStream=avx2_loadSomFromStream - -Dloadcompressed128=avx2_loadcompressed128 - -Dloadcompressed256=avx2_loadcompressed256 - -Dloadcompressed32=avx2_loadcompressed32 - -Dloadcompressed384=avx2_loadcompressed384 - -Dloadcompressed512=avx2_loadcompressed512 - -Dloadcompressed64=avx2_loadcompressed64 - -Dmcsheng_pext_mask=avx2_mcsheng_pext_mask - -Dmm_mask_mask=avx2_mm_mask_mask - -Dmm_shuffle_end=avx2_mm_shuffle_end - -Dmmbit_keyshift_lut=avx2_mmbit_keyshift_lut - -Dmmbit_maxlevel_direct_lut=avx2_mmbit_maxlevel_direct_lut - -Dmmbit_maxlevel_from_keyshift_lut=avx2_mmbit_maxlevel_from_keyshift_lut - -Dmmbit_root_offset_from_level=avx2_mmbit_root_offset_from_level - -Dmmbit_zero_to_lut=avx2_mmbit_zero_to_lut - -DnfaBlockExecReverse=avx2_nfaBlockExecReverse - -DnfaCheckFinalState=avx2_nfaCheckFinalState - -DnfaExecCastle_Q=avx2_nfaExecCastle_Q - -DnfaExecCastle_Q2=avx2_nfaExecCastle_Q2 - -DnfaExecCastle_QR=avx2_nfaExecCastle_QR - -DnfaExecCastle_expandState=avx2_nfaExecCastle_expandState - -DnfaExecCastle_inAccept=avx2_nfaExecCastle_inAccept - -DnfaExecCastle_inAnyAccept=avx2_nfaExecCastle_inAnyAccept - -DnfaExecCastle_initCompressedState=avx2_nfaExecCastle_initCompressedState - -DnfaExecCastle_queueCompressState=avx2_nfaExecCastle_queueCompressState - -DnfaExecCastle_queueInitState=avx2_nfaExecCastle_queueInitState - -DnfaExecCastle_reportCurrent=avx2_nfaExecCastle_reportCurrent - -DnfaExecGough16_Q=avx2_nfaExecGough16_Q - -DnfaExecGough16_Q2=avx2_nfaExecGough16_Q2 - -DnfaExecGough16_QR=avx2_nfaExecGough16_QR - -DnfaExecGough16_expandState=avx2_nfaExecGough16_expandState - -DnfaExecGough16_inAccept=avx2_nfaExecGough16_inAccept - -DnfaExecGough16_inAnyAccept=avx2_nfaExecGough16_inAnyAccept - -DnfaExecGough16_initCompressedState=avx2_nfaExecGough16_initCompressedState - -DnfaExecGough16_queueCompressState=avx2_nfaExecGough16_queueCompressState - -DnfaExecGough16_queueInitState=avx2_nfaExecGough16_queueInitState - -DnfaExecGough16_reportCurrent=avx2_nfaExecGough16_reportCurrent - -DnfaExecGough16_testEOD=avx2_nfaExecGough16_testEOD - -DnfaExecGough8_Q=avx2_nfaExecGough8_Q - -DnfaExecGough8_Q2=avx2_nfaExecGough8_Q2 - -DnfaExecGough8_QR=avx2_nfaExecGough8_QR - -DnfaExecGough8_expandState=avx2_nfaExecGough8_expandState - -DnfaExecGough8_inAccept=avx2_nfaExecGough8_inAccept - -DnfaExecGough8_inAnyAccept=avx2_nfaExecGough8_inAnyAccept - -DnfaExecGough8_initCompressedState=avx2_nfaExecGough8_initCompressedState - -DnfaExecGough8_queueCompressState=avx2_nfaExecGough8_queueCompressState - -DnfaExecGough8_queueInitState=avx2_nfaExecGough8_queueInitState - -DnfaExecGough8_reportCurrent=avx2_nfaExecGough8_reportCurrent - -DnfaExecGough8_testEOD=avx2_nfaExecGough8_testEOD - -DnfaExecLbrDot_Q=avx2_nfaExecLbrDot_Q - -DnfaExecLbrDot_Q2=avx2_nfaExecLbrDot_Q2 - -DnfaExecLbrDot_QR=avx2_nfaExecLbrDot_QR - -DnfaExecLbrDot_expandState=avx2_nfaExecLbrDot_expandState - -DnfaExecLbrDot_inAccept=avx2_nfaExecLbrDot_inAccept - -DnfaExecLbrDot_inAnyAccept=avx2_nfaExecLbrDot_inAnyAccept - -DnfaExecLbrDot_initCompressedState=avx2_nfaExecLbrDot_initCompressedState - -DnfaExecLbrDot_queueCompressState=avx2_nfaExecLbrDot_queueCompressState - -DnfaExecLbrDot_queueInitState=avx2_nfaExecLbrDot_queueInitState - -DnfaExecLbrDot_reportCurrent=avx2_nfaExecLbrDot_reportCurrent - -DnfaExecLbrNVerm_Q=avx2_nfaExecLbrNVerm_Q - -DnfaExecLbrNVerm_Q2=avx2_nfaExecLbrNVerm_Q2 - -DnfaExecLbrNVerm_QR=avx2_nfaExecLbrNVerm_QR - -DnfaExecLbrNVerm_expandState=avx2_nfaExecLbrNVerm_expandState - -DnfaExecLbrNVerm_inAccept=avx2_nfaExecLbrNVerm_inAccept - -DnfaExecLbrNVerm_inAnyAccept=avx2_nfaExecLbrNVerm_inAnyAccept - -DnfaExecLbrNVerm_initCompressedState=avx2_nfaExecLbrNVerm_initCompressedState - -DnfaExecLbrNVerm_queueCompressState=avx2_nfaExecLbrNVerm_queueCompressState - -DnfaExecLbrNVerm_queueInitState=avx2_nfaExecLbrNVerm_queueInitState - -DnfaExecLbrNVerm_reportCurrent=avx2_nfaExecLbrNVerm_reportCurrent - -DnfaExecLbrShuf_Q=avx2_nfaExecLbrShuf_Q - -DnfaExecLbrShuf_Q2=avx2_nfaExecLbrShuf_Q2 - -DnfaExecLbrShuf_QR=avx2_nfaExecLbrShuf_QR - -DnfaExecLbrShuf_expandState=avx2_nfaExecLbrShuf_expandState - -DnfaExecLbrShuf_inAccept=avx2_nfaExecLbrShuf_inAccept - -DnfaExecLbrShuf_inAnyAccept=avx2_nfaExecLbrShuf_inAnyAccept - -DnfaExecLbrShuf_initCompressedState=avx2_nfaExecLbrShuf_initCompressedState - -DnfaExecLbrShuf_queueCompressState=avx2_nfaExecLbrShuf_queueCompressState - -DnfaExecLbrShuf_queueInitState=avx2_nfaExecLbrShuf_queueInitState - -DnfaExecLbrShuf_reportCurrent=avx2_nfaExecLbrShuf_reportCurrent - -DnfaExecLbrTruf_Q=avx2_nfaExecLbrTruf_Q - -DnfaExecLbrTruf_Q2=avx2_nfaExecLbrTruf_Q2 - -DnfaExecLbrTruf_QR=avx2_nfaExecLbrTruf_QR - -DnfaExecLbrTruf_expandState=avx2_nfaExecLbrTruf_expandState - -DnfaExecLbrTruf_inAccept=avx2_nfaExecLbrTruf_inAccept - -DnfaExecLbrTruf_inAnyAccept=avx2_nfaExecLbrTruf_inAnyAccept - -DnfaExecLbrTruf_initCompressedState=avx2_nfaExecLbrTruf_initCompressedState - -DnfaExecLbrTruf_queueCompressState=avx2_nfaExecLbrTruf_queueCompressState - -DnfaExecLbrTruf_queueInitState=avx2_nfaExecLbrTruf_queueInitState - -DnfaExecLbrTruf_reportCurrent=avx2_nfaExecLbrTruf_reportCurrent - -DnfaExecLbrVerm_Q=avx2_nfaExecLbrVerm_Q - -DnfaExecLbrVerm_Q2=avx2_nfaExecLbrVerm_Q2 - -DnfaExecLbrVerm_QR=avx2_nfaExecLbrVerm_QR - -DnfaExecLbrVerm_expandState=avx2_nfaExecLbrVerm_expandState - -DnfaExecLbrVerm_inAccept=avx2_nfaExecLbrVerm_inAccept - -DnfaExecLbrVerm_inAnyAccept=avx2_nfaExecLbrVerm_inAnyAccept - -DnfaExecLbrVerm_initCompressedState=avx2_nfaExecLbrVerm_initCompressedState - -DnfaExecLbrVerm_queueCompressState=avx2_nfaExecLbrVerm_queueCompressState - -DnfaExecLbrVerm_queueInitState=avx2_nfaExecLbrVerm_queueInitState - -DnfaExecLbrVerm_reportCurrent=avx2_nfaExecLbrVerm_reportCurrent - -DnfaExecLimEx128_B_Reverse=avx2_nfaExecLimEx128_B_Reverse - -DnfaExecLimEx128_Q=avx2_nfaExecLimEx128_Q - -DnfaExecLimEx128_Q2=avx2_nfaExecLimEx128_Q2 - -DnfaExecLimEx128_QR=avx2_nfaExecLimEx128_QR - -DnfaExecLimEx128_expandState=avx2_nfaExecLimEx128_expandState - -DnfaExecLimEx128_inAccept=avx2_nfaExecLimEx128_inAccept - -DnfaExecLimEx128_inAnyAccept=avx2_nfaExecLimEx128_inAnyAccept - -DnfaExecLimEx128_initCompressedState=avx2_nfaExecLimEx128_initCompressedState - -DnfaExecLimEx128_queueCompressState=avx2_nfaExecLimEx128_queueCompressState - -DnfaExecLimEx128_queueInitState=avx2_nfaExecLimEx128_queueInitState - -DnfaExecLimEx128_reportCurrent=avx2_nfaExecLimEx128_reportCurrent - -DnfaExecLimEx128_testEOD=avx2_nfaExecLimEx128_testEOD - -DnfaExecLimEx128_zombie_status=avx2_nfaExecLimEx128_zombie_status - -DnfaExecLimEx256_B_Reverse=avx2_nfaExecLimEx256_B_Reverse - -DnfaExecLimEx256_Q=avx2_nfaExecLimEx256_Q - -DnfaExecLimEx256_Q2=avx2_nfaExecLimEx256_Q2 - -DnfaExecLimEx256_QR=avx2_nfaExecLimEx256_QR - -DnfaExecLimEx256_expandState=avx2_nfaExecLimEx256_expandState - -DnfaExecLimEx256_inAccept=avx2_nfaExecLimEx256_inAccept - -DnfaExecLimEx256_inAnyAccept=avx2_nfaExecLimEx256_inAnyAccept - -DnfaExecLimEx256_initCompressedState=avx2_nfaExecLimEx256_initCompressedState - -DnfaExecLimEx256_queueCompressState=avx2_nfaExecLimEx256_queueCompressState - -DnfaExecLimEx256_queueInitState=avx2_nfaExecLimEx256_queueInitState - -DnfaExecLimEx256_reportCurrent=avx2_nfaExecLimEx256_reportCurrent - -DnfaExecLimEx256_testEOD=avx2_nfaExecLimEx256_testEOD - -DnfaExecLimEx256_zombie_status=avx2_nfaExecLimEx256_zombie_status - -DnfaExecLimEx32_B_Reverse=avx2_nfaExecLimEx32_B_Reverse - -DnfaExecLimEx32_Q=avx2_nfaExecLimEx32_Q - -DnfaExecLimEx32_Q2=avx2_nfaExecLimEx32_Q2 - -DnfaExecLimEx32_QR=avx2_nfaExecLimEx32_QR - -DnfaExecLimEx32_expandState=avx2_nfaExecLimEx32_expandState - -DnfaExecLimEx32_inAccept=avx2_nfaExecLimEx32_inAccept - -DnfaExecLimEx32_inAnyAccept=avx2_nfaExecLimEx32_inAnyAccept - -DnfaExecLimEx32_initCompressedState=avx2_nfaExecLimEx32_initCompressedState - -DnfaExecLimEx32_queueCompressState=avx2_nfaExecLimEx32_queueCompressState - -DnfaExecLimEx32_queueInitState=avx2_nfaExecLimEx32_queueInitState - -DnfaExecLimEx32_reportCurrent=avx2_nfaExecLimEx32_reportCurrent - -DnfaExecLimEx32_testEOD=avx2_nfaExecLimEx32_testEOD - -DnfaExecLimEx32_zombie_status=avx2_nfaExecLimEx32_zombie_status - -DnfaExecLimEx384_B_Reverse=avx2_nfaExecLimEx384_B_Reverse - -DnfaExecLimEx384_Q=avx2_nfaExecLimEx384_Q - -DnfaExecLimEx384_Q2=avx2_nfaExecLimEx384_Q2 - -DnfaExecLimEx384_QR=avx2_nfaExecLimEx384_QR - -DnfaExecLimEx384_expandState=avx2_nfaExecLimEx384_expandState - -DnfaExecLimEx384_inAccept=avx2_nfaExecLimEx384_inAccept - -DnfaExecLimEx384_inAnyAccept=avx2_nfaExecLimEx384_inAnyAccept - -DnfaExecLimEx384_initCompressedState=avx2_nfaExecLimEx384_initCompressedState - -DnfaExecLimEx384_queueCompressState=avx2_nfaExecLimEx384_queueCompressState - -DnfaExecLimEx384_queueInitState=avx2_nfaExecLimEx384_queueInitState - -DnfaExecLimEx384_reportCurrent=avx2_nfaExecLimEx384_reportCurrent - -DnfaExecLimEx384_testEOD=avx2_nfaExecLimEx384_testEOD - -DnfaExecLimEx384_zombie_status=avx2_nfaExecLimEx384_zombie_status - -DnfaExecLimEx512_B_Reverse=avx2_nfaExecLimEx512_B_Reverse - -DnfaExecLimEx512_Q=avx2_nfaExecLimEx512_Q - -DnfaExecLimEx512_Q2=avx2_nfaExecLimEx512_Q2 - -DnfaExecLimEx512_QR=avx2_nfaExecLimEx512_QR - -DnfaExecLimEx512_expandState=avx2_nfaExecLimEx512_expandState - -DnfaExecLimEx512_inAccept=avx2_nfaExecLimEx512_inAccept - -DnfaExecLimEx512_inAnyAccept=avx2_nfaExecLimEx512_inAnyAccept - -DnfaExecLimEx512_initCompressedState=avx2_nfaExecLimEx512_initCompressedState - -DnfaExecLimEx512_queueCompressState=avx2_nfaExecLimEx512_queueCompressState - -DnfaExecLimEx512_queueInitState=avx2_nfaExecLimEx512_queueInitState - -DnfaExecLimEx512_reportCurrent=avx2_nfaExecLimEx512_reportCurrent - -DnfaExecLimEx512_testEOD=avx2_nfaExecLimEx512_testEOD - -DnfaExecLimEx512_zombie_status=avx2_nfaExecLimEx512_zombie_status - -DnfaExecLimEx64_B_Reverse=avx2_nfaExecLimEx64_B_Reverse - -DnfaExecLimEx64_Q=avx2_nfaExecLimEx64_Q - -DnfaExecLimEx64_Q2=avx2_nfaExecLimEx64_Q2 - -DnfaExecLimEx64_QR=avx2_nfaExecLimEx64_QR - -DnfaExecLimEx64_expandState=avx2_nfaExecLimEx64_expandState - -DnfaExecLimEx64_inAccept=avx2_nfaExecLimEx64_inAccept - -DnfaExecLimEx64_inAnyAccept=avx2_nfaExecLimEx64_inAnyAccept - -DnfaExecLimEx64_initCompressedState=avx2_nfaExecLimEx64_initCompressedState - -DnfaExecLimEx64_queueCompressState=avx2_nfaExecLimEx64_queueCompressState - -DnfaExecLimEx64_queueInitState=avx2_nfaExecLimEx64_queueInitState - -DnfaExecLimEx64_reportCurrent=avx2_nfaExecLimEx64_reportCurrent - -DnfaExecLimEx64_testEOD=avx2_nfaExecLimEx64_testEOD - -DnfaExecLimEx64_zombie_status=avx2_nfaExecLimEx64_zombie_status - -DnfaExecMcClellan16_B=avx2_nfaExecMcClellan16_B - -DnfaExecMcClellan16_Q=avx2_nfaExecMcClellan16_Q - -DnfaExecMcClellan16_Q2=avx2_nfaExecMcClellan16_Q2 - -DnfaExecMcClellan16_QR=avx2_nfaExecMcClellan16_QR - -DnfaExecMcClellan16_SimpStream=avx2_nfaExecMcClellan16_SimpStream - -DnfaExecMcClellan16_expandState=avx2_nfaExecMcClellan16_expandState - -DnfaExecMcClellan16_inAccept=avx2_nfaExecMcClellan16_inAccept - -DnfaExecMcClellan16_inAnyAccept=avx2_nfaExecMcClellan16_inAnyAccept - -DnfaExecMcClellan16_initCompressedState=avx2_nfaExecMcClellan16_initCompressedState - -DnfaExecMcClellan16_queueCompressState=avx2_nfaExecMcClellan16_queueCompressState - -DnfaExecMcClellan16_queueInitState=avx2_nfaExecMcClellan16_queueInitState - -DnfaExecMcClellan16_reportCurrent=avx2_nfaExecMcClellan16_reportCurrent - -DnfaExecMcClellan16_testEOD=avx2_nfaExecMcClellan16_testEOD - -DnfaExecMcClellan8_B=avx2_nfaExecMcClellan8_B - -DnfaExecMcClellan8_Q=avx2_nfaExecMcClellan8_Q - -DnfaExecMcClellan8_Q2=avx2_nfaExecMcClellan8_Q2 - -DnfaExecMcClellan8_QR=avx2_nfaExecMcClellan8_QR - -DnfaExecMcClellan8_SimpStream=avx2_nfaExecMcClellan8_SimpStream - -DnfaExecMcClellan8_expandState=avx2_nfaExecMcClellan8_expandState - -DnfaExecMcClellan8_inAccept=avx2_nfaExecMcClellan8_inAccept - -DnfaExecMcClellan8_inAnyAccept=avx2_nfaExecMcClellan8_inAnyAccept - -DnfaExecMcClellan8_initCompressedState=avx2_nfaExecMcClellan8_initCompressedState - -DnfaExecMcClellan8_queueCompressState=avx2_nfaExecMcClellan8_queueCompressState - -DnfaExecMcClellan8_queueInitState=avx2_nfaExecMcClellan8_queueInitState - -DnfaExecMcClellan8_reportCurrent=avx2_nfaExecMcClellan8_reportCurrent - -DnfaExecMcClellan8_testEOD=avx2_nfaExecMcClellan8_testEOD - -DnfaExecMcSheng16_Q=avx2_nfaExecMcSheng16_Q - -DnfaExecMcSheng16_Q2=avx2_nfaExecMcSheng16_Q2 - -DnfaExecMcSheng16_QR=avx2_nfaExecMcSheng16_QR - -DnfaExecMcSheng16_expandState=avx2_nfaExecMcSheng16_expandState - -DnfaExecMcSheng16_inAccept=avx2_nfaExecMcSheng16_inAccept - -DnfaExecMcSheng16_inAnyAccept=avx2_nfaExecMcSheng16_inAnyAccept - -DnfaExecMcSheng16_initCompressedState=avx2_nfaExecMcSheng16_initCompressedState - -DnfaExecMcSheng16_queueCompressState=avx2_nfaExecMcSheng16_queueCompressState - -DnfaExecMcSheng16_queueInitState=avx2_nfaExecMcSheng16_queueInitState - -DnfaExecMcSheng16_reportCurrent=avx2_nfaExecMcSheng16_reportCurrent - -DnfaExecMcSheng16_testEOD=avx2_nfaExecMcSheng16_testEOD - -DnfaExecMcSheng8_Q=avx2_nfaExecMcSheng8_Q - -DnfaExecMcSheng8_Q2=avx2_nfaExecMcSheng8_Q2 - -DnfaExecMcSheng8_QR=avx2_nfaExecMcSheng8_QR - -DnfaExecMcSheng8_expandState=avx2_nfaExecMcSheng8_expandState - -DnfaExecMcSheng8_inAccept=avx2_nfaExecMcSheng8_inAccept - -DnfaExecMcSheng8_inAnyAccept=avx2_nfaExecMcSheng8_inAnyAccept - -DnfaExecMcSheng8_initCompressedState=avx2_nfaExecMcSheng8_initCompressedState - -DnfaExecMcSheng8_queueCompressState=avx2_nfaExecMcSheng8_queueCompressState - -DnfaExecMcSheng8_queueInitState=avx2_nfaExecMcSheng8_queueInitState - -DnfaExecMcSheng8_reportCurrent=avx2_nfaExecMcSheng8_reportCurrent - -DnfaExecMcSheng8_testEOD=avx2_nfaExecMcSheng8_testEOD - -DnfaExecMpv_Q=avx2_nfaExecMpv_Q - -DnfaExecMpv_QueueExecRaw=avx2_nfaExecMpv_QueueExecRaw - -DnfaExecMpv_expandState=avx2_nfaExecMpv_expandState - -DnfaExecMpv_initCompressedState=avx2_nfaExecMpv_initCompressedState - -DnfaExecMpv_queueCompressState=avx2_nfaExecMpv_queueCompressState - -DnfaExecMpv_queueInitState=avx2_nfaExecMpv_queueInitState - -DnfaExecMpv_reportCurrent=avx2_nfaExecMpv_reportCurrent - -DnfaExecSheng_B=avx2_nfaExecSheng_B - -DnfaExecSheng_Q=avx2_nfaExecSheng_Q - -DnfaExecSheng_Q2=avx2_nfaExecSheng_Q2 - -DnfaExecSheng_QR=avx2_nfaExecSheng_QR - -DnfaExecSheng_expandState=avx2_nfaExecSheng_expandState - -DnfaExecSheng_inAccept=avx2_nfaExecSheng_inAccept - -DnfaExecSheng_inAnyAccept=avx2_nfaExecSheng_inAnyAccept - -DnfaExecSheng_initCompressedState=avx2_nfaExecSheng_initCompressedState - -DnfaExecSheng_queueCompressState=avx2_nfaExecSheng_queueCompressState - -DnfaExecSheng_queueInitState=avx2_nfaExecSheng_queueInitState - -DnfaExecSheng_reportCurrent=avx2_nfaExecSheng_reportCurrent - -DnfaExecSheng_testEOD=avx2_nfaExecSheng_testEOD - -DnfaExecTamarama_Q=avx2_nfaExecTamarama_Q - -DnfaExecTamarama_Q2=avx2_nfaExecTamarama_Q2 - -DnfaExecTamarama_QR=avx2_nfaExecTamarama_QR - -DnfaExecTamarama_expandState=avx2_nfaExecTamarama_expandState - -DnfaExecTamarama_inAccept=avx2_nfaExecTamarama_inAccept - -DnfaExecTamarama_inAnyAccept=avx2_nfaExecTamarama_inAnyAccept - -DnfaExecTamarama_queueCompressState=avx2_nfaExecTamarama_queueCompressState - -DnfaExecTamarama_queueInitState=avx2_nfaExecTamarama_queueInitState - -DnfaExecTamarama_reportCurrent=avx2_nfaExecTamarama_reportCurrent - -DnfaExecTamarama_testEOD=avx2_nfaExecTamarama_testEOD - -DnfaExecTamarama_zombie_status=avx2_nfaExecTamarama_zombie_status - -DnfaExpandState=avx2_nfaExpandState - -DnfaGetZombieStatus=avx2_nfaGetZombieStatus - -DnfaInAcceptState=avx2_nfaInAcceptState - -DnfaInAnyAcceptState=avx2_nfaInAnyAcceptState - -DnfaInitCompressedState=avx2_nfaInitCompressedState - -DnfaQueueCompressState=avx2_nfaQueueCompressState - -DnfaQueueExec=avx2_nfaQueueExec - -DnfaQueueExec2_raw=avx2_nfaQueueExec2_raw - -DnfaQueueExecRose=avx2_nfaQueueExecRose - -DnfaQueueExecToMatch=avx2_nfaQueueExecToMatch - -DnfaQueueExec_raw=avx2_nfaQueueExec_raw - -DnfaQueueInitState=avx2_nfaQueueInitState - -DnfaReportCurrentMatches=avx2_nfaReportCurrentMatches - -DnoodExec=avx2_noodExec - -DnoodExecStreaming=avx2_noodExecStreaming - -Dp_mask_arr=avx2_p_mask_arr - -Dp_mask_arr256=avx2_p_mask_arr256 - -DrepeatHasMatchBitmap=avx2_repeatHasMatchBitmap - -DrepeatHasMatchRange=avx2_repeatHasMatchRange - -DrepeatHasMatchRing=avx2_repeatHasMatchRing - -DrepeatHasMatchSparseOptimalP=avx2_repeatHasMatchSparseOptimalP - -DrepeatHasMatchTrailer=avx2_repeatHasMatchTrailer - -DrepeatLastTopBitmap=avx2_repeatLastTopBitmap - -DrepeatLastTopRange=avx2_repeatLastTopRange - -DrepeatLastTopRing=avx2_repeatLastTopRing - -DrepeatLastTopSparseOptimalP=avx2_repeatLastTopSparseOptimalP - -DrepeatLastTopTrailer=avx2_repeatLastTopTrailer - -DrepeatNextMatchBitmap=avx2_repeatNextMatchBitmap - -DrepeatNextMatchRange=avx2_repeatNextMatchRange - -DrepeatNextMatchRing=avx2_repeatNextMatchRing - -DrepeatNextMatchSparseOptimalP=avx2_repeatNextMatchSparseOptimalP - -DrepeatNextMatchTrailer=avx2_repeatNextMatchTrailer - -DrepeatPack=avx2_repeatPack - -DrepeatStoreBitmap=avx2_repeatStoreBitmap - -DrepeatStoreRange=avx2_repeatStoreRange - -DrepeatStoreRing=avx2_repeatStoreRing - -DrepeatStoreSparseOptimalP=avx2_repeatStoreSparseOptimalP - -DrepeatStoreTrailer=avx2_repeatStoreTrailer - -DrepeatUnpack=avx2_repeatUnpack - -DroseAnchoredCallback=avx2_roseAnchoredCallback - -DroseBlockExec=avx2_roseBlockExec - -DroseCallback=avx2_roseCallback - -DroseCatchUpAll=avx2_roseCatchUpAll - -DroseCatchUpMPV_i=avx2_roseCatchUpMPV_i - -DroseCatchUpSuf=avx2_roseCatchUpSuf - -DroseDelayRebuildCallback=avx2_roseDelayRebuildCallback - -DroseFloatingCallback=avx2_roseFloatingCallback - -DroseHandleChainMatch=avx2_roseHandleChainMatch - -DroseInitState=avx2_roseInitState - -DroseNfaAdaptor=avx2_roseNfaAdaptor - -DroseNfaEarliestSom=avx2_roseNfaEarliestSom - -DroseReportAdaptor=avx2_roseReportAdaptor - -DroseRunBoundaryProgram=avx2_roseRunBoundaryProgram - -DroseRunFlushCombProgram=avx2_roseRunFlushCombProgram - -DroseRunLastFlushCombProgram=avx2_roseRunLastFlushCombProgram - -DroseRunProgram=avx2_roseRunProgram - -DroseRunProgram_l=avx2_roseRunProgram_l - -DroseStreamEodExec=avx2_roseStreamEodExec - -DroseStreamExec=avx2_roseStreamExec - -DrshuftiExec=avx2_rshuftiExec - -DrtruffleExec=avx2_rtruffleExec - -Drun_accel=avx2_run_accel - -DsetSomFromSomAware=avx2_setSomFromSomAware - -DshuftiDoubleExec=avx2_shuftiDoubleExec - -DshuftiExec=avx2_shuftiExec - -Dsimd_onebit_masks=avx2_simd_onebit_masks - -Dsize_compress_stream=avx2_size_compress_stream - -DstoreSomToStream=avx2_storeSomToStream - -Dstorecompressed128=avx2_storecompressed128 - -Dstorecompressed256=avx2_storecompressed256 - -Dstorecompressed32=avx2_storecompressed32 - -Dstorecompressed384=avx2_storecompressed384 - -Dstorecompressed512=avx2_storecompressed512 - -Dstorecompressed64=avx2_storecompressed64 - -DstreamInitSufPQ=avx2_streamInitSufPQ - -DtruffleExec=avx2_truffleExec - -Dvbs_mask_data=avx2_vbs_mask_data -) - -SRCDIR(contrib/libs/hyperscan) - -SRCS( - src/alloc.c - src/crc32.c - src/database.c - src/fdr/fdr.c - src/fdr/teddy.c - src/fdr/teddy_avx2.c - src/hs_valid_platform.c - src/hs_version.c - src/hwlm/hwlm.c - src/hwlm/noodle_engine.c - src/nfa/accel.c - src/nfa/castle.c - src/nfa/gough.c - src/nfa/lbr.c - src/nfa/limex_64.c - src/nfa/limex_accel.c - src/nfa/limex_native.c - src/nfa/limex_simd128.c - src/nfa/limex_simd256.c - src/nfa/limex_simd384.c - src/nfa/limex_simd512.c - src/nfa/mcclellan.c - src/nfa/mcsheng.c - src/nfa/mcsheng_data.c - src/nfa/mpv.c - src/nfa/nfa_api_dispatch.c - src/nfa/repeat.c - src/nfa/sheng.c - src/nfa/shufti.c - src/nfa/tamarama.c - src/nfa/truffle.c - src/rose/block.c - src/rose/catchup.c - src/rose/init.c - src/rose/match.c - src/rose/program_runtime.c - src/rose/stream.c - src/runtime.c - src/scratch.c - src/som/som_runtime.c - src/som/som_stream.c - src/stream_compress.c - src/util/cpuid_flags.c - src/util/masked_move.c - src/util/multibit.c - src/util/simd_utils.c - src/util/state_compress.c -) - -END() +# Generated by devtools/yamaker. + +LIBRARY() + +OWNER( + galtsev + g:antiinfra + g:cpp-contrib + g:yql +) + +LICENSE(BSD-3-Clause) + +LICENSE_TEXTS(.yandex_meta/licenses.list.txt) + +ADDINCL( + contrib/libs/hyperscan + contrib/libs/hyperscan/src +) + +NO_COMPILER_WARNINGS() + +NO_RUNTIME() + +CFLAGS( + ${SSE41_CFLAGS} + -DHAVE_SSE41 + ${SSE42_CFLAGS} + -DHAVE_SSE42 + ${POPCNT_CFLAGS} + -DHAVE_POPCOUNT_INSTR + ${AVX_CFLAGS} + -DHAVE_AVX + ${AVX2_CFLAGS} + -DHAVE_AVX2 + -DCrc32c_ComputeBuf=avx2_Crc32c_ComputeBuf + -DblockInitSufPQ=avx2_blockInitSufPQ + -Dcompress_stream=avx2_compress_stream + -Dcpuid_flags=avx2_cpuid_flags + -Dcpuid_tune=avx2_cpuid_tune + -DdbIsValid=avx2_dbIsValid + -DdoAccel128=avx2_doAccel128 + -DdoAccel256=avx2_doAccel256 + -DdoAccel32=avx2_doAccel32 + -DdoAccel384=avx2_doAccel384 + -DdoAccel512=avx2_doAccel512 + -DdoAccel64=avx2_doAccel64 + -Dexpand_stream=avx2_expand_stream + -DfdrExec=avx2_fdrExec + -DfdrExecStreaming=avx2_fdrExecStreaming + -Dfdr_exec_fat_teddy_msks1=avx2_fdr_exec_fat_teddy_msks1 + -Dfdr_exec_fat_teddy_msks1_pck=avx2_fdr_exec_fat_teddy_msks1_pck + -Dfdr_exec_fat_teddy_msks2=avx2_fdr_exec_fat_teddy_msks2 + -Dfdr_exec_fat_teddy_msks2_pck=avx2_fdr_exec_fat_teddy_msks2_pck + -Dfdr_exec_fat_teddy_msks3=avx2_fdr_exec_fat_teddy_msks3 + -Dfdr_exec_fat_teddy_msks3_pck=avx2_fdr_exec_fat_teddy_msks3_pck + -Dfdr_exec_fat_teddy_msks4=avx2_fdr_exec_fat_teddy_msks4 + -Dfdr_exec_fat_teddy_msks4_pck=avx2_fdr_exec_fat_teddy_msks4_pck + -Dfdr_exec_teddy_msks1=avx2_fdr_exec_teddy_msks1 + -Dfdr_exec_teddy_msks1_pck=avx2_fdr_exec_teddy_msks1_pck + -Dfdr_exec_teddy_msks2=avx2_fdr_exec_teddy_msks2 + -Dfdr_exec_teddy_msks2_pck=avx2_fdr_exec_teddy_msks2_pck + -Dfdr_exec_teddy_msks3=avx2_fdr_exec_teddy_msks3 + -Dfdr_exec_teddy_msks3_pck=avx2_fdr_exec_teddy_msks3_pck + -Dfdr_exec_teddy_msks4=avx2_fdr_exec_teddy_msks4 + -Dfdr_exec_teddy_msks4_pck=avx2_fdr_exec_teddy_msks4_pck + -DflushQueuedLiterals_i=avx2_flushQueuedLiterals_i + -DflushStoredSomMatches_i=avx2_flushStoredSomMatches_i + -DhandleSomExternal=avx2_handleSomExternal + -DhandleSomInternal=avx2_handleSomInternal + -Dhs_alloc_scratch=avx2_hs_alloc_scratch + -Dhs_clone_scratch=avx2_hs_clone_scratch + -Dhs_close_stream=avx2_hs_close_stream + -Dhs_compress_stream=avx2_hs_compress_stream + -Dhs_copy_stream=avx2_hs_copy_stream + -Dhs_database_alloc=avx2_hs_database_alloc + -Dhs_database_free=avx2_hs_database_free + -Dhs_database_info=avx2_hs_database_info + -Dhs_database_size=avx2_hs_database_size + -Dhs_deserialize_database=avx2_hs_deserialize_database + -Dhs_deserialize_database_at=avx2_hs_deserialize_database_at + -Dhs_expand_stream=avx2_hs_expand_stream + -Dhs_free_database=avx2_hs_free_database + -Dhs_free_scratch=avx2_hs_free_scratch + -Dhs_misc_alloc=avx2_hs_misc_alloc + -Dhs_misc_free=avx2_hs_misc_free + -Dhs_open_stream=avx2_hs_open_stream + -Dhs_reset_and_copy_stream=avx2_hs_reset_and_copy_stream + -Dhs_reset_and_expand_stream=avx2_hs_reset_and_expand_stream + -Dhs_reset_stream=avx2_hs_reset_stream + -Dhs_scan=avx2_hs_scan + -Dhs_scan_stream=avx2_hs_scan_stream + -Dhs_scan_vector=avx2_hs_scan_vector + -Dhs_scratch_alloc=avx2_hs_scratch_alloc + -Dhs_scratch_free=avx2_hs_scratch_free + -Dhs_scratch_size=avx2_hs_scratch_size + -Dhs_serialize_database=avx2_hs_serialize_database + -Dhs_serialized_database_info=avx2_hs_serialized_database_info + -Dhs_serialized_database_size=avx2_hs_serialized_database_size + -Dhs_set_allocator=avx2_hs_set_allocator + -Dhs_set_database_allocator=avx2_hs_set_database_allocator + -Dhs_set_misc_allocator=avx2_hs_set_misc_allocator + -Dhs_set_scratch_allocator=avx2_hs_set_scratch_allocator + -Dhs_set_stream_allocator=avx2_hs_set_stream_allocator + -Dhs_stream_alloc=avx2_hs_stream_alloc + -Dhs_stream_free=avx2_hs_stream_free + -Dhs_stream_size=avx2_hs_stream_size + -Dhs_valid_platform=avx2_hs_valid_platform + -Dhs_version=avx2_hs_version + -DhwlmExec=avx2_hwlmExec + -DhwlmExecStreaming=avx2_hwlmExecStreaming + -DloadSomFromStream=avx2_loadSomFromStream + -Dloadcompressed128=avx2_loadcompressed128 + -Dloadcompressed256=avx2_loadcompressed256 + -Dloadcompressed32=avx2_loadcompressed32 + -Dloadcompressed384=avx2_loadcompressed384 + -Dloadcompressed512=avx2_loadcompressed512 + -Dloadcompressed64=avx2_loadcompressed64 + -Dmcsheng_pext_mask=avx2_mcsheng_pext_mask + -Dmm_mask_mask=avx2_mm_mask_mask + -Dmm_shuffle_end=avx2_mm_shuffle_end + -Dmmbit_keyshift_lut=avx2_mmbit_keyshift_lut + -Dmmbit_maxlevel_direct_lut=avx2_mmbit_maxlevel_direct_lut + -Dmmbit_maxlevel_from_keyshift_lut=avx2_mmbit_maxlevel_from_keyshift_lut + -Dmmbit_root_offset_from_level=avx2_mmbit_root_offset_from_level + -Dmmbit_zero_to_lut=avx2_mmbit_zero_to_lut + -DnfaBlockExecReverse=avx2_nfaBlockExecReverse + -DnfaCheckFinalState=avx2_nfaCheckFinalState + -DnfaExecCastle_Q=avx2_nfaExecCastle_Q + -DnfaExecCastle_Q2=avx2_nfaExecCastle_Q2 + -DnfaExecCastle_QR=avx2_nfaExecCastle_QR + -DnfaExecCastle_expandState=avx2_nfaExecCastle_expandState + -DnfaExecCastle_inAccept=avx2_nfaExecCastle_inAccept + -DnfaExecCastle_inAnyAccept=avx2_nfaExecCastle_inAnyAccept + -DnfaExecCastle_initCompressedState=avx2_nfaExecCastle_initCompressedState + -DnfaExecCastle_queueCompressState=avx2_nfaExecCastle_queueCompressState + -DnfaExecCastle_queueInitState=avx2_nfaExecCastle_queueInitState + -DnfaExecCastle_reportCurrent=avx2_nfaExecCastle_reportCurrent + -DnfaExecGough16_Q=avx2_nfaExecGough16_Q + -DnfaExecGough16_Q2=avx2_nfaExecGough16_Q2 + -DnfaExecGough16_QR=avx2_nfaExecGough16_QR + -DnfaExecGough16_expandState=avx2_nfaExecGough16_expandState + -DnfaExecGough16_inAccept=avx2_nfaExecGough16_inAccept + -DnfaExecGough16_inAnyAccept=avx2_nfaExecGough16_inAnyAccept + -DnfaExecGough16_initCompressedState=avx2_nfaExecGough16_initCompressedState + -DnfaExecGough16_queueCompressState=avx2_nfaExecGough16_queueCompressState + -DnfaExecGough16_queueInitState=avx2_nfaExecGough16_queueInitState + -DnfaExecGough16_reportCurrent=avx2_nfaExecGough16_reportCurrent + -DnfaExecGough16_testEOD=avx2_nfaExecGough16_testEOD + -DnfaExecGough8_Q=avx2_nfaExecGough8_Q + -DnfaExecGough8_Q2=avx2_nfaExecGough8_Q2 + -DnfaExecGough8_QR=avx2_nfaExecGough8_QR + -DnfaExecGough8_expandState=avx2_nfaExecGough8_expandState + -DnfaExecGough8_inAccept=avx2_nfaExecGough8_inAccept + -DnfaExecGough8_inAnyAccept=avx2_nfaExecGough8_inAnyAccept + -DnfaExecGough8_initCompressedState=avx2_nfaExecGough8_initCompressedState + -DnfaExecGough8_queueCompressState=avx2_nfaExecGough8_queueCompressState + -DnfaExecGough8_queueInitState=avx2_nfaExecGough8_queueInitState + -DnfaExecGough8_reportCurrent=avx2_nfaExecGough8_reportCurrent + -DnfaExecGough8_testEOD=avx2_nfaExecGough8_testEOD + -DnfaExecLbrDot_Q=avx2_nfaExecLbrDot_Q + -DnfaExecLbrDot_Q2=avx2_nfaExecLbrDot_Q2 + -DnfaExecLbrDot_QR=avx2_nfaExecLbrDot_QR + -DnfaExecLbrDot_expandState=avx2_nfaExecLbrDot_expandState + -DnfaExecLbrDot_inAccept=avx2_nfaExecLbrDot_inAccept + -DnfaExecLbrDot_inAnyAccept=avx2_nfaExecLbrDot_inAnyAccept + -DnfaExecLbrDot_initCompressedState=avx2_nfaExecLbrDot_initCompressedState + -DnfaExecLbrDot_queueCompressState=avx2_nfaExecLbrDot_queueCompressState + -DnfaExecLbrDot_queueInitState=avx2_nfaExecLbrDot_queueInitState + -DnfaExecLbrDot_reportCurrent=avx2_nfaExecLbrDot_reportCurrent + -DnfaExecLbrNVerm_Q=avx2_nfaExecLbrNVerm_Q + -DnfaExecLbrNVerm_Q2=avx2_nfaExecLbrNVerm_Q2 + -DnfaExecLbrNVerm_QR=avx2_nfaExecLbrNVerm_QR + -DnfaExecLbrNVerm_expandState=avx2_nfaExecLbrNVerm_expandState + -DnfaExecLbrNVerm_inAccept=avx2_nfaExecLbrNVerm_inAccept + -DnfaExecLbrNVerm_inAnyAccept=avx2_nfaExecLbrNVerm_inAnyAccept + -DnfaExecLbrNVerm_initCompressedState=avx2_nfaExecLbrNVerm_initCompressedState + -DnfaExecLbrNVerm_queueCompressState=avx2_nfaExecLbrNVerm_queueCompressState + -DnfaExecLbrNVerm_queueInitState=avx2_nfaExecLbrNVerm_queueInitState + -DnfaExecLbrNVerm_reportCurrent=avx2_nfaExecLbrNVerm_reportCurrent + -DnfaExecLbrShuf_Q=avx2_nfaExecLbrShuf_Q + -DnfaExecLbrShuf_Q2=avx2_nfaExecLbrShuf_Q2 + -DnfaExecLbrShuf_QR=avx2_nfaExecLbrShuf_QR + -DnfaExecLbrShuf_expandState=avx2_nfaExecLbrShuf_expandState + -DnfaExecLbrShuf_inAccept=avx2_nfaExecLbrShuf_inAccept + -DnfaExecLbrShuf_inAnyAccept=avx2_nfaExecLbrShuf_inAnyAccept + -DnfaExecLbrShuf_initCompressedState=avx2_nfaExecLbrShuf_initCompressedState + -DnfaExecLbrShuf_queueCompressState=avx2_nfaExecLbrShuf_queueCompressState + -DnfaExecLbrShuf_queueInitState=avx2_nfaExecLbrShuf_queueInitState + -DnfaExecLbrShuf_reportCurrent=avx2_nfaExecLbrShuf_reportCurrent + -DnfaExecLbrTruf_Q=avx2_nfaExecLbrTruf_Q + -DnfaExecLbrTruf_Q2=avx2_nfaExecLbrTruf_Q2 + -DnfaExecLbrTruf_QR=avx2_nfaExecLbrTruf_QR + -DnfaExecLbrTruf_expandState=avx2_nfaExecLbrTruf_expandState + -DnfaExecLbrTruf_inAccept=avx2_nfaExecLbrTruf_inAccept + -DnfaExecLbrTruf_inAnyAccept=avx2_nfaExecLbrTruf_inAnyAccept + -DnfaExecLbrTruf_initCompressedState=avx2_nfaExecLbrTruf_initCompressedState + -DnfaExecLbrTruf_queueCompressState=avx2_nfaExecLbrTruf_queueCompressState + -DnfaExecLbrTruf_queueInitState=avx2_nfaExecLbrTruf_queueInitState + -DnfaExecLbrTruf_reportCurrent=avx2_nfaExecLbrTruf_reportCurrent + -DnfaExecLbrVerm_Q=avx2_nfaExecLbrVerm_Q + -DnfaExecLbrVerm_Q2=avx2_nfaExecLbrVerm_Q2 + -DnfaExecLbrVerm_QR=avx2_nfaExecLbrVerm_QR + -DnfaExecLbrVerm_expandState=avx2_nfaExecLbrVerm_expandState + -DnfaExecLbrVerm_inAccept=avx2_nfaExecLbrVerm_inAccept + -DnfaExecLbrVerm_inAnyAccept=avx2_nfaExecLbrVerm_inAnyAccept + -DnfaExecLbrVerm_initCompressedState=avx2_nfaExecLbrVerm_initCompressedState + -DnfaExecLbrVerm_queueCompressState=avx2_nfaExecLbrVerm_queueCompressState + -DnfaExecLbrVerm_queueInitState=avx2_nfaExecLbrVerm_queueInitState + -DnfaExecLbrVerm_reportCurrent=avx2_nfaExecLbrVerm_reportCurrent + -DnfaExecLimEx128_B_Reverse=avx2_nfaExecLimEx128_B_Reverse + -DnfaExecLimEx128_Q=avx2_nfaExecLimEx128_Q + -DnfaExecLimEx128_Q2=avx2_nfaExecLimEx128_Q2 + -DnfaExecLimEx128_QR=avx2_nfaExecLimEx128_QR + -DnfaExecLimEx128_expandState=avx2_nfaExecLimEx128_expandState + -DnfaExecLimEx128_inAccept=avx2_nfaExecLimEx128_inAccept + -DnfaExecLimEx128_inAnyAccept=avx2_nfaExecLimEx128_inAnyAccept + -DnfaExecLimEx128_initCompressedState=avx2_nfaExecLimEx128_initCompressedState + -DnfaExecLimEx128_queueCompressState=avx2_nfaExecLimEx128_queueCompressState + -DnfaExecLimEx128_queueInitState=avx2_nfaExecLimEx128_queueInitState + -DnfaExecLimEx128_reportCurrent=avx2_nfaExecLimEx128_reportCurrent + -DnfaExecLimEx128_testEOD=avx2_nfaExecLimEx128_testEOD + -DnfaExecLimEx128_zombie_status=avx2_nfaExecLimEx128_zombie_status + -DnfaExecLimEx256_B_Reverse=avx2_nfaExecLimEx256_B_Reverse + -DnfaExecLimEx256_Q=avx2_nfaExecLimEx256_Q + -DnfaExecLimEx256_Q2=avx2_nfaExecLimEx256_Q2 + -DnfaExecLimEx256_QR=avx2_nfaExecLimEx256_QR + -DnfaExecLimEx256_expandState=avx2_nfaExecLimEx256_expandState + -DnfaExecLimEx256_inAccept=avx2_nfaExecLimEx256_inAccept + -DnfaExecLimEx256_inAnyAccept=avx2_nfaExecLimEx256_inAnyAccept + -DnfaExecLimEx256_initCompressedState=avx2_nfaExecLimEx256_initCompressedState + -DnfaExecLimEx256_queueCompressState=avx2_nfaExecLimEx256_queueCompressState + -DnfaExecLimEx256_queueInitState=avx2_nfaExecLimEx256_queueInitState + -DnfaExecLimEx256_reportCurrent=avx2_nfaExecLimEx256_reportCurrent + -DnfaExecLimEx256_testEOD=avx2_nfaExecLimEx256_testEOD + -DnfaExecLimEx256_zombie_status=avx2_nfaExecLimEx256_zombie_status + -DnfaExecLimEx32_B_Reverse=avx2_nfaExecLimEx32_B_Reverse + -DnfaExecLimEx32_Q=avx2_nfaExecLimEx32_Q + -DnfaExecLimEx32_Q2=avx2_nfaExecLimEx32_Q2 + -DnfaExecLimEx32_QR=avx2_nfaExecLimEx32_QR + -DnfaExecLimEx32_expandState=avx2_nfaExecLimEx32_expandState + -DnfaExecLimEx32_inAccept=avx2_nfaExecLimEx32_inAccept + -DnfaExecLimEx32_inAnyAccept=avx2_nfaExecLimEx32_inAnyAccept + -DnfaExecLimEx32_initCompressedState=avx2_nfaExecLimEx32_initCompressedState + -DnfaExecLimEx32_queueCompressState=avx2_nfaExecLimEx32_queueCompressState + -DnfaExecLimEx32_queueInitState=avx2_nfaExecLimEx32_queueInitState + -DnfaExecLimEx32_reportCurrent=avx2_nfaExecLimEx32_reportCurrent + -DnfaExecLimEx32_testEOD=avx2_nfaExecLimEx32_testEOD + -DnfaExecLimEx32_zombie_status=avx2_nfaExecLimEx32_zombie_status + -DnfaExecLimEx384_B_Reverse=avx2_nfaExecLimEx384_B_Reverse + -DnfaExecLimEx384_Q=avx2_nfaExecLimEx384_Q + -DnfaExecLimEx384_Q2=avx2_nfaExecLimEx384_Q2 + -DnfaExecLimEx384_QR=avx2_nfaExecLimEx384_QR + -DnfaExecLimEx384_expandState=avx2_nfaExecLimEx384_expandState + -DnfaExecLimEx384_inAccept=avx2_nfaExecLimEx384_inAccept + -DnfaExecLimEx384_inAnyAccept=avx2_nfaExecLimEx384_inAnyAccept + -DnfaExecLimEx384_initCompressedState=avx2_nfaExecLimEx384_initCompressedState + -DnfaExecLimEx384_queueCompressState=avx2_nfaExecLimEx384_queueCompressState + -DnfaExecLimEx384_queueInitState=avx2_nfaExecLimEx384_queueInitState + -DnfaExecLimEx384_reportCurrent=avx2_nfaExecLimEx384_reportCurrent + -DnfaExecLimEx384_testEOD=avx2_nfaExecLimEx384_testEOD + -DnfaExecLimEx384_zombie_status=avx2_nfaExecLimEx384_zombie_status + -DnfaExecLimEx512_B_Reverse=avx2_nfaExecLimEx512_B_Reverse + -DnfaExecLimEx512_Q=avx2_nfaExecLimEx512_Q + -DnfaExecLimEx512_Q2=avx2_nfaExecLimEx512_Q2 + -DnfaExecLimEx512_QR=avx2_nfaExecLimEx512_QR + -DnfaExecLimEx512_expandState=avx2_nfaExecLimEx512_expandState + -DnfaExecLimEx512_inAccept=avx2_nfaExecLimEx512_inAccept + -DnfaExecLimEx512_inAnyAccept=avx2_nfaExecLimEx512_inAnyAccept + -DnfaExecLimEx512_initCompressedState=avx2_nfaExecLimEx512_initCompressedState + -DnfaExecLimEx512_queueCompressState=avx2_nfaExecLimEx512_queueCompressState + -DnfaExecLimEx512_queueInitState=avx2_nfaExecLimEx512_queueInitState + -DnfaExecLimEx512_reportCurrent=avx2_nfaExecLimEx512_reportCurrent + -DnfaExecLimEx512_testEOD=avx2_nfaExecLimEx512_testEOD + -DnfaExecLimEx512_zombie_status=avx2_nfaExecLimEx512_zombie_status + -DnfaExecLimEx64_B_Reverse=avx2_nfaExecLimEx64_B_Reverse + -DnfaExecLimEx64_Q=avx2_nfaExecLimEx64_Q + -DnfaExecLimEx64_Q2=avx2_nfaExecLimEx64_Q2 + -DnfaExecLimEx64_QR=avx2_nfaExecLimEx64_QR + -DnfaExecLimEx64_expandState=avx2_nfaExecLimEx64_expandState + -DnfaExecLimEx64_inAccept=avx2_nfaExecLimEx64_inAccept + -DnfaExecLimEx64_inAnyAccept=avx2_nfaExecLimEx64_inAnyAccept + -DnfaExecLimEx64_initCompressedState=avx2_nfaExecLimEx64_initCompressedState + -DnfaExecLimEx64_queueCompressState=avx2_nfaExecLimEx64_queueCompressState + -DnfaExecLimEx64_queueInitState=avx2_nfaExecLimEx64_queueInitState + -DnfaExecLimEx64_reportCurrent=avx2_nfaExecLimEx64_reportCurrent + -DnfaExecLimEx64_testEOD=avx2_nfaExecLimEx64_testEOD + -DnfaExecLimEx64_zombie_status=avx2_nfaExecLimEx64_zombie_status + -DnfaExecMcClellan16_B=avx2_nfaExecMcClellan16_B + -DnfaExecMcClellan16_Q=avx2_nfaExecMcClellan16_Q + -DnfaExecMcClellan16_Q2=avx2_nfaExecMcClellan16_Q2 + -DnfaExecMcClellan16_QR=avx2_nfaExecMcClellan16_QR + -DnfaExecMcClellan16_SimpStream=avx2_nfaExecMcClellan16_SimpStream + -DnfaExecMcClellan16_expandState=avx2_nfaExecMcClellan16_expandState + -DnfaExecMcClellan16_inAccept=avx2_nfaExecMcClellan16_inAccept + -DnfaExecMcClellan16_inAnyAccept=avx2_nfaExecMcClellan16_inAnyAccept + -DnfaExecMcClellan16_initCompressedState=avx2_nfaExecMcClellan16_initCompressedState + -DnfaExecMcClellan16_queueCompressState=avx2_nfaExecMcClellan16_queueCompressState + -DnfaExecMcClellan16_queueInitState=avx2_nfaExecMcClellan16_queueInitState + -DnfaExecMcClellan16_reportCurrent=avx2_nfaExecMcClellan16_reportCurrent + -DnfaExecMcClellan16_testEOD=avx2_nfaExecMcClellan16_testEOD + -DnfaExecMcClellan8_B=avx2_nfaExecMcClellan8_B + -DnfaExecMcClellan8_Q=avx2_nfaExecMcClellan8_Q + -DnfaExecMcClellan8_Q2=avx2_nfaExecMcClellan8_Q2 + -DnfaExecMcClellan8_QR=avx2_nfaExecMcClellan8_QR + -DnfaExecMcClellan8_SimpStream=avx2_nfaExecMcClellan8_SimpStream + -DnfaExecMcClellan8_expandState=avx2_nfaExecMcClellan8_expandState + -DnfaExecMcClellan8_inAccept=avx2_nfaExecMcClellan8_inAccept + -DnfaExecMcClellan8_inAnyAccept=avx2_nfaExecMcClellan8_inAnyAccept + -DnfaExecMcClellan8_initCompressedState=avx2_nfaExecMcClellan8_initCompressedState + -DnfaExecMcClellan8_queueCompressState=avx2_nfaExecMcClellan8_queueCompressState + -DnfaExecMcClellan8_queueInitState=avx2_nfaExecMcClellan8_queueInitState + -DnfaExecMcClellan8_reportCurrent=avx2_nfaExecMcClellan8_reportCurrent + -DnfaExecMcClellan8_testEOD=avx2_nfaExecMcClellan8_testEOD + -DnfaExecMcSheng16_Q=avx2_nfaExecMcSheng16_Q + -DnfaExecMcSheng16_Q2=avx2_nfaExecMcSheng16_Q2 + -DnfaExecMcSheng16_QR=avx2_nfaExecMcSheng16_QR + -DnfaExecMcSheng16_expandState=avx2_nfaExecMcSheng16_expandState + -DnfaExecMcSheng16_inAccept=avx2_nfaExecMcSheng16_inAccept + -DnfaExecMcSheng16_inAnyAccept=avx2_nfaExecMcSheng16_inAnyAccept + -DnfaExecMcSheng16_initCompressedState=avx2_nfaExecMcSheng16_initCompressedState + -DnfaExecMcSheng16_queueCompressState=avx2_nfaExecMcSheng16_queueCompressState + -DnfaExecMcSheng16_queueInitState=avx2_nfaExecMcSheng16_queueInitState + -DnfaExecMcSheng16_reportCurrent=avx2_nfaExecMcSheng16_reportCurrent + -DnfaExecMcSheng16_testEOD=avx2_nfaExecMcSheng16_testEOD + -DnfaExecMcSheng8_Q=avx2_nfaExecMcSheng8_Q + -DnfaExecMcSheng8_Q2=avx2_nfaExecMcSheng8_Q2 + -DnfaExecMcSheng8_QR=avx2_nfaExecMcSheng8_QR + -DnfaExecMcSheng8_expandState=avx2_nfaExecMcSheng8_expandState + -DnfaExecMcSheng8_inAccept=avx2_nfaExecMcSheng8_inAccept + -DnfaExecMcSheng8_inAnyAccept=avx2_nfaExecMcSheng8_inAnyAccept + -DnfaExecMcSheng8_initCompressedState=avx2_nfaExecMcSheng8_initCompressedState + -DnfaExecMcSheng8_queueCompressState=avx2_nfaExecMcSheng8_queueCompressState + -DnfaExecMcSheng8_queueInitState=avx2_nfaExecMcSheng8_queueInitState + -DnfaExecMcSheng8_reportCurrent=avx2_nfaExecMcSheng8_reportCurrent + -DnfaExecMcSheng8_testEOD=avx2_nfaExecMcSheng8_testEOD + -DnfaExecMpv_Q=avx2_nfaExecMpv_Q + -DnfaExecMpv_QueueExecRaw=avx2_nfaExecMpv_QueueExecRaw + -DnfaExecMpv_expandState=avx2_nfaExecMpv_expandState + -DnfaExecMpv_initCompressedState=avx2_nfaExecMpv_initCompressedState + -DnfaExecMpv_queueCompressState=avx2_nfaExecMpv_queueCompressState + -DnfaExecMpv_queueInitState=avx2_nfaExecMpv_queueInitState + -DnfaExecMpv_reportCurrent=avx2_nfaExecMpv_reportCurrent + -DnfaExecSheng_B=avx2_nfaExecSheng_B + -DnfaExecSheng_Q=avx2_nfaExecSheng_Q + -DnfaExecSheng_Q2=avx2_nfaExecSheng_Q2 + -DnfaExecSheng_QR=avx2_nfaExecSheng_QR + -DnfaExecSheng_expandState=avx2_nfaExecSheng_expandState + -DnfaExecSheng_inAccept=avx2_nfaExecSheng_inAccept + -DnfaExecSheng_inAnyAccept=avx2_nfaExecSheng_inAnyAccept + -DnfaExecSheng_initCompressedState=avx2_nfaExecSheng_initCompressedState + -DnfaExecSheng_queueCompressState=avx2_nfaExecSheng_queueCompressState + -DnfaExecSheng_queueInitState=avx2_nfaExecSheng_queueInitState + -DnfaExecSheng_reportCurrent=avx2_nfaExecSheng_reportCurrent + -DnfaExecSheng_testEOD=avx2_nfaExecSheng_testEOD + -DnfaExecTamarama_Q=avx2_nfaExecTamarama_Q + -DnfaExecTamarama_Q2=avx2_nfaExecTamarama_Q2 + -DnfaExecTamarama_QR=avx2_nfaExecTamarama_QR + -DnfaExecTamarama_expandState=avx2_nfaExecTamarama_expandState + -DnfaExecTamarama_inAccept=avx2_nfaExecTamarama_inAccept + -DnfaExecTamarama_inAnyAccept=avx2_nfaExecTamarama_inAnyAccept + -DnfaExecTamarama_queueCompressState=avx2_nfaExecTamarama_queueCompressState + -DnfaExecTamarama_queueInitState=avx2_nfaExecTamarama_queueInitState + -DnfaExecTamarama_reportCurrent=avx2_nfaExecTamarama_reportCurrent + -DnfaExecTamarama_testEOD=avx2_nfaExecTamarama_testEOD + -DnfaExecTamarama_zombie_status=avx2_nfaExecTamarama_zombie_status + -DnfaExpandState=avx2_nfaExpandState + -DnfaGetZombieStatus=avx2_nfaGetZombieStatus + -DnfaInAcceptState=avx2_nfaInAcceptState + -DnfaInAnyAcceptState=avx2_nfaInAnyAcceptState + -DnfaInitCompressedState=avx2_nfaInitCompressedState + -DnfaQueueCompressState=avx2_nfaQueueCompressState + -DnfaQueueExec=avx2_nfaQueueExec + -DnfaQueueExec2_raw=avx2_nfaQueueExec2_raw + -DnfaQueueExecRose=avx2_nfaQueueExecRose + -DnfaQueueExecToMatch=avx2_nfaQueueExecToMatch + -DnfaQueueExec_raw=avx2_nfaQueueExec_raw + -DnfaQueueInitState=avx2_nfaQueueInitState + -DnfaReportCurrentMatches=avx2_nfaReportCurrentMatches + -DnoodExec=avx2_noodExec + -DnoodExecStreaming=avx2_noodExecStreaming + -Dp_mask_arr=avx2_p_mask_arr + -Dp_mask_arr256=avx2_p_mask_arr256 + -DrepeatHasMatchBitmap=avx2_repeatHasMatchBitmap + -DrepeatHasMatchRange=avx2_repeatHasMatchRange + -DrepeatHasMatchRing=avx2_repeatHasMatchRing + -DrepeatHasMatchSparseOptimalP=avx2_repeatHasMatchSparseOptimalP + -DrepeatHasMatchTrailer=avx2_repeatHasMatchTrailer + -DrepeatLastTopBitmap=avx2_repeatLastTopBitmap + -DrepeatLastTopRange=avx2_repeatLastTopRange + -DrepeatLastTopRing=avx2_repeatLastTopRing + -DrepeatLastTopSparseOptimalP=avx2_repeatLastTopSparseOptimalP + -DrepeatLastTopTrailer=avx2_repeatLastTopTrailer + -DrepeatNextMatchBitmap=avx2_repeatNextMatchBitmap + -DrepeatNextMatchRange=avx2_repeatNextMatchRange + -DrepeatNextMatchRing=avx2_repeatNextMatchRing + -DrepeatNextMatchSparseOptimalP=avx2_repeatNextMatchSparseOptimalP + -DrepeatNextMatchTrailer=avx2_repeatNextMatchTrailer + -DrepeatPack=avx2_repeatPack + -DrepeatStoreBitmap=avx2_repeatStoreBitmap + -DrepeatStoreRange=avx2_repeatStoreRange + -DrepeatStoreRing=avx2_repeatStoreRing + -DrepeatStoreSparseOptimalP=avx2_repeatStoreSparseOptimalP + -DrepeatStoreTrailer=avx2_repeatStoreTrailer + -DrepeatUnpack=avx2_repeatUnpack + -DroseAnchoredCallback=avx2_roseAnchoredCallback + -DroseBlockExec=avx2_roseBlockExec + -DroseCallback=avx2_roseCallback + -DroseCatchUpAll=avx2_roseCatchUpAll + -DroseCatchUpMPV_i=avx2_roseCatchUpMPV_i + -DroseCatchUpSuf=avx2_roseCatchUpSuf + -DroseDelayRebuildCallback=avx2_roseDelayRebuildCallback + -DroseFloatingCallback=avx2_roseFloatingCallback + -DroseHandleChainMatch=avx2_roseHandleChainMatch + -DroseInitState=avx2_roseInitState + -DroseNfaAdaptor=avx2_roseNfaAdaptor + -DroseNfaEarliestSom=avx2_roseNfaEarliestSom + -DroseReportAdaptor=avx2_roseReportAdaptor + -DroseRunBoundaryProgram=avx2_roseRunBoundaryProgram + -DroseRunFlushCombProgram=avx2_roseRunFlushCombProgram + -DroseRunLastFlushCombProgram=avx2_roseRunLastFlushCombProgram + -DroseRunProgram=avx2_roseRunProgram + -DroseRunProgram_l=avx2_roseRunProgram_l + -DroseStreamEodExec=avx2_roseStreamEodExec + -DroseStreamExec=avx2_roseStreamExec + -DrshuftiExec=avx2_rshuftiExec + -DrtruffleExec=avx2_rtruffleExec + -Drun_accel=avx2_run_accel + -DsetSomFromSomAware=avx2_setSomFromSomAware + -DshuftiDoubleExec=avx2_shuftiDoubleExec + -DshuftiExec=avx2_shuftiExec + -Dsimd_onebit_masks=avx2_simd_onebit_masks + -Dsize_compress_stream=avx2_size_compress_stream + -DstoreSomToStream=avx2_storeSomToStream + -Dstorecompressed128=avx2_storecompressed128 + -Dstorecompressed256=avx2_storecompressed256 + -Dstorecompressed32=avx2_storecompressed32 + -Dstorecompressed384=avx2_storecompressed384 + -Dstorecompressed512=avx2_storecompressed512 + -Dstorecompressed64=avx2_storecompressed64 + -DstreamInitSufPQ=avx2_streamInitSufPQ + -DtruffleExec=avx2_truffleExec + -Dvbs_mask_data=avx2_vbs_mask_data +) + +SRCDIR(contrib/libs/hyperscan) + +SRCS( + src/alloc.c + src/crc32.c + src/database.c + src/fdr/fdr.c + src/fdr/teddy.c + src/fdr/teddy_avx2.c + src/hs_valid_platform.c + src/hs_version.c + src/hwlm/hwlm.c + src/hwlm/noodle_engine.c + src/nfa/accel.c + src/nfa/castle.c + src/nfa/gough.c + src/nfa/lbr.c + src/nfa/limex_64.c + src/nfa/limex_accel.c + src/nfa/limex_native.c + src/nfa/limex_simd128.c + src/nfa/limex_simd256.c + src/nfa/limex_simd384.c + src/nfa/limex_simd512.c + src/nfa/mcclellan.c + src/nfa/mcsheng.c + src/nfa/mcsheng_data.c + src/nfa/mpv.c + src/nfa/nfa_api_dispatch.c + src/nfa/repeat.c + src/nfa/sheng.c + src/nfa/shufti.c + src/nfa/tamarama.c + src/nfa/truffle.c + src/rose/block.c + src/rose/catchup.c + src/rose/init.c + src/rose/match.c + src/rose/program_runtime.c + src/rose/stream.c + src/runtime.c + src/scratch.c + src/som/som_runtime.c + src/som/som_stream.c + src/stream_compress.c + src/util/cpuid_flags.c + src/util/masked_move.c + src/util/multibit.c + src/util/simd_utils.c + src/util/state_compress.c +) + +END() |