X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fkernel.cpp;h=e3ed6d1eabc4f7841b622f2e795264a95be01fbf;hb=fb24309e8e08fb4ce6d97b2e17dccfee06689836;hp=52c17af8905a99a3826ce6cd71bdb4f40846dd24;hpb=961a3c4f1132805426c904e411bfdfafa31bda77;p=novacoin.git diff --git a/src/kernel.cpp b/src/kernel.cpp index 52c17af..e3ed6d1 100644 --- a/src/kernel.cpp +++ b/src/kernel.cpp @@ -1,4 +1,7 @@ // Copyright (c) 2012-2013 The PPCoin developers +// Copyright (c) 2013-2015 The Novacoin developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -454,12 +457,22 @@ static const uint32_t block2_suffix_4way[4 * 8] = { }; extern "C" int sha256_use_4way(); - extern "C" void sha256_init(uint32_t *state); extern "C" void sha256_transform(uint32_t *state, const uint32_t *block, int swap); - extern "C" void sha256_init_4way(uint32_t *state); extern "C" void sha256_transform_4way(uint32_t *state, const uint32_t *block, int swap); +extern "C" void copy_swap_hashes(uint32_t *blocks, uint32_t *state); // Generic block copy function + +#ifdef USE_SSSE3 +extern "C" int sha256_use_ssse3(); +extern "C" void copy_swap_hashes_ssse3(uint32_t *blocks, uint32_t *state); // SSSE3 optimized block copy function + +void (*copy_swap)(uint32_t *, uint32_t *) = (sha256_use_ssse3() != 0) ? ©_swap_hashes_ssse3 : copy_swap_hashes; +#else +void (*copy_swap)(uint32_t *, uint32_t *) = ©_swap_hashes; +#endif + +bool fUse4Way = sha256_use_4way() != 0; class ScanMidstateWorker { @@ -474,6 +487,8 @@ public: void Do_4way() { + cout << sha256_use_ssse3() << endl; + SetThreadPriority(THREAD_PRIORITY_LOWEST); // Compute maximum possible target to filter out majority of obviously insufficient hashes @@ -505,33 +520,33 @@ public: // Search forward in time from the given timestamp // Stopping search in case of shutting down - for (uint32_t nTimeTx=nIntervalBegin, nMaxTarget32 = nMaxTarget.Get32(7); nTimeTx >& GetSolutions()