Skip to content

Commit df8c722

Browse files
committed
Merge #11176: build: Rename --enable-experimental-asm to --enable-asm and enable by default
538cc0c build: Mention use of asm in summary (Wladimir J. van der Laan) ce5381e build: Rename --enable-experimental-asm to --enable-asm and enable by default (Wladimir J. van der Laan) Pull request description: Now that 0.15 is branched off, enable assembler SHA256 optimizations by default, but still allow disabling them, for example if something goes wrong with auto-detection on a platform. Also add mention of the use of asm in the configure summary. Tree-SHA512: cd20c497f65edd6b1e8b2cc3dfe82be11fcf4777543c830ccdec6c10f25eab4576b0f2953f3957736d7e04deaa4efca777aa84b12bb1cecb40c258e86c120ec8
2 parents ba05971 + 538cc0c commit df8c722

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

configure.ac

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -177,14 +177,14 @@ AC_ARG_ENABLE([glibc-back-compat],
177177
[use_glibc_compat=$enableval],
178178
[use_glibc_compat=no])
179179

180-
AC_ARG_ENABLE([experimental-asm],
181-
[AS_HELP_STRING([--enable-experimental-asm],
182-
[Enable experimental assembly routines (default is no)])],
183-
[experimental_asm=$enableval],
184-
[experimental_asm=no])
185-
186-
if test "x$experimental_asm" = xyes; then
187-
AC_DEFINE(EXPERIMENTAL_ASM, 1, [Define this symbol to build in experimental assembly routines])
180+
AC_ARG_ENABLE([asm],
181+
[AS_HELP_STRING([--enable-asm],
182+
[Enable assembly routines (default is yes)])],
183+
[use_asm=$enableval],
184+
[use_asm=yes])
185+
186+
if test "x$use_asm" = xyes; then
187+
AC_DEFINE(USE_ASM, 1, [Define this symbol to build in assembly routines])
188188
fi
189189

190190
AC_ARG_WITH([system-univalue],
@@ -1179,7 +1179,7 @@ AM_CONDITIONAL([USE_LCOV],[test x$use_lcov = xyes])
11791179
AM_CONDITIONAL([GLIBC_BACK_COMPAT],[test x$use_glibc_compat = xyes])
11801180
AM_CONDITIONAL([HARDEN],[test x$use_hardening = xyes])
11811181
AM_CONDITIONAL([ENABLE_HWCRC32],[test x$enable_hwcrc32 = xyes])
1182-
AM_CONDITIONAL([EXPERIMENTAL_ASM],[test x$experimental_asm = xyes])
1182+
AM_CONDITIONAL([USE_ASM],[test x$use_asm = xyes])
11831183

11841184
AC_DEFINE(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR, [Major version])
11851185
AC_DEFINE(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR, [Minor version])
@@ -1297,6 +1297,7 @@ echo " with zmq = $use_zmq"
12971297
echo " with test = $use_tests"
12981298
echo " with bench = $use_bench"
12991299
echo " with upnp = $use_upnp"
1300+
echo " use asm = $use_asm"
13001301
echo " debug enabled = $enable_debug"
13011302
echo " werror = $enable_werror"
13021303
echo

src/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ crypto_libbitcoin_crypto_a_SOURCES = \
273273
crypto/sha512.cpp \
274274
crypto/sha512.h
275275

276-
if EXPERIMENTAL_ASM
276+
if USE_ASM
277277
crypto_libbitcoin_crypto_a_SOURCES += crypto/sha256_sse4.cpp
278278
endif
279279

src/crypto/sha256.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <atomic>
1111

1212
#if defined(__x86_64__) || defined(__amd64__)
13-
#if defined(EXPERIMENTAL_ASM)
13+
#if defined(USE_ASM)
1414
#include <cpuid.h>
1515
namespace sha256_sse4
1616
{
@@ -178,7 +178,7 @@ TransformType Transform = sha256::Transform;
178178

179179
std::string SHA256AutoDetect()
180180
{
181-
#if defined(EXPERIMENTAL_ASM) && (defined(__x86_64__) || defined(__amd64__))
181+
#if defined(USE_ASM) && (defined(__x86_64__) || defined(__amd64__))
182182
uint32_t eax, ebx, ecx, edx;
183183
if (__get_cpuid(1, &eax, &ebx, &ecx, &edx) && (ecx >> 19) & 1) {
184184
Transform = sha256_sse4::Transform;

0 commit comments

Comments
 (0)