aboutsummaryrefslogtreecommitdiff
path: root/src/crypto
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2017-07-18 01:06:11 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2017-07-20 09:03:53 -0700
commit6b8d872e5e2dd68a5229ec55f5261dae34ff9bdb (patch)
tree3ac15ca0584417ab467071a4c28132630093a922 /src/crypto
parentfa9be909c945c3689591590ac19504aa53154c2f (diff)
downloadbitcoin-6b8d872e5e2dd68a5229ec55f5261dae34ff9bdb.tar.xz
Protect SSE4 code behind a compile-time flag
Diffstat (limited to 'src/crypto')
-rw-r--r--src/crypto/sha256.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/crypto/sha256.cpp b/src/crypto/sha256.cpp
index 25f4eabd4c..15d6db90c2 100644
--- a/src/crypto/sha256.cpp
+++ b/src/crypto/sha256.cpp
@@ -10,12 +10,14 @@
#include <atomic>
#if defined(__x86_64__) || defined(__amd64__)
+#if defined(EXPERIMENTAL_ASM)
#include <cpuid.h>
namespace sha256_sse4
{
void Transform(uint32_t* s, const unsigned char* chunk, size_t blocks);
}
#endif
+#endif
// Internal implementation code.
namespace
@@ -176,7 +178,7 @@ TransformType Transform = sha256::Transform;
std::string SHA256AutoDetect()
{
-#if defined(__x86_64__) || defined(__amd64__)
+#if defined(EXPERIMENTAL_ASM) && (defined(__x86_64__) || defined(__amd64__))
uint32_t eax, ebx, ecx, edx;
if (__get_cpuid(1, &eax, &ebx, &ecx, &edx) && (ecx >> 19) & 1) {
Transform = sha256_sse4::Transform;