From 938c281ee0794245a1be2ad62830b0ff5247b0c5 Mon Sep 17 00:00:00 2001 From: jsteube Date: Fri, 25 Aug 2017 17:06:07 +0200 Subject: [PATCH] Resurrect some volatile variables in order to correctly compile pure kernels on AMD drivers --- OpenCL/inc_hash_md4.cl | 4 ++-- OpenCL/inc_hash_md5.cl | 4 ++-- OpenCL/inc_hash_ripemd160.cl | 4 ++-- OpenCL/inc_hash_sha1.cl | 4 ++-- OpenCL/inc_hash_sha224.cl | 4 ++-- OpenCL/inc_hash_sha256.cl | 4 ++-- OpenCL/inc_hash_sha384.cl | 4 ++-- OpenCL/inc_hash_sha512.cl | 4 ++-- OpenCL/inc_hash_whirlpool.cl | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/OpenCL/inc_hash_md4.cl b/OpenCL/inc_hash_md4.cl index 9176a1d4e..53358a438 100644 --- a/OpenCL/inc_hash_md4.cl +++ b/OpenCL/inc_hash_md4.cl @@ -111,7 +111,7 @@ 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 - const int pos = ctx->len & 63; + volatile const int pos = ctx->len & 63; #else const int pos = ctx->len & 63; #endif @@ -1235,7 +1235,7 @@ 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 - const int pos = ctx->len & 63; + volatile const int pos = ctx->len & 63; #else const int pos = ctx->len & 63; #endif diff --git a/OpenCL/inc_hash_md5.cl b/OpenCL/inc_hash_md5.cl index 99bb61793..687990280 100644 --- a/OpenCL/inc_hash_md5.cl +++ b/OpenCL/inc_hash_md5.cl @@ -145,7 +145,7 @@ 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 - const int pos = ctx->len & 63; + volatile const int pos = ctx->len & 63; #else const int pos = ctx->len & 63; #endif @@ -1303,7 +1303,7 @@ 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 - const int pos = ctx->len & 63; + volatile const int pos = ctx->len & 63; #else const int pos = ctx->len & 63; #endif diff --git a/OpenCL/inc_hash_ripemd160.cl b/OpenCL/inc_hash_ripemd160.cl index 2b2c07ab0..70abae4c7 100644 --- a/OpenCL/inc_hash_ripemd160.cl +++ b/OpenCL/inc_hash_ripemd160.cl @@ -245,7 +245,7 @@ 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 - const int pos = ctx->len & 63; + volatile const int pos = ctx->len & 63; #else const int pos = ctx->len & 63; #endif @@ -1504,7 +1504,7 @@ 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 - const int pos = ctx->len & 63; + volatile const int pos = ctx->len & 63; #else const int pos = ctx->len & 63; #endif diff --git a/OpenCL/inc_hash_sha1.cl b/OpenCL/inc_hash_sha1.cl index ca83180d0..6daf8d404 100644 --- a/OpenCL/inc_hash_sha1.cl +++ b/OpenCL/inc_hash_sha1.cl @@ -177,7 +177,7 @@ 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 - const int pos = ctx->len & 63; + volatile const int pos = ctx->len & 63; #else const int pos = ctx->len & 63; #endif @@ -1604,7 +1604,7 @@ 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 - const int pos = ctx->len & 63; + volatile const int pos = ctx->len & 63; #else const int pos = ctx->len & 63; #endif diff --git a/OpenCL/inc_hash_sha224.cl b/OpenCL/inc_hash_sha224.cl index 40451d804..c29e8016d 100644 --- a/OpenCL/inc_hash_sha224.cl +++ b/OpenCL/inc_hash_sha224.cl @@ -162,7 +162,7 @@ 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 - const int pos = ctx->len & 63; + volatile const int pos = ctx->len & 63; #else const int pos = ctx->len & 63; #endif @@ -1321,7 +1321,7 @@ 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 - const int pos = ctx->len & 63; + volatile const int pos = ctx->len & 63; #else const int pos = ctx->len & 63; #endif diff --git a/OpenCL/inc_hash_sha256.cl b/OpenCL/inc_hash_sha256.cl index 24b452a0f..1607e1ae4 100644 --- a/OpenCL/inc_hash_sha256.cl +++ b/OpenCL/inc_hash_sha256.cl @@ -162,7 +162,7 @@ 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 - const int pos = ctx->len & 63; + volatile const int pos = ctx->len & 63; #else const int pos = ctx->len & 63; #endif @@ -1321,7 +1321,7 @@ 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 - const int pos = ctx->len & 63; + volatile const int pos = ctx->len & 63; #else const int pos = ctx->len & 63; #endif diff --git a/OpenCL/inc_hash_sha384.cl b/OpenCL/inc_hash_sha384.cl index 0d4d5ede6..8dfddad3a 100644 --- a/OpenCL/inc_hash_sha384.cl +++ b/OpenCL/inc_hash_sha384.cl @@ -186,7 +186,7 @@ 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 - const int pos = ctx->len & 127; + volatile const int pos = ctx->len & 127; #else const int pos = ctx->len & 127; #endif @@ -2017,7 +2017,7 @@ 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 - const int pos = ctx->len & 127; + volatile const int pos = ctx->len & 127; #else const int pos = ctx->len & 127; #endif diff --git a/OpenCL/inc_hash_sha512.cl b/OpenCL/inc_hash_sha512.cl index 1a3338f8d..392f23f65 100644 --- a/OpenCL/inc_hash_sha512.cl +++ b/OpenCL/inc_hash_sha512.cl @@ -186,7 +186,7 @@ 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 - const int pos = ctx->len & 127; + volatile const int pos = ctx->len & 127; #else const int pos = ctx->len & 127; #endif @@ -2017,7 +2017,7 @@ 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 - const int pos = ctx->len & 127; + volatile const int pos = ctx->len & 127; #else const int pos = ctx->len & 127; #endif diff --git a/OpenCL/inc_hash_whirlpool.cl b/OpenCL/inc_hash_whirlpool.cl index 8afa1adbf..371d98a4d 100644 --- a/OpenCL/inc_hash_whirlpool.cl +++ b/OpenCL/inc_hash_whirlpool.cl @@ -2608,7 +2608,7 @@ 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 - const int pos = ctx->len & 63; + volatile const int pos = ctx->len & 63; #else const int pos = ctx->len & 63; #endif