aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/hyperscan/src/hwlm/hwlm.c
diff options
context:
space:
mode:
authorIvan Blinkov <ivan@blinkov.ru>2022-02-10 16:47:10 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:10 +0300
commit1aeb9a455974457866f78722ad98114bafc84e8a (patch)
treee4340eaf1668684d83a0a58c36947c5def5350ad /contrib/libs/hyperscan/src/hwlm/hwlm.c
parentbd5ef432f5cfb1e18851381329d94665a4c22470 (diff)
downloadydb-1aeb9a455974457866f78722ad98114bafc84e8a.tar.gz
Restoring authorship annotation for Ivan Blinkov <ivan@blinkov.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/hyperscan/src/hwlm/hwlm.c')
-rw-r--r--contrib/libs/hyperscan/src/hwlm/hwlm.c80
1 files changed, 40 insertions, 40 deletions
diff --git a/contrib/libs/hyperscan/src/hwlm/hwlm.c b/contrib/libs/hyperscan/src/hwlm/hwlm.c
index 8cf585a98c..666bb80803 100644
--- a/contrib/libs/hyperscan/src/hwlm/hwlm.c
+++ b/contrib/libs/hyperscan/src/hwlm/hwlm.c
@@ -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:
@@ -37,7 +37,7 @@
#include "fdr/fdr.h"
#include "nfa/accel.h"
#include "nfa/shufti.h"
-#include "nfa/truffle.h"
+#include "nfa/truffle.h"
#include "nfa/vermicelli.h"
#include <string.h>
@@ -65,13 +65,13 @@ const u8 *run_hwlm_accel(const union AccelAux *aux, const u8 *ptr,
case ACCEL_SHUFTI:
DEBUG_PRINTF("single shufti\n");
return shuftiExec(aux->shufti.lo, aux->shufti.hi, ptr, end);
- case ACCEL_TRUFFLE:
- DEBUG_PRINTF("truffle\n");
- return truffleExec(aux->truffle.mask1, aux->truffle.mask2, ptr, end);
+ case ACCEL_TRUFFLE:
+ DEBUG_PRINTF("truffle\n");
+ return truffleExec(aux->truffle.mask1, aux->truffle.mask2, ptr, end);
default:
/* no acceleration, fall through and return current ptr */
- DEBUG_PRINTF("no accel; %u\n", (int)aux->accel_type);
- assert(aux->accel_type == ACCEL_NONE);
+ DEBUG_PRINTF("no accel; %u\n", (int)aux->accel_type);
+ assert(aux->accel_type == ACCEL_NONE);
return ptr;
}
}
@@ -170,10 +170,10 @@ void do_accel_streaming(const union AccelAux *aux, const u8 *hbuf, size_t hlen,
}
hwlm_error_t hwlmExec(const struct HWLM *t, const u8 *buf, size_t len,
- size_t start, HWLMCallback cb, struct hs_scratch *scratch,
+ size_t start, HWLMCallback cb, struct hs_scratch *scratch,
hwlm_group_t groups) {
- assert(t);
-
+ assert(t);
+
DEBUG_PRINTF("buf len=%zu, start=%zu, groups=%llx\n", len, start, groups);
if (!groups) {
DEBUG_PRINTF("groups all off\n");
@@ -184,26 +184,26 @@ hwlm_error_t hwlmExec(const struct HWLM *t, const u8 *buf, size_t len,
if (t->type == HWLM_ENGINE_NOOD) {
DEBUG_PRINTF("calling noodExec\n");
- return noodExec(HWLM_C_DATA(t), buf, len, start, cb, scratch);
- }
-
- assert(t->type == HWLM_ENGINE_FDR);
- const union AccelAux *aa = &t->accel0;
- if ((groups & ~t->accel1_groups) == 0) {
- DEBUG_PRINTF("using hq accel %hhu\n", t->accel1.accel_type);
- aa = &t->accel1;
+ return noodExec(HWLM_C_DATA(t), buf, len, start, cb, scratch);
}
- do_accel_block(aa, buf, len, &start);
- DEBUG_PRINTF("calling frankie (groups=%08llx, start=%zu)\n", groups, start);
- return fdrExec(HWLM_C_DATA(t), buf, len, start, cb, scratch, groups);
+
+ assert(t->type == HWLM_ENGINE_FDR);
+ const union AccelAux *aa = &t->accel0;
+ if ((groups & ~t->accel1_groups) == 0) {
+ DEBUG_PRINTF("using hq accel %hhu\n", t->accel1.accel_type);
+ aa = &t->accel1;
+ }
+ do_accel_block(aa, buf, len, &start);
+ DEBUG_PRINTF("calling frankie (groups=%08llx, start=%zu)\n", groups, start);
+ return fdrExec(HWLM_C_DATA(t), buf, len, start, cb, scratch, groups);
}
-hwlm_error_t hwlmExecStreaming(const struct HWLM *t, size_t len, size_t start,
- HWLMCallback cb, struct hs_scratch *scratch,
- hwlm_group_t groups) {
- assert(t);
- assert(scratch);
-
+hwlm_error_t hwlmExecStreaming(const struct HWLM *t, size_t len, size_t start,
+ HWLMCallback cb, struct hs_scratch *scratch,
+ hwlm_group_t groups) {
+ assert(t);
+ assert(scratch);
+
const u8 *hbuf = scratch->core_info.hbuf;
const size_t hlen = scratch->core_info.hlen;
const u8 *buf = scratch->core_info.buf;
@@ -222,21 +222,21 @@ hwlm_error_t hwlmExecStreaming(const struct HWLM *t, size_t len, size_t start,
// If we've been handed a start offset, we can use a block mode scan at
// that offset.
if (start) {
- return noodExec(HWLM_C_DATA(t), buf, len, start, cb, scratch);
+ return noodExec(HWLM_C_DATA(t), buf, len, start, cb, scratch);
} else {
return noodExecStreaming(HWLM_C_DATA(t), hbuf, hlen, buf, len, cb,
- scratch);
+ scratch);
}
}
-
- assert(t->type == HWLM_ENGINE_FDR);
- const union AccelAux *aa = &t->accel0;
- if ((groups & ~t->accel1_groups) == 0) {
- DEBUG_PRINTF("using hq accel %hhu\n", t->accel1.accel_type);
- aa = &t->accel1;
- }
- do_accel_streaming(aa, hbuf, hlen, buf, len, &start);
- DEBUG_PRINTF("calling frankie (groups=%08llx, start=%zu)\n", groups, start);
- return fdrExecStreaming(HWLM_C_DATA(t), hbuf, hlen, buf, len, start, cb,
- scratch, groups);
+
+ assert(t->type == HWLM_ENGINE_FDR);
+ const union AccelAux *aa = &t->accel0;
+ if ((groups & ~t->accel1_groups) == 0) {
+ DEBUG_PRINTF("using hq accel %hhu\n", t->accel1.accel_type);
+ aa = &t->accel1;
+ }
+ do_accel_streaming(aa, hbuf, hlen, buf, len, &start);
+ DEBUG_PRINTF("calling frankie (groups=%08llx, start=%zu)\n", groups, start);
+ return fdrExecStreaming(HWLM_C_DATA(t), hbuf, hlen, buf, len, start, cb,
+ scratch, groups);
}