1
mirror of https://github.com/hashcat/hashcat synced 2024-12-30 20:16:22 +01:00

revert switch to rotate ()

This commit is contained in:
jsteube 2015-12-27 21:22:54 +01:00
parent 3942ae02a2
commit 94d6fd3693

View File

@ -159,6 +159,8 @@ static inline u64 hl32_to_64 (const u32 a, const u32 b)
return as_ulong ((uint2) (b, a));
}
#ifdef IS_AMD
static inline u32 rotr32 (const u32 a, const u32 n)
{
return rotate (a, 32 - n);
@ -169,8 +171,6 @@ static inline u32 rotl32 (const u32 a, const u32 n)
return rotate (a, n);
}
#ifdef IS_AMD
static inline u64 rotr64 (const u64 a, const u32 n)
{
uint2 a2 = as_uint2 (a);
@ -196,6 +196,20 @@ static inline u64 rotl64 (const u64 a, const u32 n)
#if CUDA_ARCH >= 350
static inline u32 rotr32 (const u32 a, const u32 n)
{
u32 r;
asm ("shf.r.wrap.b32 %0, %1, %2, %3;" : "=r"(r) : "r"(a), "r"(a), "r"(n));
return r;
}
static inline u32 rotl32 (const u32 a, const u32 n)
{
return rotr32 (a, 32 - n);
}
static inline u64 rotr64 (const u64 a, const u32 n)
{
u32 il;
@ -231,6 +245,16 @@ static inline u64 rotl64 (const u64 a, const u32 n)
#else
static inline u32 rotr32 (const u32 a, const u32 n)
{
return rotate (a, 32 - n);
}
static inline u32 rotl32 (const u32 a, const u32 n)
{
return rotate (a, n);
}
static inline u64 rotr64 (const u64 a, const u64 n)
{
return rotate (a, 64 - n);