aboutsummaryrefslogtreecommitdiff
path: root/src/crypto
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2024-02-07 20:04:01 +0000
committerCory Fields <cory-nospam-@coryfields.com>2024-02-29 19:05:45 +0000
commit376f0f6d0798c10f09266d609afea3ada1b99f9b (patch)
tree2b0e7ab06a2cd64750c9161496799a7afab45be2 /src/crypto
parent22a5ccfb06429c3b0e111a191e7ba71d98a1d198 (diff)
downloadbitcoin-376f0f6d0798c10f09266d609afea3ada1b99f9b.tar.xz
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/crypto')
-rw-r--r--src/crypto/sha256.cpp8
1 files changed, 3 insertions, 5 deletions
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;