diff --git a/OpenCL/inc_hash_md4.cl b/OpenCL/inc_hash_md4.cl index 4a72ce8a7..53358a438 100644 --- a/OpenCL/inc_hash_md4.cl +++ b/OpenCL/inc_hash_md4.cl @@ -110,7 +110,11 @@ static void md4_init (md4_ctx_t *ctx) static void md4_update_64 (md4_ctx_t *ctx, u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const int len) { + #ifdef IS_AMD + volatile const int pos = ctx->len & 63; + #else const int pos = ctx->len & 63; + #endif ctx->len += len; @@ -1230,7 +1234,11 @@ static void md4_init_vector_from_scalar (md4_ctx_vector_t *ctx, md4_ctx_t *ctx0) static void md4_update_vector_64 (md4_ctx_vector_t *ctx, u32x w0[4], u32x w1[4], u32x w2[4], u32x w3[4], const int len) { + #ifdef IS_AMD + volatile const int pos = ctx->len & 63; + #else const int pos = ctx->len & 63; + #endif ctx->len += len; diff --git a/OpenCL/inc_hash_md5.cl b/OpenCL/inc_hash_md5.cl index 0318db7c8..0e2346a9e 100644 --- a/OpenCL/inc_hash_md5.cl +++ b/OpenCL/inc_hash_md5.cl @@ -146,7 +146,11 @@ static void md5_init (md5_ctx_t *ctx) static void md5_update_64 (md5_ctx_t *ctx, u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const int len) { + #ifdef IS_AMD + volatile const int pos = ctx->len & 63; + #else const int pos = ctx->len & 63; + #endif ctx->len += len; @@ -1302,7 +1306,11 @@ static void md5_init_vector_from_scalar (md5_ctx_vector_t *ctx, md5_ctx_t *ctx0) static void md5_update_vector_64 (md5_ctx_vector_t *ctx, u32x w0[4], u32x w1[4], u32x w2[4], u32x w3[4], const int len) { + #ifdef IS_AMD + volatile const int pos = ctx->len & 63; + #else const int pos = ctx->len & 63; + #endif ctx->len += len; diff --git a/OpenCL/inc_hash_ripemd160.cl b/OpenCL/inc_hash_ripemd160.cl index e46b490f9..70abae4c7 100644 --- a/OpenCL/inc_hash_ripemd160.cl +++ b/OpenCL/inc_hash_ripemd160.cl @@ -244,7 +244,11 @@ static void ripemd160_init (ripemd160_ctx_t *ctx) static void ripemd160_update_64 (ripemd160_ctx_t *ctx, u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const int len) { + #ifdef IS_AMD + volatile const int pos = ctx->len & 63; + #else const int pos = ctx->len & 63; + #endif ctx->len += len; @@ -1499,7 +1503,11 @@ static void ripemd160_init_vector_from_scalar (ripemd160_ctx_vector_t *ctx, ripe static void ripemd160_update_vector_64 (ripemd160_ctx_vector_t *ctx, u32x w0[4], u32x w1[4], u32x w2[4], u32x w3[4], const int len) { + #ifdef IS_AMD + volatile const int pos = ctx->len & 63; + #else const int pos = ctx->len & 63; + #endif ctx->len += len; diff --git a/OpenCL/inc_hash_sha1.cl b/OpenCL/inc_hash_sha1.cl index 38d988469..6daf8d404 100644 --- a/OpenCL/inc_hash_sha1.cl +++ b/OpenCL/inc_hash_sha1.cl @@ -176,7 +176,11 @@ static void sha1_init (sha1_ctx_t *ctx) static void sha1_update_64 (sha1_ctx_t *ctx, u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const int len) { + #ifdef IS_AMD + volatile const int pos = ctx->len & 63; + #else const int pos = ctx->len & 63; + #endif ctx->len += len; @@ -1599,7 +1603,11 @@ static void sha1_init_vector_from_scalar (sha1_ctx_vector_t *ctx, sha1_ctx_t *ct static void sha1_update_vector_64 (sha1_ctx_vector_t *ctx, u32x w0[4], u32x w1[4], u32x w2[4], u32x w3[4], const int len) { + #ifdef IS_AMD + volatile const int pos = ctx->len & 63; + #else const int pos = ctx->len & 63; + #endif ctx->len += len; diff --git a/OpenCL/inc_hash_sha224.cl b/OpenCL/inc_hash_sha224.cl index a18620d4d..c29e8016d 100644 --- a/OpenCL/inc_hash_sha224.cl +++ b/OpenCL/inc_hash_sha224.cl @@ -161,7 +161,11 @@ static void sha224_init (sha224_ctx_t *ctx) static void sha224_update_64 (sha224_ctx_t *ctx, u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const int len) { + #ifdef IS_AMD + volatile const int pos = ctx->len & 63; + #else const int pos = ctx->len & 63; + #endif ctx->len += len; @@ -1316,7 +1320,11 @@ static void sha224_init_vector_from_scalar (sha224_ctx_vector_t *ctx, sha224_ctx static void sha224_update_vector_64 (sha224_ctx_vector_t *ctx, u32x w0[4], u32x w1[4], u32x w2[4], u32x w3[4], const int len) { + #ifdef IS_AMD + volatile const int pos = ctx->len & 63; + #else const int pos = ctx->len & 63; + #endif ctx->len += len; diff --git a/OpenCL/inc_hash_sha256.cl b/OpenCL/inc_hash_sha256.cl index 702635d2f..1607e1ae4 100644 --- a/OpenCL/inc_hash_sha256.cl +++ b/OpenCL/inc_hash_sha256.cl @@ -161,7 +161,11 @@ static void sha256_init (sha256_ctx_t *ctx) static void sha256_update_64 (sha256_ctx_t *ctx, u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const int len) { + #ifdef IS_AMD + volatile const int pos = ctx->len & 63; + #else const int pos = ctx->len & 63; + #endif ctx->len += len; @@ -1316,7 +1320,11 @@ static void sha256_init_vector_from_scalar (sha256_ctx_vector_t *ctx, sha256_ctx static void sha256_update_vector_64 (sha256_ctx_vector_t *ctx, u32x w0[4], u32x w1[4], u32x w2[4], u32x w3[4], const int len) { + #ifdef IS_AMD + volatile const int pos = ctx->len & 63; + #else const int pos = ctx->len & 63; + #endif ctx->len += len; diff --git a/OpenCL/inc_hash_sha384.cl b/OpenCL/inc_hash_sha384.cl index a10330d6b..8dfddad3a 100644 --- a/OpenCL/inc_hash_sha384.cl +++ b/OpenCL/inc_hash_sha384.cl @@ -185,7 +185,11 @@ static void sha384_init (sha384_ctx_t *ctx) static void sha384_update_128 (sha384_ctx_t *ctx, u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], u32 w4[4], u32 w5[4], u32 w6[4], u32 w7[4], const int len) { + #ifdef IS_AMD + volatile const int pos = ctx->len & 127; + #else const int pos = ctx->len & 127; + #endif ctx->len += len; @@ -2012,7 +2016,11 @@ static void sha384_init_vector_from_scalar (sha384_ctx_vector_t *ctx, sha384_ctx static void sha384_update_vector_128 (sha384_ctx_vector_t *ctx, u32x w0[4], u32x w1[4], u32x w2[4], u32x w3[4], u32x w4[4], u32x w5[4], u32x w6[4], u32x w7[4], const int len) { + #ifdef IS_AMD + volatile const int pos = ctx->len & 127; + #else const int pos = ctx->len & 127; + #endif ctx->len += len; diff --git a/OpenCL/inc_hash_sha512.cl b/OpenCL/inc_hash_sha512.cl index 1902d9dde..392f23f65 100644 --- a/OpenCL/inc_hash_sha512.cl +++ b/OpenCL/inc_hash_sha512.cl @@ -185,7 +185,11 @@ static void sha512_init (sha512_ctx_t *ctx) static void sha512_update_128 (sha512_ctx_t *ctx, u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], u32 w4[4], u32 w5[4], u32 w6[4], u32 w7[4], const int len) { + #ifdef IS_AMD + volatile const int pos = ctx->len & 127; + #else const int pos = ctx->len & 127; + #endif ctx->len += len; @@ -2012,7 +2016,11 @@ static void sha512_init_vector_from_scalar (sha512_ctx_vector_t *ctx, sha512_ctx static void sha512_update_vector_128 (sha512_ctx_vector_t *ctx, u32x w0[4], u32x w1[4], u32x w2[4], u32x w3[4], u32x w4[4], u32x w5[4], u32x w6[4], u32x w7[4], const int len) { + #ifdef IS_AMD + volatile const int pos = ctx->len & 127; + #else const int pos = ctx->len & 127; + #endif ctx->len += len; diff --git a/OpenCL/inc_hash_whirlpool.cl b/OpenCL/inc_hash_whirlpool.cl index a8ace7d8e..e514eb777 100644 --- a/OpenCL/inc_hash_whirlpool.cl +++ b/OpenCL/inc_hash_whirlpool.cl @@ -1345,7 +1345,7 @@ static void whirlpool_init (whirlpool_ctx_t *ctx, SHM_TYPE u32 (*s_Ch)[256], SHM static void whirlpool_update_64 (whirlpool_ctx_t *ctx, u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const int len) { #ifdef IS_AMD - const int pos = ctx->len & 63; + volatile const int pos = ctx->len & 63; #else const int pos = ctx->len & 63; #endif @@ -2607,7 +2607,11 @@ static void whirlpool_init_vector_from_scalar (whirlpool_ctx_vector_t *ctx, whir static void whirlpool_update_vector_64 (whirlpool_ctx_vector_t *ctx, u32x w0[4], u32x w1[4], u32x w2[4], u32x w3[4], const int len) { + #ifdef IS_AMD + volatile const int pos = ctx->len & 63; + #else const int pos = ctx->len & 63; + #endif ctx->len += len;