1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-22 14:48:12 +00:00

Fix -m 7800 by adding amd_bytealign emulation

This commit is contained in:
jsteube 2015-12-16 16:15:21 +01:00
parent 67cff7b856
commit 9d9097a12c

View File

@ -31,6 +31,26 @@ static u32 __byte_perm (const u32 a, const u32 b, const u32 s)
return r;
}
#if CUDA_ARCH >= 350
static u32 amd_bytealign (const u32 a, const u32 b, const u32 c)
{
u32 r;
asm ("shf.r.wrap.b32 %0, %1, %2, %3;" : "=r"(r) : "r"(b), "r"(a), "r"((c & 3) * 8));
return r;
}
#else
static u32 amd_bytealign (const u32 a, const u32 b, const u32 c)
{
return __byte_perm (b, a, (0x76543210 >> ((c & 3) * 4)) & 0xffff);
}
#endif
static u32 lut3_2d (const u32 a, const u32 b, const u32 c)
{
u32 r;