From 38c1029f2e67763bf26f2e227696ce1ff55e983e Mon Sep 17 00:00:00 2001 From: Jens Steube Date: Wed, 17 Apr 2019 13:21:35 +0200 Subject: [PATCH] Need volatile for IRIS GPU on Mac OSX for -m 2500 and -m 2501 --- OpenCL/inc_hash_md4.cl | 8 ++++---- OpenCL/inc_hash_md5.cl | 8 ++++---- OpenCL/inc_hash_ripemd160.cl | 8 ++++---- OpenCL/inc_hash_sha1.cl | 8 ++++---- OpenCL/inc_hash_sha224.cl | 8 ++++---- OpenCL/inc_hash_sha256.cl | 8 ++++---- OpenCL/inc_hash_sha384.cl | 8 ++++---- OpenCL/inc_hash_sha512.cl | 8 ++++---- OpenCL/inc_hash_streebog256.cl | 8 ++++---- OpenCL/inc_hash_streebog512.cl | 8 ++++---- OpenCL/inc_hash_whirlpool.cl | 8 ++++---- OpenCL/inc_vendor.h | 4 ++++ OpenCL/m10700-pure.cl | 6 +++--- OpenCL/m16400_a0-pure.cl | 4 ++-- OpenCL/m16400_a1-pure.cl | 4 ++-- OpenCL/m16400_a3-pure.cl | 4 ++-- OpenCL/m19200-pure.cl | 4 ++-- src/modules/module_02500.c | 20 +++++++++++++++++++- src/modules/module_02501.c | 20 +++++++++++++++++++- 19 files changed, 97 insertions(+), 57 deletions(-) diff --git a/OpenCL/inc_hash_md4.cl b/OpenCL/inc_hash_md4.cl index 07b267d24..3b9113907 100644 --- a/OpenCL/inc_hash_md4.cl +++ b/OpenCL/inc_hash_md4.cl @@ -106,7 +106,7 @@ DECLSPEC void md4_init (md4_ctx_t *ctx) DECLSPEC void md4_update_64 (md4_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; ctx->len += len; @@ -736,7 +736,7 @@ DECLSPEC void md4_update_global_utf16le_swap (md4_ctx_t *ctx, GLOBAL_AS const u3 DECLSPEC void md4_final (md4_ctx_t *ctx) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; append_0x80_4x4_S (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos); @@ -1249,7 +1249,7 @@ DECLSPEC void md4_init_vector_from_scalar (md4_ctx_vector_t *ctx, md4_ctx_t *ctx DECLSPEC void md4_update_vector_64 (md4_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; ctx->len += len; @@ -1623,7 +1623,7 @@ DECLSPEC void md4_update_vector_utf16le_swap (md4_ctx_vector_t *ctx, const u32x DECLSPEC void md4_final_vector (md4_ctx_vector_t *ctx) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; append_0x80_4x4 (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos); diff --git a/OpenCL/inc_hash_md5.cl b/OpenCL/inc_hash_md5.cl index e16646ec0..66c58d282 100644 --- a/OpenCL/inc_hash_md5.cl +++ b/OpenCL/inc_hash_md5.cl @@ -142,7 +142,7 @@ DECLSPEC void md5_init (md5_ctx_t *ctx) DECLSPEC void md5_update_64 (md5_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; ctx->len += len; @@ -772,7 +772,7 @@ DECLSPEC void md5_update_global_utf16le_swap (md5_ctx_t *ctx, GLOBAL_AS const u3 DECLSPEC void md5_final (md5_ctx_t *ctx) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; append_0x80_4x4_S (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos); @@ -1321,7 +1321,7 @@ DECLSPEC void md5_init_vector_from_scalar (md5_ctx_vector_t *ctx, md5_ctx_t *ctx DECLSPEC void md5_update_vector_64 (md5_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; ctx->len += len; @@ -1695,7 +1695,7 @@ DECLSPEC void md5_update_vector_utf16le_swap (md5_ctx_vector_t *ctx, const u32x DECLSPEC void md5_final_vector (md5_ctx_vector_t *ctx) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; append_0x80_4x4 (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos); diff --git a/OpenCL/inc_hash_ripemd160.cl b/OpenCL/inc_hash_ripemd160.cl index 13cbc7459..73715e9ea 100644 --- a/OpenCL/inc_hash_ripemd160.cl +++ b/OpenCL/inc_hash_ripemd160.cl @@ -240,7 +240,7 @@ DECLSPEC void ripemd160_init (ripemd160_ctx_t *ctx) DECLSPEC void ripemd160_update_64 (ripemd160_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; ctx->len += len; @@ -870,7 +870,7 @@ DECLSPEC void ripemd160_update_global_utf16le_swap (ripemd160_ctx_t *ctx, GLOBAL DECLSPEC void ripemd160_final (ripemd160_ctx_t *ctx) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; append_0x80_4x4_S (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos); @@ -1518,7 +1518,7 @@ DECLSPEC void ripemd160_init_vector_from_scalar (ripemd160_ctx_vector_t *ctx, ri DECLSPEC void ripemd160_update_vector_64 (ripemd160_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; ctx->len += len; @@ -1892,7 +1892,7 @@ DECLSPEC void ripemd160_update_vector_utf16le_swap (ripemd160_ctx_vector_t *ctx, DECLSPEC void ripemd160_final_vector (ripemd160_ctx_vector_t *ctx) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; append_0x80_4x4 (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos); diff --git a/OpenCL/inc_hash_sha1.cl b/OpenCL/inc_hash_sha1.cl index cb85ce56f..dcc6ceb04 100644 --- a/OpenCL/inc_hash_sha1.cl +++ b/OpenCL/inc_hash_sha1.cl @@ -172,7 +172,7 @@ DECLSPEC void sha1_init (sha1_ctx_t *ctx) DECLSPEC void sha1_update_64 (sha1_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; ctx->len += len; @@ -1038,7 +1038,7 @@ DECLSPEC void sha1_update_global_utf16be_swap (sha1_ctx_t *ctx, GLOBAL_AS const DECLSPEC void sha1_final (sha1_ctx_t *ctx) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; append_0x80_4x4_S (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos ^ 3); @@ -1618,7 +1618,7 @@ DECLSPEC void sha1_init_vector_from_scalar (sha1_ctx_vector_t *ctx, sha1_ctx_t * DECLSPEC void sha1_update_vector_64 (sha1_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; ctx->len += len; @@ -2076,7 +2076,7 @@ DECLSPEC void sha1_update_vector_utf16beN (sha1_ctx_vector_t *ctx, const u32x *w DECLSPEC void sha1_final_vector (sha1_ctx_vector_t *ctx) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; append_0x80_4x4 (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos ^ 3); diff --git a/OpenCL/inc_hash_sha224.cl b/OpenCL/inc_hash_sha224.cl index e20a5ecd8..ed4f81b0f 100644 --- a/OpenCL/inc_hash_sha224.cl +++ b/OpenCL/inc_hash_sha224.cl @@ -157,7 +157,7 @@ DECLSPEC void sha224_init (sha224_ctx_t *ctx) DECLSPEC void sha224_update_64 (sha224_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; ctx->len += len; @@ -787,7 +787,7 @@ DECLSPEC void sha224_update_global_utf16le_swap (sha224_ctx_t *ctx, GLOBAL_AS co DECLSPEC void sha224_final (sha224_ctx_t *ctx) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; append_0x80_4x4_S (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos ^ 3); @@ -1335,7 +1335,7 @@ DECLSPEC void sha224_init_vector_from_scalar (sha224_ctx_vector_t *ctx, sha224_c DECLSPEC void sha224_update_vector_64 (sha224_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; ctx->len += len; @@ -1751,7 +1751,7 @@ DECLSPEC void sha224_update_vector_utf16beN (sha224_ctx_vector_t *ctx, const u32 DECLSPEC void sha224_final_vector (sha224_ctx_vector_t *ctx) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; append_0x80_4x4 (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos ^ 3); diff --git a/OpenCL/inc_hash_sha256.cl b/OpenCL/inc_hash_sha256.cl index ca0525f07..464984b15 100644 --- a/OpenCL/inc_hash_sha256.cl +++ b/OpenCL/inc_hash_sha256.cl @@ -157,7 +157,7 @@ DECLSPEC void sha256_init (sha256_ctx_t *ctx) DECLSPEC void sha256_update_64 (sha256_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; ctx->len += len; @@ -787,7 +787,7 @@ DECLSPEC void sha256_update_global_utf16le_swap (sha256_ctx_t *ctx, GLOBAL_AS co DECLSPEC void sha256_final (sha256_ctx_t *ctx) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; append_0x80_4x4_S (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos ^ 3); @@ -1335,7 +1335,7 @@ DECLSPEC void sha256_init_vector_from_scalar (sha256_ctx_vector_t *ctx, sha256_c DECLSPEC void sha256_update_vector_64 (sha256_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; ctx->len += len; @@ -1751,7 +1751,7 @@ DECLSPEC void sha256_update_vector_utf16beN (sha256_ctx_vector_t *ctx, const u32 DECLSPEC void sha256_final_vector (sha256_ctx_vector_t *ctx) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; append_0x80_4x4 (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos ^ 3); diff --git a/OpenCL/inc_hash_sha384.cl b/OpenCL/inc_hash_sha384.cl index 0fa33469d..8817ab772 100644 --- a/OpenCL/inc_hash_sha384.cl +++ b/OpenCL/inc_hash_sha384.cl @@ -177,7 +177,7 @@ DECLSPEC void sha384_init (sha384_ctx_t *ctx) DECLSPEC void sha384_update_128 (sha384_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, u32 *w4, u32 *w5, u32 *w6, u32 *w7, const int len) { - const int pos = ctx->len & 127; + MAYBE_VOLATILE const int pos = ctx->len & 127; ctx->len += len; @@ -1259,7 +1259,7 @@ DECLSPEC void sha384_update_global_utf16le_swap (sha384_ctx_t *ctx, GLOBAL_AS co DECLSPEC void sha384_final (sha384_ctx_t *ctx) { - const int pos = ctx->len & 127; + MAYBE_VOLATILE const int pos = ctx->len & 127; append_0x80_8x4_S (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->w4, ctx->w5, ctx->w6, ctx->w7, pos ^ 3); @@ -2051,7 +2051,7 @@ DECLSPEC void sha384_init_vector_from_scalar (sha384_ctx_vector_t *ctx, sha384_c DECLSPEC void sha384_update_vector_128 (sha384_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, u32x *w4, u32x *w5, u32x *w6, u32x *w7, const int len) { - const int pos = ctx->len & 127; + MAYBE_VOLATILE const int pos = ctx->len & 127; ctx->len += len; @@ -2759,7 +2759,7 @@ DECLSPEC void sha384_update_vector_utf16beN (sha384_ctx_vector_t *ctx, const u32 DECLSPEC void sha384_final_vector (sha384_ctx_vector_t *ctx) { - const int pos = ctx->len & 127; + MAYBE_VOLATILE const int pos = ctx->len & 127; append_0x80_8x4 (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->w4, ctx->w5, ctx->w6, ctx->w7, pos ^ 3); diff --git a/OpenCL/inc_hash_sha512.cl b/OpenCL/inc_hash_sha512.cl index 513972c74..02e2a41df 100644 --- a/OpenCL/inc_hash_sha512.cl +++ b/OpenCL/inc_hash_sha512.cl @@ -177,7 +177,7 @@ DECLSPEC void sha512_init (sha512_ctx_t *ctx) DECLSPEC void sha512_update_128 (sha512_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, u32 *w4, u32 *w5, u32 *w6, u32 *w7, const int len) { - const int pos = ctx->len & 127; + MAYBE_VOLATILE const int pos = ctx->len & 127; ctx->len += len; @@ -1259,7 +1259,7 @@ DECLSPEC void sha512_update_global_utf16le_swap (sha512_ctx_t *ctx, GLOBAL_AS co DECLSPEC void sha512_final (sha512_ctx_t *ctx) { - const int pos = ctx->len & 127; + MAYBE_VOLATILE const int pos = ctx->len & 127; append_0x80_8x4_S (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->w4, ctx->w5, ctx->w6, ctx->w7, pos ^ 3); @@ -2168,7 +2168,7 @@ DECLSPEC void sha512_init_vector_from_scalar (sha512_ctx_vector_t *ctx, sha512_c DECLSPEC void sha512_update_vector_128 (sha512_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, u32x *w4, u32x *w5, u32x *w6, u32x *w7, const int len) { - const int pos = ctx->len & 127; + MAYBE_VOLATILE const int pos = ctx->len & 127; ctx->len += len; @@ -2876,7 +2876,7 @@ DECLSPEC void sha512_update_vector_utf16beN (sha512_ctx_vector_t *ctx, const u32 DECLSPEC void sha512_final_vector (sha512_ctx_vector_t *ctx) { - const int pos = ctx->len & 127; + MAYBE_VOLATILE const int pos = ctx->len & 127; append_0x80_8x4 (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->w4, ctx->w5, ctx->w6, ctx->w7, pos ^ 3); diff --git a/OpenCL/inc_hash_streebog256.cl b/OpenCL/inc_hash_streebog256.cl index 5056f6984..e14ad4007 100644 --- a/OpenCL/inc_hash_streebog256.cl +++ b/OpenCL/inc_hash_streebog256.cl @@ -757,7 +757,7 @@ DECLSPEC void streebog256_transform (streebog256_ctx_t *ctx, const u32 *w0, cons DECLSPEC void streebog256_update_64 (streebog256_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; ctx->len += len; @@ -1046,7 +1046,7 @@ DECLSPEC void streebog256_update_global_swap (streebog256_ctx_t *ctx, GLOBAL_AS DECLSPEC void streebog256_final (streebog256_ctx_t *ctx) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; append_0x01_4x4_S (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos ^ 3); @@ -1460,7 +1460,7 @@ DECLSPEC void streebog256_transform_vector (streebog256_ctx_vector_t *ctx, const DECLSPEC void streebog256_update_vector_64 (streebog256_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; ctx->len += len; @@ -1692,7 +1692,7 @@ DECLSPEC void streebog256_update_vector_swap (streebog256_ctx_vector_t *ctx, con DECLSPEC void streebog256_final_vector (streebog256_ctx_vector_t *ctx) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; append_0x01_4x4_VV (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos ^ 3); diff --git a/OpenCL/inc_hash_streebog512.cl b/OpenCL/inc_hash_streebog512.cl index 51b5c0a29..e32c4169d 100644 --- a/OpenCL/inc_hash_streebog512.cl +++ b/OpenCL/inc_hash_streebog512.cl @@ -757,7 +757,7 @@ DECLSPEC void streebog512_transform (streebog512_ctx_t *ctx, const u32 *w0, cons DECLSPEC void streebog512_update_64 (streebog512_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; ctx->len += len; @@ -1046,7 +1046,7 @@ DECLSPEC void streebog512_update_global_swap (streebog512_ctx_t *ctx, GLOBAL_AS DECLSPEC void streebog512_final (streebog512_ctx_t *ctx) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; append_0x01_4x4_S (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos ^ 3); @@ -1479,7 +1479,7 @@ DECLSPEC void streebog512_transform_vector (streebog512_ctx_vector_t *ctx, const DECLSPEC void streebog512_update_vector_64 (streebog512_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; ctx->len += len; @@ -1711,7 +1711,7 @@ DECLSPEC void streebog512_update_vector_swap (streebog512_ctx_vector_t *ctx, con DECLSPEC void streebog512_final_vector (streebog512_ctx_vector_t *ctx) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; append_0x01_4x4_VV (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos ^ 3); diff --git a/OpenCL/inc_hash_whirlpool.cl b/OpenCL/inc_hash_whirlpool.cl index 37d073cba..0b61a7b9d 100644 --- a/OpenCL/inc_hash_whirlpool.cl +++ b/OpenCL/inc_hash_whirlpool.cl @@ -1321,7 +1321,7 @@ DECLSPEC void whirlpool_init (whirlpool_ctx_t *ctx, SHM_TYPE u32 (*s_Ch)[256], S DECLSPEC void whirlpool_update_64 (whirlpool_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; ctx->len += len; @@ -1951,7 +1951,7 @@ DECLSPEC void whirlpool_update_global_utf16le_swap (whirlpool_ctx_t *ctx, GLOBAL DECLSPEC void whirlpool_final (whirlpool_ctx_t *ctx) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; append_0x80_4x4_S (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos ^ 3); @@ -2619,7 +2619,7 @@ DECLSPEC void whirlpool_init_vector_from_scalar (whirlpool_ctx_vector_t *ctx, wh DECLSPEC void whirlpool_update_vector_64 (whirlpool_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; ctx->len += len; @@ -2993,7 +2993,7 @@ DECLSPEC void whirlpool_update_vector_utf16le_swap (whirlpool_ctx_vector_t *ctx, DECLSPEC void whirlpool_final_vector (whirlpool_ctx_vector_t *ctx) { - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; append_0x80_4x4 (ctx->w0, ctx->w1, ctx->w2, ctx->w3, pos ^ 3); diff --git a/OpenCL/inc_vendor.h b/OpenCL/inc_vendor.h index 64205edb6..ba85cbc74 100644 --- a/OpenCL/inc_vendor.h +++ b/OpenCL/inc_vendor.h @@ -18,6 +18,10 @@ #define KERNEL_FQ __kernel #endif +#ifndef MAYBE_VOLATILE +#define MAYBE_VOLATILE +#endif + #ifndef MAYBE_UNUSED #define MAYBE_UNUSED #endif diff --git a/OpenCL/m10700-pure.cl b/OpenCL/m10700-pure.cl index 63cd57cd8..6b9dfc686 100644 --- a/OpenCL/m10700-pure.cl +++ b/OpenCL/m10700-pure.cl @@ -87,7 +87,7 @@ DECLSPEC u32 sha256_update_aes_64 (sha256_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, { u32 ex = 0; - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; ctx->len += len; @@ -258,7 +258,7 @@ DECLSPEC void sha256_final_aes (sha256_ctx_t *ctx, const u32 *aes_ks, u32 *aes_i DECLSPEC void sha384_update_aes_128 (sha384_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, u32 *w4, u32 *w5, u32 *w6, u32 *w7, const int len, const u32 *aes_ks, u32 *aes_iv, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4) { - const int pos = ctx->len & 127; + MAYBE_VOLATILE const int pos = ctx->len & 127; ctx->len += len; @@ -536,7 +536,7 @@ DECLSPEC void sha384_final_aes (sha384_ctx_t *ctx, const u32 *aes_ks, u32 *aes_i DECLSPEC void sha512_update_aes_128 (sha512_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, u32 *w4, u32 *w5, u32 *w6, u32 *w7, const int len, const u32 *aes_ks, u32 *aes_iv, SHM_TYPE u32 *s_te0, SHM_TYPE u32 *s_te1, SHM_TYPE u32 *s_te2, SHM_TYPE u32 *s_te3, SHM_TYPE u32 *s_te4) { - const int pos = ctx->len & 127; + MAYBE_VOLATILE const int pos = ctx->len & 127; ctx->len += len; diff --git a/OpenCL/m16400_a0-pure.cl b/OpenCL/m16400_a0-pure.cl index b75f2d144..87ad14899 100644 --- a/OpenCL/m16400_a0-pure.cl +++ b/OpenCL/m16400_a0-pure.cl @@ -118,9 +118,9 @@ DECLSPEC void cram_md5_transform (const u32 *w0, const u32 *w1, const u32 *w2, c DECLSPEC void cram_md5_update_64 (md5_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len) { #ifdef IS_AMD - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; #else - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; #endif ctx->len += len; diff --git a/OpenCL/m16400_a1-pure.cl b/OpenCL/m16400_a1-pure.cl index ba2d9ee56..6392f42d1 100644 --- a/OpenCL/m16400_a1-pure.cl +++ b/OpenCL/m16400_a1-pure.cl @@ -116,9 +116,9 @@ DECLSPEC void cram_md5_transform (const u32 *w0, const u32 *w1, const u32 *w2, c DECLSPEC void cram_md5_update_64 (md5_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, const int len) { #ifdef IS_AMD - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; #else - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; #endif ctx->len += len; diff --git a/OpenCL/m16400_a3-pure.cl b/OpenCL/m16400_a3-pure.cl index a9b2d75f0..9532b58f4 100644 --- a/OpenCL/m16400_a3-pure.cl +++ b/OpenCL/m16400_a3-pure.cl @@ -116,9 +116,9 @@ DECLSPEC void cram_md5_transform_vector (const u32x *w0, const u32x *w1, const u DECLSPEC void cram_md5_update_vector_64 (md5_ctx_vector_t *ctx, u32x *w0, u32x *w1, u32x *w2, u32x *w3, const int len) { #ifdef IS_AMD - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; #else - const int pos = ctx->len & 63; + MAYBE_VOLATILE const int pos = ctx->len & 63; #endif ctx->len += len; diff --git a/OpenCL/m19200-pure.cl b/OpenCL/m19200-pure.cl index e0c7c9b5e..8d40173e7 100644 --- a/OpenCL/m19200-pure.cl +++ b/OpenCL/m19200-pure.cl @@ -26,7 +26,7 @@ typedef struct qnx_sha512_tmp DECLSPEC u32 sha512_update_128_qnxbug (sha512_ctx_t *ctx, u32 *w0, u32 *w1, u32 *w2, u32 *w3, u32 *w4, u32 *w5, u32 *w6, u32 *w7, const int len, u32 sav) { - const int pos = ctx->len & 127; + MAYBE_VOLATILE const int pos = ctx->len & 127; ctx->len += len; @@ -312,7 +312,7 @@ DECLSPEC u32 sha512_update_global_swap_qnxbug (sha512_ctx_t *ctx, GLOBAL_AS cons DECLSPEC void sha512_final_qnxbug (sha512_ctx_t *ctx, u32 sav) { - const int pos = ctx->len & 127; + MAYBE_VOLATILE const int pos = ctx->len & 127; append_0x80_8x4_S (ctx->w0, ctx->w1, ctx->w2, ctx->w3, ctx->w4, ctx->w5, ctx->w6, ctx->w7, pos ^ 3); diff --git a/src/modules/module_02500.c b/src/modules/module_02500.c index b449c58da..5b66c8708 100644 --- a/src/modules/module_02500.c +++ b/src/modules/module_02500.c @@ -587,6 +587,24 @@ bool module_potfile_custom_check (MAYBE_UNUSED const hashconfig_t *hashconfig, M return r; } +char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra, MAYBE_UNUSED const hashes_t *hashes, MAYBE_UNUSED const hc_device_param_t *device_param) +{ + char *jit_build_options = NULL; + + if (device_param->platform_vendor_id == VENDOR_ID_APPLE) + { + if (device_param->device_vendor_id == VENDOR_ID_INTEL_SDK) + { + if (device_param->device_type & CL_DEVICE_TYPE_GPU) + { + hc_asprintf (&jit_build_options, "-D MAYBE_VOLATILE=volatile"); + } + } + } + + return jit_build_options; +} + int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED void *digest_buf, MAYBE_UNUSED salt_t *salt, MAYBE_UNUSED void *esalt_buf, MAYBE_UNUSED void *hook_salt_buf, MAYBE_UNUSED hashinfo_t *hash_info, const char *line_buf, MAYBE_UNUSED const int line_len) { u32 *digest = (u32 *) digest_buf; @@ -927,7 +945,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_hook23 = MODULE_DEFAULT; module_ctx->module_hook_salt_size = MODULE_DEFAULT; module_ctx->module_hook_size = MODULE_DEFAULT; - module_ctx->module_jit_build_options = MODULE_DEFAULT; + module_ctx->module_jit_build_options = module_jit_build_options; module_ctx->module_jit_cache_disable = MODULE_DEFAULT; module_ctx->module_kernel_accel_max = MODULE_DEFAULT; module_ctx->module_kernel_accel_min = MODULE_DEFAULT; diff --git a/src/modules/module_02501.c b/src/modules/module_02501.c index 83ac34e68..fe830cbd6 100644 --- a/src/modules/module_02501.c +++ b/src/modules/module_02501.c @@ -584,6 +584,24 @@ int module_hash_encode_status (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYB return line_len; } +char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra, MAYBE_UNUSED const hashes_t *hashes, MAYBE_UNUSED const hc_device_param_t *device_param) +{ + char *jit_build_options = NULL; + + if (device_param->platform_vendor_id == VENDOR_ID_APPLE) + { + if (device_param->device_vendor_id == VENDOR_ID_INTEL_SDK) + { + if (device_param->device_type & CL_DEVICE_TYPE_GPU) + { + hc_asprintf (&jit_build_options, "-D MAYBE_VOLATILE=volatile"); + } + } + } + + return jit_build_options; +} + int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED void *digest_buf, MAYBE_UNUSED salt_t *salt, MAYBE_UNUSED void *esalt_buf, MAYBE_UNUSED void *hook_salt_buf, MAYBE_UNUSED hashinfo_t *hash_info, const char *line_buf, MAYBE_UNUSED const int line_len) { u32 *digest = (u32 *) digest_buf; @@ -924,7 +942,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_hook23 = MODULE_DEFAULT; module_ctx->module_hook_salt_size = MODULE_DEFAULT; module_ctx->module_hook_size = MODULE_DEFAULT; - module_ctx->module_jit_build_options = MODULE_DEFAULT; + module_ctx->module_jit_build_options = module_jit_build_options; module_ctx->module_jit_cache_disable = MODULE_DEFAULT; module_ctx->module_kernel_accel_max = MODULE_DEFAULT; module_ctx->module_kernel_accel_min = MODULE_DEFAULT;