diff --git a/AUTHORS b/AUTHORS index 04129fd..1ed191b 100644 --- a/AUTHORS +++ b/AUTHORS @@ -29,3 +29,5 @@ Wolf0 Optiminer Jay D Dee + +xcouiz@gmail.com diff --git a/README.md b/README.md index 9f7e081..0a82bd2 100644 --- a/README.md +++ b/README.md @@ -45,83 +45,84 @@ MacOS, OSx and Android are not supported. Supported Algorithms -------------------- - allium Garlicoin - anime Animecoin - argon2 Argon2 coin (AR2) - argon2d250 argon2d-crds, Credits (CRDS) - argon2d500 argon2d-dyn, Dynamic (DYN) - argon2d4096 argon2d-uis, Unitus, (UIS) - axiom Shabal-256 MemoHash + allium Garlicoin + anime Animecoin + argon2 Argon2 coin (AR2) + argon2d250 argon2d-crds, Credits (CRDS) + argon2d500 argon2d-dyn, Dynamic (DYN) + argon2d4096 argon2d-uis, Unitus, (UIS) + axiom Shabal-256 MemoHash bastion - blake Blake-256 (SFR) - blakecoin blake256r8 - blake2s Blake-2 S - bmw BMW 256 - c11 Chaincoin - cryptolight Cryptonight-light - cryptonight cryptonote, Monero (XMR) + blake Blake-256 (SFR) + blakecoin blake256r8 + blake2s Blake-2 S + bmw BMW 256 + c11 Chaincoin + cryptolight Cryptonight-light + cryptonight + cryptonightv7 Monero (XMR) decred - deep Deepcoin (DCN) - dmd-gr Diamond-Groestl - drop Dropcoin - fresh Fresh - groestl Groestl coin - heavy Heavy - hmq1725 Espers - hodl Hodlcoin - jha Jackpotcoin - keccak Maxcoin - keccakc Creative coin - lbry LBC, LBRY Credits - luffa Luffa - lyra2h Hppcoin - lyra2re lyra2 - lyra2rev2 lyra2v2, Vertcoin - lyra2z Zcoin (XZC) - lyra2z330 Lyra2 330 rows, Zoin (ZOI) - m7m Magi (XMG) - myr-gr Myriad-Groestl - neoscrypt NeoScrypt(128, 2, 1) - nist5 Nist5 - pentablake Pentablake - phi1612 phi, LUX coin - pluck Pluck:128 (Supcoin) - polytimos Ninja - quark Quark - qubit Qubit - scrypt scrypt(1024, 1, 1) (default) - scrypt:N scrypt(N, 1, 1) + deep Deepcoin (DCN) + dmd-gr Diamond-Groestl + drop Dropcoin + fresh Fresh + groestl Groestl coin + heavy Heavy + hmq1725 Espers + hodl Hodlcoin + jha Jackpotcoin + keccak Maxcoin + keccakc Creative coin + lbry LBC, LBRY Credits + luffa Luffa + lyra2h Hppcoin + lyra2re lyra2 + lyra2rev2 lyra2v2, Vertcoin + lyra2z Zcoin (XZC) + lyra2z330 Lyra2 330 rows, Zoin (ZOI) + m7m Magi (XMG) + myr-gr Myriad-Groestl + neoscrypt NeoScrypt(128, 2, 1) + nist5 Nist5 + pentablake Pentablake + phi1612 phi, LUX coin + pluck Pluck:128 (Supcoin) + polytimos Ninja + quark Quark + qubit Qubit + scrypt scrypt(1024, 1, 1) (default) + scrypt:N scrypt(N, 1, 1) scryptjane:nf - sha256d Double SHA-256 - sha256t Triple SHA-256, Onecoin (OC) - shavite3 Shavite3 - skein Skein+Sha (Skeincoin) - skein2 Double Skein (Woodcoin) - skunk Signatum (SIGT) - timetravel Machinecoin (MAC) - timetravel10 Bitcore - tribus Denarius (DNR) - vanilla blake256r8vnl (VCash) - veltor (VLT) + sha256d Double SHA-256 + sha256t Triple SHA-256, Onecoin (OC) + shavite3 Shavite3 + skein Skein+Sha (Skeincoin) + skein2 Double Skein (Woodcoin) + skunk Signatum (SIGT) + timetravel Machinecoin (MAC) + timetravel10 Bitcore + tribus Denarius (DNR) + vanilla blake256r8vnl (VCash) + veltor (VLT) whirlpool whirlpoolx - x11 Dash - x11evo Revolvercoin - x11gost sib (SibCoin) - x12 Galaxie Cash (GCH) - x13 X13 - x13sm3 hsr (Hshare) - x14 X14 - x15 X15 - x16r Ravencoin (RVN) - x16s pigeoncoin (PGN) + x11 Dash + x11evo Revolvercoin + x11gost sib (SibCoin) + x12 Galaxie Cash (GCH) + x13 X13 + x13sm3 hsr (Hshare) + x14 X14 + x15 X15 + x16r Ravencoin (RVN) + x16s pigeoncoin (PGN) x17 - xevan Bitsend (BSD) - yescrypt Globalboost-Y (BSTY) - yescryptr8 BitZeny (ZNY) - yescryptr16 Yenten (YTN) - yescryptr32 WAVI - zr5 Ziftr + xevan Bitsend (BSD) + yescrypt Globalboost-Y (BSTY) + yescryptr8 BitZeny (ZNY) + yescryptr16 Yenten (YTN) + yescryptr32 WAVI + zr5 Ziftr Errata ------ diff --git a/README.txt b/README.txt index 12f21ab..0a0ecbf 100644 --- a/README.txt +++ b/README.txt @@ -28,6 +28,7 @@ Exe name Compile flags Arch name cpuminer-sse2.exe "-msse2" Core2, Nehalem cpuminer-aes-sse42.exe "-march=westmere" Westmere, Sandy-Ivybridge +cpuminer-avx.exe "-march=corei7-avx" Sandy-Ivybridge cpuminer-avx2.exe "-march=core-avx2" Haswell, Sky-Kaby-Coffeelake cpuminer-avx2-sha.exe "-march=core-avx2 -msha" Ryzen diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 71c1367..895c0a5 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -50,8 +50,7 @@ will give a clue as to the missing package. The following command should install everything you need on Debian based distributions such as Ubuntu: -sudo apt-get install build-essential libssl-dev libcurl4-openssl-dev libjansson-dev libgmp-dev automake - +sudo apt-get install build-essential libssl-dev libcurl4-openssl-dev libjansson-dev libgmp-dev automake zlib1g-dev build-essential (for Ubuntu, Development Tools package group on Fedora) automake @@ -86,7 +85,7 @@ make Additional optional compile flags, add the following to CFLAGS to activate: --DUSE_SPH_SHA +-DUSE_SPH_SHA (deprecated) SPH may give slightly better performance on algos that use sha256 when using openssl 1.0.1 or older. Openssl 1.0.2 adds AVX2 and 1.1 adds SHA and perform @@ -160,6 +159,16 @@ Support for even older x86_64 without AES_NI or SSE2 is not availble. Change Log ---------- +v3.8.8.1 + +Fixed x16r. +Removed cryptonight variant check due to false positives. +API displays hashrate before shares are submitted. + +v3.8.8 + +Added cryptonightv7 for Monero. + v3.8.7.2 Fixed argon2d-dyn regression in v3.8.7.1. diff --git a/aclocal.m4 b/aclocal.m4 index d202f86..0e40733 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.14.1 -*- Autoconf -*- +# generated automatically by aclocal 1.15.1 -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2017 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# Copyright (C) 2002-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.]) # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.14' +[am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.14.1], [], +m4_if([$1], [1.15.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.14.1])dnl +[AM_AUTOMAKE_VERSION([1.15.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # Figure out how to run the assembler. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -78,7 +78,7 @@ _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -123,15 +123,14 @@ _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], -[dnl Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50])dnl -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -162,7 +161,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -353,7 +352,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -429,7 +428,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -519,8 +518,8 @@ AC_REQUIRE([AC_PROG_MKDIR_P])dnl # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl @@ -593,7 +592,11 @@ to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi -fi]) +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. +]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further @@ -622,7 +625,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -633,7 +636,7 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_co # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh}" != xset; then +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -643,7 +646,7 @@ if test x"${install_sh}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2013 Free Software Foundation, Inc. +# Copyright (C) 2003-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -665,7 +668,7 @@ AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -700,7 +703,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -750,7 +753,7 @@ rm -f confinc confmf # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -789,7 +792,7 @@ fi # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -818,7 +821,7 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -865,7 +868,7 @@ AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -884,7 +887,7 @@ AC_DEFUN([AM_RUN_LOG], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -965,7 +968,7 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2013 Free Software Foundation, Inc. +# Copyright (C) 2009-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1025,7 +1028,7 @@ AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1053,7 +1056,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2013 Free Software Foundation, Inc. +# Copyright (C) 2006-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1072,7 +1075,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2013 Free Software Foundation, Inc. +# Copyright (C) 2004-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/algo-gate-api.c b/algo-gate-api.c index bff9c80..314d808 100644 --- a/algo-gate-api.c +++ b/algo-gate-api.c @@ -157,82 +157,83 @@ bool register_algo_gate( int algo, algo_gate_t *gate ) switch (algo) { - case ALGO_ALLIUM: register_allium_algo ( gate ); break; - case ALGO_ANIME: register_anime_algo ( gate ); break; - case ALGO_ARGON2: register_argon2_algo ( gate ); break; - case ALGO_ARGON2D250: register_argon2d_crds_algo( gate ); break; - case ALGO_ARGON2D500: register_argon2d_dyn_algo ( gate ); break; - case ALGO_ARGON2D4096: register_argon2d4096_algo ( gate ); break; - case ALGO_AXIOM: register_axiom_algo ( gate ); break; - case ALGO_BASTION: register_bastion_algo ( gate ); break; - case ALGO_BLAKE: register_blake_algo ( gate ); break; - case ALGO_BLAKECOIN: register_blakecoin_algo ( gate ); break; + case ALGO_ALLIUM: register_allium_algo ( gate ); break; + case ALGO_ANIME: register_anime_algo ( gate ); break; + case ALGO_ARGON2: register_argon2_algo ( gate ); break; + case ALGO_ARGON2D250: register_argon2d_crds_algo ( gate ); break; + case ALGO_ARGON2D500: register_argon2d_dyn_algo ( gate ); break; + case ALGO_ARGON2D4096: register_argon2d4096_algo ( gate ); break; + case ALGO_AXIOM: register_axiom_algo ( gate ); break; + case ALGO_BASTION: register_bastion_algo ( gate ); break; + case ALGO_BLAKE: register_blake_algo ( gate ); break; + case ALGO_BLAKECOIN: register_blakecoin_algo ( gate ); break; // case ALGO_BLAKE2B: register_blake2b_algo ( gate ); break; - case ALGO_BLAKE2S: register_blake2s_algo ( gate ); break; - case ALGO_C11: register_c11_algo ( gate ); break; - case ALGO_CRYPTOLIGHT: register_cryptolight_algo ( gate ); break; - case ALGO_CRYPTONIGHT: register_cryptonight_algo ( gate ); break; - case ALGO_DECRED: register_decred_algo ( gate ); break; - case ALGO_DEEP: register_deep_algo ( gate ); break; - case ALGO_DMD_GR: register_dmd_gr_algo ( gate ); break; - case ALGO_DROP: register_drop_algo ( gate ); break; - case ALGO_FRESH: register_fresh_algo ( gate ); break; - case ALGO_GROESTL: register_groestl_algo ( gate ); break; - case ALGO_HEAVY: register_heavy_algo ( gate ); break; - case ALGO_HMQ1725: register_hmq1725_algo ( gate ); break; - case ALGO_HODL: register_hodl_algo ( gate ); break; - case ALGO_JHA: register_jha_algo ( gate ); break; - case ALGO_KECCAK: register_keccak_algo ( gate ); break; - case ALGO_KECCAKC: register_keccakc_algo ( gate ); break; - case ALGO_LBRY: register_lbry_algo ( gate ); break; - case ALGO_LUFFA: register_luffa_algo ( gate ); break; - case ALGO_LYRA2H: register_lyra2h_algo ( gate ); break; - case ALGO_LYRA2RE: register_lyra2re_algo ( gate ); break; - case ALGO_LYRA2REV2: register_lyra2rev2_algo ( gate ); break; - case ALGO_LYRA2Z: register_lyra2z_algo ( gate ); break; - case ALGO_LYRA2Z330: register_lyra2z330_algo ( gate ); break; - case ALGO_M7M: register_m7m_algo ( gate ); break; - case ALGO_MYR_GR: register_myriad_algo ( gate ); break; - case ALGO_NEOSCRYPT: register_neoscrypt_algo ( gate ); break; - case ALGO_NIST5: register_nist5_algo ( gate ); break; - case ALGO_PENTABLAKE: register_pentablake_algo ( gate ); break; - case ALGO_PHI1612: register_phi1612_algo ( gate ); break; - case ALGO_PLUCK: register_pluck_algo ( gate ); break; - case ALGO_POLYTIMOS: register_polytimos_algo ( gate ); break; - case ALGO_QUARK: register_quark_algo ( gate ); break; - case ALGO_QUBIT: register_qubit_algo ( gate ); break; - case ALGO_SCRYPT: register_scrypt_algo ( gate ); break; - case ALGO_SCRYPTJANE: register_scryptjane_algo ( gate ); break; - case ALGO_SHA256D: register_sha256d_algo ( gate ); break; - case ALGO_SHA256T: register_sha256t_algo ( gate ); break; - case ALGO_SHAVITE3: register_shavite_algo ( gate ); break; - case ALGO_SKEIN: register_skein_algo ( gate ); break; - case ALGO_SKEIN2: register_skein2_algo ( gate ); break; - case ALGO_SKUNK: register_skunk_algo ( gate ); break; - case ALGO_TIMETRAVEL: register_timetravel_algo ( gate ); break; - case ALGO_TIMETRAVEL10: register_timetravel10_algo( gate ); break; - case ALGO_TRIBUS: register_tribus_algo ( gate ); break; - case ALGO_VANILLA: register_vanilla_algo ( gate ); break; - case ALGO_VELTOR: register_veltor_algo ( gate ); break; - case ALGO_WHIRLPOOL: register_whirlpool_algo ( gate ); break; - case ALGO_WHIRLPOOLX: register_whirlpoolx_algo ( gate ); break; - case ALGO_X11: register_x11_algo ( gate ); break; - case ALGO_X11EVO: register_x11evo_algo ( gate ); break; - case ALGO_X11GOST: register_x11gost_algo ( gate ); break; - case ALGO_X12: register_x12_algo ( gate ); break; - case ALGO_X13: register_x13_algo ( gate ); break; - case ALGO_X13SM3: register_x13sm3_algo ( gate ); break; - case ALGO_X14: register_x14_algo ( gate ); break; - case ALGO_X15: register_x15_algo ( gate ); break; - case ALGO_X16R: register_x16r_algo ( gate ); break; - case ALGO_X16S: register_x16s_algo ( gate ); break; - case ALGO_X17: register_x17_algo ( gate ); break; - case ALGO_XEVAN: register_xevan_algo ( gate ); break; - case ALGO_YESCRYPT: register_yescrypt_algo ( gate ); break; - case ALGO_YESCRYPTR8: register_yescryptr8_algo ( gate ); break; - case ALGO_YESCRYPTR16: register_yescryptr16_algo ( gate ); break; - case ALGO_YESCRYPTR32: register_yescryptr32_algo ( gate ); break; - case ALGO_ZR5: register_zr5_algo ( gate ); break; + case ALGO_BLAKE2S: register_blake2s_algo ( gate ); break; + case ALGO_C11: register_c11_algo ( gate ); break; + case ALGO_CRYPTOLIGHT: register_cryptolight_algo ( gate ); break; + case ALGO_CRYPTONIGHT: register_cryptonight_algo ( gate ); break; + case ALGO_CRYPTONIGHTV7:register_cryptonightv7_algo( gate ); break; + case ALGO_DECRED: register_decred_algo ( gate ); break; + case ALGO_DEEP: register_deep_algo ( gate ); break; + case ALGO_DMD_GR: register_dmd_gr_algo ( gate ); break; + case ALGO_DROP: register_drop_algo ( gate ); break; + case ALGO_FRESH: register_fresh_algo ( gate ); break; + case ALGO_GROESTL: register_groestl_algo ( gate ); break; + case ALGO_HEAVY: register_heavy_algo ( gate ); break; + case ALGO_HMQ1725: register_hmq1725_algo ( gate ); break; + case ALGO_HODL: register_hodl_algo ( gate ); break; + case ALGO_JHA: register_jha_algo ( gate ); break; + case ALGO_KECCAK: register_keccak_algo ( gate ); break; + case ALGO_KECCAKC: register_keccakc_algo ( gate ); break; + case ALGO_LBRY: register_lbry_algo ( gate ); break; + case ALGO_LUFFA: register_luffa_algo ( gate ); break; + case ALGO_LYRA2H: register_lyra2h_algo ( gate ); break; + case ALGO_LYRA2RE: register_lyra2re_algo ( gate ); break; + case ALGO_LYRA2REV2: register_lyra2rev2_algo ( gate ); break; + case ALGO_LYRA2Z: register_lyra2z_algo ( gate ); break; + case ALGO_LYRA2Z330: register_lyra2z330_algo ( gate ); break; + case ALGO_M7M: register_m7m_algo ( gate ); break; + case ALGO_MYR_GR: register_myriad_algo ( gate ); break; + case ALGO_NEOSCRYPT: register_neoscrypt_algo ( gate ); break; + case ALGO_NIST5: register_nist5_algo ( gate ); break; + case ALGO_PENTABLAKE: register_pentablake_algo ( gate ); break; + case ALGO_PHI1612: register_phi1612_algo ( gate ); break; + case ALGO_PLUCK: register_pluck_algo ( gate ); break; + case ALGO_POLYTIMOS: register_polytimos_algo ( gate ); break; + case ALGO_QUARK: register_quark_algo ( gate ); break; + case ALGO_QUBIT: register_qubit_algo ( gate ); break; + case ALGO_SCRYPT: register_scrypt_algo ( gate ); break; + case ALGO_SCRYPTJANE: register_scryptjane_algo ( gate ); break; + case ALGO_SHA256D: register_sha256d_algo ( gate ); break; + case ALGO_SHA256T: register_sha256t_algo ( gate ); break; + case ALGO_SHAVITE3: register_shavite_algo ( gate ); break; + case ALGO_SKEIN: register_skein_algo ( gate ); break; + case ALGO_SKEIN2: register_skein2_algo ( gate ); break; + case ALGO_SKUNK: register_skunk_algo ( gate ); break; + case ALGO_TIMETRAVEL: register_timetravel_algo ( gate ); break; + case ALGO_TIMETRAVEL10: register_timetravel10_algo ( gate ); break; + case ALGO_TRIBUS: register_tribus_algo ( gate ); break; + case ALGO_VANILLA: register_vanilla_algo ( gate ); break; + case ALGO_VELTOR: register_veltor_algo ( gate ); break; + case ALGO_WHIRLPOOL: register_whirlpool_algo ( gate ); break; + case ALGO_WHIRLPOOLX: register_whirlpoolx_algo ( gate ); break; + case ALGO_X11: register_x11_algo ( gate ); break; + case ALGO_X11EVO: register_x11evo_algo ( gate ); break; + case ALGO_X11GOST: register_x11gost_algo ( gate ); break; + case ALGO_X12: register_x12_algo ( gate ); break; + case ALGO_X13: register_x13_algo ( gate ); break; + case ALGO_X13SM3: register_x13sm3_algo ( gate ); break; + case ALGO_X14: register_x14_algo ( gate ); break; + case ALGO_X15: register_x15_algo ( gate ); break; + case ALGO_X16R: register_x16r_algo ( gate ); break; + case ALGO_X16S: register_x16s_algo ( gate ); break; + case ALGO_X17: register_x17_algo ( gate ); break; + case ALGO_XEVAN: register_xevan_algo ( gate ); break; + case ALGO_YESCRYPT: register_yescrypt_algo ( gate ); break; + case ALGO_YESCRYPTR8: register_yescryptr8_algo ( gate ); break; + case ALGO_YESCRYPTR16: register_yescryptr16_algo ( gate ); break; + case ALGO_YESCRYPTR32: register_yescryptr32_algo ( gate ); break; + case ALGO_ZR5: register_zr5_algo ( gate ); break; default: applog(LOG_ERR,"FAIL: algo_gate registration failed, unknown algo %s.\n", algo_names[opt_algo] ); return false; diff --git a/algo/cryptonight/cryptolight.c b/algo/cryptonight/cryptolight.c index 011e48e..b3e3a66 100644 --- a/algo/cryptonight/cryptolight.c +++ b/algo/cryptonight/cryptolight.c @@ -325,7 +325,7 @@ int scanhash_cryptolight(int thr_id, struct work *work, struct cryptonight_ctx *ctx = (struct cryptonight_ctx*)malloc(sizeof(struct cryptonight_ctx)); -#ifndef NO_AES_NI +#if defined(__AES__) do { *nonceptr = ++n; cryptolight_hash_ctx_aes_ni(hash, pdata, 76, ctx); diff --git a/algo/cryptonight/cryptonight-aesni.c b/algo/cryptonight/cryptonight-aesni.c index e28d2cf..e904929 100644 --- a/algo/cryptonight/cryptonight-aesni.c +++ b/algo/cryptonight/cryptonight-aesni.c @@ -1,14 +1,11 @@ +#if defined(__AES__) + #include #include #include "cryptonight.h" #include "miner.h" #include "crypto/c_keccak.h" #include -//#include "avxdefs.h" - -void aesni_parallel_noxor(uint8_t *long_state, uint8_t *text, uint8_t *ExpandedKey); -void aesni_parallel_xor(uint8_t *text, uint8_t *ExpandedKey, uint8_t *long_state); -void that_fucking_loop(uint8_t a[16], uint8_t b[16], uint8_t *long_state); static inline void ExpandAESKey256_sub1(__m128i *tmp1, __m128i *tmp2) { @@ -25,7 +22,6 @@ static inline void ExpandAESKey256_sub1(__m128i *tmp1, __m128i *tmp2) static inline void ExpandAESKey256_sub2(__m128i *tmp1, __m128i *tmp3) { -#ifndef NO_AES_NI __m128i tmp2, tmp4; tmp4 = _mm_aeskeygenassist_si128(*tmp1, 0x00); @@ -37,14 +33,12 @@ static inline void ExpandAESKey256_sub2(__m128i *tmp1, __m128i *tmp3) tmp4 = _mm_slli_si128(tmp4, 0x04); *tmp3 = _mm_xor_si128(*tmp3, tmp4); *tmp3 = _mm_xor_si128(*tmp3, tmp2); -#endif } // Special thanks to Intel for helping me // with ExpandAESKey256() and its subroutines static inline void ExpandAESKey256(char *keybuf) { -#ifndef NO_AES_NI __m128i tmp1, tmp2, tmp3, *keys; keys = (__m128i *)keybuf; @@ -91,7 +85,6 @@ static inline void ExpandAESKey256(char *keybuf) tmp2 = _mm_aeskeygenassist_si128(tmp3, 0x40); ExpandAESKey256_sub1(&tmp1, &tmp2); keys[14] = tmp1; -#endif } // align to 64 byte cache line @@ -109,13 +102,19 @@ static __thread cryptonight_ctx ctx; void cryptonight_hash_aes( void *restrict output, const void *input, int len ) { -#ifndef NO_AES_NI - uint8_t ExpandedKey[256] __attribute__((aligned(64))); __m128i *longoutput, *expkey, *xmminput; size_t i, j; keccak( (const uint8_t*)input, 76, (char*)&ctx.state.hs.b, 200 ); + + if ( cryptonightV7 && len < 43 ) + return; + + const uint64_t tweak = cryptonightV7 + ? *((const uint64_t*) (((const uint8_t*)input) + 35)) + ^ ctx.state.hs.w[24] : 0; + memcpy( ExpandedKey, ctx.state.hs.b, AES_KEY_SIZE ); ExpandAESKey256( ExpandedKey ); memcpy( ctx.text, ctx.state.init, INIT_SIZE_BYTE ); @@ -214,7 +213,15 @@ void cryptonight_hash_aes( void *restrict output, const void *input, int len ) _mm_store_si128( (__m128i*)c, c_x ); b_x = _mm_xor_si128( b_x, c_x ); nextblock = (uint64_t *)&ctx.long_state[c[0] & 0x1FFFF0]; - _mm_store_si128( lsa, b_x ); + _mm_store_si128( lsa, b_x ); + + if ( cryptonightV7 ) + { + const uint8_t tmp = ( (const uint8_t*)(lsa) )[11]; + const uint8_t index = ( ( (tmp >> 3) & 6 ) | (tmp & 1) ) << 1; + ((uint8_t*)(lsa))[11] = tmp ^ ( ( 0x75310 >> index) & 0x30 ); + } + b[0] = nextblock[0]; b[1] = nextblock[1]; @@ -227,10 +234,14 @@ void cryptonight_hash_aes( void *restrict output, const void *input, int len ) : "cc" ); b_x = c_x; - nextblock[0] = a[0] + hi; - nextblock[1] = a[1] + lo; - a[0] = b[0] ^ nextblock[0]; - a[1] = b[1] ^ nextblock[1]; + + a[0] += hi; + a[1] += lo; + nextblock[0] = a[0]; + nextblock[1] = cryptonightV7 ? a[1] ^ tweak : a[1]; + a[0] ^= b[0]; + a[1] ^= b[1]; + lsa = (__m128i*)&ctx.long_state[ a[0] & 0x1FFFF0 ]; a_x = _mm_load_si128( (__m128i*)a ); c_x = _mm_load_si128( lsa ); @@ -241,6 +252,14 @@ void cryptonight_hash_aes( void *restrict output, const void *input, int len ) b_x = _mm_xor_si128( b_x, c_x ); nextblock = (uint64_t *)&ctx.long_state[c[0] & 0x1FFFF0]; _mm_store_si128( lsa, b_x ); + + if ( cryptonightV7 ) + { + const uint8_t tmp = ( (const uint8_t*)(lsa) )[11]; + const uint8_t index = ( ( (tmp >> 3) & 6 ) | (tmp & 1) ) << 1; + ((uint8_t*)(lsa))[11] = tmp ^ ( ( 0x75310 >> index) & 0x30 ); + } + b[0] = nextblock[0]; b[1] = nextblock[1]; @@ -251,8 +270,12 @@ void cryptonight_hash_aes( void *restrict output, const void *input, int len ) "rm" ( b[0] ) : "cc" ); - nextblock[0] = a[0] + hi; - nextblock[1] = a[1] + lo; + a[0] += hi; + a[1] += lo; + nextblock[0] = a[0]; + nextblock[1] = cryptonightV7 ? a[1] ^ tweak : a[1]; + a[0] ^= b[0]; + a[1] ^= b[1]; memcpy( ExpandedKey, &ctx.state.hs.b[32], AES_KEY_SIZE ); ExpandAESKey256( ExpandedKey ); @@ -330,5 +353,5 @@ void cryptonight_hash_aes( void *restrict output, const void *input, int len ) keccakf( (uint64_t*)&ctx.state.hs.w, 24 ); extra_hashes[ctx.state.hs.b[0] & 3](&ctx.state, 200, output); -#endif } +#endif diff --git a/algo/cryptonight/cryptonight-common.c b/algo/cryptonight/cryptonight-common.c index b7c96db..671704c 100644 --- a/algo/cryptonight/cryptonight-common.c +++ b/algo/cryptonight/cryptonight-common.c @@ -7,11 +7,11 @@ #include "cpuminer-config.h" #include "algo-gate-api.h" -#ifndef NO_AES_NI +#if defined(__AES__) #include "algo/groestl/aes_ni/hash-groestl256.h" -#endif - +#else #include "crypto/c_groestl.h" +#endif #include "crypto/c_blake256.h" #include "crypto/c_jh.h" #include "crypto/c_skein.h" @@ -30,12 +30,12 @@ void do_blake_hash(const void* input, size_t len, char* output) { } void do_groestl_hash(const void* input, size_t len, char* output) { -#ifdef NO_AES_NI - groestl(input, len * 8, (uint8_t*)output); -#else +#if defined(__AES__) hashState_groestl256 ctx; init_groestl256( &ctx, 32 ); update_and_final_groestl256( &ctx, output, input, len * 8 ); +#else + groestl(input, len * 8, (uint8_t*)output); #endif } @@ -52,23 +52,24 @@ void (* const extra_hashes[4])( const void *, size_t, char *) = void cryptonight_hash( void *restrict output, const void *input, int len ) { - -#ifdef NO_AES_NI - cryptonight_hash_ctx ( output, input, len ); -#else +#if defined(__AES__) cryptonight_hash_aes( output, input, len ); +#else + cryptonight_hash_ctx ( output, input, len ); #endif } void cryptonight_hash_suw( void *restrict output, const void *input ) { -#ifdef NO_AES_NI - cryptonight_hash_ctx ( output, input, 76 ); -#else +#if defined(__AES__) cryptonight_hash_aes( output, input, 76 ); +#else + cryptonight_hash_ctx ( output, input, 76 ); #endif } +bool cryptonightV7 = false; + int scanhash_cryptonight( int thr_id, struct work *work, uint32_t max_nonce, uint64_t *hashes_done ) { @@ -80,6 +81,11 @@ int scanhash_cryptonight( int thr_id, struct work *work, uint32_t max_nonce, const uint32_t first_nonce = n + 1; const uint32_t Htarg = ptarget[7]; uint32_t hash[32 / 4] __attribute__((aligned(32))); + +// if ( ( cryptonightV7 && ( *(uint8_t*)pdata < 7 ) ) +// || ( !cryptonightV7 && ( *(uint8_t*)pdata == 7 ) ) ) +// applog(LOG_WARNING,"Cryptonight variant mismatch, shares may be rejected."); + do { *nonceptr = ++n; @@ -87,6 +93,7 @@ int scanhash_cryptonight( int thr_id, struct work *work, uint32_t max_nonce, if (unlikely( hash[7] < Htarg )) { *hashes_done = n - first_nonce + 1; +// work_set_target_ratio( work, hash ); return true; } } while (likely((n <= max_nonce && !work_restart[thr_id].restart))); @@ -97,6 +104,7 @@ int scanhash_cryptonight( int thr_id, struct work *work, uint32_t max_nonce, bool register_cryptonight_algo( algo_gate_t* gate ) { + cryptonightV7 = false; register_json_rpc2( gate ); gate->optimizations = SSE2_OPT | AES_OPT; gate->scanhash = (void*)&scanhash_cryptonight; @@ -106,3 +114,15 @@ bool register_cryptonight_algo( algo_gate_t* gate ) return true; }; +bool register_cryptonightv7_algo( algo_gate_t* gate ) +{ + cryptonightV7 = true; + register_json_rpc2( gate ); + gate->optimizations = SSE2_OPT | AES_OPT; + gate->scanhash = (void*)&scanhash_cryptonight; + gate->hash = (void*)&cryptonight_hash; + gate->hash_suw = (void*)&cryptonight_hash_suw; + gate->get_max64 = (void*)&get_max64_0x40LL; + return true; +}; + diff --git a/algo/cryptonight/cryptonight.c b/algo/cryptonight/cryptonight.c index fb0eefb..3792729 100644 --- a/algo/cryptonight/cryptonight.c +++ b/algo/cryptonight/cryptonight.c @@ -20,8 +20,8 @@ #include "crypto/c_jh.h" #include "crypto/c_skein.h" #include "crypto/int-util.h" -#include "crypto/hash-ops.h" -//#include "cryptonight.h" +//#include "crypto/hash-ops.h" +#include "cryptonight.h" #if USE_INT128 @@ -51,6 +51,7 @@ typedef __uint128_t uint128_t; #define INIT_SIZE_BLK 8 #define INIT_SIZE_BYTE (INIT_SIZE_BLK * AES_BLOCK_SIZE) +/* #pragma pack(push, 1) union cn_slow_hash_state { union hash_state hs; @@ -78,6 +79,7 @@ static void do_skein_hash(const void* input, size_t len, char* output) { int r = skein_hash(8 * HASH_SIZE, input, 8 * len, (uint8_t*)output); assert(likely(SKEIN_SUCCESS == r)); } +*/ extern int aesb_single_round(const uint8_t *in, uint8_t*out, const uint8_t *expandedKey); extern int aesb_pseudo_round_mut(uint8_t *val, uint8_t *expandedKey); @@ -120,9 +122,11 @@ static uint64_t mul128(uint64_t multiplier, uint64_t multiplicand, uint64_t* pro extern uint64_t mul128(uint64_t multiplier, uint64_t multiplicand, uint64_t* product_hi); #endif +/* static void (* const extra_hashes[4])(const void *, size_t, char *) = { do_blake_hash, do_groestl_hash, do_jh_hash, do_skein_hash }; +*/ static inline size_t e2i(const uint8_t* a) { #if !LITE @@ -132,14 +136,16 @@ static inline size_t e2i(const uint8_t* a) { #endif } -static inline void mul_sum_xor_dst(const uint8_t* a, uint8_t* c, uint8_t* dst) { +static inline void mul_sum_xor_dst( const uint8_t* a, uint8_t* c, uint8_t* dst, + const uint64_t tweak ) +{ uint64_t hi, lo = mul128(((uint64_t*) a)[0], ((uint64_t*) dst)[0], &hi) + ((uint64_t*) c)[1]; hi += ((uint64_t*) c)[0]; ((uint64_t*) c)[0] = ((uint64_t*) dst)[0] ^ hi; ((uint64_t*) c)[1] = ((uint64_t*) dst)[1] ^ lo; ((uint64_t*) dst)[0] = hi; - ((uint64_t*) dst)[1] = lo; + ((uint64_t*) dst)[1] = cryptonightV7 ? lo ^ tweak : lo; } static inline void xor_blocks(uint8_t* a, const uint8_t* b) { @@ -174,8 +180,16 @@ static __thread cryptonight_ctx ctx; void cryptonight_hash_ctx(void* output, const void* input, int len) { - hash_process(&ctx.state.hs, (const uint8_t*) input, len); - ctx.aes_ctx = (oaes_ctx*) oaes_alloc(); +// hash_process(&ctx.state.hs, (const uint8_t*) input, len); + keccak( (const uint8_t*)input, 76, (char*)&ctx.state.hs.b, 200 ); + + if ( cryptonightV7 && len < 43 ) + return; + const uint64_t tweak = cryptonightV7 + ? *((const uint64_t*) (((const uint8_t*)input) + 35)) + ^ ctx.state.hs.w[24] : 0; + + ctx.aes_ctx = (oaes_ctx*) oaes_alloc(); __builtin_prefetch( ctx.text, 0, 3 ); __builtin_prefetch( ctx.text + 64, 0, 3 ); @@ -211,23 +225,44 @@ void cryptonight_hash_ctx(void* output, const void* input, int len) xor_blocks_dst(&ctx.state.k[0], &ctx.state.k[32], ctx.a); xor_blocks_dst(&ctx.state.k[16], &ctx.state.k[48], ctx.b); - for (i = 0; likely(i < ITER / 4); ++i) { - /* Dependency chain: address -> read value ------+ - * written value <-+ hard function (AES or MUL) <+ - * next address <-+ - */ - /* Iteration 1 */ - j = e2i(ctx.a); - aesb_single_round(&ctx.long_state[j], ctx.c, ctx.a); - xor_blocks_dst(ctx.c, ctx.b, &ctx.long_state[j]); - /* Iteration 2 */ - mul_sum_xor_dst(ctx.c, ctx.a, &ctx.long_state[e2i(ctx.c)]); - /* Iteration 3 */ - j = e2i(ctx.a); - aesb_single_round(&ctx.long_state[j], ctx.b, ctx.a); - xor_blocks_dst(ctx.b, ctx.c, &ctx.long_state[j]); - /* Iteration 4 */ - mul_sum_xor_dst(ctx.b, ctx.a, &ctx.long_state[e2i(ctx.b)]); + for (i = 0; likely(i < ITER / 4); ++i) + { + /* Dependency chain: address -> read value ------+ + * written value <-+ hard function (AES or MUL) <+ + * next address <-+ + */ + /* Iteration 1 */ + j = e2i(ctx.a); + aesb_single_round(&ctx.long_state[j], ctx.c, ctx.a); + xor_blocks_dst(ctx.c, ctx.b, &ctx.long_state[j]); + + if ( cryptonightV7 ) + { + uint8_t *lsa = (uint8_t*)&ctx.long_state[((uint64_t *)(ctx.a))[0] & 0x1FFFF0]; + const uint8_t tmp = lsa[11]; + const uint8_t index = ( ( (tmp >> 3) & 6 ) | (tmp & 1) ) << 1; + lsa[11] = tmp ^ ( ( 0x75310 >> index) & 0x30 ); + } + + /* Iteration 2 */ + mul_sum_xor_dst(ctx.c, ctx.a, &ctx.long_state[e2i(ctx.c)], tweak ); + + /* Iteration 3 */ + j = e2i(ctx.a); + aesb_single_round(&ctx.long_state[j], ctx.b, ctx.a); + xor_blocks_dst(ctx.b, ctx.c, &ctx.long_state[j]); + + if ( cryptonightV7 ) + { + uint8_t *lsa = (uint8_t*)&ctx.long_state[((uint64_t *)(ctx.a))[0] & 0x1FFFF0]; + const uint8_t tmp = lsa[11]; + const uint8_t index = ( ( (tmp >> 3) & 6 ) | (tmp & 1) ) << 1; + lsa[11] = tmp ^ ( ( 0x75310 >> index) & 0x30 ); + } + + /* Iteration 4 */ + mul_sum_xor_dst(ctx.b, ctx.a, &ctx.long_state[e2i(ctx.b)], tweak ); + } __builtin_prefetch( ctx.text, 0, 3 ); @@ -266,7 +301,8 @@ void cryptonight_hash_ctx(void* output, const void* input, int len) aesb_pseudo_round_mut(&ctx.text[7 * AES_BLOCK_SIZE], ctx.aes_ctx->key->exp_data); } memcpy(ctx.state.init, ctx.text, INIT_SIZE_BYTE); - hash_permutation(&ctx.state.hs); +// hash_permutation(&ctx.state.hs); + keccakf( (uint64_t*)&ctx.state.hs.w, 24 ); /*memcpy(hash, &state, 32);*/ extra_hashes[ctx.state.hs.b[0] & 3](&ctx.state, 200, output); oaes_free((OAES_CTX **) &ctx.aes_ctx); diff --git a/algo/cryptonight/cryptonight.h b/algo/cryptonight/cryptonight.h index 5124594..b420c32 100644 --- a/algo/cryptonight/cryptonight.h +++ b/algo/cryptonight/cryptonight.h @@ -45,5 +45,7 @@ int scanhash_cryptonight( int thr_id, struct work *work, uint32_t max_nonce, void cryptonight_hash_aes( void *restrict output, const void *input, int len ); +extern bool cryptonightV7; + #endif diff --git a/algo/lyra2/lyra2h-4way.c b/algo/lyra2/lyra2h-4way.c index 517f9f2..d65c6e2 100644 --- a/algo/lyra2/lyra2h-4way.c +++ b/algo/lyra2/lyra2h-4way.c @@ -67,7 +67,7 @@ int scanhash_lyra2h_4way( int thr_id, struct work *work, uint32_t max_nonce, if ( opt_benchmark ) ptarget[7] = 0x0000ff; - for ( int i=0; i < 19; i++ ) + for ( int i=0; i < 20; i++ ) be32enc( &edata[i], pdata[i] ); mm_interleave_4x32( vdata, edata, edata, edata, edata, 640 ); diff --git a/algo/lyra2/lyra2z-4way.c b/algo/lyra2/lyra2z-4way.c index 201de30..1852805 100644 --- a/algo/lyra2/lyra2z-4way.c +++ b/algo/lyra2/lyra2z-4way.c @@ -67,7 +67,7 @@ int scanhash_lyra2z_4way( int thr_id, struct work *work, uint32_t max_nonce, if ( opt_benchmark ) ptarget[7] = 0x0000ff; - for ( int i=0; i < 19; i++ ) + for ( int i=0; i < 20; i++ ) be32enc( &edata[i], pdata[i] ); mm_interleave_4x32( vdata, edata, edata, edata, edata, 640 ); diff --git a/algo/sha/sha256t-4way.c b/algo/sha/sha256t-4way.c index ee19afd..c9a5d2b 100644 --- a/algo/sha/sha256t-4way.c +++ b/algo/sha/sha256t-4way.c @@ -60,7 +60,7 @@ int scanhash_sha256t_8way( int thr_id, struct work *work, 0xFFFF0000, 0 }; - for ( int k = 0; k < 19; k++ ) + for ( int k = 0; k < 20; k++ ) be32enc( &edata[k], pdata[k] ); mm256_interleave_8x32( vdata, edata, edata, edata, edata, diff --git a/algo/x11/x11evo-gate.c b/algo/x11/x11evo-gate.c index 2a2a6f2..ccb0d71 100644 --- a/algo/x11/x11evo-gate.c +++ b/algo/x11/x11evo-gate.c @@ -31,11 +31,13 @@ int nextPerm( uint8_t n[], uint32_t count ) return 0; for ( i = count - 1; i>0 && n[i - 1] >= n[i]; i-- ); - tail = i; + tail = i; if ( tail > 0 ) + { for ( j = count - 1; j>tail && n[j] <= n[tail - 1]; j-- ); - evo_swap( &n[tail - 1], &n[j] ); + evo_swap( &n[tail - 1], &n[j] ); + } for ( i = tail, j = count - 1; i> 1; // 16 ascii hex chars, reversed - uint8_t algoDigit = (i & 1) ? data[b] & 0xF : data[b] >> 4; + uint8_t algoDigit = (i & 1) ? prevblock[b] & 0xF : prevblock[b] >> 4; int offset = algoDigit; // insert the nth character at the front char oldVal = output[offset]; diff --git a/algo/x17/x16r-gate.h b/algo/x17/x16r-gate.h index d724517..6d03088 100644 --- a/algo/x17/x16r-gate.h +++ b/algo/x17/x16r-gate.h @@ -29,9 +29,9 @@ enum x16r_Algo { X16R_HASH_FUNC_COUNT }; -bool (*x16_r_s_getAlgoString) ( const char*, char* ); -void x16r_getAlgoString( const char* prevblock, char *output ); -void x16s_getAlgoString( const char* prevblock, char *output ); +void (*x16_r_s_getAlgoString) ( const uint8_t*, char* ); +void x16r_getAlgoString( const uint8_t* prevblock, char *output ); +void x16s_getAlgoString( const uint8_t* prevblock, char *output ); bool register_x16r_algo( algo_gate_t* gate ); bool register_x16s_algo( algo_gate_t* gate ); diff --git a/algo/x17/x16r.c b/algo/x17/x16r.c index 401ab71..49e8673 100644 --- a/algo/x17/x16r.c +++ b/algo/x17/x16r.c @@ -205,7 +205,7 @@ int scanhash_x16r( int thr_id, struct work *work, uint32_t max_nonce, if ( s_ntime != pdata[17] ) { uint32_t ntime = swab32(pdata[17]); - x16_r_s_getAlgoString( (const char*) (&endiandata[1]), hashOrder ); + x16_r_s_getAlgoString( (const uint8_t*) (&endiandata[1]), hashOrder ); s_ntime = ntime; if ( opt_debug && !thr_id ) applog( LOG_DEBUG, "hash order %s (%08x)", hashOrder, ntime ); diff --git a/avxdefs.h b/avxdefs.h index 6bca1c3..e7367e8 100644 --- a/avxdefs.h +++ b/avxdefs.h @@ -156,7 +156,7 @@ static inline __m128i foo() // _mm_setzero_si128 uses pxor instruction, it's unclear what _mm_set_epi does. // If a pseudo constant is used repeatedly in a function it may be worthwhile // to define a register variable to represent that constant. -// register __m128i zero = mm_zero; +// register __m128i zero = mm_setzero_si128(); // Constant zero #define m128_zero _mm_setzero_si128() @@ -1018,7 +1018,8 @@ inline __m256i mm256_aesenc_nokey_2x128_obs( __m256i x ) ////////////////////////////////////////////////////////////// -#if defined(__AVX512F__) && defined(__AVX512DQ__) && defined(__AVX512BW__) && defined(__AVX512VBMI__) +#if defined(__AVX512F__) +//#if defined(__AVX512F__) && defined(__AVX512DQ__) && defined(__AVX512BW__) && defined(__AVX512VBMI__) // Experimental, not tested. diff --git a/build-allarch.sh b/build-allarch.sh index 6670bfb..e9b5696 100755 --- a/build-allarch.sh +++ b/build-allarch.sh @@ -3,10 +3,30 @@ make distclean || echo clean rm -f config.status ./autogen.sh || echo done +CFLAGS="-O3 -march=core-avx2 -msha -Wall" ./configure --with-curl +make -j 4 +strip -s cpuminer.exe +mv cpuminer.exe cpuminer-avx2-sha.exe +strip -s cpuminer +mv cpuminer cpuminer-avx2-sha + +make clean || echo clean +rm -f config.status +./autogen.sh || echo done +CFLAGS="-O3 -march=skylake-avx512 -Wall" ./configure --with-curl +make -j 4 +strip -s cpuminer.exe +mv cpuminer.exe cpuminer-avx512.exe +strip -s cpuminer +mv cpuminer cpuminer-avx512 + +make clean || echo clean +rm -f config.status +./autogen.sh || echo done CFLAGS="-O3 -march=core-avx2 -Wall" ./configure --with-curl make -j 4 strip -s cpuminer.exe -mv cpuminer.exe cpuminer-aes-avx2.exe +mv cpuminer.exe cpuminer-avx2.exe strip -s cpuminer mv cpuminer cpuminer-avx2 diff --git a/configure b/configure index 0562bb8..a597b9e 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for cpuminer-opt 3.8.7.2. +# Generated by GNU Autoconf 2.69 for cpuminer-opt 3.8.8.1. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -577,8 +577,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='cpuminer-opt' PACKAGE_TARNAME='cpuminer-opt' -PACKAGE_VERSION='3.8.7.2' -PACKAGE_STRING='cpuminer-opt 3.8.7.2' +PACKAGE_VERSION='3.8.8.1' +PACKAGE_STRING='cpuminer-opt 3.8.8.1' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -738,6 +738,7 @@ infodir docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -819,6 +820,7 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1071,6 +1073,15 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1208,7 +1219,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1321,7 +1332,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures cpuminer-opt 3.8.7.2 to adapt to many kinds of systems. +\`configure' configures cpuminer-opt 3.8.8.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1361,6 +1372,7 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1392,7 +1404,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of cpuminer-opt 3.8.7.2:";; + short | recursive ) echo "Configuration of cpuminer-opt 3.8.8.1:";; esac cat <<\_ACEOF @@ -1497,7 +1509,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -cpuminer-opt configure 3.8.7.2 +cpuminer-opt configure 3.8.8.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2000,7 +2012,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by cpuminer-opt $as_me 3.8.7.2, which was +It was created by cpuminer-opt $as_me 3.8.8.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2495,7 +2507,7 @@ ac_config_headers="$ac_config_headers cpuminer-config.h" -am__api_version='1.14' +am__api_version='1.15' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -2667,8 +2679,8 @@ test "$program_suffix" != NONE && ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in @@ -2687,7 +2699,7 @@ else $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi -if test x"${install_sh}" != xset; then +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -2981,7 +2993,7 @@ fi # Define the identity of the package. PACKAGE='cpuminer-opt' - VERSION='3.8.7.2' + VERSION='3.8.8.1' cat >>confdefs.h <<_ACEOF @@ -3015,8 +3027,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # mkdir_p='$(MKDIR_P)' -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' @@ -3075,6 +3087,7 @@ END fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. @@ -6677,7 +6690,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by cpuminer-opt $as_me 3.8.7.2, which was +This file was extended by cpuminer-opt $as_me 3.8.8.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -6743,7 +6756,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -cpuminer-opt config.status 3.8.7.2 +cpuminer-opt config.status 3.8.8.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 6736667..2ef6381 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([cpuminer-opt], [3.8.7.2]) +AC_INIT([cpuminer-opt], [3.8.8.1]) AC_PREREQ([2.59c]) AC_CANONICAL_SYSTEM diff --git a/cpu-miner.c b/cpu-miner.c index 0db48ec..72f81bf 100644 --- a/cpu-miner.c +++ b/cpu-miner.c @@ -98,7 +98,7 @@ static int opt_fail_pause = 10; static int opt_time_limit = 0; int opt_timeout = 300; static int opt_scantime = 5; -static const bool opt_time = true; +//static const bool opt_time = true; enum algos opt_algo = ALGO_NULL; int opt_scrypt_n = 0; int opt_pluck_n = 128; @@ -1988,7 +1988,9 @@ static void *miner_thread( void *userdata ) } } // Display benchmark total - if ( opt_benchmark && thr_id == opt_n_threads - 1 ) + // Update hashrate for API if no shares accepted yet. + if ( ( opt_benchmark || !accepted_count ) + && thr_id == opt_n_threads - 1 ) { double hashrate = 0.; double hashcount = 0.; @@ -1999,27 +2001,30 @@ static void *miner_thread( void *userdata ) } if ( hashcount ) { - char hc[16]; - char hc_units[2] = {0,0}; - char hr[16]; - char hr_units[2] = {0,0}; global_hashcount = hashcount; global_hashrate = hashrate; - scale_hash_for_display( &hashcount, hc_units ); - scale_hash_for_display( &hashrate, hr_units ); - if ( hc_units[0] ) - sprintf( hc, "%.2f", hashcount ); - else // no fractions of a hash - sprintf( hc, "%.0f", hashcount ); - sprintf( hr, "%.2f", hashrate ); + if ( opt_benchmark ) + { + char hc[16]; + char hc_units[2] = {0,0}; + char hr[16]; + char hr_units[2] = {0,0}; + scale_hash_for_display( &hashcount, hc_units ); + scale_hash_for_display( &hashrate, hr_units ); + if ( hc_units[0] ) + sprintf( hc, "%.2f", hashcount ); + else // no fractions of a hash + sprintf( hc, "%.0f", hashcount ); + sprintf( hr, "%.2f", hashrate ); #if ((defined(_WIN64) || defined(__WINDOWS__))) - applog( LOG_NOTICE, "Total: %s %sH, %s %sH/s", + applog( LOG_NOTICE, "Total: %s %sH, %s %sH/s", hc, hc_units, hr, hr_units ); #else - applog( LOG_NOTICE, "Total: %s %sH, %s %sH/s, %dC", + applog( LOG_NOTICE, "Total: %s %sH, %s %sH/s, %dC", hc, hc_units, hr, hr_units, (uint32_t)cpu_temp(0) ); #endif - } + } + } } } // miner_thread loop @@ -3002,11 +3007,13 @@ bool check_cpu_capability () bool cpu_has_sse2 = has_sse2(); bool cpu_has_aes = has_aes_ni(); bool cpu_has_sse42 = has_sse42(); + bool cpu_has_avx = has_avx1(); bool cpu_has_avx2 = has_avx2(); bool cpu_has_sha = has_sha(); bool cpu_has_avx512 = has_avx512f(); bool sw_has_aes = false; bool sw_has_sse42 = false; + bool sw_has_avx = false; bool sw_has_avx2 = false; bool sw_has_avx512 = false; bool sw_has_sha = false; @@ -3031,6 +3038,9 @@ bool check_cpu_capability () #ifdef __SSE4_2__ sw_has_sse42 = true; #endif + #ifdef __AVX__ + sw_has_avx = true; + #endif #ifdef __AVX2__ sw_has_avx2 = true; #endif @@ -3059,19 +3069,21 @@ bool check_cpu_capability () #endif printf("CPU features:"); - if ( cpu_has_sse2 ) printf( " SSE2" ); - if ( cpu_has_aes ) printf( " AES" ); - if ( cpu_has_sse42 ) printf( " SSE4.2" ); - if ( cpu_has_avx2 ) printf( " AVX2" ); + if ( cpu_has_sse2 ) printf( " SSE2" ); + if ( cpu_has_aes ) printf( " AES" ); + if ( cpu_has_sse42 ) printf( " SSE4.2" ); + if ( cpu_has_avx ) printf( " AVX" ); + if ( cpu_has_avx2 ) printf( " AVX2" ); if ( cpu_has_avx512 ) printf( " AVX512" ); - if ( cpu_has_sha ) printf( " SHA" ); + if ( cpu_has_sha ) printf( " SHA" ); printf(".\nSW features: SSE2"); - if ( sw_has_aes ) printf( " AES" ); - if ( sw_has_sse42 ) printf( " SSE4.2" ); - if ( sw_has_avx2 ) printf( " AVX2" ); + if ( sw_has_aes ) printf( " AES" ); + if ( sw_has_sse42 ) printf( " SSE4.2" ); + if ( sw_has_avx ) printf( " AVX" ); + if ( sw_has_avx2 ) printf( " AVX2" ); if ( sw_has_avx512 ) printf( " AVX512" ); - if ( sw_has_sha ) printf( " SHA" ); + if ( sw_has_sha ) printf( " SHA" ); printf(".\nAlgo features:"); diff --git a/interleave.h b/interleave.h index 58905bb..88c81b4 100644 --- a/interleave.h +++ b/interleave.h @@ -789,8 +789,8 @@ static inline void mm_reinterleave_4x32( void *dst, void *src, int bit_len ) #endif // __AVX2__ -//#if defined(__AVX512F__) -#if 0 +#if defined(__AVX512F__) +//#if 0 // Macro functions returning vector. // Abstracted typecasting, avoid temp pointers. @@ -804,7 +804,7 @@ static inline void mm_reinterleave_4x32( void *dst, void *src, int bit_len ) #define mm512_put_32( s00, s01, s02, s03, s04, s05, s06, s07, \ s08, s09, s10, s11, s12, s13, s14, s15 ) \ - _mm512_set_epi64( *((const uint32_t*)(s15)), *((const uint32_t*)(s14)), \ + _mm512_set_epi32( *((const uint32_t*)(s15)), *((const uint32_t*)(s14)), \ *((const uint32_t*)(s13)), *((const uint32_t*)(s12)), \ *((const uint32_t*)(s11)), *((const uint32_t*)(s10)), \ *((const uint32_t*)(s09)), *((const uint32_t*)(s08)), \ @@ -931,9 +931,8 @@ static inline void mm256_deinterleave_8x64x256( void *d0, void *d1, void *d2, } // 8 lanes of 512 bits using 64 bit interleaving (typical intermediate hash) -static inline void mm512_deinterleave_8x64x512( void *d00, void *d01, - void *d02, void *d03, void *d04, void *d05, void *d06, - void *d07, const void *s ) +static inline void mm512_deinterleave_8x64x512( void *d0, void *d1, void *d2, + void *d3, void *d4, void *d5, void *d6, void *d7, const void *s ) { cast_m512i( d0 ) = mm512_get_64( s, 56, 48, 40, 32, 24, 16, 8, 0 ); cast_m512i( d1 ) = mm512_get_64( s, 57, 49, 41, 33, 25, 17, 9, 1 ); @@ -941,7 +940,7 @@ static inline void mm512_deinterleave_8x64x512( void *d00, void *d01, cast_m512i( d3 ) = mm512_get_64( s, 59, 51, 43, 35, 27, 19, 11, 3 ); cast_m512i( d4 ) = mm512_get_64( s, 60, 52, 44, 36, 28, 20, 12, 4 ); cast_m512i( d5 ) = mm512_get_64( s, 61, 53, 45, 37, 29, 21, 13, 5 ); - cast_m512i( d7 ) = mm512_get_64( s, 62, 54, 46, 38, 30, 22, 14, 6 ); + cast_m512i( d6 ) = mm512_get_64( s, 62, 54, 46, 38, 30, 22, 14, 6 ); cast_m512i( d7 ) = mm512_get_64( s, 63, 55, 47, 39, 31, 23, 15, 7 ); } @@ -953,7 +952,7 @@ static inline void mm512_deinterleave_8x64( void *dst0, void *dst1, void *dst2, { mm256_deinterleave_8x64x256( dst0, dst1, dst2, dst3, dst4, dst5, dst6, dst7, src ); - return + return; } mm512_deinterleave_8x64x512( dst0, dst1, dst2, dst3, @@ -976,7 +975,6 @@ static inline void mm512_deinterleave_8x64( void *dst0, void *dst1, void *dst2, static inline void mm512_extract_lane_8x64( void *dst, const void *src, const int lane, const int bit_len ) { - const uint64_t *s = (const uint64_t*)src; if ( bit_len <= 256 ) { @@ -992,7 +990,7 @@ static inline void mm512_extract_lane_8x64( void *dst, const void *src, } -static inline void mm512_interleave_16x32( void *dst, const void *s00, +static inline void mm512_interleave_16x32( void *d, const void *s00, const void *s01, const void *s02, const void *s03, const void *s04, const void *s05, const void *s06, const void *s07, const void *s08, const void *s09, const void *s10, const void *s11, const void *s12, @@ -1233,7 +1231,7 @@ static inline void mm512_deinterleave_16x32( void *d00, void *d01, void *d02, mm256_deinterleave_16x32x256( d00, d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14, d15, src ); - return + return; } mm512_deinterleave_16x32x512( d00, d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14, d15, @@ -1303,7 +1301,7 @@ static inline void mm512_interleave_4x128( void *d, const void *s0, } static inline void mm512_deinterleave_4x128x128( void *d0, void *d1, void *d2, - void *d3, const void *src, const int bit_len ) + void *d3, const void *s ) { cast_m128i( d0 ) = mm_get_64( s, 1, 0 ); cast_m128i( d1 ) = mm_get_64( s, 3, 2 ); @@ -1312,7 +1310,7 @@ static inline void mm512_deinterleave_4x128x128( void *d0, void *d1, void *d2, } static inline void mm512_deinterleave_4x128x256( void *d0, void *d1, void *d2, - void *d3, const void *src, const int bit_len ) + void *d3, const void *s ) { cast_m256i( d0 ) = mm256_get_64( s, 9, 8, 1, 0 ); cast_m256i( d1 ) = mm256_get_64( s, 11, 10, 3, 2 ); @@ -1321,7 +1319,7 @@ static inline void mm512_deinterleave_4x128x256( void *d0, void *d1, void *d2, } static inline void mm512_deinterleave_4x128x512( void *d0, void *d1, void *d2, - void *d3, const void *src, const int bit_len ) + void *d3, const void *s ) { cast_m512i( d0 ) = mm512_get_64( s, 25, 24, 17, 16, 9, 8, 1, 0 ); cast_m512i( d1 ) = mm512_get_64( s, 27, 26, 19, 18, 11, 10, 3, 2 ); @@ -1334,8 +1332,8 @@ static inline void mm512_deinterleave_4x128( void *dst0, void *dst1, void *dst2, { if ( bit_len <= 256 ) { - mm256_deinterleave_4x128x256( dst0, dst1, dst2, dst3, src ); - return + mm512_deinterleave_4x128x256( dst0, dst1, dst2, dst3, src ); + return; } mm512_deinterleave_4x128x512( dst0, dst1, dst2, dst3, src ); @@ -1343,7 +1341,7 @@ static inline void mm512_deinterleave_4x128( void *dst0, void *dst1, void *dst2, if ( bit_len <= 640 ) { - mm_deinterleave_4x128x128( dst0+128, dst1+128, dst2+128, dst3+128, + mm512_deinterleave_4x128x128( dst0+128, dst1+128, dst2+128, dst3+128, src+512 ); return; } diff --git a/miner.h b/miner.h index eb5e6be..b49aa53 100644 --- a/miner.h +++ b/miner.h @@ -498,7 +498,8 @@ enum algos { ALGO_BMW, ALGO_C11, ALGO_CRYPTOLIGHT, - ALGO_CRYPTONIGHT, + ALGO_CRYPTONIGHT, + ALGO_CRYPTONIGHTV7, ALGO_DECRED, ALGO_DEEP, ALGO_DMD_GR, @@ -580,6 +581,7 @@ static const char* const algo_names[] = { "c11", "cryptolight", "cryptonight", + "cryptonightv7", "decred", "deep", "dmd-gr", @@ -704,83 +706,84 @@ static char const usage[] = "\ Usage: " PACKAGE_NAME " [OPTIONS]\n\ Options:\n\ -a, --algo=ALGO specify the algorithm to use\n\ - allium Garlicoin (GRLC)\n\ - anime Animecoin (ANI)\n\ - argon2 Argon2 Coin (AR2)\n\ - argon2d250 argon2d-crds, Credits (CRDS)\n\ - argon2d500 argon2d-dyn, Dynamic (DYN)\n\ - argon2d4096 argon2d-uis, Unitus (UIS)\n\ - axiom Shabal-256 MemoHash\n\ + allium Garlicoin (GRLC)\n\ + anime Animecoin (ANI)\n\ + argon2 Argon2 Coin (AR2)\n\ + argon2d250 argon2d-crds, Credits (CRDS)\n\ + argon2d500 argon2d-dyn, Dynamic (DYN)\n\ + argon2d4096 argon2d-uis, Unitus (UIS)\n\ + axiom Shabal-256 MemoHash\n\ bastion\n\ - blake blake256r14 (SFR)\n\ - blakecoin blake256r8\n\ - blake2s Blake-2 S\n\ - bmw BMW 256\n\ - c11 Chaincoin\n\ - cryptolight Cryptonight-light\n\ - cryptonight cryptonote, Monero (XMR)\n\ - decred Blake256r14dcr\n\ - deep Deepcoin (DCN)\n\ - dmd-gr Diamond\n\ - drop Dropcoin\n\ - fresh Fresh\n\ - groestl Groestl coin\n\ - heavy Heavy\n\ - hmq1725 Espers\n\ - hodl Hodlcoin\n\ - jha jackppot (Jackpotcoin)\n\ - keccak Maxcoin\n\ - keccakc Creative Coin\n\ - lbry LBC, LBRY Credits\n\ - luffa Luffa\n\ - lyra2h Hppcoin\n\ - lyra2re lyra2\n\ - lyra2rev2 lyrav2, Vertcoin\n\ - lyra2z Zcoin (XZC)\n\ - lyra2z330 Lyra2 330 rows, Zoin (ZOI)\n\ - m7m Magi (XMG)\n\ - myr-gr Myriad-Groestl\n\ - neoscrypt NeoScrypt(128, 2, 1)\n\ - nist5 Nist5\n\ - pentablake 5 x blake512\n\ - phi1612 phi, LUX coin\n\ - pluck Pluck:128 (Supcoin)\n\ + blake blake256r14 (SFR)\n\ + blakecoin blake256r8\n\ + blake2s Blake-2 S\n\ + bmw BMW 256\n\ + c11 Chaincoin\n\ + cryptolight Cryptonight-light\n\ + cryptonight Cryptonote legacy\n\ + cryptonightv7 variant 7, Monero (XMR)\n\ + decred Blake256r14dcr\n\ + deep Deepcoin (DCN)\n\ + dmd-gr Diamond\n\ + drop Dropcoin\n\ + fresh Fresh\n\ + groestl Groestl coin\n\ + heavy Heavy\n\ + hmq1725 Espers\n\ + hodl Hodlcoin\n\ + jha jackppot (Jackpotcoin)\n\ + keccak Maxcoin\n\ + keccakc Creative Coin\n\ + lbry LBC, LBRY Credits\n\ + luffa Luffa\n\ + lyra2h Hppcoin\n\ + lyra2re lyra2\n\ + lyra2rev2 lyrav2, Vertcoin\n\ + lyra2z Zcoin (XZC)\n\ + lyra2z330 Lyra2 330 rows, Zoin (ZOI)\n\ + m7m Magi (XMG)\n\ + myr-gr Myriad-Groestl\n\ + neoscrypt NeoScrypt(128, 2, 1)\n\ + nist5 Nist5\n\ + pentablake 5 x blake512\n\ + phi1612 phi, LUX coin\n\ + pluck Pluck:128 (Supcoin)\n\ polytimos\n\ - quark Quark\n\ - qubit Qubit\n\ - scrypt scrypt(1024, 1, 1) (default)\n\ - scrypt:N scrypt(N, 1, 1)\n\ + quark Quark\n\ + qubit Qubit\n\ + scrypt scrypt(1024, 1, 1) (default)\n\ + scrypt:N scrypt(N, 1, 1)\n\ scryptjane:nf\n\ - sha256d Double SHA-256\n\ - sha256t Triple SHA-256, Onecoin (OC)\n\ - shavite3 Shavite3\n\ - skein Skein+Sha (Skeincoin)\n\ - skein2 Double Skein (Woodcoin)\n\ - skunk Signatum (SIGT)\n\ - timetravel timeravel8, Machinecoin (MAC)\n\ - timetravel10 Bitcore (BTX)\n\ - tribus Denarius (DNR)\n\ - vanilla blake256r8vnl (VCash)\n\ + sha256d Double SHA-256\n\ + sha256t Triple SHA-256, Onecoin (OC)\n\ + shavite3 Shavite3\n\ + skein Skein+Sha (Skeincoin)\n\ + skein2 Double Skein (Woodcoin)\n\ + skunk Signatum (SIGT)\n\ + timetravel timeravel8, Machinecoin (MAC)\n\ + timetravel10 Bitcore (BTX)\n\ + tribus Denarius (DNR)\n\ + vanilla blake256r8vnl (VCash)\n\ veltor\n\ whirlpool\n\ whirlpoolx\n\ - x11 Dash\n\ - x11evo Revolvercoin (XRE)\n\ - x11gost sib (SibCoin)\n\ - x12 Galaxie Cash (GCH)\n\ - x13 X13\n\ - x13sm3 hsr (Hshare)\n\ - x14 X14\n\ - x15 X15\n\ - x16r Ravencoin (RVN)\n\ - x16s Pigeoncoin (PGN)\n\ + x11 Dash\n\ + x11evo Revolvercoin (XRE)\n\ + x11gost sib (SibCoin)\n\ + x12 Galaxie Cash (GCH)\n\ + x13 X13\n\ + x13sm3 hsr (Hshare)\n\ + x14 X14\n\ + x15 X15\n\ + x16r Ravencoin (RVN)\n\ + x16s Pigeoncoin (PGN)\n\ x17\n\ - xevan Bitsend (BSD)\n\ - yescrypt Globlboost-Y (BSTY)\n\ - yescryptr8 BitZeny (ZNY)\n\ - yescryptr16 Yenten (YTN)\n\ - yescryptr32 WAVI\n\ - zr5 Ziftr\n\ + xevan Bitsend (BSD)\n\ + yescrypt Globlboost-Y (BSTY)\n\ + yescryptr8 BitZeny (ZNY)\n\ + yescryptr16 Yenten (YTN)\n\ + yescryptr32 WAVI\n\ + zr5 Ziftr\n\ -o, --url=URL URL of mining server\n\ -O, --userpass=U:P username:password pair for mining server\n\ -u, --user=USERNAME username for mining server\n\ diff --git a/winbuild-cross.sh b/winbuild-cross.sh index d034e4c..6e0cca4 100755 --- a/winbuild-cross.sh +++ b/winbuild-cross.sh @@ -46,12 +46,12 @@ mv cpuminer.exe release/cpuminer-avx2.exe #mv cpuminer.exe release/cpuminer-aes-sha.exe -#make clean || echo clean -#rm -f config.status -#CFLAGS="-O3 -march=corei7-avx -Wall" ./configure $F -#make -#strip -s cpuminer.exe -#mv cpuminer.exe release/cpuminer-aes-avx.exe +make clean || echo clean +rm -f config.status +CFLAGS="-O3 -march=corei7-avx -Wall" ./configure $F +make +strip -s cpuminer.exe +mv cpuminer.exe release/cpuminer-avx.exe # -march=westmere is supported in gcc5 make clean || echo clean