aboutsummaryrefslogtreecommitdiff
path: root/src/crypto
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-02-17 12:01:04 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-02-18 13:14:15 +0000
commit993a1994fa5dc9d25391c483218b00010e6bf4ea (patch)
tree366b856ca7766d08b918e73f6eef741bdeb2a9df /src/crypto
parentcrypto: plug CNv4 JIT into cn_slow_hash (diff)
downloadmonero-993a1994fa5dc9d25391c483218b00010e6bf4ea.tar.xz
tests: add a CNv4 JIT test
Diffstat (limited to 'src/crypto')
-rw-r--r--src/crypto/slow-hash.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/crypto/slow-hash.c b/src/crypto/slow-hash.c
index 9f629be0c..d823634fc 100644
--- a/src/crypto/slow-hash.c
+++ b/src/crypto/slow-hash.c
@@ -494,25 +494,26 @@ STATIC INLINE int force_software_aes(void)
return use;
}
+volatile int use_v4_jit_flag = -1;
+
STATIC INLINE int use_v4_jit(void)
{
#if defined(__x86_64__)
- static int use = -1;
- if (use != -1)
- return use;
+ if (use_v4_jit_flag != -1)
+ return use_v4_jit_flag;
const char *env = getenv("MONERO_USE_CNV4_JIT");
if (!env) {
- use = 0;
+ use_v4_jit_flag = 0;
}
else if (!strcmp(env, "0") || !strcmp(env, "no")) {
- use = 0;
+ use_v4_jit_flag = 0;
}
else {
- use = 1;
+ use_v4_jit_flag = 1;
}
- return use;
+ return use_v4_jit_flag;
#else
return 0;
#endif