1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-01-22 21:51:07 +00:00

Fall back to old rotr64 optimization for AMD

This commit is contained in:
jsteube 2017-08-16 16:14:46 +02:00
parent 0dcec01623
commit 58012ada0c

View File

@ -198,9 +198,17 @@ u32 rotl32_S (const u32 a, const u32 n)
return rotate (a, n);
}
u64 rotr64_S (const u64 a, const u32 n)
inline u64 rotr64_S (const u64 a, const u32 n)
{
return rotate (a, (u64) (64 - n));
const u32 a0 = h32_from_64_S (a);
const u32 a1 = l32_from_64_S (a);
const u32 t0 = (n >= 32) ? amd_bitalign (a0, a1, n - 32) : amd_bitalign (a1, a0, n);
const u32 t1 = (n >= 32) ? amd_bitalign (a1, a0, n - 32) : amd_bitalign (a0, a1, n);
const u64 r = hl32_to_64_S (t0, t1);
return r;
}
u64 rotl64_S (const u64 a, const u32 n)
@ -232,9 +240,17 @@ u32x rotl32 (const u32x a, const u32 n)
return rotate (a, n);
}
u64x rotr64 (const u64x a, const u32 n)
inline u64x rotr64 (const u64x a, const u32 n)
{
return rotate (a, (u64x) (64 - n));
const u32x a0 = h32_from_64 (a);
const u32x a1 = l32_from_64 (a);
const u32x t0 = (n >= 32) ? amd_bitalign (a0, a1, n - 32) : amd_bitalign (a1, a0, n);
const u32x t1 = (n >= 32) ? amd_bitalign (a1, a0, n - 32) : amd_bitalign (a0, a1, n);
const u64x r = hl32_to_64 (t0, t1);
return r;
}
u64x rotl64 (const u64x a, const u32 n)