1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-23 00:28:11 +00:00

Use packv() and unpackv() for slow hash SIMD handling in kernels

This commit is contained in:
Jens Steube 2016-05-15 00:37:46 +02:00
parent 9d74f2958d
commit 0ddb264a5a
3 changed files with 70 additions and 740 deletions

View File

@ -121,7 +121,7 @@ void md5_transform_S (const u32 w0[4], const u32 w1[4], const u32 w2[4], const u
digest[3] += d;
}
void md5_transform (const u32x w0[4], const u32x w1[4], const u32x w2[4], const u32x w3[4], u32x digest[4])
void md5_transform_V (const u32x w0[4], const u32x w1[4], const u32x w2[4], const u32x w3[4], u32x digest[4])
{
u32x a = digest[0];
u32x b = digest[1];
@ -326,217 +326,31 @@ __kernel void m00400_loop (__global pw_t *pws, __global kernel_rule_t *rules_buf
if (gid >= gid_max) return;
u32x w0[4] = { 0 };
u32x w1[4] = { 0 };
u32x w2[4] = { 0 };
u32x w0[4];
u32x w1[4];
u32x w2[4];
u32x pw_len = 0;
w0[0] = packv (pws, i, gid, 0);
w0[1] = packv (pws, i, gid, 1);
w0[2] = packv (pws, i, gid, 2);
w0[3] = packv (pws, i, gid, 3);
w1[0] = packv (pws, i, gid, 4);
w1[1] = packv (pws, i, gid, 5);
w1[2] = packv (pws, i, gid, 6);
w1[3] = packv (pws, i, gid, 7);
w2[0] = packv (pws, i, gid, 8);
w2[1] = packv (pws, i, gid, 9);
w2[2] = 0;
w2[3] = 0;
u32x digest[4] = { 0 };
u32x pw_len = packvf (pws, pw_len, gid);
#if VECT_SIZE == 1
u32x digest[4];
w0[0] = pws[gid].i[0];
w0[1] = pws[gid].i[1];
w0[2] = pws[gid].i[2];
w0[3] = pws[gid].i[3];
w1[0] = pws[gid].i[4];
w1[1] = pws[gid].i[5];
w1[2] = pws[gid].i[6];
w1[3] = pws[gid].i[7];
w2[0] = pws[gid].i[8];
w2[1] = pws[gid].i[9];
pw_len = pws[gid].pw_len;
digest[0] = tmps[gid].digest_buf[0];
digest[1] = tmps[gid].digest_buf[1];
digest[2] = tmps[gid].digest_buf[2];
digest[3] = tmps[gid].digest_buf[3];
#else
const u32 gidx = gid * VECT_SIZE;
#if VECT_SIZE >= 2
if ((gidx + 0) < gid_max)
{
w0[0].s0 = pws[gidx + 0].i[0];
w0[1].s0 = pws[gidx + 0].i[1];
w0[2].s0 = pws[gidx + 0].i[2];
w0[3].s0 = pws[gidx + 0].i[3];
w1[0].s0 = pws[gidx + 0].i[4];
w1[1].s0 = pws[gidx + 0].i[5];
w1[2].s0 = pws[gidx + 0].i[6];
w1[3].s0 = pws[gidx + 0].i[7];
w2[0].s0 = pws[gidx + 0].i[8];
w2[1].s0 = pws[gidx + 0].i[9];
pw_len.s0 = pws[gidx + 0].pw_len;
digest[0].s0 = tmps[gidx + 0].digest_buf[0];
digest[1].s0 = tmps[gidx + 0].digest_buf[1];
digest[2].s0 = tmps[gidx + 0].digest_buf[2];
digest[3].s0 = tmps[gidx + 0].digest_buf[3];
}
if ((gidx + 1) < gid_max)
{
w0[0].s1 = pws[gidx + 1].i[0];
w0[1].s1 = pws[gidx + 1].i[1];
w0[2].s1 = pws[gidx + 1].i[2];
w0[3].s1 = pws[gidx + 1].i[3];
w1[0].s1 = pws[gidx + 1].i[4];
w1[1].s1 = pws[gidx + 1].i[5];
w1[2].s1 = pws[gidx + 1].i[6];
w1[3].s1 = pws[gidx + 1].i[7];
w2[0].s1 = pws[gidx + 1].i[8];
w2[1].s1 = pws[gidx + 1].i[9];
pw_len.s1 = pws[gidx + 1].pw_len;
digest[0].s1 = tmps[gidx + 1].digest_buf[0];
digest[1].s1 = tmps[gidx + 1].digest_buf[1];
digest[2].s1 = tmps[gidx + 1].digest_buf[2];
digest[3].s1 = tmps[gidx + 1].digest_buf[3];
}
#endif
#if VECT_SIZE >= 4
if ((gidx + 2) < gid_max)
{
w0[0].s2 = pws[gidx + 2].i[0];
w0[1].s2 = pws[gidx + 2].i[1];
w0[2].s2 = pws[gidx + 2].i[2];
w0[3].s2 = pws[gidx + 2].i[3];
w1[0].s2 = pws[gidx + 2].i[4];
w1[1].s2 = pws[gidx + 2].i[5];
w1[2].s2 = pws[gidx + 2].i[6];
w1[3].s2 = pws[gidx + 2].i[7];
w2[0].s2 = pws[gidx + 2].i[8];
w2[1].s2 = pws[gidx + 2].i[9];
pw_len.s2 = pws[gidx + 2].pw_len;
digest[0].s2 = tmps[gidx + 2].digest_buf[0];
digest[1].s2 = tmps[gidx + 2].digest_buf[1];
digest[2].s2 = tmps[gidx + 2].digest_buf[2];
digest[3].s2 = tmps[gidx + 2].digest_buf[3];
}
if ((gidx + 3) < gid_max)
{
w0[0].s3 = pws[gidx + 3].i[0];
w0[1].s3 = pws[gidx + 3].i[1];
w0[2].s3 = pws[gidx + 3].i[2];
w0[3].s3 = pws[gidx + 3].i[3];
w1[0].s3 = pws[gidx + 3].i[4];
w1[1].s3 = pws[gidx + 3].i[5];
w1[2].s3 = pws[gidx + 3].i[6];
w1[3].s3 = pws[gidx + 3].i[7];
w2[0].s3 = pws[gidx + 3].i[8];
w2[1].s3 = pws[gidx + 3].i[9];
pw_len.s3 = pws[gidx + 3].pw_len;
digest[0].s3 = tmps[gidx + 3].digest_buf[0];
digest[1].s3 = tmps[gidx + 3].digest_buf[1];
digest[2].s3 = tmps[gidx + 3].digest_buf[2];
digest[3].s3 = tmps[gidx + 3].digest_buf[3];
}
#endif
#if VECT_SIZE >= 8
if ((gidx + 4) < gid_max)
{
w0[0].s4 = pws[gidx + 4].i[0];
w0[1].s4 = pws[gidx + 4].i[1];
w0[2].s4 = pws[gidx + 4].i[2];
w0[3].s4 = pws[gidx + 4].i[3];
w1[0].s4 = pws[gidx + 4].i[4];
w1[1].s4 = pws[gidx + 4].i[5];
w1[2].s4 = pws[gidx + 4].i[6];
w1[3].s4 = pws[gidx + 4].i[7];
w2[0].s4 = pws[gidx + 4].i[8];
w2[1].s4 = pws[gidx + 4].i[9];
pw_len.s4 = pws[gidx + 4].pw_len;
digest[0].s4 = tmps[gidx + 4].digest_buf[0];
digest[1].s4 = tmps[gidx + 4].digest_buf[1];
digest[2].s4 = tmps[gidx + 4].digest_buf[2];
digest[3].s4 = tmps[gidx + 4].digest_buf[3];
}
if ((gidx + 5) < gid_max)
{
w0[0].s5 = pws[gidx + 5].i[0];
w0[1].s5 = pws[gidx + 5].i[1];
w0[2].s5 = pws[gidx + 5].i[2];
w0[3].s5 = pws[gidx + 5].i[3];
w1[0].s5 = pws[gidx + 5].i[4];
w1[1].s5 = pws[gidx + 5].i[5];
w1[2].s5 = pws[gidx + 5].i[6];
w1[3].s5 = pws[gidx + 5].i[7];
w2[0].s5 = pws[gidx + 5].i[8];
w2[1].s5 = pws[gidx + 5].i[9];
pw_len.s5 = pws[gidx + 5].pw_len;
digest[0].s5 = tmps[gidx + 5].digest_buf[0];
digest[1].s5 = tmps[gidx + 5].digest_buf[1];
digest[2].s5 = tmps[gidx + 5].digest_buf[2];
digest[3].s5 = tmps[gidx + 5].digest_buf[3];
}
if ((gidx + 6) < gid_max)
{
w0[0].s6 = pws[gidx + 6].i[0];
w0[1].s6 = pws[gidx + 6].i[1];
w0[2].s6 = pws[gidx + 6].i[2];
w0[3].s6 = pws[gidx + 6].i[3];
w1[0].s6 = pws[gidx + 6].i[4];
w1[1].s6 = pws[gidx + 6].i[5];
w1[2].s6 = pws[gidx + 6].i[6];
w1[3].s6 = pws[gidx + 6].i[7];
w2[0].s6 = pws[gidx + 6].i[8];
w2[1].s6 = pws[gidx + 6].i[9];
pw_len.s6 = pws[gidx + 6].pw_len;
digest[0].s6 = tmps[gidx + 6].digest_buf[0];
digest[1].s6 = tmps[gidx + 6].digest_buf[1];
digest[2].s6 = tmps[gidx + 6].digest_buf[2];
digest[3].s6 = tmps[gidx + 6].digest_buf[3];
}
if ((gidx + 7) < gid_max)
{
w0[0].s7 = pws[gidx + 7].i[0];
w0[1].s7 = pws[gidx + 7].i[1];
w0[2].s7 = pws[gidx + 7].i[2];
w0[3].s7 = pws[gidx + 7].i[3];
w1[0].s7 = pws[gidx + 7].i[4];
w1[1].s7 = pws[gidx + 7].i[5];
w1[2].s7 = pws[gidx + 7].i[6];
w1[3].s7 = pws[gidx + 7].i[7];
w2[0].s7 = pws[gidx + 7].i[8];
w2[1].s7 = pws[gidx + 7].i[9];
pw_len.s7 = pws[gidx + 7].pw_len;
digest[0].s7 = tmps[gidx + 7].digest_buf[0];
digest[1].s7 = tmps[gidx + 7].digest_buf[1];
digest[2].s7 = tmps[gidx + 7].digest_buf[2];
digest[3].s7 = tmps[gidx + 7].digest_buf[3];
}
#endif
#endif
digest[0] = packv (tmps, digest_buf, gid, 0);
digest[1] = packv (tmps, digest_buf, gid, 1);
digest[2] = packv (tmps, digest_buf, gid, 2);
digest[3] = packv (tmps, digest_buf, gid, 3);
/**
* loop
@ -584,94 +398,13 @@ __kernel void m00400_loop (__global pw_t *pws, __global kernel_rule_t *rules_buf
digest[2] = MD5M_C;
digest[3] = MD5M_D;
md5_transform (block0, block1, block2, block3, digest);
md5_transform_V (block0, block1, block2, block3, digest);
}
#if VECT_SIZE == 1
tmps[gid].digest_buf[0] = digest[0];
tmps[gid].digest_buf[1] = digest[1];
tmps[gid].digest_buf[2] = digest[2];
tmps[gid].digest_buf[3] = digest[3];
#else
#if VECT_SIZE >= 2
if ((gidx + 0) < gid_max)
{
tmps[gidx + 0].digest_buf[0] = digest[0].s0;
tmps[gidx + 0].digest_buf[1] = digest[1].s0;
tmps[gidx + 0].digest_buf[2] = digest[2].s0;
tmps[gidx + 0].digest_buf[3] = digest[3].s0;
}
if ((gidx + 1) < gid_max)
{
tmps[gidx + 1].digest_buf[0] = digest[0].s1;
tmps[gidx + 1].digest_buf[1] = digest[1].s1;
tmps[gidx + 1].digest_buf[2] = digest[2].s1;
tmps[gidx + 1].digest_buf[3] = digest[3].s1;
}
#endif
#if VECT_SIZE >= 4
if ((gidx + 2) < gid_max)
{
tmps[gidx + 2].digest_buf[0] = digest[0].s2;
tmps[gidx + 2].digest_buf[1] = digest[1].s2;
tmps[gidx + 2].digest_buf[2] = digest[2].s2;
tmps[gidx + 2].digest_buf[3] = digest[3].s2;
}
if ((gidx + 3) < gid_max)
{
tmps[gidx + 3].digest_buf[0] = digest[0].s3;
tmps[gidx + 3].digest_buf[1] = digest[1].s3;
tmps[gidx + 3].digest_buf[2] = digest[2].s3;
tmps[gidx + 3].digest_buf[3] = digest[3].s3;
}
#endif
#if VECT_SIZE >= 8
if ((gidx + 4) < gid_max)
{
tmps[gidx + 4].digest_buf[0] = digest[0].s4;
tmps[gidx + 4].digest_buf[1] = digest[1].s4;
tmps[gidx + 4].digest_buf[2] = digest[2].s4;
tmps[gidx + 4].digest_buf[3] = digest[3].s4;
}
if ((gidx + 5) < gid_max)
{
tmps[gidx + 5].digest_buf[0] = digest[0].s5;
tmps[gidx + 5].digest_buf[1] = digest[1].s5;
tmps[gidx + 5].digest_buf[2] = digest[2].s5;
tmps[gidx + 5].digest_buf[3] = digest[3].s5;
}
if ((gidx + 6) < gid_max)
{
tmps[gidx + 6].digest_buf[0] = digest[0].s6;
tmps[gidx + 6].digest_buf[1] = digest[1].s6;
tmps[gidx + 6].digest_buf[2] = digest[2].s6;
tmps[gidx + 6].digest_buf[3] = digest[3].s6;
}
if ((gidx + 7) < gid_max)
{
tmps[gidx + 7].digest_buf[0] = digest[0].s7;
tmps[gidx + 7].digest_buf[1] = digest[1].s7;
tmps[gidx + 7].digest_buf[2] = digest[2].s7;
tmps[gidx + 7].digest_buf[3] = digest[3].s7;
}
#endif
#endif
unpackv (tmps, digest_buf, gid, 0, digest[0]);
unpackv (tmps, digest_buf, gid, 1, digest[1]);
unpackv (tmps, digest_buf, gid, 2, digest[2]);
unpackv (tmps, digest_buf, gid, 3, digest[3]);
}
__kernel void m00400_comp (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global phpass_tmp_t *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)

View File

@ -18,6 +18,7 @@
#include "include/kernel_functions.c"
#include "OpenCL/types_ocl.c"
#include "OpenCL/common.c"
#include "OpenCL/simd.c"
#define COMPARE_S "OpenCL/check_single_comp4.c"
#define COMPARE_M "OpenCL/check_multi_comp4.c"
@ -750,312 +751,34 @@ __kernel void m02500_loop (__global pw_t *pws, __global kernel_rule_t *rules_buf
u32x ipad[5];
u32x opad[5];
#if VECT_SIZE == 1
ipad[0] = packv (tmps, ipad, gid, 0);
ipad[1] = packv (tmps, ipad, gid, 1);
ipad[2] = packv (tmps, ipad, gid, 2);
ipad[3] = packv (tmps, ipad, gid, 3);
ipad[4] = packv (tmps, ipad, gid, 4);
ipad[0] = tmps[gid].ipad[0];
ipad[1] = tmps[gid].ipad[1];
ipad[2] = tmps[gid].ipad[2];
ipad[3] = tmps[gid].ipad[3];
ipad[4] = tmps[gid].ipad[4];
opad[0] = tmps[gid].opad[0];
opad[1] = tmps[gid].opad[1];
opad[2] = tmps[gid].opad[2];
opad[3] = tmps[gid].opad[3];
opad[4] = tmps[gid].opad[4];
#else
const u32 gidx = gid * VECT_SIZE;
#if VECT_SIZE >= 2
if ((gidx + 0) < gid_max)
{
ipad[0].s0 = tmps[gidx + 0].ipad[0];
ipad[1].s0 = tmps[gidx + 0].ipad[1];
ipad[2].s0 = tmps[gidx + 0].ipad[2];
ipad[3].s0 = tmps[gidx + 0].ipad[3];
ipad[4].s0 = tmps[gidx + 0].ipad[4];
opad[0].s0 = tmps[gidx + 0].opad[0];
opad[1].s0 = tmps[gidx + 0].opad[1];
opad[2].s0 = tmps[gidx + 0].opad[2];
opad[3].s0 = tmps[gidx + 0].opad[3];
opad[4].s0 = tmps[gidx + 0].opad[4];
}
if ((gidx + 1) < gid_max)
{
ipad[0].s1 = tmps[gidx + 1].ipad[0];
ipad[1].s1 = tmps[gidx + 1].ipad[1];
ipad[2].s1 = tmps[gidx + 1].ipad[2];
ipad[3].s1 = tmps[gidx + 1].ipad[3];
ipad[4].s1 = tmps[gidx + 1].ipad[4];
opad[0].s1 = tmps[gidx + 1].opad[0];
opad[1].s1 = tmps[gidx + 1].opad[1];
opad[2].s1 = tmps[gidx + 1].opad[2];
opad[3].s1 = tmps[gidx + 1].opad[3];
opad[4].s1 = tmps[gidx + 1].opad[4];
}
#endif
#if VECT_SIZE >= 4
if ((gidx + 2) < gid_max)
{
ipad[0].s2 = tmps[gidx + 2].ipad[0];
ipad[1].s2 = tmps[gidx + 2].ipad[1];
ipad[2].s2 = tmps[gidx + 2].ipad[2];
ipad[3].s2 = tmps[gidx + 2].ipad[3];
ipad[4].s2 = tmps[gidx + 2].ipad[4];
opad[0].s2 = tmps[gidx + 2].opad[0];
opad[1].s2 = tmps[gidx + 2].opad[1];
opad[2].s2 = tmps[gidx + 2].opad[2];
opad[3].s2 = tmps[gidx + 2].opad[3];
opad[4].s2 = tmps[gidx + 2].opad[4];
}
if ((gidx + 3) < gid_max)
{
ipad[0].s3 = tmps[gidx + 3].ipad[0];
ipad[1].s3 = tmps[gidx + 3].ipad[1];
ipad[2].s3 = tmps[gidx + 3].ipad[2];
ipad[3].s3 = tmps[gidx + 3].ipad[3];
ipad[4].s3 = tmps[gidx + 3].ipad[4];
opad[0].s3 = tmps[gidx + 3].opad[0];
opad[1].s3 = tmps[gidx + 3].opad[1];
opad[2].s3 = tmps[gidx + 3].opad[2];
opad[3].s3 = tmps[gidx + 3].opad[3];
opad[4].s3 = tmps[gidx + 3].opad[4];
}
#endif
#if VECT_SIZE >= 8
if ((gidx + 4) < gid_max)
{
ipad[0].s4 = tmps[gidx + 4].ipad[0];
ipad[1].s4 = tmps[gidx + 4].ipad[1];
ipad[2].s4 = tmps[gidx + 4].ipad[2];
ipad[3].s4 = tmps[gidx + 4].ipad[3];
ipad[4].s4 = tmps[gidx + 4].ipad[4];
opad[0].s4 = tmps[gidx + 4].opad[0];
opad[1].s4 = tmps[gidx + 4].opad[1];
opad[2].s4 = tmps[gidx + 4].opad[2];
opad[3].s4 = tmps[gidx + 4].opad[3];
opad[4].s4 = tmps[gidx + 4].opad[4];
}
if ((gidx + 5) < gid_max)
{
ipad[0].s5 = tmps[gidx + 5].ipad[0];
ipad[1].s5 = tmps[gidx + 5].ipad[1];
ipad[2].s5 = tmps[gidx + 5].ipad[2];
ipad[3].s5 = tmps[gidx + 5].ipad[3];
ipad[4].s5 = tmps[gidx + 5].ipad[4];
opad[0].s5 = tmps[gidx + 5].opad[0];
opad[1].s5 = tmps[gidx + 5].opad[1];
opad[2].s5 = tmps[gidx + 5].opad[2];
opad[3].s5 = tmps[gidx + 5].opad[3];
opad[4].s5 = tmps[gidx + 5].opad[4];
}
if ((gidx + 6) < gid_max)
{
ipad[0].s6 = tmps[gidx + 6].ipad[0];
ipad[1].s6 = tmps[gidx + 6].ipad[1];
ipad[2].s6 = tmps[gidx + 6].ipad[2];
ipad[3].s6 = tmps[gidx + 6].ipad[3];
ipad[4].s6 = tmps[gidx + 6].ipad[4];
opad[0].s6 = tmps[gidx + 6].opad[0];
opad[1].s6 = tmps[gidx + 6].opad[1];
opad[2].s6 = tmps[gidx + 6].opad[2];
opad[3].s6 = tmps[gidx + 6].opad[3];
opad[4].s6 = tmps[gidx + 6].opad[4];
}
if ((gidx + 7) < gid_max)
{
ipad[0].s7 = tmps[gidx + 7].ipad[0];
ipad[1].s7 = tmps[gidx + 7].ipad[1];
ipad[2].s7 = tmps[gidx + 7].ipad[2];
ipad[3].s7 = tmps[gidx + 7].ipad[3];
ipad[4].s7 = tmps[gidx + 7].ipad[4];
opad[0].s7 = tmps[gidx + 7].opad[0];
opad[1].s7 = tmps[gidx + 7].opad[1];
opad[2].s7 = tmps[gidx + 7].opad[2];
opad[3].s7 = tmps[gidx + 7].opad[3];
opad[4].s7 = tmps[gidx + 7].opad[4];
}
#endif
#endif
opad[0] = packv (tmps, opad, gid, 0);
opad[1] = packv (tmps, opad, gid, 1);
opad[2] = packv (tmps, opad, gid, 2);
opad[3] = packv (tmps, opad, gid, 3);
opad[4] = packv (tmps, opad, gid, 4);
for (u32 i = 0; i < 8; i += 5)
{
u32x dgst[5];
u32x out[5];
#if VECT_SIZE == 1
dgst[0] = packv (tmps, dgst, gid, 0);
dgst[1] = packv (tmps, dgst, gid, 1);
dgst[2] = packv (tmps, dgst, gid, 2);
dgst[3] = packv (tmps, dgst, gid, 3);
dgst[4] = packv (tmps, dgst, gid, 4);
dgst[0] = tmps[gid].dgst[i + 0];
dgst[1] = tmps[gid].dgst[i + 1];
dgst[2] = tmps[gid].dgst[i + 2];
dgst[3] = tmps[gid].dgst[i + 3];
dgst[4] = tmps[gid].dgst[i + 4];
out[0] = tmps[gid].out[i + 0];
out[1] = tmps[gid].out[i + 1];
out[2] = tmps[gid].out[i + 2];
out[3] = tmps[gid].out[i + 3];
out[4] = tmps[gid].out[i + 4];
#else
#if VECT_SIZE >= 2
if ((gidx + 0) < gid_max)
{
dgst[0].s0 = tmps[gidx + 0].dgst[i + 0];
dgst[1].s0 = tmps[gidx + 0].dgst[i + 1];
dgst[2].s0 = tmps[gidx + 0].dgst[i + 2];
dgst[3].s0 = tmps[gidx + 0].dgst[i + 3];
dgst[4].s0 = tmps[gidx + 0].dgst[i + 4];
out[0].s0 = tmps[gidx + 0].out[i + 0];
out[1].s0 = tmps[gidx + 0].out[i + 1];
out[2].s0 = tmps[gidx + 0].out[i + 2];
out[3].s0 = tmps[gidx + 0].out[i + 3];
out[4].s0 = tmps[gidx + 0].out[i + 4];
}
if ((gidx + 1) < gid_max)
{
dgst[0].s1 = tmps[gidx + 1].dgst[i + 0];
dgst[1].s1 = tmps[gidx + 1].dgst[i + 1];
dgst[2].s1 = tmps[gidx + 1].dgst[i + 2];
dgst[3].s1 = tmps[gidx + 1].dgst[i + 3];
dgst[4].s1 = tmps[gidx + 1].dgst[i + 4];
out[0].s1 = tmps[gidx + 1].out[i + 0];
out[1].s1 = tmps[gidx + 1].out[i + 1];
out[2].s1 = tmps[gidx + 1].out[i + 2];
out[3].s1 = tmps[gidx + 1].out[i + 3];
out[4].s1 = tmps[gidx + 1].out[i + 4];
}
#endif
#if VECT_SIZE >= 4
if ((gidx + 2) < gid_max)
{
dgst[0].s2 = tmps[gidx + 2].dgst[i + 0];
dgst[1].s2 = tmps[gidx + 2].dgst[i + 1];
dgst[2].s2 = tmps[gidx + 2].dgst[i + 2];
dgst[3].s2 = tmps[gidx + 2].dgst[i + 3];
dgst[4].s2 = tmps[gidx + 2].dgst[i + 4];
out[0].s2 = tmps[gidx + 2].out[i + 0];
out[1].s2 = tmps[gidx + 2].out[i + 1];
out[2].s2 = tmps[gidx + 2].out[i + 2];
out[3].s2 = tmps[gidx + 2].out[i + 3];
out[4].s2 = tmps[gidx + 2].out[i + 4];
}
if ((gidx + 3) < gid_max)
{
dgst[0].s3 = tmps[gidx + 3].dgst[i + 0];
dgst[1].s3 = tmps[gidx + 3].dgst[i + 1];
dgst[2].s3 = tmps[gidx + 3].dgst[i + 2];
dgst[3].s3 = tmps[gidx + 3].dgst[i + 3];
dgst[4].s3 = tmps[gidx + 3].dgst[i + 4];
out[0].s3 = tmps[gidx + 3].out[i + 0];
out[1].s3 = tmps[gidx + 3].out[i + 1];
out[2].s3 = tmps[gidx + 3].out[i + 2];
out[3].s3 = tmps[gidx + 3].out[i + 3];
out[4].s3 = tmps[gidx + 3].out[i + 4];
}
#endif
#if VECT_SIZE >= 8
if ((gidx + 4) < gid_max)
{
dgst[0].s4 = tmps[gidx + 4].dgst[i + 0];
dgst[1].s4 = tmps[gidx + 4].dgst[i + 1];
dgst[2].s4 = tmps[gidx + 4].dgst[i + 2];
dgst[3].s4 = tmps[gidx + 4].dgst[i + 3];
dgst[4].s4 = tmps[gidx + 4].dgst[i + 4];
out[0].s4 = tmps[gidx + 4].out[i + 0];
out[1].s4 = tmps[gidx + 4].out[i + 1];
out[2].s4 = tmps[gidx + 4].out[i + 2];
out[3].s4 = tmps[gidx + 4].out[i + 3];
out[4].s4 = tmps[gidx + 4].out[i + 4];
}
if ((gidx + 5) < gid_max)
{
dgst[0].s5 = tmps[gidx + 5].dgst[i + 0];
dgst[1].s5 = tmps[gidx + 5].dgst[i + 1];
dgst[2].s5 = tmps[gidx + 5].dgst[i + 2];
dgst[3].s5 = tmps[gidx + 5].dgst[i + 3];
dgst[4].s5 = tmps[gidx + 5].dgst[i + 4];
out[0].s5 = tmps[gidx + 5].out[i + 0];
out[1].s5 = tmps[gidx + 5].out[i + 1];
out[2].s5 = tmps[gidx + 5].out[i + 2];
out[3].s5 = tmps[gidx + 5].out[i + 3];
out[4].s5 = tmps[gidx + 5].out[i + 4];
}
if ((gidx + 6) < gid_max)
{
dgst[0].s6 = tmps[gidx + 6].dgst[i + 0];
dgst[1].s6 = tmps[gidx + 6].dgst[i + 1];
dgst[2].s6 = tmps[gidx + 6].dgst[i + 2];
dgst[3].s6 = tmps[gidx + 6].dgst[i + 3];
dgst[4].s6 = tmps[gidx + 6].dgst[i + 4];
out[0].s6 = tmps[gidx + 6].out[i + 0];
out[1].s6 = tmps[gidx + 6].out[i + 1];
out[2].s6 = tmps[gidx + 6].out[i + 2];
out[3].s6 = tmps[gidx + 6].out[i + 3];
out[4].s6 = tmps[gidx + 6].out[i + 4];
}
if ((gidx + 7) < gid_max)
{
dgst[0].s7 = tmps[gidx + 7].dgst[i + 0];
dgst[1].s7 = tmps[gidx + 7].dgst[i + 1];
dgst[2].s7 = tmps[gidx + 7].dgst[i + 2];
dgst[3].s7 = tmps[gidx + 7].dgst[i + 3];
dgst[4].s7 = tmps[gidx + 7].dgst[i + 4];
out[0].s7 = tmps[gidx + 7].out[i + 0];
out[1].s7 = tmps[gidx + 7].out[i + 1];
out[2].s7 = tmps[gidx + 7].out[i + 2];
out[3].s7 = tmps[gidx + 7].out[i + 3];
out[4].s7 = tmps[gidx + 7].out[i + 4];
}
#endif
#endif
out[0] = packv (tmps, out, gid, 0);
out[1] = packv (tmps, out, gid, 1);
out[2] = packv (tmps, out, gid, 2);
out[3] = packv (tmps, out, gid, 3);
out[4] = packv (tmps, out, gid, 4);
for (u32 j = 0; j < loop_cnt; j++)
{
@ -1090,155 +813,17 @@ __kernel void m02500_loop (__global pw_t *pws, __global kernel_rule_t *rules_buf
out[4] ^= dgst[4];
}
#if VECT_SIZE == 1
unpackv (tmps, dgst, gid, 0, dgst[0]);
unpackv (tmps, dgst, gid, 1, dgst[1]);
unpackv (tmps, dgst, gid, 2, dgst[2]);
unpackv (tmps, dgst, gid, 3, dgst[3]);
unpackv (tmps, dgst, gid, 4, dgst[4]);
tmps[gid].dgst[i + 0] = dgst[0];
tmps[gid].dgst[i + 1] = dgst[1];
tmps[gid].dgst[i + 2] = dgst[2];
tmps[gid].dgst[i + 3] = dgst[3];
tmps[gid].dgst[i + 4] = dgst[4];
tmps[gid].out[i + 0] = out[0];
tmps[gid].out[i + 1] = out[1];
tmps[gid].out[i + 2] = out[2];
tmps[gid].out[i + 3] = out[3];
tmps[gid].out[i + 4] = out[4];
#else
#if VECT_SIZE >= 2
if ((gidx + 0) < gid_max)
{
tmps[gidx + 0].dgst[i + 0] = dgst[0].s0;
tmps[gidx + 0].dgst[i + 1] = dgst[1].s0;
tmps[gidx + 0].dgst[i + 2] = dgst[2].s0;
tmps[gidx + 0].dgst[i + 3] = dgst[3].s0;
tmps[gidx + 0].dgst[i + 4] = dgst[4].s0;
tmps[gidx + 0].out[i + 0] = out[0].s0;
tmps[gidx + 0].out[i + 1] = out[1].s0;
tmps[gidx + 0].out[i + 2] = out[2].s0;
tmps[gidx + 0].out[i + 3] = out[3].s0;
tmps[gidx + 0].out[i + 4] = out[4].s0;
}
if ((gidx + 1) < gid_max)
{
tmps[gidx + 1].dgst[i + 0] = dgst[0].s1;
tmps[gidx + 1].dgst[i + 1] = dgst[1].s1;
tmps[gidx + 1].dgst[i + 2] = dgst[2].s1;
tmps[gidx + 1].dgst[i + 3] = dgst[3].s1;
tmps[gidx + 1].dgst[i + 4] = dgst[4].s1;
tmps[gidx + 1].out[i + 0] = out[0].s1;
tmps[gidx + 1].out[i + 1] = out[1].s1;
tmps[gidx + 1].out[i + 2] = out[2].s1;
tmps[gidx + 1].out[i + 3] = out[3].s1;
tmps[gidx + 1].out[i + 4] = out[4].s1;
}
#endif
#if VECT_SIZE >= 4
if ((gidx + 2) < gid_max)
{
tmps[gidx + 2].dgst[i + 0] = dgst[0].s2;
tmps[gidx + 2].dgst[i + 1] = dgst[1].s2;
tmps[gidx + 2].dgst[i + 2] = dgst[2].s2;
tmps[gidx + 2].dgst[i + 3] = dgst[3].s2;
tmps[gidx + 2].dgst[i + 4] = dgst[4].s2;
tmps[gidx + 2].out[i + 0] = out[0].s2;
tmps[gidx + 2].out[i + 1] = out[1].s2;
tmps[gidx + 2].out[i + 2] = out[2].s2;
tmps[gidx + 2].out[i + 3] = out[3].s2;
tmps[gidx + 2].out[i + 4] = out[4].s2;
}
if ((gidx + 3) < gid_max)
{
tmps[gidx + 3].dgst[i + 0] = dgst[0].s3;
tmps[gidx + 3].dgst[i + 1] = dgst[1].s3;
tmps[gidx + 3].dgst[i + 2] = dgst[2].s3;
tmps[gidx + 3].dgst[i + 3] = dgst[3].s3;
tmps[gidx + 3].dgst[i + 4] = dgst[4].s3;
tmps[gidx + 3].out[i + 0] = out[0].s3;
tmps[gidx + 3].out[i + 1] = out[1].s3;
tmps[gidx + 3].out[i + 2] = out[2].s3;
tmps[gidx + 3].out[i + 3] = out[3].s3;
tmps[gidx + 3].out[i + 4] = out[4].s3;
}
#endif
#if VECT_SIZE >= 8
if ((gidx + 4) < gid_max)
{
tmps[gidx + 4].dgst[i + 0] = dgst[0].s4;
tmps[gidx + 4].dgst[i + 1] = dgst[1].s4;
tmps[gidx + 4].dgst[i + 2] = dgst[2].s4;
tmps[gidx + 4].dgst[i + 3] = dgst[3].s4;
tmps[gidx + 4].dgst[i + 4] = dgst[4].s4;
tmps[gidx + 4].out[i + 0] = out[0].s4;
tmps[gidx + 4].out[i + 1] = out[1].s4;
tmps[gidx + 4].out[i + 2] = out[2].s4;
tmps[gidx + 4].out[i + 3] = out[3].s4;
tmps[gidx + 4].out[i + 4] = out[4].s4;
}
if ((gidx + 5) < gid_max)
{
tmps[gidx + 5].dgst[i + 0] = dgst[0].s5;
tmps[gidx + 5].dgst[i + 1] = dgst[1].s5;
tmps[gidx + 5].dgst[i + 2] = dgst[2].s5;
tmps[gidx + 5].dgst[i + 3] = dgst[3].s5;
tmps[gidx + 5].dgst[i + 4] = dgst[4].s5;
tmps[gidx + 5].out[i + 0] = out[0].s5;
tmps[gidx + 5].out[i + 1] = out[1].s5;
tmps[gidx + 5].out[i + 2] = out[2].s5;
tmps[gidx + 5].out[i + 3] = out[3].s5;
tmps[gidx + 5].out[i + 4] = out[4].s5;
}
if ((gidx + 6) < gid_max)
{
tmps[gidx + 6].dgst[i + 0] = dgst[0].s6;
tmps[gidx + 6].dgst[i + 1] = dgst[1].s6;
tmps[gidx + 6].dgst[i + 2] = dgst[2].s6;
tmps[gidx + 6].dgst[i + 3] = dgst[3].s6;
tmps[gidx + 6].dgst[i + 4] = dgst[4].s6;
tmps[gidx + 6].out[i + 0] = out[0].s6;
tmps[gidx + 6].out[i + 1] = out[1].s6;
tmps[gidx + 6].out[i + 2] = out[2].s6;
tmps[gidx + 6].out[i + 3] = out[3].s6;
tmps[gidx + 6].out[i + 4] = out[4].s6;
}
if ((gidx + 7) < gid_max)
{
tmps[gidx + 7].dgst[i + 0] = dgst[0].s7;
tmps[gidx + 7].dgst[i + 1] = dgst[1].s7;
tmps[gidx + 7].dgst[i + 2] = dgst[2].s7;
tmps[gidx + 7].dgst[i + 3] = dgst[3].s7;
tmps[gidx + 7].dgst[i + 4] = dgst[4].s7;
tmps[gidx + 7].out[i + 0] = out[0].s7;
tmps[gidx + 7].out[i + 1] = out[1].s7;
tmps[gidx + 7].out[i + 2] = out[2].s7;
tmps[gidx + 7].out[i + 3] = out[3].s7;
tmps[gidx + 7].out[i + 4] = out[4].s7;
}
#endif
#endif
unpackv (tmps, out, gid, 0, out[0]);
unpackv (tmps, out, gid, 1, out[1]);
unpackv (tmps, out, gid, 2, out[2]);
unpackv (tmps, out, gid, 3, out[3]);
unpackv (tmps, out, gid, 4, out[4]);
}
}

View File

@ -1239,6 +1239,18 @@ inline u32x ix_create_combt (__global comb_t *combs_buf, const u32 il_pos, const
#define packv(arr,var,gid,idx) (u32x) ((arr)[((gid) * 16) + 0].var[(idx)], (arr)[((gid) * 16) + 1].var[(idx)], (arr)[((gid) * 16) + 2].var[(idx)], (arr)[((gid) * 16) + 3].var[(idx)], (arr)[((gid) * 16) + 4].var[(idx)], (arr)[((gid) * 16) + 5].var[(idx)], (arr)[((gid) * 16) + 6].var[(idx)], (arr)[((gid) * 16) + 7].var[(idx)], (arr)[((gid) * 16) + 8].var[(idx)], (arr)[((gid) * 16) + 9].var[(idx)], (arr)[((gid) * 16) + 10].var[(idx)], (arr)[((gid) * 16) + 11].var[(idx)], (arr)[((gid) * 16) + 12].var[(idx)], (arr)[((gid) * 16) + 13].var[(idx)], (arr)[((gid) * 16) + 14].var[(idx)], (arr)[((gid) * 16) + 15].var[(idx)])
#endif
#if VECT_SIZE == 1
#define packvf(arr,var,gid) (u32x) ((arr)[((gid) * 1) + 0].var)
#elif VECT_SIZE == 2
#define packvf(arr,var,gid) (u32x) ((arr)[((gid) * 2) + 0].var, (arr)[((gid) * 2) + 1].var)
#elif VECT_SIZE == 4
#define packvf(arr,var,gid) (u32x) ((arr)[((gid) * 4) + 0].var, (arr)[((gid) * 4) + 1].var, (arr)[((gid) * 4) + 2].var, (arr)[((gid) * 4) + 3].var)
#elif VECT_SIZE == 8
#define packvf(arr,var,gid) (u32x) ((arr)[((gid) * 8) + 0].var, (arr)[((gid) * 8) + 1].var, (arr)[((gid) * 8) + 2].var, (arr)[((gid) * 8) + 3].var, (arr)[((gid) * 8) + 4].var, (arr)[((gid) * 8) + 5].var, (arr)[((gid) * 8) + 6].var, (arr)[((gid) * 8) + 7].var)
#elif VECT_SIZE == 16
#define packvf(arr,var,gid) (u32x) ((arr)[((gid) * 16) + 0].var, (arr)[((gid) * 16) + 1].var, (arr)[((gid) * 16) + 2].var, (arr)[((gid) * 16) + 3].var, (arr)[((gid) * 16) + 4].var, (arr)[((gid) * 16) + 5].var, (arr)[((gid) * 16) + 6].var, (arr)[((gid) * 16) + 7].var, (arr)[((gid) * 16) + 8].var, (arr)[((gid) * 16) + 9].var, (arr)[((gid) * 16) + 10].var, (arr)[((gid) * 16) + 11].var, (arr)[((gid) * 16) + 12].var, (arr)[((gid) * 16) + 13].var, (arr)[((gid) * 16) + 14].var, (arr)[((gid) * 16) + 15].var)
#endif
#if VECT_SIZE == 1
#define unpackv(arr,var,gid,idx,val) (arr)[((gid) * 1) + 0].var[(idx)] = val;
#elif VECT_SIZE == 2