diff options
author | Cory Fields <cory-nospam-@coryfields.com> | 2024-02-07 20:04:01 +0000 |
---|---|---|
committer | Cory Fields <cory-nospam-@coryfields.com> | 2024-02-29 19:05:45 +0000 |
commit | 376f0f6d0798c10f09266d609afea3ada1b99f9b (patch) | |
tree | 2b0e7ab06a2cd64750c9161496799a7afab45be2 /src | |
parent | 22a5ccfb06429c3b0e111a191e7ba71d98a1d198 (diff) |
build: remove confusing and inconsistent disable-asm option
1. It didn't actually disable asm usage in our code. Regardless of the setting,
asm is used in random.cpp and support/cleanse.cpp.
2. The value wasn't forwarded to libsecp as a user might have reasonably
expected.
3. We now have the DISABLE_OPTIMIZED_SHA256 define which is what disable-asm
actually did in practice.
If there is any desire, we can hook DISABLE_OPTIMIZED_SHA256 up to a new
configure option that actually does what it says.
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/crypto/sha256.cpp | 8 |
2 files changed, 3 insertions, 7 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 3e8870c828..3e24ea5a7e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -50,10 +50,8 @@ LIBBITCOIN_WALLET_TOOL=libbitcoin_wallet_tool.a endif LIBBITCOIN_CRYPTO = $(LIBBITCOIN_CRYPTO_BASE) -if USE_ASM LIBBITCOIN_CRYPTO_SSE4 = crypto/libbitcoin_crypto_sse4.la LIBBITCOIN_CRYPTO += $(LIBBITCOIN_CRYPTO_SSE4) -endif if ENABLE_SSE41 LIBBITCOIN_CRYPTO_SSE41 = crypto/libbitcoin_crypto_sse41.la LIBBITCOIN_CRYPTO += $(LIBBITCOIN_CRYPTO_SSE41) diff --git a/src/crypto/sha256.cpp b/src/crypto/sha256.cpp index 36ef6d9a1a..4c7bb6f20f 100644 --- a/src/crypto/sha256.cpp +++ b/src/crypto/sha256.cpp @@ -26,13 +26,11 @@ #endif #if defined(__x86_64__) || defined(__amd64__) || defined(__i386__) -#if defined(USE_ASM) namespace sha256_sse4 { void Transform(uint32_t* s, const unsigned char* chunk, size_t blocks); } #endif -#endif namespace sha256d64_sse41 { @@ -574,7 +572,7 @@ bool SelfTest() { } #if !defined(DISABLE_OPTIMIZED_SHA256) -#if defined(USE_ASM) && (defined(__x86_64__) || defined(__amd64__) || defined(__i386__)) +#if (defined(__x86_64__) || defined(__amd64__) || defined(__i386__)) /** Check whether the OS has enabled AVX registers. */ bool AVXEnabled() { @@ -597,7 +595,7 @@ std::string SHA256AutoDetect(sha256_implementation::UseImplementation use_implem TransformD64_8way = nullptr; #if !defined(DISABLE_OPTIMIZED_SHA256) -#if defined(USE_ASM) && defined(HAVE_GETCPUID) +#if defined(HAVE_GETCPUID) bool have_sse4 = false; bool have_xsave = false; bool have_avx = false; @@ -654,7 +652,7 @@ std::string SHA256AutoDetect(sha256_implementation::UseImplementation use_implem ret += ",avx2(8way)"; } #endif -#endif // defined(USE_ASM) && defined(HAVE_GETCPUID) +#endif // defined(HAVE_GETCPUID) #if defined(ENABLE_ARM_SHANI) bool have_arm_shani = false; |