Skip to content

Commit

Permalink
build: Rename --enable-experimental-asm to --enable-asm and enable by…
Browse files Browse the repository at this point in the history
… default

Now that 0.15 is branched off, enable assembler SHA256 optimizations by default.
  • Loading branch information
laanwj committed Aug 28, 2017
1 parent df91e11 commit ce5381e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
18 changes: 9 additions & 9 deletions configure.ac
Expand Up @@ -177,14 +177,14 @@ AC_ARG_ENABLE([glibc-back-compat],
[use_glibc_compat=$enableval],
[use_glibc_compat=no])

AC_ARG_ENABLE([experimental-asm],
[AS_HELP_STRING([--enable-experimental-asm],
[Enable experimental assembly routines (default is no)])],
[experimental_asm=$enableval],
[experimental_asm=no])

if test "x$experimental_asm" = xyes; then
AC_DEFINE(EXPERIMENTAL_ASM, 1, [Define this symbol to build in experimental assembly routines])
AC_ARG_ENABLE([asm],
[AS_HELP_STRING([--enable-asm],
[Enable assembly routines (default is yes)])],
[use_asm=$enableval],
[use_asm=yes])

if test "x$use_asm" = xyes; then
AC_DEFINE(USE_ASM, 1, [Define this symbol to build in assembly routines])
fi

AC_ARG_WITH([system-univalue],
Expand Down Expand Up @@ -1179,7 +1179,7 @@ AM_CONDITIONAL([USE_LCOV],[test x$use_lcov = xyes])
AM_CONDITIONAL([GLIBC_BACK_COMPAT],[test x$use_glibc_compat = xyes])
AM_CONDITIONAL([HARDEN],[test x$use_hardening = xyes])
AM_CONDITIONAL([ENABLE_HWCRC32],[test x$enable_hwcrc32 = xyes])
AM_CONDITIONAL([EXPERIMENTAL_ASM],[test x$experimental_asm = xyes])
AM_CONDITIONAL([USE_ASM],[test x$use_asm = xyes])

AC_DEFINE(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR, [Major version])
AC_DEFINE(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR, [Minor version])
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.am
Expand Up @@ -271,7 +271,7 @@ crypto_libbitcoin_crypto_a_SOURCES = \
crypto/sha512.cpp \
crypto/sha512.h

if EXPERIMENTAL_ASM
if USE_ASM
crypto_libbitcoin_crypto_a_SOURCES += crypto/sha256_sse4.cpp
endif

Expand Down
4 changes: 2 additions & 2 deletions src/crypto/sha256.cpp
Expand Up @@ -10,7 +10,7 @@
#include <atomic>

#if defined(__x86_64__) || defined(__amd64__)
#if defined(EXPERIMENTAL_ASM)
#if defined(USE_ASM)
#include <cpuid.h>
namespace sha256_sse4
{
Expand Down Expand Up @@ -178,7 +178,7 @@ TransformType Transform = sha256::Transform;

std::string SHA256AutoDetect()
{
#if defined(EXPERIMENTAL_ASM) && (defined(__x86_64__) || defined(__amd64__))
#if defined(USE_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;
Expand Down

0 comments on commit ce5381e

Please sign in to comment.