2599b3fd24199a8a6b9180f04d5ccd0ff85e5bbd
6 #define MATCHES_ONE_VV(a,b) ((a) == (b))
7 #define MATCHES_ONE_VS(a,b) ((a) == (b))
9 #define COMPARE_S_SIMD(h0,h1,h2,h3) \
11 if (((h0) == search[0]) && ((h1) == search[1]) && ((h2) == search[2]) && ((h3) == search[3])) \
13 const u32 final_hash_pos = digests_offset + 0; \
15 if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0) \
17 mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos); \
19 d_return_buf[lid] = 1; \
24 #define COMPARE_M_SIMD(h0,h1,h2,h3) \
26 const u32 digest_tp0[4] = { h0, h1, h2, h3 }; \
28 if (check (digest_tp0, \
29 bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, \
30 bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, \
35 int hash_pos = find_hash (digest_tp0, digests_cnt, &digests_buf[digests_offset]); \
39 const u32 final_hash_pos = digests_offset + hash_pos; \
41 if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0) \
43 mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos); \
45 d_return_buf[lid] = 1; \
57 #define MATCHES_ONE_VV(a,b) (((a).s0 == (b).s0) || ((a).s1 == (b).s1))
58 #define MATCHES_ONE_VS(a,b) (((a).s0 == (b) ) || ((a).s1 == (b) ))
60 #define COMPARE_S_SIMD(h0,h1,h2,h3) \
62 if (((h0).s0 == search[0]) && ((h1).s0 == search[1]) && ((h2).s0 == search[2]) && ((h3).s0 == search[3])) \
64 const u32 final_hash_pos = digests_offset + 0; \
66 if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0) \
68 mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 0); \
70 d_return_buf[lid] = 1; \
74 if (((h0).s1 == search[0]) && ((h1).s1 == search[1]) && ((h2).s1 == search[2]) && ((h3).s1 == search[3])) \
76 const u32 final_hash_pos = digests_offset + 0; \
78 if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0) \
80 mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 1); \
82 d_return_buf[lid] = 1; \
87 #define COMPARE_M_SIMD(h0,h1,h2,h3) \
89 const u32 digest_tp0[4] = { h0.s0, h1.s0, h2.s0, h3.s0 }; \
90 const u32 digest_tp1[4] = { h0.s1, h1.s1, h2.s1, h3.s1 }; \
92 if (check (digest_tp0, \
93 bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, \
94 bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, \
99 int hash_pos = find_hash (digest_tp0, digests_cnt, &digests_buf[digests_offset]); \
101 if (hash_pos != -1) \
103 const u32 final_hash_pos = digests_offset + hash_pos; \
105 if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0) \
107 mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 0); \
109 d_return_buf[lid] = 1; \
114 if (check (digest_tp1, \
115 bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, \
116 bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, \
121 int hash_pos = find_hash (digest_tp1, digests_cnt, &digests_buf[digests_offset]); \
123 if (hash_pos != -1) \
125 const u32 final_hash_pos = digests_offset + hash_pos; \
127 if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0) \
129 mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 1); \
131 d_return_buf[lid] = 1; \
143 #define MATCHES_ONE_VV(a,b) (((a).s0 == (b).s0) || ((a).s1 == (b).s1) || ((a).s2 == (b).s2) || ((a).s3 == (b).s3))
144 #define MATCHES_ONE_VS(a,b) (((a).s0 == (b) ) || ((a).s1 == (b) ) || ((a).s2 == (b) ) || ((a).s3 == (b) ))
146 #define COMPARE_S_SIMD(h0,h1,h2,h3) \
148 if (((h0).s0 == search[0]) && ((h1).s0 == search[1]) && ((h2).s0 == search[2]) && ((h3).s0 == search[3])) \
150 const u32 final_hash_pos = digests_offset + 0; \
152 if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0) \
154 mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 0); \
156 d_return_buf[lid] = 1; \
160 if (((h0).s1 == search[0]) && ((h1).s1 == search[1]) && ((h2).s1 == search[2]) && ((h3).s1 == search[3])) \
162 const u32 final_hash_pos = digests_offset + 0; \
164 if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0) \
166 mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 1); \
168 d_return_buf[lid] = 1; \
172 if (((h0).s2 == search[0]) && ((h1).s2 == search[1]) && ((h2).s2 == search[2]) && ((h3).s2 == search[3])) \
174 const u32 final_hash_pos = digests_offset + 0; \
176 if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0) \
178 mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 2); \
180 d_return_buf[lid] = 1; \
184 if (((h0).s3 == search[0]) && ((h1).s3 == search[1]) && ((h2).s3 == search[2]) && ((h3).s3 == search[3])) \
186 const u32 final_hash_pos = digests_offset + 0; \
188 if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0) \
190 mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 3); \
192 d_return_buf[lid] = 1; \
197 #define COMPARE_M_SIMD(h0,h1,h2,h3) \
199 const u32 digest_tp0[4] = { h0.s0, h1.s0, h2.s0, h3.s0 }; \
200 const u32 digest_tp1[4] = { h0.s1, h1.s1, h2.s1, h3.s1 }; \
201 const u32 digest_tp2[4] = { h0.s2, h1.s2, h2.s2, h3.s2 }; \
202 const u32 digest_tp3[4] = { h0.s3, h1.s3, h2.s3, h3.s3 }; \
204 if (check (digest_tp0, \
205 bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, \
206 bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, \
211 int hash_pos = find_hash (digest_tp0, digests_cnt, &digests_buf[digests_offset]); \
213 if (hash_pos != -1) \
215 const u32 final_hash_pos = digests_offset + hash_pos; \
217 if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0) \
219 mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 0); \
221 d_return_buf[lid] = 1; \
226 if (check (digest_tp1, \
227 bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, \
228 bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, \
233 int hash_pos = find_hash (digest_tp1, digests_cnt, &digests_buf[digests_offset]); \
235 if (hash_pos != -1) \
237 const u32 final_hash_pos = digests_offset + hash_pos; \
239 if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0) \
241 mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 1); \
243 d_return_buf[lid] = 1; \
248 if (check (digest_tp2, \
249 bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, \
250 bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, \
255 int hash_pos = find_hash (digest_tp2, digests_cnt, &digests_buf[digests_offset]); \
257 if (hash_pos != -1) \
259 const u32 final_hash_pos = digests_offset + hash_pos; \
261 if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0) \
263 mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 2); \
265 d_return_buf[lid] = 1; \
270 if (check (digest_tp3, \
271 bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, \
272 bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, \
277 int hash_pos = find_hash (digest_tp3, digests_cnt, &digests_buf[digests_offset]); \
279 if (hash_pos != -1) \
281 const u32 final_hash_pos = digests_offset + hash_pos; \
283 if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0) \
285 mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 3); \
287 d_return_buf[lid] = 1; \
299 #define MATCHES_ONE_VV(a,b) (((a).s0 == (b).s0) || ((a).s1 == (b).s1) || ((a).s2 == (b).s2) || ((a).s3 == (b).s3) || ((a).s4 == (b).s4) || ((a).s5 == (b).s5) || ((a).s6 == (b).s6) || ((a).s7 == (b).s7))
300 #define MATCHES_ONE_VS(a,b) (((a).s0 == (b) ) || ((a).s1 == (b) ) || ((a).s2 == (b) ) || ((a).s3 == (b) ) || ((a).s4 == (b) ) || ((a).s5 == (b) ) || ((a).s6 == (b) ) || ((a).s7 == (b) ))
302 #define COMPARE_S_SIMD(h0,h1,h2,h3) \
304 if (((h0).s0 == search[0]) && ((h1).s0 == search[1]) && ((h2).s0 == search[2]) && ((h3).s0 == search[3])) \
306 const u32 final_hash_pos = digests_offset + 0; \
308 if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0) \
310 mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 0); \
312 d_return_buf[lid] = 1; \
316 if (((h0).s1 == search[0]) && ((h1).s1 == search[1]) && ((h2).s1 == search[2]) && ((h3).s1 == search[3])) \
318 const u32 final_hash_pos = digests_offset + 0; \
320 if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0) \
322 mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 1); \
324 d_return_buf[lid] = 1; \
328 if (((h0).s2 == search[0]) && ((h1).s2 == search[1]) && ((h2).s2 == search[2]) && ((h3).s2 == search[3])) \
330 const u32 final_hash_pos = digests_offset + 0; \
332 if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0) \
334 mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 2); \
336 d_return_buf[lid] = 1; \
340 if (((h0).s3 == search[0]) && ((h1).s3 == search[1]) && ((h2).s3 == search[2]) && ((h3).s3 == search[3])) \
342 const u32 final_hash_pos = digests_offset + 0; \
344 if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0) \
346 mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 3); \
348 d_return_buf[lid] = 1; \
351 if (((h0).s4 == search[0]) && ((h1).s4 == search[1]) && ((h2).s4 == search[2]) && ((h3).s4 == search[3])) \
353 const u32 final_hash_pos = digests_offset + 0; \
355 if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0) \
357 mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 4); \
359 d_return_buf[lid] = 1; \
363 if (((h0).s5 == search[0]) && ((h1).s5 == search[1]) && ((h2).s5 == search[2]) && ((h3).s5 == search[3])) \
365 const u32 final_hash_pos = digests_offset + 0; \
367 if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0) \
369 mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 5); \
371 d_return_buf[lid] = 1; \
375 if (((h0).s6 == search[0]) && ((h1).s6 == search[1]) && ((h2).s6 == search[2]) && ((h3).s6 == search[3])) \
377 const u32 final_hash_pos = digests_offset + 0; \
379 if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0) \
381 mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 6); \
383 d_return_buf[lid] = 1; \
387 if (((h0).s7 == search[0]) && ((h1).s7 == search[1]) && ((h2).s7 == search[2]) && ((h3).s7 == search[3])) \
389 const u32 final_hash_pos = digests_offset + 0; \
391 if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0) \
393 mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 7); \
395 d_return_buf[lid] = 1; \
400 #define COMPARE_M_SIMD(h0,h1,h2,h3) \
402 const u32 digest_tp0[4] = { h0.s0, h1.s0, h2.s0, h3.s0 }; \
403 const u32 digest_tp1[4] = { h0.s1, h1.s1, h2.s1, h3.s1 }; \
404 const u32 digest_tp2[4] = { h0.s2, h1.s2, h2.s2, h3.s2 }; \
405 const u32 digest_tp3[4] = { h0.s3, h1.s3, h2.s3, h3.s3 }; \
406 const u32 digest_tp4[4] = { h0.s4, h1.s4, h2.s4, h3.s4 }; \
407 const u32 digest_tp5[4] = { h0.s5, h1.s5, h2.s5, h3.s5 }; \
408 const u32 digest_tp6[4] = { h0.s6, h1.s6, h2.s6, h3.s6 }; \
409 const u32 digest_tp7[4] = { h0.s7, h1.s7, h2.s7, h3.s7 }; \
411 if (check (digest_tp0, \
412 bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, \
413 bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, \
418 int hash_pos = find_hash (digest_tp0, digests_cnt, &digests_buf[digests_offset]); \
420 if (hash_pos != -1) \
422 const u32 final_hash_pos = digests_offset + hash_pos; \
424 if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0) \
426 mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 0); \
428 d_return_buf[lid] = 1; \
433 if (check (digest_tp1, \
434 bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, \
435 bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, \
440 int hash_pos = find_hash (digest_tp1, digests_cnt, &digests_buf[digests_offset]); \
442 if (hash_pos != -1) \
444 const u32 final_hash_pos = digests_offset + hash_pos; \
446 if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0) \
448 mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 1); \
450 d_return_buf[lid] = 1; \
455 if (check (digest_tp2, \
456 bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, \
457 bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, \
462 int hash_pos = find_hash (digest_tp2, digests_cnt, &digests_buf[digests_offset]); \
464 if (hash_pos != -1) \
466 const u32 final_hash_pos = digests_offset + hash_pos; \
468 if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0) \
470 mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 2); \
472 d_return_buf[lid] = 1; \
477 if (check (digest_tp3, \
478 bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, \
479 bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, \
484 int hash_pos = find_hash (digest_tp3, digests_cnt, &digests_buf[digests_offset]); \
486 if (hash_pos != -1) \
488 const u32 final_hash_pos = digests_offset + hash_pos; \
490 if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0) \
492 mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 3); \
494 d_return_buf[lid] = 1; \
498 if (check (digest_tp4, \
499 bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, \
500 bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, \
505 int hash_pos = find_hash (digest_tp4, digests_cnt, &digests_buf[digests_offset]); \
507 if (hash_pos != -1) \
509 const u32 final_hash_pos = digests_offset + hash_pos; \
511 if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0) \
513 mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 4); \
515 d_return_buf[lid] = 1; \
520 if (check (digest_tp5, \
521 bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, \
522 bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, \
527 int hash_pos = find_hash (digest_tp5, digests_cnt, &digests_buf[digests_offset]); \
529 if (hash_pos != -1) \
531 const u32 final_hash_pos = digests_offset + hash_pos; \
533 if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0) \
535 mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 5); \
537 d_return_buf[lid] = 1; \
542 if (check (digest_tp6, \
543 bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, \
544 bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, \
549 int hash_pos = find_hash (digest_tp6, digests_cnt, &digests_buf[digests_offset]); \
551 if (hash_pos != -1) \
553 const u32 final_hash_pos = digests_offset + hash_pos; \
555 if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0) \
557 mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 6); \
559 d_return_buf[lid] = 1; \
564 if (check (digest_tp7, \
565 bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, \
566 bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, \
571 int hash_pos = find_hash (digest_tp7, digests_cnt, &digests_buf[digests_offset]); \
573 if (hash_pos != -1) \
575 const u32 final_hash_pos = digests_offset + hash_pos; \
577 if (atomic_add (&hashes_shown[final_hash_pos], 1) == 0) \
579 mark_hash (plains_buf, hashes_shown, final_hash_pos, gid, il_pos + 7); \
581 d_return_buf[lid] = 1; \
589 #define MATCHES_NONE_VV(a,b) !(MATCHES_ONE_VV ((a), (b)))
590 #define MATCHES_NONE_VS(a,b) !(MATCHES_ONE_VS ((a), (b)))