diff options
author | Ivan Blinkov <ivan@blinkov.ru> | 2022-02-10 16:47:10 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:10 +0300 |
commit | 1aeb9a455974457866f78722ad98114bafc84e8a (patch) | |
tree | e4340eaf1668684d83a0a58c36947c5def5350ad /contrib/libs/hyperscan/src/nfa/trufflecompile.cpp | |
parent | bd5ef432f5cfb1e18851381329d94665a4c22470 (diff) | |
download | ydb-1aeb9a455974457866f78722ad98114bafc84e8a.tar.gz |
Restoring authorship annotation for Ivan Blinkov <ivan@blinkov.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/hyperscan/src/nfa/trufflecompile.cpp')
-rw-r--r-- | contrib/libs/hyperscan/src/nfa/trufflecompile.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/contrib/libs/hyperscan/src/nfa/trufflecompile.cpp b/contrib/libs/hyperscan/src/nfa/trufflecompile.cpp index f19de0ee04..29fc503ce5 100644 --- a/contrib/libs/hyperscan/src/nfa/trufflecompile.cpp +++ b/contrib/libs/hyperscan/src/nfa/trufflecompile.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2017, Intel Corporation + * Copyright (c) 2015-2017, Intel Corporation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -32,16 +32,16 @@ * truffle is always able to represent an entire character class, providing a * backstop to other acceleration engines. */ - + #include "trufflecompile.h" - + #include "ue2common.h" #include "util/charreach.h" -#include "util/dump_mask.h" +#include "util/dump_mask.h" #include "util/simd_types.h" -#include <cstring> - +#include <cstring> + using namespace std; namespace ue2 { @@ -56,15 +56,15 @@ namespace ue2 { * bits 456 is the bit that is set at that offset. */ -void truffleBuildMasks(const CharReach &cr, u8 *shuf_mask_lo_highclear, - u8 *shuf_mask_lo_highset) { - memset(shuf_mask_lo_highset, 0, sizeof(m128)); - memset(shuf_mask_lo_highclear, 0, sizeof(m128)); +void truffleBuildMasks(const CharReach &cr, u8 *shuf_mask_lo_highclear, + u8 *shuf_mask_lo_highset) { + memset(shuf_mask_lo_highset, 0, sizeof(m128)); + memset(shuf_mask_lo_highclear, 0, sizeof(m128)); for (size_t v = cr.find_first(); v != CharReach::npos; v = cr.find_next(v)) { DEBUG_PRINTF("adding 0x%02x to %s\n", (u8)v, (v & 0x80) ? "highset" : "highclear"); - u8 *change_mask = (v & 0x80) ? shuf_mask_lo_highset : shuf_mask_lo_highclear; + u8 *change_mask = (v & 0x80) ? shuf_mask_lo_highset : shuf_mask_lo_highclear; u8 low_nibble = v & 0xf; u8 bits_456 = (v & 0x70) >> 4; change_mask[low_nibble] |= 1 << bits_456; @@ -74,16 +74,16 @@ void truffleBuildMasks(const CharReach &cr, u8 *shuf_mask_lo_highclear, /* * Reconstruct the charclass that the truffle masks represent */ -CharReach truffle2cr(const u8 *highclear, const u8 *highset) { +CharReach truffle2cr(const u8 *highclear, const u8 *highset) { CharReach cr; for (u8 i = 0; i < 16; i++) { - u32 bits_456 = highclear[i]; + u32 bits_456 = highclear[i]; while (bits_456) { u32 pos = findAndClearLSB_32(&bits_456); assert(pos < 8); cr.set(pos << 4 | i); } - bits_456 = highset[i]; + bits_456 = highset[i]; while (bits_456) { u32 pos = findAndClearLSB_32(&bits_456); assert(pos < 8); |