Skip to content

Commit

Permalink
Merge pull request #7 from meritlabs/feature/v0.2
Browse files Browse the repository at this point in the history
Fix diff 1 value
  • Loading branch information
tonypizzicato authored Jun 3, 2018
2 parents 0867551 + 7f7affa commit 8edba3c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
22 changes: 12 additions & 10 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AC_INIT([merit-miner], [0.1.0])
AC_INIT([merit-miner], [0.2.0])

AC_PREREQ([2.59c])
AC_CANONICAL_SYSTEM
Expand Down Expand Up @@ -76,18 +76,20 @@ fi
AC_ARG_ENABLE([march],
[AS_HELP_STRING([--enable-march], [Use native CPU instructions for mining (default is no)])],
[enable_march=$enableval],
[enable_march=no])
[enable_march=yes])

CFLAGS="$CFLAGS -O3"

AC_MSG_CHECKING(whether we can compile with native arch for AVX2 support)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ _mm256_broadcastq_epi64(_mm_cvtsi64_si128(0xff)); ])],
CXXFLAGS="$CXXFLAGS -march=native"
AC_MSG_RESULT(yes)
,
AC_MSG_RESULT(no)
AC_MSG_WARN([The assembler does not support the AVX2 instruction set.])
)
if test x$enable_march != xno; then
AC_MSG_CHECKING(whether we can compile with native arch for AVX2 support)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ _mm256_broadcastq_epi64(_mm_cvtsi64_si128(0xff)); ])],
CXXFLAGS="$CXXFLAGS -march=native"
AC_MSG_RESULT(yes)
,
AC_MSG_RESULT(no)
AC_MSG_WARN([The assembler does not support the AVX2 instruction set.])
)
fi

if test x$enable_assembly == xyes -a x$have_x86_64 = xtrue
then
Expand Down
2 changes: 1 addition & 1 deletion util.c
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ void diff_to_target(uint32_t *target, double diff)

for (k = 7; k > 0 && diff > 1.0; k--)
diff /= 4294967296.0;
m = 4294901760.0 / diff;
m = 2147450880.0 / diff;

memset(target, 0, 32);
target[k] = (uint32_t)m;
Expand Down

0 comments on commit 8edba3c

Please sign in to comment.